:root {
  color-scheme: light;
  --ink: #222629;
  --muted: #68726f;
  --line: #d7ddd8;
  --paper: #f5f2ec;
  --field: #fffdf8;
  --leaf: #2f7357;
  --leaf-soft: #dceee4;
  --wechat: #07c160;
  --chat-bg: #f0f1ef;
  --bubble-user: #95ec69;
  --bubble-friend: #ffffff;
  --blue: #356f9e;
  --blue-soft: #ddeaf5;
  --rose: #a95b6c;
  --rose-soft: #f2e1e6;
  --amber: #9b6c2e;
  --amber-soft: #f1e3cc;
  --shadow: 0 18px 46px rgba(40, 38, 32, 0.11);
}

/* MVP 0.4.11 editorial home and local relation film */
.home-view,
.time-machine-view {
  --editorial-coral: #ff5f55;
  --editorial-coral-dark: #e5443c;
  --editorial-mint: #b9f2cf;
  --editorial-cream: #fff9ef;
  --editorial-ink: #181818;
  --editorial-line: #1d1d1d;
  color: var(--editorial-ink);
}

.home-view {
  gap: 22px;
  padding-bottom: 30px;
}

.editorial-classic-panel {
  display: grid;
  gap: 22px;
}

.editorial-mode-switch {
  margin: -4px 0 0;
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  padding: 3px;
  background: var(--editorial-cream);
  box-shadow: 4px 4px 0 var(--editorial-line);
}

