:root {
  color-scheme: light;
  --ink: #1c2926;
  --ink-soft: #4e625d;
  --paper: #f7f6f1;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --line: #d9e0dc;
  --brand: #173c36;
  --brand-2: #285f55;
  --accent: #d8a44a;
  --accent-soft: #fff3d7;
  --success: #287c55;
  --danger: #a83e36;
  --warning: #9a641e;
  --shadow: 0 18px 45px rgba(23, 60, 54, 0.11);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max: 1240px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(216, 164, 74, 0.15), transparent 30rem),
    radial-gradient(circle at 96% 20%, rgba(40, 95, 85, 0.13), transparent 35rem),
    var(--paper);
  font-family: var(--font);
  line-height: 1.55;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: 0.8rem 1rem;
  border-radius: 0.75rem;
  color: white;
  background: var(--brand);
}
.skip-link:focus { top: 1rem; }

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
  padding: 0.8rem max(1.2rem, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid rgba(217, 224, 220, 0.8);
  background: rgba(247, 246, 241, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(23, 60, 54, 0.15);
  border-radius: 50%;
  background: linear-gradient(145deg, #224d45, #102c28);
  box-shadow: 0 8px 24px rgba(23, 60, 54, 0.22);
}
.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  display: block;
  content: "";
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
.brand-mark::before { width: 24px; height: 13px; transform: rotate(38deg); }
.brand-mark::after { width: 24px; height: 13px; transform: rotate(-38deg); }
.brand-mark span { width: 7px; height: 7px; border-color: var(--accent); background: var(--accent); }

.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-size: 1.07rem; letter-spacing: 0.01em; }
.brand-copy small { margin-top: 0.25rem; color: var(--ink-soft); font-size: 0.68rem; }

.top-status { display: flex; align-items: center; gap: 0.55rem; }

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  width: fit-content;
  padding: 0.34rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 4px rgba(40, 124, 85, 0.12); }
.status-dot.offline { background: var(--warning); box-shadow: 0 0 0 4px rgba(154, 100, 30, 0.12); }

.primary-nav {
  position: sticky;
  top: 78px;
  z-index: 15;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(217, 224, 220, 0.7);
  background: rgba(247, 246, 241, 0.88);
  backdrop-filter: blur(16px);
}
.primary-nav button {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
  padding: 0.62rem 0.9rem;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 700;
}
.primary-nav button:first-child { margin-inline-start: auto; }
.primary-nav button:last-child { margin-inline-end: auto; }
.primary-nav[hidden] { display: none; }
.primary-nav button:hover,
.primary-nav button[aria-current="page"] { color: white; background: var(--brand); }

.main-content {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 5rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--brand-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.8rem; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -0.04em; }
h2 { margin-bottom: 0.65rem; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.18; letter-spacing: -0.025em; }
h3 { margin-bottom: 0.45rem; font-size: 1.05rem; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.84rem; }
.micro { font-size: 0.72rem; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 1.2rem;
  align-items: stretch;
  margin-bottom: 1.4rem;
}