.editorial-mode-switch button {
  min-height: 38px;
  border-radius: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.editorial-mode-switch button.active {
  color: #fff;
  background: var(--editorial-ink);
}

.home-view .simple-home-panel {
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  background: #f0f1ef;
  box-shadow: 6px 6px 0 var(--editorial-line);
}

.home-view .simple-chat-log {
  min-height: calc(100vh - 340px);
  max-height: none;
}

.editorial-home-hero {
  padding: 22px 5px 2px;
}

.chaptered-home-hero {
  padding-top: 14px;
}

.chaptered-home-hero h2 {
  font-size: clamp(37px, 10vw, 54px);
}

.editorial-index,
.time-machine-hero > p,
.editorial-section-title span,
.memory-editor-heading span,
.memory-photo-picker > div > span {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.editorial-home-hero h2,
.time-machine-hero h2 {
  max-width: 420px;
  margin: 0 0 14px;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(42px, 12vw, 62px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.editorial-home-hero > p:last-child,
.time-machine-hero > small {
  display: block;
  max-width: 340px;
  margin: 0;
  color: #585550;
  font-size: 14px;
  line-height: 1.65;
}

.editorial-chat-entry,
.editorial-route,
.home-memory-empty,
.home-memory-frame {
  width: 100%;
  color: inherit;
  text-align: left;
}

.editorial-chat-entry {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  padding: 24px;
  color: #fff;
  background: var(--editorial-coral);
  box-shadow: 8px 8px 0 var(--editorial-line);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.editorial-chat-entry:active {
  transform: translate(4px, 4px);
  box-shadow: 4px 4px 0 var(--editorial-line);
}

.editorial-chat-entry span,
.editorial-route span {
  display: block;
  margin-bottom: 20px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.editorial-chat-entry strong {
  display: block;
  font-family: Georgia, "Songti SC", serif;
  font-size: 38px;
  line-height: 1;
}

.editorial-chat-entry small,
.editorial-route small {
  display: block;
  max-width: 230px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.editorial-chat-entry b {
  position: absolute;
  right: 20px;
  bottom: 13px;
  font-family: Georgia, serif;
  font-size: 54px;
  font-weight: 400;
}

.editorial-route-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
}

.editorial-route {
  min-height: 180px;
  overflow: hidden;
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  padding: 0 0 18px;
  background: var(--editorial-cream);
}

.editorial-route.editorial-understanding {
  background: var(--editorial-mint);
}

.editorial-route strong {
  display: block;
  padding: 0 16px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  line-height: 1.05;
}

.editorial-route > img {
  display: block;
  width: 100%;
  height: 112px;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--editorial-line);
  object-fit: cover;
}

.editorial-route > span,
.editorial-route > small {
  margin-right: 16px;
  margin-left: 16px;
}

.editorial-chapter {
  display: grid;
  gap: 12px;
  border: 3px solid var(--editorial-line);
  border-radius: 0;
  padding: 14px;
  background: var(--editorial-cream);
}

.solo-chapter {
  border-color: #2a7b4f;
  background: #f2fff6;
  box-shadow: 7px 7px 0 #2a7b4f;
}

.duo-chapter {
  color: #fff;
  border-color: #111;
  background: #111;
  box-shadow: 7px 7px 0 var(--editorial-coral);
}

.chapter-label-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  align-items: end;
  border: 2px solid currentColor;
  padding: 12px 14px;
  color: #0e3a27;
  background: #bdf2cf;
}

.duo-chapter .chapter-label-banner {
  color: #fff;
  background: var(--editorial-coral);
}

.chapter-label-banner span {
  grid-row: span 2;
  align-self: center;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(32px, 10vw, 42px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.08em;
}

.chapter-label-banner strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.chapter-label-banner small {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.chapter-cover {
  display: grid;
  grid-template-columns: 1fr 42%;
  min-height: 168px;
  overflow: hidden;
  border: 2px solid var(--editorial-line);
  background: #fff;
}

.duo-chapter .chapter-cover {
  border-color: #fff;
  background: #111;
}

.chapter-cover > div {
  align-self: center;
  padding: 18px 16px;
}

.chapter-cover span,
.chapter-primary span,
.chapter-action span {
  display: block;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.09em;
}

.chapter-cover span {
  margin-bottom: 14px;
}

.chapter-cover h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 28px;
  line-height: 1.02;
}

.chapter-cover p {
  margin: 0;
  color: #3f4c43;
  font-size: 12px;
  line-height: 1.58;
}

.duo-chapter .chapter-cover p {
  color: #d6d6d6;
}

.chapter-cover img {
  width: 100%;
  height: 100%;
  min-height: 168px;
  border-left: 2px solid var(--editorial-line);
  object-fit: cover;
}

.duo-chapter .chapter-cover img {
  border-color: #fff;
}

.chapter-boundary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.chapter-boundary span {
  min-height: 42px;
  border: 2px solid currentColor;
  padding: 8px 6px;
  color: #0e3a27;
  background: #dff7e8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.duo-chapter .chapter-boundary span {
  color: #fff;
  background: #242424;
}

.chapter-primary,
.chapter-action {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  color: inherit;
  text-align: left;
}

.chapter-primary {
  min-height: 154px;
  padding: 22px;
  color: #fff;
  background: #104b31;
  box-shadow: 5px 5px 0 var(--editorial-line);
}

.duo-primary {
  border-color: #fff;
  color: #fff;
  background: var(--editorial-coral);
  box-shadow: 5px 5px 0 #fff;
}

.chapter-primary span {
  margin-bottom: 22px;
}

.chapter-primary strong {
  display: block;
  max-width: 260px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
  line-height: 1.05;
}

.chapter-primary small {
  display: block;
  max-width: 230px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.chapter-primary b {
  position: absolute;
  right: 16px;
  bottom: 9px;
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 400;
}

.chapter-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chapter-action {
  min-height: 208px;
  padding: 0 0 15px;
  background: #fff;
}

.duo-chapter .chapter-action {
  border-color: #fff;
  color: #111;
  background: #fff;
}

.chapter-action.wide {
  display: grid;
  grid-template-columns: 42% 1fr;
  min-height: 128px;
  padding: 0;
}

.chapter-action img {
  display: block;
  width: 100%;
  height: 92px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--editorial-line);
  object-fit: cover;
}

.duo-chapter .chapter-action img {
  border-color: #111;
}

.chapter-action.wide img {
  height: 100%;
  min-height: 128px;
  margin: 0;
  border-right: 2px solid var(--editorial-line);
  border-bottom: 0;
}

.chapter-action span,
.chapter-action strong,
.chapter-action small {
  margin-right: 14px;
  margin-left: 14px;
}

.chapter-action.wide span,
.chapter-action.wide strong,
.chapter-action.wide small {
  margin-left: 0;
}

.chapter-action.wide span {
  align-self: end;
  margin-top: 16px;
}

.chapter-action strong {
  display: block;
  margin-top: 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  line-height: 1.08;
}

.chapter-action small {
  display: block;
  margin-top: 8px;
  color: #5f5b55;
  font-size: 11px;
  line-height: 1.45;
}

.chapter-action.wide strong,
.chapter-action.wide small,
.chapter-action.wide span {
  grid-column: 2;
}

.editorial-duo-entry {
  position: relative;
  display: grid;
  grid-template-columns: 44% 1fr;
  min-height: 164px;
  overflow: hidden;
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  padding: 0;
  color: #fff;
  background: #171717;
  text-align: left;
  box-shadow: 6px 6px 0 var(--editorial-line);
}

.editorial-duo-entry > img {
  width: 100%;
  height: 100%;
  min-height: 164px;
  border-right: 2px solid var(--editorial-line);
  object-fit: cover;
}

.editorial-duo-copy {
  align-self: center;
  padding: 18px 34px 18px 17px;
}

.editorial-duo-copy small,
.editorial-duo-copy strong,
.editorial-duo-copy em {
  display: block;
}

.editorial-duo-copy small {
  margin-bottom: 16px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.editorial-duo-copy strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 27px;
  line-height: 1;
}

.editorial-duo-copy em {
  margin-top: 10px;
  color: #d8d8d8;
  font-size: 11px;
  font-style: normal;
  line-height: 1.5;
}

.editorial-duo-entry > b {
  position: absolute;
  right: 13px;
  bottom: 7px;
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 400;
}

.home-film-preview,
.editorial-memory-list,
.memory-editor-sheet {
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  background: var(--editorial-cream);
  box-shadow: none;
}

.home-film-preview {
  padding: 22px 18px 18px;
}

.editorial-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--editorial-line);
  padding-bottom: 12px;
}

.editorial-section-title span,
.editorial-section-title h2 {
  margin: 0;
}

.editorial-section-title h2 {
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
}

.home-memory-preview {
  display: grid;
  gap: 10px;
}

.home-memory-empty,
.home-memory-frame {
  border: 1px solid var(--editorial-line);
  border-radius: 0;
  padding: 16px;
  background: #fff;
}

.home-memory-empty.has-editorial-photo {
  position: relative;
  display: grid;
  grid-template-columns: 44% 1fr;
  min-height: 140px;
  overflow: hidden;
  padding: 0;
}

.home-memory-empty.has-editorial-photo > img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  border-right: 1px solid var(--editorial-line);
  object-fit: cover;
}

.home-memory-empty-copy {
  align-self: center;
  padding: 14px;
}

.home-memory-empty span,
.home-memory-empty small,
.home-memory-frame small,
.home-memory-frame em {
  display: block;
  color: #6a6660;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.home-memory-empty strong,
.home-memory-frame strong {
  display: block;
  margin: 8px 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 19px;
}

.home-memory-frame {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  align-items: stretch;
  min-height: 96px;
  padding: 0;
  overflow: hidden;
}

.home-memory-frame img,
.frame-number {
  width: 74px;
  height: 100%;
  min-height: 96px;
  object-fit: cover;
}

.frame-number {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--editorial-coral);
  font-family: Georgia, serif;
  font-size: 30px;
}

.frame-copy {
  align-self: center;
  padding: 12px 12px 12px 0;
}

.home-add-memory {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-top: 1px solid var(--editorial-line);
  padding: 14px 0 0;
  color: var(--editorial-ink);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.editorial-utility-list {
  display: grid;
  border-top: 2px solid var(--editorial-line);
}

.editorial-utility-list button {
  display: flex;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid var(--editorial-line);
  padding: 15px 4px;
  color: inherit;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.editorial-utility-list span {
  font-family: Georgia, serif;
  font-size: 12px;
}

.editorial-home-principle {
  margin: 0;
  padding: 0 4px;
  color: #65615c;
  font-family: Georgia, "Songti SC", serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.7;
}

.time-machine-view {
  gap: 20px;
}

.time-machine-hero {
  position: relative;
  overflow: hidden;
  margin: 0 -14px;
  padding: 34px 20px 28px;
  border-bottom: 2px solid var(--editorial-line);
  background: var(--editorial-mint);
}

.time-machine-hero::after {
  content: "FILM";
  position: absolute;
  right: -12px;
  bottom: -18px;
  color: rgba(24, 24, 24, 0.08);
  font-family: Georgia, serif;
  font-size: 76px;
  font-weight: 900;
}

.time-add-button,
.memory-save-button,
.memory-inline-add {
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  color: #fff;
  background: var(--editorial-coral);
  box-shadow: 4px 4px 0 var(--editorial-line);
  font-weight: 900;
}

.time-add-button {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding: 13px 18px;
}

.memory-editor-sheet {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.memory-editor-sheet.is-collapsed {
  display: none;
}

.memory-editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--editorial-line);
  padding-bottom: 12px;
}

.memory-editor-heading h2,
.memory-editor-heading span {
  margin: 0;
}

.memory-editor-heading h2 {
  font-family: Georgia, "Songti SC", serif;
}

.memory-editor-close {
  align-self: start;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 2px 0;
  background: transparent;
  font-size: 12px;
}

.memory-form-intro {
  margin: -6px 0 0;
  color: #68635d;
  font-size: 13px;
}

.memory-form-grid {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px 12px;
  align-items: center;
}

.memory-form-grid .field-label {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
}

.memory-form-grid input,
.memory-form-grid select,
.memory-form-grid textarea {
  border: 1px solid var(--editorial-line);
  border-radius: 0;
  background: #fff;
}

.memory-photo-picker {
  display: grid;
  gap: 10px;
  border: 1px solid var(--editorial-line);
  padding: 15px;
  background: #fff;
}

.memory-photo-picker > div > strong,
.memory-photo-picker > div > span {
  display: block;
}

.memory-photo-add,
.memory-photo-preview button {
  border: 1px solid var(--editorial-line);
  border-radius: 0;
  padding: 10px 12px;
  color: inherit;
  background: var(--editorial-mint);
  font-weight: 800;
}

.memory-photo-picker p,
.memory-photo-picker small {
  margin: 0;
  color: #68635d;
  font-size: 11px;
  line-height: 1.55;
}

.memory-photo-preview img,
.memory-detail-photo {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.memory-photo-preview > div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.memory-save-button {
  width: 100%;
  padding: 14px 18px;
}

.editorial-memory-list {
  padding: 18px;
}

.time-machine-view .section-title {
  border-bottom: 2px solid var(--editorial-line);
  padding-bottom: 10px;
}

.time-machine-view .section-title h2 {
  font-family: Georgia, "Songti SC", serif;
  font-size: 26px;
}

.time-machine-view .memory-scope-tabs {
  border: 1px solid var(--editorial-line);
  border-radius: 0;
  background: #fff;
}

.time-machine-view .memory-scope-tab {
  border-radius: 0;
}

.time-machine-view .memory-scope-tab.active {
  color: var(--editorial-ink);
  background: var(--editorial-mint);
}

.memory-filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 14px -18px 0;
  padding: 0 18px 8px;
  scrollbar-width: none;
}

.memory-filter-row::-webkit-scrollbar {
  display: none;
}

.memory-filter-row button {
  flex: 0 0 auto;
  border: 1px solid var(--editorial-line);
  border-radius: 999px;
  padding: 7px 12px;
  color: inherit;
  background: #fff;
  font-size: 11px;
}

.memory-filter-row button.active {
  color: #fff;
  background: var(--editorial-coral);
}

.time-machine-view .memory-timeline {
  display: grid;
  gap: 12px;
}

.time-machine-view .memory-timeline::before {
  display: none;
}

.memory-month-heading {
  margin: 18px 0 2px;
  border-bottom: 1px solid var(--editorial-line);
  padding-bottom: 6px;
  font-family: Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.time-machine-view .timeline-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
}

.time-machine-view .timeline-date {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  padding-top: 12px;
  text-align: left;
}

.time-machine-view .timeline-date strong {
  font-family: Georgia, serif;
  font-size: 24px;
}

.time-machine-view .timeline-date span {
  display: none;
}

.time-machine-view .timeline-dot {
  display: none;
}

.time-machine-view .memory-card {
  grid-column: 2;
  overflow: hidden;
  border: 1px solid var(--editorial-line);
  border-radius: 0;
  padding: 14px;
  background: #fff;
}

.memory-card-photo {
  display: block;
  width: calc(100% + 28px);
  height: 180px;
  margin: -14px -14px 14px;
  object-fit: cover;
}

.memory-card-photo.editorial-photo {
  filter: saturate(0.82) contrast(1.04);
}

.time-machine-view .memory-card h3 {
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
}

.time-machine-view .memory-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #5f5a55;
  font-size: 13px;
}

.time-machine-view .tag {
  border-radius: 0;
  color: var(--editorial-ink);
  background: var(--editorial-mint);
}

.time-machine-view .tag.soft {
  background: #ffd4cf;
}

.memory-inline-add {
  padding: 11px 14px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

@media (max-width: 370px) {
  .editorial-route-split {
    grid-template-columns: 1fr;
  }

  .editorial-route {
    min-height: 150px;
  }

  .chapter-cover,
  .chapter-action.wide {
    grid-template-columns: 1fr;
  }

  .chapter-cover img,
  .chapter-action.wide img {
    border-left: 0;
    border-right: 0;
    border-top: 2px solid var(--editorial-line);
  }

  .duo-chapter .chapter-cover img,
  .duo-chapter .chapter-action.wide img {
    border-top-color: #fff;
  }

  .memory-form-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(160deg, rgba(246, 242, 233, 0.94), rgba(234, 244, 239, 0.9) 56%, rgba(248, 244, 236, 0.96)),
    radial-gradient(circle at 18% 0%, rgba(220, 238, 228, 0.82), transparent 34%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.6;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--field);
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.12;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.app-shell {
  width: min(100%, 500px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: -18px -14px 16px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid rgba(215, 221, 216, 0.72);
  background: rgba(246, 242, 233, 0.88);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.connection-pill {
  min-width: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.82);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.auth-status-strip {
  display: grid;
  gap: 8px;
  margin: -6px 0 14px;
  border: 1px solid rgba(215, 221, 216, 0.86);
  border-radius: 18px;
  padding: 8px 10px 8px 12px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 10px 24px rgba(40, 38, 32, 0.06);
}

.auth-status-main {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.auth-status-main > div:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.auth-status-strip span {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.auth-status-strip strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.auth-login-button,
.auth-logout-button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.9);
  font-size: 12px;
  font-weight: 850;
}

.auth-login-button {
  color: var(--ink);
  background: var(--leaf-soft);
}

.auth-login-form {
  display: grid;
  gap: 7px;
  border-top: 1px solid rgba(215, 221, 216, 0.86);
  padding-top: 8px;
}

.auth-login-form label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.auth-login-form p,
.auth-login-form small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-login-form > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.auth-login-form input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 253, 248, 0.96);
}

.auth-login-form input:disabled,
.auth-login-form button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.86);
  font-size: 28px;
  line-height: 1;
}

.topbar .icon-button.hidden {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}

.view {
  display: grid;
  gap: 14px;
}

.hero-panel,
.guidance-card,
.flow-card,
.result-card,
.privacy-panel,
.setup-grid,
.room-panel,
.memory-list-panel,
.consent-panel,
.card-play-panel {
  border: 1px solid rgba(215, 221, 216, 0.94);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}

.hero-panel,
.guidance-card,
.flow-card,
.result-card,
.privacy-panel,
.setup-grid,
.room-panel,
.memory-list-panel,
.consent-panel,
.card-play-panel {
  padding: 18px;
}

.hero-panel {
  padding-top: 24px;
}

.room-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.room-panel-heading .eyebrow {
  margin: 0;
}

.room-leave-button {
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.hero-panel p,
.guidance-card p,
.privacy-panel p,
.muted-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.guidance-card.compact {
  box-shadow: none;
}

.signal-mark {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 48px;
  margin-bottom: 18px;
}

.signal-mark span {
  display: block;
  width: 15px;
  border-radius: 999px;
  background: var(--leaf);
}

.signal-mark span:nth-child(1) {
  height: 20px;
}

.signal-mark span:nth-child(2) {
  height: 34px;
  background: var(--amber);
}

.signal-mark span:nth-child(3) {
  height: 48px;
  background: var(--blue);
}

.entry-grid,
.scenario-grid,
.home-primary-grid,
.quick-entry-grid,
.intent-grid,
.action-list,
.quick-grid,
.prompt-grid,
.memory-list,
.card-actions,
.feedback-actions {
  display: grid;
  gap: 10px;
}

.entry-card,
.feature-card,
.scenario-card,
.intent-chip,
.menu-button,
.quick-button,
.prompt-chip,
.primary-action,
.ghost-button,
.text-link-button,
.join-row button,
.deck-tab {
  border-radius: 8px;
  min-height: 48px;
  font-weight: 850;
}

.entry-card {
  border: 1px solid var(--line);
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.84);
  text-align: left;
}

.home-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: min(100%, 236px);
  margin-left: auto;
  border: 1px solid rgba(215, 221, 216, 0.86);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 253, 248, 0.8);
  box-shadow: 0 10px 30px rgba(32, 38, 41, 0.08);
}

.home-mode-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.home-mode-switch button.active {
  color: white;
  background: #263832;
}

.home-mode-panel {
  display: grid;
  gap: 14px;
}

.classic-home-panel {
  animation: panel-in 180ms ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-home-panel {
  border: 1px solid rgba(215, 221, 216, 0.94);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
}

.ai-home-orb {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  margin-bottom: 16px;
  background: linear-gradient(145deg, var(--leaf-soft), var(--blue-soft));
}

.ai-home-orb span {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #263832;
}

.ai-home-panel h2 {
  margin-bottom: 10px;
  font-size: 27px;
  line-height: 1.16;
}

.ai-home-panel p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.68;
}

.home-ai-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.home-ai-form .field-label {
  margin-top: 0;
}

.home-ai-form textarea {
  min-height: 118px;
}

.home-boundary-note {
  margin-top: 14px;
}

.simple-home-panel {
  min-height: calc(100vh - 156px);
  border: 1px solid rgba(204, 211, 207, 0.94);
  border-radius: 8px;
  padding: 12px 8px 148px;
  background: #ededed;
  box-shadow: var(--shadow);
}

.simple-chat-header,
.chat-panel-header {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.simple-chat-header h2,
.chat-panel-header h2 {
  margin-bottom: 2px;
}

.simple-chat-log {
  min-height: calc(100vh - 332px);
  max-height: none;
}

.simple-boundary-note {
  margin-top: 0;
}

.simple-submit {
  min-height: 48px;
}

.context-tools-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 253, 248, 0.7);
}

.context-tools-panel summary {
  min-height: 30px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 30px;
}

.context-actions.compact {
  margin-top: 8px;
}

.intent-panel {
  border: 1px solid rgba(215, 221, 216, 0.94);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.72);
}

.intent-grid {
  grid-template-columns: 1fr;
}

.intent-chip {
  border: 1px solid var(--line);
  padding: 12px 13px;
  color: var(--ink);
  background: var(--field);
  font-size: 14px;
  text-align: left;
}

.home-primary-grid {
  grid-template-columns: 1fr;
}

.feature-card {
  border: 1px solid var(--line);
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.9);
  text-align: left;
}

.feature-card.primary-feature {
  color: white;
  background: #263832;
}

.feature-card.film-feature {
  border-color: rgba(53, 111, 158, 0.28);
  background: var(--blue-soft);
}

.feature-card.duo-feature {
  border-color: rgba(47, 115, 87, 0.28);
  background: var(--leaf-soft);
}

.feature-card.ideal-feature {
  border-color: rgba(161, 105, 65, 0.24);
  background: rgba(255, 247, 232, 0.94);
}

.feature-card.profile-feature {
  border-color: rgba(155, 108, 46, 0.32);
  background: var(--amber-soft);
}

.feature-card span,
.feature-card strong,
.feature-card small {
  display: block;
}

.feature-card span {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.2;
}

.feature-card.primary-feature span {
  color: white;
}

.feature-card strong {
  margin-bottom: 4px;
  color: var(--leaf);
  font-size: 13px;
  line-height: 1.25;
}

.feature-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.feature-card.primary-feature strong {
  color: rgba(255, 255, 255, 0.78);
}