.hero-main,
.hero-aside,
.panel,
.card {
  border: 1px solid rgba(217, 224, 220, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-main {
  position: relative;
  overflow: hidden;
  padding: clamp(1.6rem, 4vw, 3.2rem);
  color: white;
  background: linear-gradient(135deg, #13352f 0%, #245c52 63%, #347366 100%);
}
.hero-main::after {
  position: absolute;
  right: -6rem;
  bottom: -7rem;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 3rem rgba(255, 255, 255, 0.035), 0 0 0 6rem rgba(255, 255, 255, 0.025);
  content: "";
}
.hero-main .eyebrow { color: #f4ce84; }
.hero-main p { max-width: 52rem; color: rgba(255, 255, 255, 0.8); }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.3rem; }

.hero-aside { display: grid; align-content: space-between; padding: 1.4rem; }
.hero-aside blockquote { margin: 0; color: var(--brand); font-size: 1.15rem; font-weight: 750; line-height: 1.5; }
.hero-aside blockquote::before { display: block; color: var(--accent); content: "“"; font-family: Georgia, serif; font-size: 3.5rem; line-height: 0.7; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 760;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: white; background: var(--brand); box-shadow: 0 8px 18px rgba(23, 60, 54, 0.2); }
.button.light { color: var(--brand); background: white; }
.button.ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.button.soft { color: var(--brand); background: var(--surface-soft); }
.button.danger { color: white; background: var(--danger); }
.button.warning { color: #58380d; background: var(--accent-soft); }
.button.small-button { min-height: 34px; padding: 0.45rem 0.75rem; font-size: 0.78rem; }

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.dashboard { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); }

.panel { padding: 1.35rem; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2, .panel-head h3 { margin: 0; }

.card {
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(23, 60, 54, 0.06);
}
.card.interactive { width: 100%; color: inherit; text-align: left; }
.card.interactive:hover { border-color: rgba(40, 95, 85, 0.5); transform: translateY(-2px); }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.stat {
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.stat strong { display: block; color: var(--brand); font-size: 1.45rem; }
.stat span { color: var(--ink-soft); font-size: 0.76rem; }

.form-stack { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.84rem; font-weight: 760; }
.field-hint { color: var(--ink-soft); font-size: 0.75rem; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  width: 100%;
  border: 1px solid #cbd5d0;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: white;
  outline: none;
}
input:not([type="checkbox"]):not([type="radio"]), select { min-height: 45px; padding: 0.7rem 0.82rem; }
textarea { min-height: 118px; padding: 0.82rem; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(40, 95, 85, 0.12); }

.auth-layout {
  display: grid;
  min-height: calc(100vh - 160px);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 1.5rem;
  align-items: center;
}
.auth-story { padding: clamp(1rem, 5vw, 4rem); }
.auth-story h1 { max-width: 12ch; }
.auth-story p { max-width: 57ch; }
.auth-card { padding: clamp(1.4rem, 4vw, 2.2rem); }

.security-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 1.2rem;
}
.security-item { padding: 0.85rem; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-md); color: rgba(255,255,255,.8); background: rgba(255,255,255,.06); }
.security-item strong { display: block; margin-bottom: 0.2rem; color: white; font-size: 0.84rem; }
.security-item span { font-size: 0.72rem; }

.empty-state { padding: 2.4rem 1rem; text-align: center; color: var(--ink-soft); }
.empty-state .empty-symbol { display: grid; width: 60px; height: 60px; margin: 0 auto 1rem; place-items: center; border-radius: 50%; color: var(--brand); background: var(--surface-soft); font-size: 1.6rem; }

.conversation-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr); gap: 1rem; align-items: start; }
.conversation-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.timeline { display: grid; gap: 0.75rem; }
.message { max-width: 88%; padding: 0.9rem 1rem; border-radius: 18px; border: 1px solid var(--line); }
.message.owner { margin-left: auto; border-bottom-right-radius: 5px; background: #e8f2ee; }
.message.guide { margin-right: auto; border-bottom-left-radius: 5px; background: white; }
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.45rem; color: var(--ink-soft); font-size: 0.72rem; }
.original-voice-label { color: var(--brand-2); font-weight: 800; }

.meaning-stack { display: grid; gap: 0.75rem; }
.meaning-card { position: relative; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; }
.meaning-card.pending { border-left: 4px solid var(--accent); }
.meaning-card.accepted, .meaning-card.corrected_successor { border-left: 4px solid var(--success); }
.meaning-card.rejected, .meaning-card.corrected { opacity: 0.68; border-left: 4px solid #8d9692; }
.meaning-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.provenance { margin-top: 0.8rem; padding: 0.75rem; border-radius: var(--radius-md); background: var(--surface-soft); font-size: 0.78rem; }
.origin-ai { color: #72510e; background: var(--accent-soft); }
.origin-user { color: #15533d; background: #e1f3eb; }

.section-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.section-tabs button { padding: 0.48rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: white; }
.section-tabs button.active { border-color: var(--brand); color: white; background: var(--brand); }

.legacy-document { padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid #d8d2c4; border-radius: var(--radius-xl); background: #fffcf3; box-shadow: 0 15px 35px rgba(92, 72, 34, 0.08); }
.legacy-document .document-rule { width: 70px; height: 3px; margin: 1rem 0 1.4rem; background: var(--accent); }
.lineage { display: grid; gap: 0.65rem; }
.lineage-item { padding-left: 1rem; border-left: 2px solid var(--line); }

.sync-stage { display: grid; gap: 0.65rem; }
.sync-step { display: grid; grid-template-columns: 34px 1fr; gap: 0.7rem; align-items: start; }
.sync-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: white; background: var(--brand); font-size: 0.76rem; font-weight: 800; }
.sync-step p { margin: 0; }

.notice { padding: 0.9rem 1rem; border: 1px solid #e7d5a9; border-radius: var(--radius-md); color: #624819; background: #fff8e8; }
.notice.security { border-color: #bcd6cc; color: #194c3d; background: #edf8f3; }
.notice.danger { border-color: #e4b9b6; color: #7a2e28; background: #fff0ef; }

.divider { height: 1px; margin: 1rem 0; background: var(--line); }
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.space-between { justify-content: space-between; }

.modal { width: min(620px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: var(--radius-xl); box-shadow: 0 30px 90px rgba(14, 35, 31, 0.32); }
.modal::backdrop { background: rgba(13, 25, 22, 0.62); backdrop-filter: blur(4px); }
.modal form { padding: 1.4rem; }
.modal-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.small-modal { max-width: 460px; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: white; font-size: 1.25rem; }

.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: grid; gap: 0.55rem; width: min(390px, calc(100% - 2rem)); }
.toast { padding: 0.9rem 1rem; border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-md); color: white; background: #183c35; box-shadow: 0 14px 40px rgba(0,0,0,.25); animation: toast-in 180ms ease-out; }
.toast.error { background: #7c302b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.busy-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(247,246,241,.72); backdrop-filter: blur(5px); }
.busy-card { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.2rem; border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.spinner { width: 22px; height: 22px; border: 3px solid #d6ded9; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.code-block { overflow: auto; padding: 0.85rem; border-radius: var(--radius-md); color: #d7f1e8; background: #112823; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.75rem; }

@media (max-width: 940px) {
  .hero, .auth-layout, .conversation-layout, .grid.dashboard { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-story { padding: 1rem 0; }
}

@media (max-width: 680px) {
  .topbar { min-height: 68px; }
  .brand-copy small { display: none; }
  .primary-nav { top: 68px; justify-content: flex-start; overflow-x: auto; }
  .main-content { width: min(100% - 1rem, var(--max)); padding-top: 1rem; }
  .grid.two, .grid.three, .security-strip, .stat-row { grid-template-columns: 1fr; }
  .hero-main, .hero-aside, .panel, .card { border-radius: 20px; }
  .message { max-width: 95%; }
  .top-status .status-pill.secondary { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}


/* v0.2.0 Guided Alpha UX */
.brand-version {
  display: inline-flex;
  margin-left: .35rem;
  padding: .18rem .42rem;
  border-radius: 999px;
  color: var(--brand-2);
  background: #e8f3ee;
  font-size: .56rem;
  font-weight: 850;
  vertical-align: middle;
}
.status-pill.local-only { border-color: #bfdbd1; color: #1b5a48; background: #eef8f4; }
.status-dot.local { background: #2f8b68; box-shadow: 0 0 0 4px rgba(47,139,104,.12); }
.status-dot.locked { background: #7d8c87; box-shadow: 0 0 0 4px rgba(125,140,135,.12); }
.wide-button { width: 100%; }
.button.glass { border-color: rgba(255,255,255,.36); color: white; background: rgba(255,255,255,.08); }

.onboarding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, .65fr);
  gap: 1.6rem;
  align-items: stretch;
  min-height: calc(100vh - 118px);
}
.onboarding-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-height: 620px;
  padding: clamp(2rem, 4.4vw, 4.2rem);
  border-radius: var(--radius-xl);
  color: white;
  background: linear-gradient(145deg, #143a33 0%, #21594e 62%, #2b6a5d 100%);
  box-shadow: var(--shadow);
}
.onboarding-story::after {
  position: absolute;
  right: -5rem;
  bottom: -8rem;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 4rem rgba(255,255,255,.035), 0 0 0 8rem rgba(255,255,255,.02);
  content: "";
}
.onboarding-story > * { position: relative; z-index: 1; }
.onboarding-story .eyebrow { color: #f7ca78; }
.onboarding-story h1 {
  display: grid;
  max-width: 13ch;
  margin-bottom: 1.1rem;
  font-size: clamp(3rem, 5vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.055em;
  word-break: keep-all;
  overflow-wrap: normal;
}
.onboarding-story h1 span { display: block; }
.onboarding-story h1 em { color: #ffd382; font-style: normal; }
.story-lead { max-width: 59ch; color: rgba(255,255,255,.78); font-size: 1.02rem; }
.story-kicker { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.1rem; }
.story-kicker span { padding: .28rem .62rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: rgba(255,255,255,.9); font-size: .72rem; font-weight: 750; }
.trust-journey { display: grid; gap: .9rem; max-width: 46rem; margin: 1.4rem 0; padding: 0; list-style: none; }
.trust-journey li { display: grid; grid-template-columns: 34px 1fr; gap: .75rem; align-items: start; }
.trust-journey li > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: #173c36; background: #ffd382; font-size: .8rem; font-weight: 850; }
.trust-journey strong, .trust-journey small { display: block; }
.trust-journey small { color: rgba(255,255,255,.67); }
.local-assurance { display: flex; align-items: center; gap: .75rem; max-width: 43rem; padding: .85rem 1rem; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-md); background: rgba(255,255,255,.06); }
.local-assurance strong, .local-assurance small { display: block; }
.local-assurance small { color: rgba(255,255,255,.68); }
.assurance-icon { display: grid; flex: 0 0 auto; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: var(--brand); background: white; font-weight: 900; }

.onboarding-card { align-self: stretch; padding: clamp(1.25rem, 2.4vw, 1.8rem); border-radius: var(--radius-xl); }
.onboarding-card-head { margin: 1rem 0 1.15rem; }
.onboarding-card-head h2 { margin-bottom: .4rem; font-size: clamp(1.6rem, 2.4vw, 2.25rem); }
.onboarding-form { gap: .72rem; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .3rem; border: 1px solid #d3ddd8; border-radius: var(--radius-md); background: #edf2ef; }
.mode-tabs button { min-height: 43px; padding: .55rem .7rem; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent; font-weight: 800; }
.mode-tabs button.active { color: var(--ink); background: white; box-shadow: 0 3px 10px rgba(23,60,54,.1); }
.password-control { position: relative; }
.password-control input { padding-right: 4.5rem; }
.password-toggle { position: absolute; top: 50%; right: .45rem; min-width: 3.5rem; min-height: 34px; padding: .35rem .6rem; transform: translateY(-50%); border: 0; border-radius: 10px; color: var(--brand); background: #edf3f0; font-size: .75rem; font-weight: 800; }
.passphrase-feedback { margin-top: -.4rem; }
.strength-track { overflow: hidden; height: 5px; border-radius: 999px; background: #e6ebe8; }
.strength-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #9b6a20; transition: width .18s ease, background .18s ease; }
.strength-track span[data-level="2"] { background: #4b8b6f; }
.strength-track span[data-level="3"] { background: #216d4e; }
.feedback-row { display: flex; justify-content: space-between; gap: .6rem; margin-top: .32rem; color: var(--ink-soft); font-size: .68rem; }
.match-feedback { margin: -.35rem 0 0; color: var(--ink-soft); font-size: .72rem; }
.match-feedback[data-state="match"] { color: var(--success); }
.match-feedback[data-state="mismatch"] { color: var(--danger); }
.consent-row { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: .7rem; align-items: start; padding: .8rem; border: 1px solid #bfdcd1; border-radius: var(--radius-md); background: #eef8f4; cursor: pointer; }
.consent-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.consent-box { display: grid; width: 22px; height: 22px; place-items: center; border: 1.5px solid #6da78f; border-radius: 6px; color: transparent; background: white; font-size: .72rem; font-weight: 900; }
.consent-row input:checked + .consent-box { color: white; border-color: var(--brand-2); background: var(--brand-2); }
.consent-row input:focus-visible + .consent-box { outline: 3px solid rgba(40,95,85,.18); outline-offset: 2px; }
.consent-row strong, .consent-row small { display: block; }
.consent-row small { margin-top: .18rem; color: var(--ink-soft); font-size: .7rem; }
.form-footnote { margin: -.2rem 0 0; color: var(--ink-soft); font-size: .68rem; text-align: center; }
.restore-form { margin-top: .4rem; }
.file-input { padding: .55rem; }
.boundary-note { display: grid; gap: .18rem; margin-top: 1rem; padding: .85rem; border-radius: var(--radius-md); color: #604819; background: #fff8e8; font-size: .78rem; }
.unlock-story h1 { max-width: 14ch; font-size: clamp(2.5rem, 4vw, 4.4rem); }
.vault-identity { display: flex; align-items: center; gap: .75rem; margin-top: 1.25rem; padding: .85rem; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-md); background: rgba(255,255,255,.06); }
.vault-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--brand); background: #ffd382; font-weight: 900; }
.vault-identity strong, .vault-identity small { display: block; }
.vault-identity small { color: rgba(255,255,255,.68); }

.home-hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(230px,.28fr); gap: 1rem; align-items: stretch; margin-bottom: 1rem; padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: var(--radius-xl); color: white; background: linear-gradient(135deg,#143b34,#2b6a5d); box-shadow: var(--shadow); }
.home-hero .eyebrow { color: #ffd382; }
.home-hero h1 { max-width: 15ch; }
.home-hero p { max-width: 52rem; color: rgba(255,255,255,.78); }
.home-hero-status { display: grid; align-content: center; justify-items: center; padding: 1rem; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-lg); background: rgba(255,255,255,.07); text-align: center; }
.home-hero-status strong { font-size: 2.5rem; }
.home-hero-status small { color: rgba(255,255,255,.75); }
.home-hero-status p { margin: .7rem 0 0; font-size: .75rem; }
.save-state { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .5rem; padding: .35rem .6rem; border-radius: 999px; color: #153e34; background: #e9f7f1; font-size: .72rem; font-weight: 800; }
.journey-panel { margin-bottom: 1rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255,255,255,.91); box-shadow: 0 10px 28px rgba(23,60,54,.06); }
.journey-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.journey-head h2 { margin: 0; }
.journey-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: .65rem; }
.journey-step { display: grid; grid-template-columns: 32px 1fr; gap: .6rem; align-items: center; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fafbf9; }
.journey-step > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--ink-soft); background: #e9eeeb; font-size: .75rem; font-weight: 850; }
.journey-step strong, .journey-step small { display: block; }
.journey-step small { color: var(--ink-soft); font-size: .68rem; }
.journey-step.current { border-color: #d5a850; background: #fff9eb; }
.journey-step.current > span { color: #59400f; background: #ffd382; }
.journey-step.complete { border-color: #bcd8cd; background: #eef8f4; }
.journey-step.complete > span { color: white; background: var(--success); }
.prompt-tabs { margin-top: 1rem; }

@media (max-height: 760px) and (min-width: 941px) {
  .topbar { min-height: 70px; padding-top: .55rem; padding-bottom: .55rem; }
  .main-content { padding-top: 1rem; }
  .onboarding-layout { min-height: calc(100vh - 95px); gap: 1rem; }
  .onboarding-story { min-height: 0; padding: 2.1rem 2.6rem; }
  .onboarding-story h1 { margin-bottom: .75rem; font-size: clamp(2.7rem, 4.2vw, 4.7rem); }
  .story-lead { margin-bottom: .4rem; font-size: .88rem; }
  .trust-journey { gap: .55rem; margin: .85rem 0; }
  .trust-journey small { font-size: .68rem; }
  .local-assurance { padding: .65rem .8rem; }
  .onboarding-card { padding: .75rem 1rem; }
  .mode-tabs button { min-height: 38px; padding: .42rem .6rem; }
  .onboarding-card-head { margin: .4rem 0 .52rem; }
  .onboarding-card-head h2 { margin-bottom: .2rem; font-size: 1.52rem; }
  .onboarding-card-head p { margin-bottom: 0; }
  .onboarding-card-head p, .field-hint { font-size: .65rem; }
  .onboarding-form { gap: .34rem; }
  .field { gap: .24rem; }
  input:not([type="checkbox"]):not([type="radio"]), select { min-height: 38px; padding: .52rem .72rem; }
  .password-toggle { min-height: 30px; }
  .feedback-row { margin-top: .18rem; }
  .consent-row { padding: .5rem .6rem; }
  .button { min-height: 38px; padding-top: .55rem; padding-bottom: .55rem; }
}

@media (max-width: 940px) {
  .onboarding-layout, .home-hero { grid-template-columns: 1fr; }
  .onboarding-story { min-height: auto; }
  .onboarding-story h1 { max-width: 13ch; }
  .journey-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 680px) {
  .onboarding-layout { gap: .75rem; }
  .onboarding-story { padding: 1.5rem; border-radius: 20px; }
  .onboarding-story h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .trust-journey { display: none; }
  .onboarding-card { border-radius: 20px; }
  .journey-grid { grid-template-columns: 1fr; }
  .feedback-row { font-size: .63rem; }
}

/* v0.3.2 — Integrity & Human Authority Hardening */
.version-030 .topbar { min-height: 80px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.65rem; min-width: 0; }
.language-button {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-height: 40px;
  padding: 0.48rem 0.7rem;
  border: 1px solid rgba(23, 60, 54, 0.16);
  border-radius: 999px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(23, 60, 54, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}
.language-button:hover { background: white; transform: translateY(-1px); }
.language-globe { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: white; background: var(--brand); font-size: 0.9rem; }
#language-button-code { min-width: 2.1rem; padding: 0.2rem 0.38rem; border-radius: 999px; color: #785112; background: var(--accent-soft); text-align: center; font-size: 0.68rem; letter-spacing: 0.05em; }

.language-modal {
  width: min(1120px, calc(100vw - 2rem));
  max-width: none;
  max-height: min(880px, calc(100vh - 2rem));
  padding: 0;
  border: 0;
  border-radius: 30px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 35px 100px rgba(8, 34, 29, 0.34);
  overflow: hidden;
}
.language-modal::backdrop {
  background: radial-gradient(circle at 12% 12%, rgba(216, 164, 74, 0.22), transparent 34rem), rgba(7, 27, 24, 0.76);
  backdrop-filter: blur(12px);
}
.language-shell { display: grid; max-height: inherit; overflow: hidden; background: #fbfbf7; }
.language-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1.7rem 1.8rem 1.4rem;
  color: white;
  background:
    radial-gradient(circle at 88% -15%, rgba(216, 164, 74, 0.45), transparent 18rem),
    linear-gradient(130deg, #102f2a, #1f564d 65%, #2e6d61);
}
.language-hero .eyebrow { color: #f5cd7d; }
.language-hero h1 { margin: 0 0 0.35rem; font-size: clamp(1.8rem, 4vw, 3.2rem); }
.language-hero p:last-child { max-width: 52rem; margin: 0; color: rgba(255,255,255,0.78); }
.language-mark {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 22px;
  background: rgba(255,255,255,0.09);
  box-shadow: inset 0 0 0 6px rgba(255,255,255,0.035);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}
.language-close { align-self: start; color: white; border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); }
.language-close[hidden] { display: none !important; }
.language-trust { display: flex; flex-wrap: wrap; gap: 0.65rem 1.2rem; padding: 0.8rem 1.8rem; border-bottom: 1px solid var(--line); background: #f0f6f2; color: var(--brand); font-size: 0.82rem; font-weight: 750; }
.language-trust span { display: inline-flex; align-items: center; gap: 0.4rem; }
.language-trust strong { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: 0.68rem; }
.language-toolbar { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.8rem 0.65rem; }
.language-search-wrap { display: flex; flex: 1; align-items: center; gap: 0.65rem; min-width: 0; padding: 0 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: white; }
.language-search-wrap:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(40,95,85,0.1); }
.language-search-wrap input { width: 100%; min-height: 44px; border: 0; outline: 0; background: transparent; }
.language-count { flex: 0 0 auto; color: var(--ink-soft); font-size: 0.75rem; font-weight: 700; }
.language-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  max-height: 330px;
  padding: 0.45rem 1.8rem 1rem;
  overflow: auto;
}
.language-option {
  position: relative;
  display: grid;
  gap: 0.18rem;
  min-height: 88px;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: white;
  text-align: start;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.language-option:hover { transform: translateY(-2px); border-color: rgba(23,60,54,0.38); box-shadow: 0 10px 24px rgba(23,60,54,0.1); }
.language-option[aria-selected="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand), 0 10px 24px rgba(23,60,54,0.12); background: #f1f7f4; }
.language-option strong { font-size: 1rem; }
.language-option small { color: var(--ink-soft); font-size: 0.7rem; }
.language-tier { align-self: end; width: fit-content; margin-top: 0.35rem; padding: 0.18rem 0.42rem; border-radius: 999px; color: #69490f; background: var(--accent-soft); font-size: 0.62rem; font-weight: 800; }
.language-option[data-tier="complete"] .language-tier { color: #15533a; background: #dff3e8; }
.language-option[data-tier="custom"] .language-tier { color: #44347c; background: #ece8ff; }
.language-no-results { padding: 1rem 1.8rem; color: var(--ink-soft); text-align: center; }
.language-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem 1.2rem;
  align-items: center;
  padding: 1rem 1.8rem 1.25rem;
  border-top: 1px solid var(--line);
  background: #f6f5ef;
}
.language-footer p { margin: 0.2rem 0 0; color: var(--ink-soft); font-size: 0.76rem; }
.language-footer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.language-first-run-note { grid-column: 1 / -1; }
html[dir="rtl"] body { font-family: Tahoma, Arial, var(--font); }
html[dir="rtl"] .brand, html[dir="rtl"] .language-option { text-align: right; }
html[dir="rtl"] .language-hero { grid-template-columns: auto minmax(0,1fr) auto; }
html[dir="rtl"] .language-close { grid-column: 1; grid-row: 1; }
html[dir="rtl"] .language-mark { grid-column: 3; }
html[dir="rtl"] .language-hero > div:nth-child(2) { grid-column: 2; }
html[dir="rtl"] .message.owner { border-inline-start-color: var(--brand); }

@media (max-width: 900px) {
  .language-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-actions { gap: 0.35rem; }
  #language-button-label { display: none; }
}
@media (max-width: 680px) {
  .language-modal { width: 100vw; max-height: 100vh; border-radius: 0; }
  .language-hero { grid-template-columns: auto minmax(0,1fr) auto; padding: 1.2rem; }
  .language-mark { width: 50px; height: 50px; border-radius: 16px; font-size: 1.45rem; }
  .language-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 43vh; padding-inline: 1rem; }
  .language-toolbar, .language-trust, .language-footer { padding-inline: 1rem; }
  .language-footer { grid-template-columns: 1fr; }
  .language-footer-actions { justify-content: stretch; }
  .language-footer-actions .button { flex: 1 1 12rem; }
  .top-status .status-pill.secondary { display: none; }
}
@media (max-width: 440px) {
  .language-grid { grid-template-columns: 1fr; }
  .brand-copy small { display: none; }
  .brand-version { display: none; }
}

/* v0.3.6 — Browser Reality Gate */
.boot-fallback,
.boot-failure {
  max-width: 760px;
  margin: 2rem auto;
}
.boot-error-detail {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  opacity: 0.8;
}

/* v0.5.1 — explicit server-knowing development boundary */
.danger-panel {
  border-style: dashed;
}
.danger-panel .notice {
  margin-block: 0.8rem;
}

/* v6.11.3 Original Voice retrieval: bounded text cards and visible source focus. */
.source-search-panel { max-width: 960px; margin-inline: auto; }
.source-result { margin-block: 16px; overflow-wrap: anywhere; }
.source-result h2 { font-size: 1.1rem; }
.source-result blockquote { margin: 16px 0; border-inline-start: 3px solid var(--accent, #216b63); padding-inline-start: 16px; }
.source-reference { display: grid; grid-template-columns: minmax(80px, 130px) 1fr; gap: 8px; font-size: .8rem; }
.source-reference dd { margin: 0; overflow-wrap: anywhere; }
.message:focus { outline: 3px solid var(--accent, #216b63); outline-offset: 4px; }

#install-app[hidden] { display: none !important; }

/* Conversation deletion v1: sibling controls preserve the existing card layout. */
.conversation-card-shell { min-width: 0; display: flex; flex-direction: column; }
.conversation-card-shell > .card { width: 100%; flex: 1; }
.conversation-card-actions { display: flex; justify-content: flex-end; padding: .25rem .5rem 0; }
#confirm-message { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Conversation lifecycle v1: editable before publish, additive-only after publish. */
.lifecycle-lock { border-color: color-mix(in srgb, currentColor 22%, transparent); }
.correction-entry { border-style: dashed; }
.conversation-card-actions { gap: .4rem; flex-wrap: wrap; align-items: center; }

.private-received-content {white-space:pre-wrap; max-height:25rem; overflow:auto; overflow-wrap:anywhere;}

/* Easy Sharing v1: readable names, keyboard access and large targets. */
.topbar > .brand { flex-shrink: 0; }
.topbar-actions { flex: 1 1 auto; max-width: 100%; }
.top-status { min-width: 0; max-width: 100%; justify-content: flex-end; }
.top-status > :not(.vault-owner-pill) { flex-shrink: 0; }
.vault-owner-pill { font-size: 1rem; gap: .45rem; min-width: 0; max-width: 22rem; flex: 0 1 auto; margin-left: auto; justify-content: flex-end; text-align: right; white-space: nowrap; }
.vault-owner-pill strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html[dir="rtl"] .topbar,
html[dir="rtl"] .topbar-actions,
html[dir="rtl"] .top-status { flex-direction: row-reverse; }
@media (max-width: 900px) {
  .topbar { position: static; flex-wrap: wrap; }
  .topbar-actions { flex: 1 1 100%; width: 100%; flex-wrap: wrap; }
  .top-status { flex: 1 1 auto; flex-wrap: wrap; }
  .vault-owner-pill { max-width: min(22rem, 100%); flex-wrap: wrap; white-space: normal; overflow-wrap: anywhere; }
  .vault-owner-pill strong { max-width: 100%; overflow: visible; }
  .primary-nav { top: 0; }
}
.easy-sharing { max-width: 1100px; margin-inline: auto; font-size: 1.25rem; line-height: 1.65; }
.easy-sharing h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.25; }
.easy-sharing h2 { font-size: 1.8rem; }
.easy-sharing h3 { font-size: 1.5rem; }
.easy-sharing .easy-step { font-size: 1.2rem; font-weight: 750; color: #174a40; }
.easy-sharing .easy-card { padding: clamp(1rem, 3vw, 2rem); margin-block: 1.5rem; border: 2px solid #cbd9d3; border-radius: 18px; background: #fff; }
.easy-sharing .button, .easy-sharing input, .easy-sharing select, .easy-sharing textarea, .easy-sharing summary { font-size: 1.2rem; min-height: 52px; }
.easy-sharing input, .easy-sharing textarea, .easy-sharing select { width: 100%; padding: .8rem; border: 2px solid #9aaca4; border-radius: 10px; }
.easy-sharing label { display: block; margin-block: 1rem; font-weight: 650; }
.easy-sharing textarea { resize: vertical; overflow-wrap: anywhere; }
.easy-sharing fieldset { border: 0; padding: 0; }
.easy-sharing .easy-check { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 2px solid #d4ded8; border-radius: 12px; cursor: pointer; }
.easy-sharing .easy-check input { flex: 0 0 28px; width: 28px; height: 28px; min-height: 28px; }
.easy-sharing small { display: block; font-weight: 450; }
.easy-sharing .easy-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.easy-sharing .easy-code { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .6rem; margin-block: 1rem; }
.easy-sharing .easy-code span { padding: .5rem; background: #ecf3ee; border: 1px solid #a3b7aa; border-radius: 8px; font-family: ui-monospace,monospace; font-size: clamp(.9rem,2vw,1.35rem); text-align: center; }
.easy-sharing .easy-connection { border-top: 2px solid #d5dfd8; margin-top: 1.5rem; padding-top: 1.5rem; }
.easy-sharing .easy-notice { background: #e7f2eb; color: #123e2f; padding: 1rem; border: 2px solid #72967b; border-radius: 12px; }
.easy-sharing .private-received-content { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 1.25rem; font-weight: 450; }
.easy-sharing .easy-turn { border-bottom: 1px solid #dce5dd; padding-block: 1rem; }
.easy-sharing summary { cursor: pointer; padding: .5rem; font-weight: 700; }
.easy-sharing .easy-contact { padding-block: 1rem; border-bottom: 1px solid #dce5dd; }
.easy-sharing :focus-visible { outline: 3px solid #205ac6; outline-offset: 4px; }
.easy-sharing .button:disabled { opacity: .7; cursor: not-allowed; }
.easy-sharing .easy-delivery-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 1.5rem; }
.easy-sharing .easy-delivery-fields label:first-child { grid-column: 1 / -1; }
.easy-sharing .easy-delivery-fields input { min-width: 0; }
.easy-sharing .easy-help { font-size: 1.05rem; font-weight: 450; line-height: 1.6; overflow-wrap: anywhere; }
.easy-sharing .easy-local-boundary { border-left: 5px solid #9b641b; border-radius: 8px; padding: 1rem; background: #fff7e7; color: #5b3b13; }
.easy-sharing .easy-delivery-methods { margin-block: 1.5rem 1rem; }
.easy-sharing .easy-delivery-methods legend { margin-bottom: 1rem; font-weight: 700; }
.easy-sharing .easy-delivery-confirmed { margin-block: 1.5rem; padding: 1.25rem; border: 2px solid #72967b; border-radius: 12px; background: #eef7f1; overflow-wrap: anywhere; }
.easy-sharing .easy-delivery-confirmed h3 { margin-top: 0; }
@media(max-width: 600px) { .easy-sharing .easy-code { grid-template-columns: repeat(2,minmax(0,1fr)); } .easy-sharing .easy-actions .button { width: 100%; } }
@media(max-width: 600px) { .easy-sharing .easy-delivery-fields { grid-template-columns: minmax(0,1fr); } }


.owner-profile-panel { max-width: 900px; margin: 1.5rem auto; padding: clamp(1.2rem, 4vw, 2.8rem); }
.owner-profile-panel h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.profile-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.profile-share-fields { display: flex; flex-wrap: wrap; gap: 1rem; }
.profile-photo { width: 128px; height: 128px; object-fit: cover; border-radius: 50%; }
.profile-actions { margin-top: 1.3rem; }
.owner-profile-panel input, .owner-profile-panel select, .owner-profile-panel textarea { font-size: 1.1rem; }
.vault-owner-pill { cursor: pointer; font: inherit; }
@media (max-width: 600px) { .profile-field-grid { grid-template-columns: 1fr; } }

/* Saved profile settings preview: hoverable, keyboard dismissible and private. */
.owner-profile-preview { position: fixed; z-index: 1200; box-sizing: border-box; width: 320px; max-width: calc(100vw - 24px); padding: 1rem; border: 1px solid #becfc5; border-radius: 16px; background: #fffef9; color: #233d32; box-shadow: 0 12px 32px #233d3226; overflow: auto; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; animation: profile-preview-in .12s ease-out; }
.owner-profile-preview[hidden] { display: none !important; }
.profile-preview-heading { display: flex; align-items: center; gap: .8rem; }
.profile-preview-heading > div { min-width: 0; }
.profile-preview-portrait { display: block; width: 48px; height: 48px; flex: 0 0 48px; }
.profile-preview-photo, .profile-preview-initials { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.profile-preview-initials { display: grid; place-items: center; background: #e2eee6; color: #245342; font-size: 1rem; font-weight: 700; }
.profile-preview-initials[hidden] { display: none; }
.profile-preview-eyebrow { display: block; color: #52685c; font-size: .78rem; }
.profile-preview-name { display: block; font-size: 1.08rem; }
.profile-preview-saved { margin: .75rem 0 .4rem; color: #52685c; font-size: .8rem; }
.profile-preview-settings { margin: 0; }
.profile-preview-settings > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; margin-block: .3rem; }
.profile-preview-settings dt { color: #52685c; }
.profile-preview-settings dd { margin: 0; text-align: end; }
.profile-preview-private, .profile-preview-hint { margin: .6rem 0 0; font-size: .8rem; }
.profile-preview-hint { border-top: 1px solid #d8e2da; padding-top: .6rem; color: #52685c; }
@keyframes profile-preview-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .owner-profile-preview { animation: none; } }

/* Mobile layout: preserve readable labels and give the record room to breathe. */
@media (max-width: 680px) {
  .version-030 .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .5rem;
    min-height: 0;
    padding: .75rem;
  }
  .topbar > .brand { min-width: 0; gap: .5rem; }
  .brand-mark { flex: 0 0 32px; width: 32px; height: 32px; }
  .brand-copy { min-width: 0; }
  .brand-copy strong { overflow: hidden; font-size: .95rem; white-space: nowrap; text-overflow: ellipsis; }
  .brand-version { display: none; }
  .topbar-actions { display: contents; }
  .language-button, #install-app { min-height: 44px; padding: .4rem .55rem; white-space: nowrap; box-shadow: none; }
  .language-button { gap: .3rem; }
  .top-status {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: .4rem;
    width: 100%;
  }
  .top-status .status-pill, .top-status .button { min-height: 44px; white-space: nowrap; }
  .vault-owner-pill {
    flex: 1 1 8rem;
    flex-wrap: nowrap;
    max-width: 100%;
    margin-inline-start: auto;
    margin-inline-end: 0;
    font-size: .8rem;
    overflow: hidden;
  }
  .vault-owner-pill strong { overflow: hidden; text-overflow: ellipsis; }
  .primary-nav { gap: .25rem; padding: .4rem .75rem; }
  .primary-nav button { padding: .55rem .85rem; font-size: .9rem; }
  .primary-nav button:first-child { margin-inline-start: 0; }
  .primary-nav button:last-child { margin-inline-end: 0; }
  .main-content { width: calc(100% - 1.5rem); padding-top: 1rem; }
  .hero-main, .hero-aside, .home-hero, .panel, .card { padding: 1.25rem; }
  .hero-main h1, .home-hero h1 { font-size: clamp(1.8rem, 7.5vw, 2.5rem); line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
  .hero-main p, .home-hero p { line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
  .hero-actions { gap: .5rem; margin-top: 1rem; }
  .hero-actions .button { flex: 1 1 10rem; }
}