.feature-card.primary-feature small {
  color: rgba(255, 255, 255, 0.68);
}

.quick-entry-panel {
  border: 1px solid rgba(215, 221, 216, 0.94);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.72);
}

.quick-entry-grid {
  grid-template-columns: 1fr 1fr;
}

.home-utility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: center;
}

.text-link-button {
  min-height: 34px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.home-privacy-note {
  padding: 13px 14px;
}

.legacy-tools-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.7);
}

.legacy-tools-panel summary {
  min-height: 34px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 34px;
}

.legacy-tools-panel .quick-entry-grid {
  margin-top: 8px;
}

.scenario-grid {
  margin-top: 14px;
}

.scenario-card {
  border: 1px solid var(--line);
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.9);
  text-align: left;
}

.scenario-card.quiet {
  background: #25332f;
  color: white;
}

.scenario-card span,
.scenario-card strong {
  display: block;
}

.scenario-card span {
  margin-bottom: 6px;
  color: inherit;
  font-size: 13px;
  font-weight: 850;
  opacity: 0.78;
}

.scenario-card strong {
  font-size: 19px;
  line-height: 1.32;
}

.secondary-entry {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.version-grid,
.acceptance-grid,
.boundary-list,
.check-list,
.test-path-grid,
.inline-actions {
  display: grid;
  gap: 10px;
}

.version-grid {
  margin-bottom: 14px;
}

.inline-actions {
  margin-top: 14px;
}

.test-path-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.78);
}

.test-path-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 900;
}

.test-path-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.friend-test-note {
  margin-top: 14px;
}

.friend-test-note h2,
.friend-test-hero h2 {
  margin-bottom: 8px;
}

.friend-test-simple-note {
  margin-bottom: 10px;
}

.friend-test-task-list,
.known-limit-list {
  display: grid;
  gap: 10px;
}

.friend-test-task-list article,
.known-limit-list p,
.feedback-template-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.78);
}

.friend-test-task-list strong {
  display: block;
  margin-bottom: 5px;
  color: var(--leaf);
  font-size: 14px;
  font-weight: 900;
}

.friend-test-task-list p,
.known-limit-list p,
.feedback-template-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.friend-feedback-points {
  margin-bottom: 12px;
}

.feedback-template-card {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.feedback-template-card p {
  flex: 1 1 100%;
}

.hup-test-section {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(47, 115, 87, 0.28);
  border-radius: 12px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(232, 243, 236, 0.9)),
    var(--field);
  box-shadow: var(--shadow);
}

.hup-test-heading {
  display: grid;
  gap: 14px;
}

.hup-test-heading h2 {
  margin-bottom: 8px;
}

.hup-test-heading p:not(.eyebrow),
.hup-test-block-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.hup-test-heading-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hup-test-status-card,
.hup-test-block,
.hup-test-debug {
  border: 1px solid rgba(47, 115, 87, 0.2);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.86);
}

.hup-test-status-card,
.hup-test-block {
  padding: 14px;
}

.hup-test-status-card header {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hup-test-status-card h3,
.hup-test-block-title h3 {
  margin: 0;
}

.hup-test-status-card header button {
  flex: 0 0 auto;
}

.hup-test-status-primary,
.hup-test-status-fields,
.hup-test-debug-grid {
  display: grid;
  gap: 8px;
}

.hup-test-status-primary {
  grid-template-columns: repeat(3, 1fr);
}

.hup-test-status-primary div,
.hup-test-status-fields div,
.hup-test-debug-grid div {
  border-radius: 8px;
  padding: 10px;
  background: rgba(220, 238, 228, 0.58);
}

.hup-test-status-primary span,
.hup-test-status-fields span,
.hup-test-debug-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.hup-test-status-primary strong,
.hup-test-status-fields strong,
.hup-test-debug-grid strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.hup-test-status-fields {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 8px;
}

.hup-test-block-title {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.hup-test-block-title > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  background: var(--leaf);
  font-size: 12px;
  font-weight: 900;
}

.hup-test-checklist,
.hup-test-case-grid,
.hup-silent-test-list {
  display: grid;
  gap: 8px;
}

.hup-test-checklist label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 253, 248, 0.84);
  cursor: pointer;
}

.hup-test-checklist input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--leaf);
}

.hup-test-checklist label:has(input:checked) {
  border-color: rgba(47, 115, 87, 0.4);
  background: var(--leaf-soft);
}

.hup-test-checklist span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hup-test-checklist strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 14px;
}

.hup-test-case-grid article {
  display: grid;
  gap: 7px;
  border-left: 3px solid var(--leaf);
  border-radius: 4px 8px 8px 4px;
  padding: 12px;
  background: rgba(245, 242, 236, 0.82);
}

.hup-test-case-grid article > span {
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
}

.hup-test-case-grid article > strong {
  font-size: 14px;
  line-height: 1.5;
}

.hup-test-case-grid article > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hup-test-case-grid article > button {
  justify-self: start;
}

.hup-silent-test-list button {
  border: 1px solid rgba(47, 115, 87, 0.25);
  border-radius: 8px;
  padding: 12px;
  color: #314236;
  background: var(--leaf-soft);
  font-weight: 800;
  text-align: left;
}

.hup-test-expectation {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--leaf);
  color: var(--muted);
  background: var(--leaf-soft);
  font-size: 13px;
  line-height: 1.6;
}

.hup-test-debug {
  padding: 12px 14px;
}

.hup-test-debug summary {
  color: var(--leaf);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.hup-test-debug summary small {
  color: var(--muted);
  font-weight: 700;
}

.hup-test-debug-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 12px;
}

.hup-test-debug pre {
  overflow-x: auto;
  margin: 10px 0 0;
  border-radius: 8px;
  padding: 10px;
  color: #dceee4;
  background: #25332f;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.check-list span,
.boundary-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.78);
}

.check-list span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
}

.boundary-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 900;
}

.boundary-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.entry-card span,
.entry-card strong,
.entry-card small {
  display: block;
}

.entry-card span {
  margin-bottom: 7px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 900;
}

.entry-card strong {
  margin-bottom: 10px;
  font-size: 17px;
  line-height: 1.4;
}

.entry-card small {
  color: var(--muted);
  font-size: 13px;
}

.menu-button,
.quick-button,
.prompt-chip {
  border: 1px solid var(--line);
  padding: 13px 14px;
  color: var(--ink);
  background: var(--field);
  text-align: left;
}

.menu-button.danger {
  color: #8f384b;
  background: var(--rose-soft);
}

.primary-action {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0 16px;
  color: white;
  background: #263832;
}

.primary-action.inline-save {
  margin-top: 6px;
}

.form-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 14px;
  background: rgba(255, 253, 248, 0.68);
}

.form-section summary {
  min-height: 34px;
  cursor: pointer;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 34px;
}

.form-section summary::marker {
  color: var(--leaf);
}

.ghost-button {
  border: 1px solid var(--line);
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.88);
}

.ghost-button.small {
  min-height: 36px;
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 15px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-chip span {
  display: grid;
  min-height: 46px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: var(--field);
  font-size: 14px;
  line-height: 1.35;
}

.choice-chip input:checked + span {
  border-color: rgba(47, 115, 87, 0.55);
  background: var(--leaf-soft);
}

.quick-grid {
  grid-template-columns: 1fr 1fr;
}

.quick-button {
  min-height: 104px;
  background: rgba(255, 253, 248, 0.88);
  font-size: 16px;
  line-height: 1.35;
}

.quick-button:nth-child(1),
.quick-button:nth-child(5) {
  background: var(--leaf-soft);
}

.quick-button:nth-child(3),
.quick-button:nth-child(6) {
  background: var(--amber-soft);
}

.quick-button:nth-child(4) {
  background: var(--rose-soft);
}

.result-card {
  box-shadow: none;
}

[data-view="during-help"] {
  min-height: calc(100vh - 104px);
  border-radius: 8px;
  padding: 12px;
  background: #202724;
}

[data-view="during-help"] .discreet-card,
[data-view="during-help"] .quick-button,
[data-view="during-help"] .result-card,
[data-view="during-help"] .flow-card {
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f1ea;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

[data-view="during-help"] .muted-copy,
[data-view="during-help"] .eyebrow,
[data-view="during-help"] .field-label {
  color: rgba(243, 241, 234, 0.68);
}

[data-view="during-help"] .large-advice {
  color: #f3f1ea;
}

.advice-row {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.advice-row span {
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
}

.advice-row p,
.large-advice {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.68;
}

.large-advice {
  font-size: 18px;
  font-weight: 760;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
  min-height: calc(100vh - 150px);
  border: 1px solid rgba(204, 211, 207, 0.94);
  border-radius: 8px;
  padding: 12px 8px 156px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 120px),
    var(--chat-bg);
  box-shadow: var(--shadow);
}

.chat-log {
  display: grid;
  align-content: end;
  gap: 10px;
  min-height: calc(100vh - 360px);
  max-height: none;
  overflow: auto;
  margin: 12px 0;
  padding: 6px 2px 24px;
  scroll-behavior: smooth;
}

.chat-message {
  position: relative;
  max-width: min(86%, 390px);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 1px rgba(32, 38, 41, 0.05);
  scroll-margin-bottom: 150px;
}

.chat-message p {
  margin-bottom: 0;
  white-space: pre-line;
  font-size: 15px;
  line-height: 1.58;
}

.chat-source {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.chat-message.user {
  justify-self: end;
  color: #1f2422;
  background: var(--bubble-user);
}

.chat-message.assistant {
  justify-self: start;
  border: 0;
  background: var(--bubble-friend);
}

.chat-message.user::after,
.chat-message.assistant::before {
  position: absolute;
  top: 12px;
  width: 0;
  height: 0;
  content: "";
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.chat-message.user::after {
  right: -6px;
  border-left: 7px solid var(--bubble-user);
}

.chat-message.assistant::before {
  left: -6px;
  border-right: 7px solid white;
}

.memory-candidate-card {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(215, 221, 216, 0.9);
  padding-top: 10px;
  margin-top: 10px;
}

.route-intent-card {
  border: 1px solid rgba(47, 115, 87, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(244, 249, 240, 0.78);
}

.memory-candidate-kicker {
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
}

.memory-candidate-card strong {
  font-size: 15px;
  line-height: 1.35;
}

.memory-candidate-card p {
  color: var(--muted);
  font-size: 13px;
}

.memory-candidate-meta,
.memory-candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.memory-candidate-meta span {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(246, 242, 233, 0.86);
  font-size: 12px;
  font-weight: 850;
}

.memory-candidate-actions .ghost-button {
  min-height: 32px;
}

.chat-message.pending {
  min-width: 54px;
}

.home-view .home-film-preview,
.time-machine-view .editorial-memory-list,
.time-machine-view .memory-editor-sheet {
  border: 2px solid var(--editorial-line);
  border-radius: 0;
  background: var(--editorial-cream);
  box-shadow: none;
}

.time-machine-view {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.time-machine-view > *,
.time-machine-view .editorial-memory-list,
.time-machine-view .memory-filter-row {
  min-width: 0;
  max-width: 100%;
}

.time-machine-view .time-machine-hero {
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 20px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #9ca5a1;
  animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.ai-source-badge {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(47, 115, 87, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  color: #5f6670;
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 900;
}

.ai-source-badge.ai {
  color: #2d634e;
  background: var(--leaf-soft);
}

.chat-compose {
  display: grid;
  position: fixed;
  right: max(14px, calc((100vw - 500px) / 2 + 14px));
  bottom: 0;
  left: max(14px, calc((100vw - 500px) / 2 + 14px));
  z-index: 18;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
  border: 1px solid rgba(194, 202, 199, 0.96);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(247, 247, 247, 0.96);
  box-shadow: 0 -8px 24px rgba(32, 38, 41, 0.12);
  backdrop-filter: blur(14px);
}

.chat-compose.drag-over {
  border-color: rgba(7, 193, 96, 0.85);
  background: #eefaf3;
}

.chat-compose .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.chat-compose textarea {
  min-height: 42px;
  max-height: 116px;
  resize: vertical;
  border: 1px solid rgba(218, 223, 220, 0.96);
  border-radius: 10px;
  padding: 10px 11px;
  background: white;
}

.chat-compose textarea:focus {
  outline: 0;
  border-color: rgba(7, 193, 96, 0.55);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.chat-upload-button,
.voice-input-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(196, 205, 201, 0.8);
  border-radius: 50%;
  color: #2f3437;
  background: #ffffff;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(32, 38, 41, 0.06);
}

.chat-upload-button:active,
.voice-input-button:active {
  transform: translateY(1px);
}

.chat-upload-button svg,
.voice-input-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-upload-button:hover,
.voice-input-button:hover {
  background: #f2f4f3;
}

.voice-input-button.listening {
  color: white;
  background: var(--wechat);
  border-color: var(--wechat);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.16);
}

.voice-input-button.unsupported {
  opacity: 0.45;
}

.voice-status {
  grid-column: 1 / -1;
  border-radius: 8px;
  padding: 7px 9px;
  color: #4c5a55;
  background: rgba(235, 246, 239, 0.92);
  font-size: 12px;
  line-height: 1.45;
}

.chat-compose .primary-action {
  width: auto;
  min-width: 58px;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 14px;
  color: white;
  background: var(--wechat);
}

.ocr-modal-card {
  gap: 10px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  border-radius: 12px;
}

.ocr-preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid rgba(204, 211, 207, 0.9);
  border-radius: 10px;
  background: #f7f7f7;
}

.ocr-status {
  border: 1px solid rgba(47, 115, 87, 0.18);
  border-radius: 10px;
  padding: 9px 10px;
  color: #4c5a55;
  background: rgba(235, 246, 239, 0.8);
  font-size: 13px;
  line-height: 1.5;
}

#ocrTranscriptInput {
  min-height: 180px;
  resize: vertical;
  border-radius: 10px;
}

.prompt-grid {
  display: flex;
  grid-column: 1 / -1;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 1px;
  scrollbar-width: none;
}

.prompt-grid::-webkit-scrollbar {
  display: none;
}

.prompt-chip {
  flex: 0 0 auto;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: #66716d;
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(199, 207, 202, 0.7);
  font-size: 12px;
  white-space: nowrap;
}

.ai-boundary-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0 0;
  background: rgba(255, 253, 248, 0.68);
}

.ai-boundary-note summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ai-boundary-note p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.memory-timeline {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.memory-scope-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 10px;
  background: rgba(255, 253, 248, 0.82);
}

.memory-scope-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.memory-scope-tab.active {
  color: white;
  background: #263832;
}

.memory-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 72px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(var(--leaf-soft), var(--amber-soft), var(--blue-soft));
}

.memory-timeline:empty::before,
.memory-timeline.is-empty::before,
.memory-timeline:has(.empty-state)::before {
  display: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 58px 18px 1fr;
  gap: 10px;
  align-items: start;
}

.timeline-date {
  display: grid;
  justify-items: end;
  padding-top: 12px;
}

.timeline-date strong {
  font-size: 20px;
  line-height: 1;
}

.timeline-date span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  margin-top: 16px;
  border: 3px solid var(--field);
  border-radius: 999px;
  background: var(--leaf);
  box-shadow: 0 0 0 1px rgba(47, 115, 87, 0.24);
}

.timeline-item.warm .timeline-dot {
  background: var(--rose);
}

.timeline-item.tender .timeline-dot {
  background: var(--amber);
}

.timeline-item.quiet .timeline-dot {
  background: var(--blue);
}

.memory-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--field);
}

.memory-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.memory-card time {
  color: var(--muted);
  font-size: 12px;
}

.memory-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.memory-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.memory-detail {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-grid strong {
  font-size: 14px;
  line-height: 1.45;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #2d634e;
  background: var(--leaf-soft);
  font-size: 12px;
  font-weight: 850;
}

.tag.soft {
  color: #5f6670;
  background: var(--blue-soft);
}

.story-quote {
  margin-top: 12px;
  border-left: 3px solid var(--leaf);
  padding: 10px 0 10px 12px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.62;
}

.room-record-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.room-record-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.88);
}

.room-record-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.room-record-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.room-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.setup-grid {
  display: grid;
  gap: 14px;
}

.join-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.join-row input {
  min-height: 48px;
  font-size: 20px;
  font-weight: 950;
  text-transform: uppercase;
}

.join-row button {
  border: 0;
  color: white;
  background: var(--leaf);
}

.room-code {
  margin-bottom: 10px;
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.identity-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(47, 115, 87, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  margin-bottom: 10px;
  color: #2d634e;
  background: var(--leaf-soft);
  font-size: 13px;
  font-weight: 850;
}

.consent-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.consent-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.consent-status div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--field);
}

.consent-status strong,
.consent-status span {
  display: block;
}

.consent-status strong {
  margin-bottom: 4px;
  font-size: 24px;
}

.consent-status span {
  color: var(--muted);
  font-size: 13px;
}

.deck-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.couple-module-menu {
  display: grid;
  gap: 10px;
}

.couple-module-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: var(--field);
  text-align: left;
}

.couple-module-entry span,
.couple-module-entry strong,
.couple-module-entry small {
  display: block;
}

.couple-module-entry span {
  margin-bottom: 7px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 950;
}

.couple-module-entry strong {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.couple-module-entry small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.couple-module-header {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.couple-module-header h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.couple-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.couple-mode-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--field);
  font-size: 13px;
  font-weight: 850;
}

.couple-mode-tab.active {
  color: white;
  background: #263832;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 12px;
  background: rgba(255, 253, 248, 0.82);
}

.role-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.role-tab.active {
  color: white;
  background: #263832;
}

.deck-tab {
  border: 1px solid var(--line);
  padding: 10px;
  color: var(--ink);
  background: var(--field);
  font-size: 13px;
}

.deck-tab.active {
  border-color: rgba(47, 115, 87, 0.55);
  background: var(--leaf-soft);
}

.couple-card {
  display: grid;
  min-height: 260px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(145deg, var(--field), rgba(220, 238, 228, 0.56));
}

.couple-card h2 {
  margin-bottom: 14px;
  font-size: 26px;
  line-height: 1.28;
}

.longtalk-card.more {
  background: var(--leaf-soft);
}

.longtalk-card.respond {
  background: var(--blue-soft);
}

.longtalk-card.brief {
  background: var(--amber-soft);
}

.longtalk-card.pivot {
  background: var(--rose-soft);
}

.alert-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.toggle-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.toggle-row input {
  width: auto;
}

.listener-tool-panel {
  margin-top: 12px;
}

.feedback-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.feedback-button {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 14px 8px;
  color: var(--ink);
  font-weight: 850;
}

.feedback-button span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 19px;
}

.feedback-button.more {
  background: var(--leaf-soft);
}

.feedback-button.respond {
  background: var(--blue-soft);
}

.feedback-button.brief {
  background: var(--amber-soft);
}

.feedback-button.pivot {
  background: var(--rose-soft);
}

.flow-card.embedded {
  border: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

.card-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.card-actions .ghost-button:last-child {
  grid-column: 1 / -1;
}

.empty-state {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  max-width: min(92vw, 420px);
  padding: 10px 14px;
  border-radius: 999px;
  color: white;
  background: rgba(33, 35, 38, 0.92);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.settings-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.profile-summary-panel {
  display: grid;
  gap: 12px;
  background: rgba(255, 253, 248, 0.92);
}

.profile-summary-grid {
  display: grid;
  gap: 12px;
}

.friend-understanding-link {
  align-self: flex-start;
  margin: -2px 0 10px;
  padding: 0;
  border: 0;
  color: #39735f;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hup-profile-intro {
  position: relative;
  overflow: hidden;
}

.hup-profile-intro::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 126px;
  height: 126px;
  border: 18px solid rgba(78, 141, 118, 0.09);
  border-radius: 50%;
}

.hup-profile-caution {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: #39735f;
  font-size: 13px;
  font-weight: 700;
}

.hup-cloud-status-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(77, 116, 98, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(239, 246, 240, 0.68)),
    rgba(250, 249, 244, 0.9);
}

.hup-cloud-status-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hup-cloud-status-heading span {
  color: #4e8d76;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.hup-cloud-status-heading h2 {
  margin: 4px 0 0;
  color: #213a30;
  font-size: 18px;
}

.hup-cloud-status-heading strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(62, 112, 92, 0.2);
  border-radius: 999px;
  color: #39735f;
  background: rgba(245, 251, 247, 0.88);
  font-size: 12px;
}

.hup-cloud-status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hup-cloud-status-local {
  color: #61736a !important;
  font-weight: 700;
}

.hup-cloud-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hup-cloud-migrate-button,
.hup-cloud-delete-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(62, 112, 92, 0.28);
  border-radius: 8px;
  color: #2f6e58;
  background: rgba(246, 252, 248, 0.94);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.hup-cloud-delete-button {
  border-color: rgba(148, 96, 88, 0.26);
  color: #8a5148;
  background: rgba(252, 248, 245, 0.86);
}

.hup-cloud-migrate-button:disabled,
.hup-cloud-delete-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.hup-cloud-status-message {
  padding-top: 2px;
  color: #39735f !important;
  font-weight: 700;
}

.hup-module-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.hup-module-index article {
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid rgba(73, 90, 82, 0.16);
  border-radius: 14px;
  background: rgba(250, 248, 242, 0.72);
}

.hup-module-index article.is-active {
  border-color: rgba(52, 113, 88, 0.44);
  background:
    linear-gradient(135deg, rgba(74, 137, 108, 0.12), transparent 65%),
    rgba(247, 252, 248, 0.96);
  box-shadow: inset 0 3px 0 #4e8d76;
}

.hup-module-index article.is-companion {
  border-color: rgba(68, 112, 128, 0.34);
  background:
    linear-gradient(135deg, rgba(95, 143, 156, 0.11), transparent 66%),
    rgba(247, 251, 251, 0.96);
  box-shadow: inset 0 3px 0 #5c8793;
}

.hup-module-index article.is-relationship {
  border-color: rgba(119, 96, 140, 0.34);
  background:
    linear-gradient(135deg, rgba(128, 105, 150, 0.11), transparent 66%),
    rgba(250, 248, 252, 0.96);
  box-shadow: inset 0 3px 0 #806895;
}

.hup-module-index article.is-memory {
  border-color: rgba(150, 112, 63, 0.34);
  background:
    linear-gradient(135deg, rgba(170, 124, 65, 0.11), transparent 66%),
    rgba(252, 249, 243, 0.96);
  box-shadow: inset 0 3px 0 #a97d43;
}

.hup-module-index span,
.hup-module-index strong,
.hup-module-index small {
  display: block;
}

.hup-module-index span {
  color: #688076;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.hup-module-index strong {
  margin-top: 8px;
  color: #243b33;
  font-size: 15px;
}

.hup-module-index small {
  margin-top: 5px;
  color: #718078;
  font-size: 11px;
  line-height: 1.45;
}

.hup-profile-overview {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid rgba(81, 111, 95, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(236, 244, 238, 0.74)),
    rgba(250, 249, 244, 0.92);
}

.hup-profile-overview > div:first-child span,
.hup-group-heading span {
  color: #4e8d76;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.hup-profile-overview h2,
.hup-group-heading h2 {
  margin: 4px 0;
  color: #213a30;
  font-size: 20px;
}

.hup-profile-overview p,
.hup-group-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.hup-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.hup-overview-grid article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(83, 110, 96, 0.14);
  border-radius: 14px;
  background: rgba(255, 254, 250, 0.9);
}

.hup-overview-grid span,
.hup-overview-grid strong,
.hup-overview-grid small {
  display: block;
}

.hup-overview-grid span {
  color: #66796f;
  font-size: 10px;
  font-weight: 820;
}

.hup-overview-grid strong {
  margin-top: 5px;
  color: #213a30;
  font-size: 14px;
}

.hup-overview-grid small {
  margin-top: 4px;
  color: #7a857f;
  font-size: 10px;
  line-height: 1.4;
}

.hup-profile-group {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.hup-group-heading {
  padding: 4px 2px 0;
}

.hup-profile-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.hup-profile-phase {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(94, 118, 105, 0.2);
  border-radius: 20px;
  background: rgba(247, 250, 247, 0.72);
}

.hup-profile-phase.hidden { display: none; }

.hup-phase-heading span {
  color: #4e8d76;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.hup-phase-heading h2 { margin: 5px 0 4px; font-size: 20px; }
.hup-phase-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.hup-basic-heading { margin-top: 22px; }

.hup-basic-profile-phase {
  border-color: rgba(78, 141, 118, 0.34);
  background:
    linear-gradient(180deg, rgba(228, 240, 232, 0.64), rgba(250, 249, 244, 0.9));
}

.hup-placeholder-phase {
  border-style: dashed;
  background: rgba(250, 249, 244, 0.72);
}

.hup-placeholder-card {
  padding: 14px;
  border: 1px dashed rgba(89, 115, 101, 0.28);
  border-radius: 15px;
  color: #64766c;
  background: rgba(255, 254, 250, 0.78);
  font-size: 13px;
  line-height: 1.6;
}

.hup-social-style-phase {
  border-color: rgba(83, 126, 105, 0.28);
  background:
    linear-gradient(180deg, rgba(232, 243, 235, 0.6), rgba(249, 248, 245, 0.92));
}

.hup-social-style-phase .hup-phase-heading span,
.hup-social-style-phase .hup-info-field-heading span,
.hup-social-style-phase .hup-text-action {
  color: #4f8266;
}

.hup-social-style-phase .hup-info-field-card {
  border-color: rgba(83, 126, 105, 0.17);
}

.hup-social-style-phase .hup-info-field-heading em {
  color: #4d705f;
  background: #e5f0e9;
}

.hup-lifestyle-phase {
  border-color: rgba(175, 132, 70, 0.26);
  background:
    linear-gradient(180deg, rgba(248, 236, 214, 0.5), rgba(250, 249, 244, 0.92));
}

.hup-lifestyle-phase .hup-phase-heading span,
.hup-lifestyle-phase .hup-info-field-heading span,
.hup-lifestyle-phase .hup-text-action {
  color: #9a6b2f;
}

.hup-lifestyle-phase .hup-info-field-card {
  border-color: rgba(175, 132, 70, 0.16);
}

.hup-lifestyle-phase .hup-info-field-heading em {
  color: #7d5c2c;
  background: #f3eadb;
}

.hup-basic-profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.hup-info-field-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(65, 103, 84, 0.18);
  border-radius: 16px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: 0 7px 20px rgba(54, 70, 62, 0.055);
}

.hup-info-field-card.is-disabled {
  border-style: dashed;
  background: rgba(245, 246, 242, 0.94);
}

.hup-info-field-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hup-info-field-heading span {
  display: block;
  color: #628071;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.055em;
}

.hup-info-field-heading h3 {
  margin: 5px 0 0;
  color: #213a30;
  font-size: 16px;
}

.hup-info-field-heading em {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #476658;
  background: #e5efe9;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.hup-info-field-heading em.is-unset {
  color: #7b7d76;
  background: #efeee9;
}

.hup-info-field-heading em.is-disabled {
  color: #8b665e;
  background: #f2e7e2;
}

.hup-info-field-value {
  margin-top: 14px;
  color: #1f382e;
  font-size: 18px;
  font-weight: 820;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hup-info-field-value.is-unset {
  color: #8a8d87;
  font-size: 15px;
  font-weight: 550;
}

.hup-info-field-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.hup-info-field-meta span {
  padding: 3px 7px;
  border: 1px solid rgba(96, 120, 107, 0.16);
  border-radius: 999px;
  color: #69776f;
  background: rgba(246, 248, 244, 0.92);
  font-size: 10px;
  font-weight: 700;
}

.hup-info-field-card > p {
  min-height: 40px;
  margin: 11px 0 0;
  color: #5e6f66;
  font-size: 12px;
  line-height: 1.58;
}

.hup-existing-profile-phase {
  background: rgba(250, 248, 243, 0.74);
}

.hup-ai-companion-phase {
  border-color: rgba(76, 119, 132, 0.3);
  background:
    linear-gradient(180deg, rgba(226, 239, 241, 0.68), rgba(249, 249, 245, 0.92));
}

.hup-ai-companion-phase .hup-phase-heading span,
.hup-ai-companion-phase .hup-info-field-heading span,
.hup-ai-companion-phase .hup-text-action {
  color: #477681;
}

.hup-ai-companion-phase .hup-info-field-card {
  border-color: rgba(76, 119, 132, 0.17);
}

.hup-ai-companion-phase .hup-info-field-heading em {
  color: #486d76;
  background: #e4eff1;
}

.hup-self-expression-phase {
  border-color: rgba(86, 117, 153, 0.28);
  background:
    linear-gradient(180deg, rgba(229, 236, 248, 0.62), rgba(249, 248, 245, 0.92));
}

.hup-self-expression-phase .hup-phase-heading span,
.hup-self-expression-phase .hup-info-field-heading span,
.hup-self-expression-phase .hup-text-action {
  color: #536f9a;
}

.hup-self-expression-phase .hup-info-field-card {
  border-color: rgba(86, 117, 153, 0.17);
}

.hup-self-expression-phase .hup-info-field-heading em {
  color: #516482;
  background: #e7edf7;
}

.hup-relationship-boundary-phase {
  border-color: rgba(119, 96, 140, 0.28);
  background:
    linear-gradient(180deg, rgba(238, 232, 244, 0.66), rgba(249, 248, 245, 0.92));
}

.hup-relationship-boundary-phase .hup-phase-heading span,
.hup-relationship-boundary-phase .hup-info-field-heading span,
.hup-relationship-boundary-phase .hup-text-action {
  color: #725f86;
}

.hup-relationship-boundary-phase .hup-info-field-card {
  border-color: rgba(119, 96, 140, 0.17);
}

.hup-relationship-boundary-phase .hup-info-field-heading em {
  color: #685776;
  background: #ece5f1;
}

.hup-memory-management-phase {
  border-color: rgba(150, 112, 63, 0.28);
  background:
    linear-gradient(180deg, rgba(246, 237, 219, 0.68), rgba(249, 248, 245, 0.92));
}

.hup-memory-management-phase .hup-phase-heading span,
.hup-memory-management-phase .hup-info-field-heading span,
.hup-memory-management-phase .hup-text-action {
  color: #8d6a38;
}

.hup-memory-management-phase .hup-info-field-card {
  border-color: rgba(150, 112, 63, 0.17);
}

.hup-memory-management-phase .hup-info-field-heading em {
  color: #765a31;
  background: #f1e7d7;
}

.hup-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid rgba(155, 77, 57, 0.24);
  border-radius: 16px;
  background: rgba(252, 245, 240, 0.92);
}

.hup-danger-zone span,
.hup-danger-zone strong,
.hup-danger-zone p {
  display: block;
}

.hup-danger-zone span {
  color: #9a5a48;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.hup-danger-zone strong {
  margin-top: 5px;
  color: #5d342c;
  font-size: 16px;
}

.hup-danger-zone p {
  margin: 5px 0 0;
  color: #7c6b62;
  font-size: 12px;
  line-height: 1.55;
}

.hup-pending-card {
  border-style: dashed;
  background:
    linear-gradient(90deg, rgba(78, 141, 118, 0.045) 1px, transparent 1px) 0 0 / 18px 18px,
    rgba(255, 254, 251, 0.98);
}

.hup-deep-phase {
  border-color: rgba(56, 75, 83, 0.22);
  background: rgba(242, 246, 246, 0.72);
}

.hup-confirmed-phase { border-color: rgba(78, 141, 118, 0.3); }
.hup-confirmed-card { border-left: 4px solid #4e8d76; }

.hup-deep-card { border-left: 4px solid #536e73; }
.hup-insight-confirm-card { border-color: rgba(78, 141, 118, 0.42); }
.hup-insight-edit { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.hup-insight-edit input { min-width: 0; }

.hup-understanding-card {
  padding: 18px;
  border: 1px solid rgba(79, 115, 95, 0.19);
  border-radius: 18px;
  background: rgba(255, 254, 251, 0.96);
  box-shadow: 0 10px 26px rgba(50, 70, 59, 0.07);
  transition: border-color 160ms ease, opacity 160ms ease;
}

.hup-understanding-card.is-disabled {
  opacity: 0.68;
  border-style: dashed;
  background: rgba(246, 247, 244, 0.94);
}

.hup-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hup-card-heading span {
  display: block;
  margin-bottom: 4px;
  color: #4e8d76;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.hup-card-heading h2 {
  margin: 0;
  font-size: 18px;
}

.hup-card-heading em {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #68736e;
  background: #e7ebe8;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.hup-card-value {
  margin-top: 16px;
  color: #20372f;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.55;
}

.hup-card-value.empty {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.hup-use-note {
  margin: 13px 0 0;
  padding: 10px 0 10px 13px;
  border-left: 3px solid rgba(78, 141, 118, 0.45);
  color: #52645b;
  font-size: 14px;
  line-height: 1.65;
}

.hup-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 15px;
  margin-top: 13px;
}

.hup-text-action {
  min-height: 34px;
  min-width: 44px;
  padding: 3px 0;
  border: 0;
  color: #39735f;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.hup-text-action.danger { color: #9a5361; }
.hup-text-action:focus-visible,
.friend-understanding-link:focus-visible { outline: 2px solid #4e8d76; outline-offset: 3px; }

.hup-card-editor {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #f1f7f3;
}

.hup-card-editor label,
.hup-card-editor legend {
  color: #31473e;
  font-size: 13px;
  font-weight: 800;
}

.hup-card-editor fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hup-editor-hint {
  margin: -2px 0 0;
  color: #66786f;
  font-size: 12px;
  line-height: 1.55;
}

.hup-label-editor { grid-template-columns: minmax(90px, 0.8fr) minmax(150px, 1.2fr); align-items: center; }
.hup-label-editor .hup-editor-actions { grid-column: 1 / -1; }

.hup-boundary-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hup-boundary-options label { cursor: pointer; }
.hup-boundary-options input { position: absolute; opacity: 0; pointer-events: none; }
.hup-boundary-options span { display: flex; min-height: 38px; align-items: center; padding: 8px 11px; border: 1px solid #cadbd4; border-radius: 999px; color: #40544b; background: #fff; font-size: 13px; font-weight: 650; }
.hup-boundary-options input:checked + span { border-color: #4e8d76; color: #235844; background: #deeee6; box-shadow: inset 0 0 0 1px #4e8d76; }

.hup-editor-actions,
.hup-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 3px;
}

.hup-profile-empty,
.hup-profile-footer {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid rgba(79, 115, 95, 0.18);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.94);
}

.hup-profile-empty h2,
.hup-profile-footer h2 { margin-top: 0; }
.hup-profile-empty p,
.hup-profile-footer p { color: var(--muted); line-height: 1.65; }
.hup-profile-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.hup-profile-footer p { margin-bottom: 0; }

.profile-summary-group {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.profile-summary-group strong {
  color: var(--ink);
  font-size: 14px;
}

.profile-summary-text {
  border: 1px solid rgba(79, 115, 95, 0.18);
  border-left: 4px solid rgba(79, 115, 95, 0.5);
  border-radius: 8px;
  padding: 11px 12px;
  color: #314236;
  background: rgba(244, 249, 240, 0.68);
  line-height: 1.65;
}

.profile-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tag-grid span {
  border: 1px solid rgba(154, 174, 143, 0.38);
  border-radius: 999px;
  padding: 6px 10px;
  color: #314236;
  background: rgba(244, 249, 240, 0.86);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.profile-empty-state {
  border: 1px dashed rgba(154, 174, 143, 0.48);
  border-radius: 8px;
  padding: 12px;
  background: rgba(250, 248, 241, 0.72);
  color: var(--muted);
  line-height: 1.6;
}

.analysis-result {
  display: grid;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
}

.analysis-result p {
  white-space: normal;
}

.analysis-metrics {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.analysis-metric-row,
.analysis-signal-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-metric-row span,
.analysis-signal-group em {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(244, 249, 240, 0.86);
  color: #314236;
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.analysis-metric-row strong {
  margin-right: 4px;
}

.analysis-signal-group strong {
  width: 100%;
  color: var(--ink);
  font-size: 13px;
}

.ideal-builder-card {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(244, 249, 240, 0.56), transparent 120px),
    rgba(255, 253, 248, 0.92);
}

.ideal-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ideal-builder-header span {
  border-radius: 999px;
  padding: 5px 10px;
  color: #314236;
  background: rgba(220, 238, 228, 0.84);
  font-size: 13px;
  font-weight: 900;
}

.ideal-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.ideal-option-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ideal-option-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(154, 174, 143, 0.36);
  border-radius: 10px;
  padding: 8px 12px;
  color: #314236;
  background: rgba(255, 253, 248, 0.9);
  font-size: 13px;
  font-weight: 850;
}

.ideal-option-chip input:checked + span {
  color: white;
  border-color: #4f735f;
  background: #4f735f;
  box-shadow: 0 5px 14px rgba(47, 115, 87, 0.16);
}

#idealQuestionInput {
  min-height: 88px;
}

.context-actions {
  display: grid;
  gap: 10px;
}

.danger-outline {
  color: #93384b;
  border-color: rgba(169, 91, 108, 0.42);
  background: var(--rose-soft);
}

.privacy-guide,
.save-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 38, 41, 0.42);
  backdrop-filter: blur(10px);
}

.privacy-guide-card,
.save-panel-card {
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--field);
  box-shadow: var(--shadow);
}

.privacy-guide-card p,
.save-panel-card p {
  color: var(--muted);
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .hup-module-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hup-cloud-status-heading {
    flex-direction: column;
    gap: 8px;
  }
  .hup-cloud-migrate-button,
  .hup-cloud-delete-button {
    min-height: 44px;
    width: 100%;
  }
  .hup-overview-grid {
    grid-template-columns: 1fr;
  }
  .hup-basic-profile-list {
    grid-template-columns: 1fr;
  }
  .hup-info-field-card > p {
    min-height: 0;
  }
  .hup-card-actions {
    gap: 12px;
  }
  .hup-text-action {
    min-height: 44px;
    min-width: 44px;
  }
  .hup-boundary-options span {
    min-height: 44px;
  }
  .hup-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
  .hup-profile-phase { padding: 12px; border-radius: 16px; }
  .hup-insight-edit { grid-template-columns: 1fr; }
  .app-shell {
    padding: 16px 12px 28px;
  }

  .topbar {
    margin: -16px -12px 14px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .auth-status-strip {
    border-radius: 18px;
  }

  .auth-status-main,
  .auth-status-main > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .auth-status-actions {
    width: 100%;
  }

  .auth-login-button,
  .auth-logout-button {
    min-height: 44px;
    width: 100%;
  }

  .auth-login-form > div {
    grid-template-columns: 1fr;
  }

  .auth-login-form input,
  .auth-login-form button {
    width: 100%;
  }

  .editorial-mode-switch,
  .home-mode-switch {
    position: static !important;
    top: auto !important;
    z-index: auto;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 20px;
  }

  .hup-understanding-card { padding: 16px; border-radius: 16px; }
  .hup-card-value { font-size: 17px; }
  .hup-label-editor { grid-template-columns: 1fr; }
  .hup-label-editor .hup-editor-actions { grid-column: auto; }
  .hup-profile-footer { align-items: stretch; flex-direction: column; }
  .hup-profile-footer .ghost-button { width: 100%; }

  .hup-test-section { padding: 14px; }
  .hup-test-heading-actions,
  .hup-test-status-primary,
  .hup-test-status-fields,
  .hup-test-debug-grid { grid-template-columns: 1fr; }

  .chip-grid,
  .quick-grid,
  .quick-entry-grid,
  .deck-tabs,
  .card-actions,
  .feedback-actions,
  .couple-mode-tabs,
  .detail-grid,
  .alert-controls {
    grid-template-columns: 1fr;
  }

  .card-actions .ghost-button:last-child {
    grid-column: auto;
  }

  .couple-card h2 {
    font-size: 22px;
  }

  [data-view="during-help"] .quick-button {
    min-height: 74px;
    font-size: 17px;
  }

  [data-view="during-help"] .primary-action,
  [data-view="during-help"] .ghost-button {
    min-height: 52px;
  }

  .memory-timeline::before {
    left: 10px;
  }

  .timeline-item {
    grid-template-columns: 20px 1fr;
  }

  .timeline-date {
    grid-column: 2;
    justify-items: start;
    padding-top: 0;
  }

  .timeline-dot {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-top: 4px;
  }

  .timeline-item .memory-card {
    grid-column: 2;
  }
}
