:root {
  color-scheme: light;
  --paper: #f5f2ea;
  --paper-deep: #ece8de;
  --card: #fffdf8;
  --ink: #18251f;
  --muted: #59645d;
  --faint: #5f6962;
  --line: #dddcd4;
  --line-strong: #c8cac1;
  --forest: #183d32;
  --forest-soft: #dfe9e3;
  --forest-mid: #456a5b;
  --peach: #ef9c70;
  --peach-soft: #f8e4d7;
  --amber: #dba34c;
  --red: #b95145;
  --shadow-sm: 0 1px 2px rgba(31, 44, 37, 0.05), 0 8px 22px rgba(31, 44, 37, 0.035);
  --shadow-md: 0 16px 38px rgba(31, 44, 37, 0.09), 0 2px 8px rgba(31, 44, 37, 0.045);
  --shadow-lg: 0 32px 90px rgba(21, 44, 35, 0.18), 0 4px 12px rgba(21, 44, 35, 0.08);
  --network-card-surface: #fffdf9;
  --network-card-surface-hover: #fffefa;
  --network-card-border: #d2d6d0;
  --network-card-border-hover: #aeb9b2;
  --network-card-radius: 14px;
  --network-card-shadow: 0 1px 2px rgba(31, 44, 37, .035), 0 5px 14px rgba(31, 44, 37, .028);
  --network-card-shadow-hover: 0 2px 4px rgba(31, 44, 37, .045), 0 8px 18px rgba(31, 44, 37, .04);
  --visual-viewport-height: 100dvh;
  --visual-viewport-width: 100vw;
  --visual-viewport-offset-top: 0px;
  --visual-viewport-offset-left: 0px;
  --type-meta: .875rem;
  --type-body: 1rem;
  --type-body-large: 1.0625rem;
  --serif: Iowan Old Style, Baskerville, Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html.automatic-log-banner-active { overflow-anchor: none; }
.automatic-log-banner-slot { position: sticky; top: env(safe-area-inset-top); z-index: 10; width: min(1220px, 100%); margin: 0 auto; transition: height 460ms cubic-bezier(.22, 1, .36, 1); }
.automatic-log-banner-inset { padding: 12px clamp(28px, 4vw, 64px) 0; }
.automatic-log-banner {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--forest-soft);
  box-shadow: 0 6px 24px rgba(18, 37, 30, .16);
  transition: opacity 200ms ease-out, transform 460ms cubic-bezier(.22, 1, .36, 1);
}
.automatic-log-banner-slot.is-dismissing { overflow: hidden; pointer-events: none; }
.automatic-log-banner-slot.is-dismissing .automatic-log-banner { opacity: 0; transform: translateY(-8px); }
.automatic-log-banner button { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-radius: inherit; background: transparent; color: var(--forest); font: inherit; font-size: var(--type-meta); cursor: pointer; }
.automatic-log-banner strong { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.automatic-log-banner button:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
.contact-editor-section { display: grid; gap: 12px; min-width: 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.contact-editor-section h3 { margin: 0; font-size: var(--type-body); }
.contact-editor-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contact-editor-section > header button { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; }
.contact-detail-entry + .contact-detail-entry { margin-top: 12px; }
.contact-detail-entry > summary { min-height: 44px; padding: 10px 0; color: var(--forest); font-size: var(--type-meta); font-weight: 650; cursor: pointer; }
.contact-detail-entry-fields { display: grid; gap: 12px; }
.contact-details-dialog :is(.contact-detail-entry, .contact-detail-entry-fields, .field, .form-row, [data-detail-notes], [data-detail-reminders]) { min-width: 0; max-width: 100%; }
.contact-details-dialog :is(.contact-editor-section, .contact-detail-entry-fields, .field) { grid-template-columns: minmax(0, 1fr); }
/* iOS date/time inputs can add padding outside their 100% width (WebKit
   301648). Put decoration on the label's wrapper; keep the native input bare. */
.contact-details-dialog .field > .date-control { display: block; width: 100%; min-width: 0; max-width: 100%; height: 41px; padding: 0 12px; border: 1px solid #d8d9d2; border-radius: 11px; background: white; color: var(--ink); font: inherit; letter-spacing: normal; text-transform: none; transition: border-color 140ms ease, box-shadow 140ms ease; }
.contact-details-dialog .date-control :is(input[type="date"], input[type="time"]) { box-sizing: border-box; display: block; width: 100%; min-width: 0; max-width: 100%; min-inline-size: 0; inline-size: 100%; max-inline-size: 100%; height: 39px; padding: 0; border: 0; border-radius: 0; background: transparent; -webkit-appearance: none; appearance: none; text-align: left; }
.contact-details-dialog .date-control:focus-within { border-color: #8da397; box-shadow: 0 0 0 3px rgba(116,149,131,.1); }
.contact-details-dialog .date-control input:focus { outline: 0; box-shadow: none; }
.contact-details-dialog .date-control:has(input:disabled) { border-color: #e1e2dc; background: #f0f0eb; cursor: not-allowed; }
.contact-details-dialog :is(input[type="date"], input[type="time"])::-webkit-date-and-time-value { display: flex; min-width: 0; min-height: 39px; align-items: center; text-align: left; }
@media (max-width: 800px) { .automatic-log-banner-inset { padding-inline: 16px; } }
@media (prefers-reduced-motion: reduce) { .automatic-log-banner-slot, .automatic-log-banner { transition: none; } }

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--paper);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, rgba(235, 181, 142, 0.13), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--type-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Keep the underlying route still throughout Capture, including its review
   and voice views. Only the dialog's own content may scroll while it is open. */
html.capture-scroll-locked { overflow: hidden; overscroll-behavior: none; }
.capture-scroll-locked body {
  position: fixed;
  top: var(--capture-page-top);
  left: var(--capture-page-left);
  width: calc(100% - var(--capture-scrollbar-width));
}

button, input, textarea, select { font: inherit; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
button, a { -webkit-tap-highlight-color: transparent; }
/* Prevent button double-taps from zooming while preserving pan and pinch zoom. */
button, a, [role="button"], [role="checkbox"], input, select, summary, .mobile-nav, .topbar { touch-action: manipulation; }
button { color: inherit; }
[hidden] { display: none !important; }

.auth-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  background:
    radial-gradient(circle at 50% 12%, rgba(239, 156, 112, .17), transparent 24rem),
    var(--paper);
}
.auth-layout {
  display: grid;
  width: min(390px, 100%);
  gap: 14px;
}
.auth-card {
  width: 100%;
  padding: clamp(28px, 5vw, 36px);
  border: 1px solid rgba(205, 205, 195, .85);
  border-radius: 24px;
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 24px 64px rgba(21, 44, 35, .13), 0 2px 8px rgba(21, 44, 35, .06);
  text-align: center;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.auth-card > img { display: block; width: 64px; height: 64px; margin: 0 auto 14px; object-fit: contain; }
.auth-confirmation-mark {
  display: none;
  width: 46px;
  height: 46px;
  margin: 2px auto 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 25px;
  font-weight: 850;
  line-height: 1;
}
.auth-card h1 { margin: 0; font-family: var(--serif); font-size: clamp(30px, 7vw, 36px); font-weight: 600; letter-spacing: -.035em; }
.auth-intro { max-width: 280px; margin: 10px auto 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.55; }
.auth-waitlist-callout,
.auth-confirmation-access { display: none; }
.auth-gate[data-auth-screen="sign-in"] .auth-waitlist-callout {
  display: grid;
  gap: 8px;
  padding: 15px 16px 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  background: var(--forest);
  box-shadow: 0 14px 34px rgba(21, 44, 35, .18), 0 2px 6px rgba(21, 44, 35, .08);
  color: white;
  text-align: center;
}
.auth-waitlist-callout h2 { margin: 0; color: white; font-size: 20px; line-height: 1.2; }
.auth-waitlist-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 0 3px 9px rgba(7, 24, 18, .2);
  color: var(--forest);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}
.auth-waitlist-button:hover,
.auth-waitlist-button:focus-visible { background: #f3efe5; }
.auth-waitlist-button:focus-visible { outline: 3px solid rgba(255, 255, 255, .5); outline-offset: 3px; }
.auth-gate[data-auth-screen="sign-in"] .auth-card { padding: 18px 22px 16px; }
.auth-gate[data-auth-screen="sign-in"] .auth-card > img { width: 44px; height: 44px; margin-bottom: 5px; }
.auth-gate[data-auth-screen="sign-in"] .auth-card h1 { font-size: 30px; line-height: 1.12; }
.auth-gate[data-auth-screen="sign-in"] .auth-intro { margin-top: 4px; line-height: 1.35; }
.auth-gate[data-auth-screen="sign-in"] .auth-mount { margin-top: 8px; }
.auth-gate[data-auth-screen="waitlist-confirmation"] .auth-card > img { margin-bottom: 8px; }
.auth-gate[data-auth-screen="waitlist-confirmation"] .auth-confirmation-mark { display: grid; }
.auth-gate[data-auth-screen="waitlist-confirmation"] .auth-confirmation-access {
  display: block;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
}
.auth-confirmation-access a { color: var(--forest); font-weight: 750; text-underline-offset: 3px; }
.auth-mount { display: flex; width: 100%; min-height: 0; margin-top: 22px; justify-content: center; }
.auth-mount > * { width: 100%; }
.auth-message { margin: 20px 0 0; padding: 12px; border-radius: 12px; background: #f8e4df; color: #7c342c; font-size: var(--type-meta); line-height: 1.5; }
.auth-legal { display: flex; justify-content: center; gap: 18px; margin-top: 22px; font-size: var(--type-meta); }
.auth-gate[data-auth-screen="sign-in"] .auth-legal { margin-top: 13px; }
.auth-legal a { color: var(--muted); text-underline-offset: 3px; }
.auth-legal a:hover { color: var(--forest); }
.vault-gate { position: fixed; inset: 0; z-index: 100; overflow-y: auto; align-items: safe center; }
.vault-card { width: min(520px, 100%); }
.vault-card .mini-label { margin: 0 0 7px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.vault-recovery-code { display: block; margin: 22px 0 15px; padding: 16px; overflow-wrap: anywhere; border: 1px solid #cbdad1; border-radius: 14px; background: #edf4f0; color: var(--forest); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; line-height: 1.55; user-select: all; }
.vault-gate-actions, .vault-choice-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 14px 0; }
.vault-choice-actions { margin-top: 24px; }
.vault-confirm { display: flex; align-items: flex-start; gap: 9px; margin: 20px 0 14px; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; text-align: left; }
.vault-confirm input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; accent-color: var(--forest); }
.vault-continue { width: 100%; justify-content: center; }
.vault-pair-code { display: block; margin: 22px auto 12px; color: var(--forest); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 36px; letter-spacing: .18em; }
.vault-waiting { color: var(--muted); font-size: var(--type-meta); }
.vault-expiry { margin: 5px 0; color: var(--muted); font-size: var(--type-meta); }
.profile-vault-security > header { flex-wrap: wrap; gap: 10px; }
#refreshVaultDevices { min-height: 44px; }
.vault-card form { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
.vault-card form .button { justify-content: center; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(239, 156, 112, 0.35);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 248px;
  display: flex;
  flex-direction: column;
  padding: 29px 18px 22px;
  background: rgba(250, 248, 242, 0.75);
  border-right: 1px solid rgba(201, 201, 192, 0.72);
  backdrop-filter: blur(18px);
}

.brand, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 90ms ease;
}
.brand-mark:hover img { opacity: .88; }
.bulk-import-notice {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(17, 75, 58, .2);
  border-radius: 999px;
  background: var(--forest);
  color: white;
  font-family: var(--sans);
  font-size: var(--type-meta);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(17, 75, 58, .18);
  cursor: pointer;
}
.bulk-import-notice:hover { background: var(--forest-strong, #0d3e30); }
.bulk-import-notice[hidden] { display: none; }
.brand.bulk-import-ready .brand-home,
.mobile-brand.bulk-import-ready .brand-home { display: none; }
.brand-mark.bulk-import-alerting { animation: reminder-pierogi-attention 1.25s ease both; }
.reminder-badge {
  position: absolute;
  z-index: 4;
  top: -4px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: #b94a3f;
  color: white;
  font-family: var(--sans);
  font-size: var(--type-meta);
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(112, 41, 34, .22);
}
.reminder-badge[hidden] { display: none; }
.brand-mark.reminder-alerting { animation: reminder-pierogi-attention 1150ms ease-in-out 1; transform-origin: 50% 78%; }
@keyframes reminder-pierogi-attention {
  0%, 100% { transform: rotate(0deg) scale(1); }
  12% { transform: rotate(-9deg) scale(1.05); }
  24% { transform: rotate(8deg) scale(1.05); }
  36% { transform: rotate(-7deg) scale(1.04); }
  48% { transform: rotate(6deg) scale(1.03); }
  62% { transform: rotate(-3deg) scale(1.02); }
  78% { transform: rotate(2deg) scale(1.01); }
}
.brand-home { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
.brand-home:hover, .brand-home:focus, .brand-home:active { color: inherit; }

.brand-loader-trigger::before,
.brand-loader-trigger::after {
  content: '';
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.brand-loader-trigger::before {
  inset: 0;
  border-radius: inherit;
  background: url('/assets/Pirogi_loader_base.png') center / contain no-repeat;
}
.brand-loader-trigger::after {
  top: -37.5%;
  left: 0;
  width: 100%;
  height: 137.5%;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.brand-loader-trigger.is-playing img {
  animation: pirogi-brand-resting-frame 1200ms steps(1, end) 1;
}
.brand-loader-trigger.is-playing::before {
  animation: pirogi-brand-base-frame 1200ms steps(1, end) 1;
}
.brand-loader-trigger.is-playing::after {
  animation: pirogi-loader-onion-frames 1200ms steps(1, end) 1;
}

.reminder-tray-scrim {
  position: fixed;
  z-index: 49;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(24, 37, 31, .08);
  cursor: default;
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}
.reminder-tray {
  position: fixed;
  z-index: 50;
  top: 66px;
  left: 24px;
  display: flex;
  width: min(390px, calc(100vw - 48px));
  max-height: min(640px, calc(100dvh - 88px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cfd8d1;
  border-radius: 20px;
  background: rgba(255, 253, 248, .97);
  box-shadow: 0 24px 70px rgba(24, 39, 32, .22), 0 3px 10px rgba(24, 39, 32, .08);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
  backdrop-filter: blur(24px) saturate(125%);
}
.reminder-tray[hidden], .reminder-tray-scrim[hidden] { display: none; }
.reminder-tray-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px 14px; border-bottom: 1px solid var(--line); }
.reminder-tray-kicker { display: block; margin-bottom: 3px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.reminder-tray-header h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.reminder-tray-body { min-height: 0; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; padding: 4px 17px 16px; }
.reminder-tray-section { padding-top: 14px; }
.reminder-tray-section + .reminder-tray-section { margin-top: 5px; border-top: 1px solid var(--line); }
.reminder-tray-section > h3 { margin: 0 0 5px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.reminder-tray-item { padding: 11px 0; border-bottom: 1px solid #e8e7e0; }
.reminder-tray-item:last-child { border-bottom: 0; }
.saved-notes-panel { margin: 12px 24px 0; padding: 12px 16px; border: 1px solid #cbdad1; border-radius: 14px; background: var(--forest-soft); color: var(--forest); font-size: var(--type-meta); }
.saved-notes-panel[hidden] { display: none; }
.saved-note-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.saved-note-card + .saved-note-card { border-top: 1px solid #cbdad1; margin-top: 12px; padding-top: 12px; }
.saved-note-copy { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.saved-note-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: inherit; }
.saved-note-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-note-actions .button { min-height: 44px; padding: 10px 14px; border-radius: 10px; font-size: var(--type-meta); }
.saved-note-actions .saved-note-discard { min-height: 44px; padding: 8px 4px; }
.saved-note-actions .button:disabled { opacity: .6; }
.reminder-tray-item.is-complete { background: #eef5f0; }
.reminder-tray-item.is-complete .reminder-tray-content strong { text-decoration: line-through; color: var(--muted); }
.reminder-tray-actions button:disabled, .reminder-snooze-options button:disabled { opacity: .65; cursor: default; }
.group-title-button, .group-about-button { appearance: none; border: 0; border-radius: 6px; padding: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.group-title-button:focus-visible, .group-about-button:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; }
.group-about-button { display: block; min-height: 44px; max-width: 100%; }
.reminder-tray-item.is-due { margin: 0 -7px; padding: 11px 7px; border-radius: 12px; background: linear-gradient(135deg, rgba(250, 224, 210, .56), rgba(255, 249, 243, .72)); }
.reminder-tray-content { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.reminder-tray-content strong { display: block; color: var(--ink); font-size: var(--type-meta); font-weight: 750; line-height: 1.4; }
.reminder-tray-content span { display: block; margin-top: 3px; color: var(--muted); font-size: var(--type-meta); line-height: 1.35; }
.reminder-tray-item.is-due .reminder-tray-content span { color: #9a563d; font-weight: 700; }
.reminder-tray-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.reminder-tray-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 30px; padding: 0 9px; border: 1px solid #d7dbd6; border-radius: 9px; background: rgba(255,255,255,.72); color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.reminder-tray-actions button:hover { border-color: #aebdb4; background: white; }
.reminder-tray-actions button:last-child { margin-left: auto; }
.reminder-snooze-options { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; padding: 6px; border-radius: 10px; background: var(--forest-soft); }
.reminder-snooze-options button { flex: 1 0 auto; max-width: 100%; min-width: 0; min-height: 32px; padding: 0 5px; border: 0; border-radius: 7px; background: rgba(255,255,255,.8); color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.reminder-snooze-options button:hover { background: white; box-shadow: var(--shadow-sm); }
.reminder-tray-empty { display: grid; place-items: center; min-height: 180px; padding: 28px 16px; text-align: center; }
.reminder-tray-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 11px; border-radius: 14px; background: var(--forest-soft); color: var(--forest); }
.reminder-tray-empty strong { color: var(--ink); font-family: var(--serif); font-size: 18px; }
.reminder-tray-empty p { max-width: 230px; margin: 5px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }

.primary-nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #626a64;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}
.nav-item:hover { background: rgba(24, 61, 50, 0.06); color: var(--forest); }
.nav-item.active { background: var(--forest); color: white; box-shadow: 0 5px 18px rgba(24, 61, 50, 0.14); }
.nav-item em { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgba(24, 61, 50, 0.08); color: var(--forest); font-size: var(--type-meta); font-style: normal; text-align: center; }
.nav-item.active em { background: rgba(255,255,255,0.14); color: white; }
.nav-icon, [data-standalone-icon], .mobile-nav-item > span { display: grid; place-items: center; width: 20px; height: 20px; }
.nav-icon svg, [data-standalone-icon] svg, .mobile-nav-item svg { width: 100%; height: 100%; stroke: currentColor; }

.sidebar-spacer { flex: 1; min-height: 30px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--muted); font-size: var(--type-meta); text-decoration: none; }
.sidebar-link:hover { color: var(--forest); }

.app-main { grid-column: 2; min-width: 0; min-height: 100vh; }
.topbar { display: flex; align-items: center; min-height: 112px; padding: 27px clamp(28px, 4vw, 64px) 20px; }
.topbar-page-copy { min-width: 0; }
.topbar .eyebrow { margin: 0 0 3px; color: var(--muted); font-size: var(--type-meta); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-family: var(--serif); font-size: 27px; line-height: 1.1; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.how-it-works-button,
.feedback-button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid #d8ddd7; border-radius: 999px; background: rgba(255,253,248,.72); color: var(--forest); font-size: var(--type-meta); cursor: pointer; transition: 160ms ease; }
.how-it-works-button:hover,
.feedback-button:hover { border-color: #bfc8c1; background: var(--card); transform: translateY(-1px); }
.how-it-works-button.active { border-color: var(--forest); background: var(--forest); color: white; }
.how-it-works-button > span,
.feedback-button > span { width: 16px; height: 16px; }
.how-it-works-button strong,
.feedback-button strong { font-weight: 750; }
.avatar-button { display: grid; place-items: center; width: 37px; height: 37px; padding: 0; border: 1px solid #ccd8d1; border-radius: 50%; background: #dce5df; color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; transition: 160ms ease; }
.avatar-button:hover { border-color: #aebfb5; background: #edf3ef; transform: translateY(-1px); }
.account-menu-wrap { position: relative; z-index: 60; }
.account-menu { position: absolute; top: calc(100% + 10px); right: 0; width: min(270px, calc(100vw - 32px)); max-height: calc(var(--visual-viewport-height) - 120px); overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line-strong); border-radius: 17px; background: var(--card); box-shadow: var(--shadow-lg); }
.account-menu[hidden], .account-menu [hidden] { display: none; }
.account-menu-title { margin: 6px 10px 8px; color: var(--muted); font-size: var(--type-meta); font-weight: 750; }
.account-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--forest); font: 650 var(--type-meta)/1.4 var(--sans); text-align: left; text-decoration: none; cursor: pointer; }
.account-menu-item:hover, .account-menu-item:focus-visible { background: var(--forest-soft); }
.account-menu-item [data-standalone-icon] { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; }
.account-undo-item { align-items: flex-start; }
.account-undo-item > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.account-undo-item > span strong, .account-undo-item > span small { display: block; }
.account-undo-item > span small { margin-top: 2px; color: var(--muted); font-size: var(--type-meta); font-weight: 500; }
.account-menu-divider { height: 1px; margin: 6px 10px; background: var(--line); }
.account-sign-out { color: #8d493f; }
.mobile-brand { display: none; }

.main-content { width: min(1220px, 100%); margin: 0 auto; padding: 10px clamp(28px, 4vw, 64px) 64px; }
/* Page and dialog focus destinations are regions rather than controls.
   WebKit otherwise draws a blue outline across their full width on focus. */
.main-content:focus, dialog:focus { outline: none; }
.page-loading { display: grid; place-items: center; min-height: 55vh; color: var(--muted); font-size: var(--type-meta); }
.assistant-orb { background: url('/assets/Pirogi_160.png') center / contain no-repeat; }
.loading-orbit {
  position: relative;
  width: 46px;
  height: 46px;
}
.loading-orbit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: center / contain no-repeat;
  animation: pirogi-loader-base-frames 1200ms steps(1, end) infinite;
}
.loading-orbit::after {
  content: '';
  position: absolute;
  top: -37.5%;
  left: 0;
  width: 100%;
  height: 137.5%;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  animation: pirogi-loader-onion-frames 1200ms steps(1, end) infinite;
}
.loading-orbit i,
.assistant-orb i {
  display: none;
}
@keyframes pirogi-loader-base-frames {
  0%, 74.999% { background-image: url('/assets/Pirogi_loader_base.png'); }
  75%, 100% { background-image: url('/assets/Pirogi_160.png'); }
}
@keyframes pirogi-loader-onion-frames {
  0%, 24.999%, 75%, 100% { opacity: 0; background-image: none; }
  25%, 49.999% { opacity: 1; background-image: url('/assets/Pirogi_loader_onionFalling.png'); }
  50%, 74.999% { opacity: 1; background-image: url('/assets/Pirogi_loader_onionFalling2.png'); }
}
@keyframes pirogi-brand-base-frame {
  0%, 74.999% { opacity: 1; }
  75%, 100% { opacity: 0; }
}
@keyframes pirogi-brand-resting-frame {
  0%, 74.999% { opacity: 0; }
  75%, 100% { opacity: 1; }
}

.page-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 28px; align-items: start; }
.page-section { min-width: 0; }
.section-heading, .page-actions-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading h2, .page-actions-row h2 { margin: 0; font-family: var(--serif); font-size: 20px; letter-spacing: -.015em; }
.section-heading p, .page-actions-row p { margin: 5px 0 0; color: var(--muted); font-size: var(--type-meta); }
.section-heading.recent-conversations-heading { align-items: center; }
.page-list-header { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 14px; }
.page-list-header > div:first-child { grid-column: 1; grid-row: 1; min-width: 0; }
.page-list-header > .page-action-buttons { grid-column: 2; grid-row: 1; justify-self: end; }
.page-list-header > .search-control { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; }
.page-list-header > .people-list-tools { grid-column: 1 / -1; grid-row: 2; }
.page-list-header > .group-list-tools { grid-column: 1 / -1; grid-row: 2; }
.network-page-heading { position: relative; width: 100%; text-align: center; }
.network-page-heading::after { content: ''; display: block; width: 24px; height: 2px; margin: 10px auto 0; border-radius: 999px; background: var(--peach); }
.network-page-heading h2 { color: var(--forest); font-size: clamp(35px, 4vw, 43px); font-weight: 500; line-height: 1; letter-spacing: -.035em; }
.network-heading-actions { position: absolute; top: 50%; right: 0; display: flex; align-items: center; gap: 8px; transform: translateY(-50%); }
.network-page-heading > .compact-add-button { position: absolute; top: 50%; right: 0; transform: translateY(-50%); }
.network-page-heading > .compact-add-button,
.network-heading-actions .compact-import-button,
.network-heading-actions .compact-add-button { width: 40px; min-width: 40px; min-height: 40px; height: 40px; padding: 0; }
.network-heading-actions .compact-import-button svg { width: 26px; height: 26px; }
body[data-page-route="people"] .topbar,
body[data-page-route="groups"] .topbar { min-height: 88px; padding-top: 18px; padding-bottom: 14px; }
body[data-page-route="people"] .topbar-page-copy,
body[data-page-route="groups"] .topbar-page-copy { display: none; }
.people-list-tools, .group-list-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.people-list-tools .search-control { width: 100%; max-width: none; }
.group-list-tools .search-control { width: 100%; max-width: none; }
.list-compact-actions { display: flex; align-items: center; gap: 8px; }
.list-sort-toggle { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 136px; padding: 3px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: rgba(240, 240, 234, .78); touch-action: pan-y; user-select: none; }
.list-sort-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 2); border-radius: 8px; background: var(--card); box-shadow: 0 2px 8px rgba(36, 52, 43, .08); transform: translateX(0); transition: transform 180ms ease; pointer-events: none; }
.list-sort-toggle[data-active-sort="alphabetical"] .list-sort-thumb { transform: translateX(100%); }
.list-sort-toggle.is-dragging .list-sort-thumb { transition: none; }
.list-sort-toggle button { position: relative; z-index: 1; min-width: 0; min-height: 34px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: var(--type-meta); font-weight: 750; cursor: pointer; }
.list-sort-toggle button.active { color: var(--forest); }
.section-link { flex: 0 0 auto; border: 0; background: transparent; color: var(--forest); font-size: var(--type-meta); font-weight: 750; white-space: nowrap; cursor: pointer; }

.hero-card { position: relative; min-height: 0; padding: 24px 8px; color: var(--ink); }
.hero-card::before { display: none; }
.hero-card .mini-label { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-card .mini-label::before { content: ''; width: 18px; height: 1px; background: var(--peach); }
.hero-card h2 { position: relative; max-width: 550px; margin: 0; color: var(--forest); font-family: var(--serif); font-size: clamp(29px, 3.5vw, 39px); font-weight: 500; line-height: 1.06; letter-spacing: -.032em; }
.hero-card p { position: relative; max-width: 520px; margin: 7px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.hero-action { position: relative; display: inline-flex; align-items: center; gap: 11px; margin-top: 24px; padding: 11px 17px 11px 11px; border: 0; border-radius: 999px; background: var(--peach); color: #38231a; font-size: var(--type-meta); font-weight: 800; cursor: pointer; box-shadow: 0 7px 20px rgba(0,0,0,.13); transition: transform 160ms ease; }
.hero-action:hover { transform: translateY(-1px); }
.hero-action span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.3); }
.hero-action svg { width: 16px; height: 16px; }
.hero-action-icon { width: 52px; height: 52px; justify-content: center; padding: 0; }
.hero-card + .section-heading { margin-top: 28px; }

.home-action-grid { display: grid; grid-template-columns: minmax(0, 780px); justify-content: center; gap: 18px; align-items: start; }
.home-action-grid .hero-card { display: grid; place-items: center; width: 100%; min-height: 340px; padding: clamp(34px, 5vw, 54px); border: 1px solid #ead4c5; border-radius: 28px; background: linear-gradient(145deg, rgba(255,253,248,.94), rgba(248,228,215,.62)); box-shadow: var(--shadow-sm); }
/* Keep the composer layout while letting Log Anything sit directly on the page. */
:root[data-theme] #mainContent .home-action-grid > .hero-card { border-color: transparent; background: transparent; box-shadow: none; }
.hero-card-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; align-items: center; width: min(570px, 100%); text-align: center; }
.hero-card-inner .log-action-copy { text-align: center; }
.hero-card-inner .log-action-copy h2,
.hero-card-inner .log-action-copy p { margin-right: auto; margin-left: auto; }
.first-contact-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 12px; color: #9d4f2e; font-size: var(--type-meta); font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.first-contact-kicker::before, .first-contact-kicker::after { content: ''; width: 14px; height: 1px; background: #d8a286; }
.first-contact-hero .log-action-copy > p { max-width: 390px; margin-top: 10px; font-family: var(--sans); font-size: var(--type-meta); }
.hero-card-inner > .hero-action { margin-top: 0; }
.hero-card-inner .capture-draft-card { grid-column: 1 / -1; width: 100%; text-align: left; }
.hero-card-inner.has-capture-draft .log-action-copy { grid-column: 1 / -1; }
.home-note-composer { position: relative; width: 100%; }
.home-note-composer textarea { display: block; width: 100%; min-height: 132px; padding: 17px 62px 17px 18px; resize: none; border: 1px solid #d6bca9; border-radius: 18px; background: rgba(255,255,255,.78); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 9px 28px rgba(97,66,47,.055); font: 15px/1.55 var(--serif); outline: 0; transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease, transform 150ms ease; }
.home-note-composer textarea::placeholder { color: var(--faint); opacity: 1; }
.home-note-composer textarea:hover { border-color: #c9a78f; background: rgba(255,255,255,.9); }
.home-note-composer textarea:focus { border-color: #c58968; background: white; box-shadow: 0 0 0 4px rgba(239,156,112,.14), 0 13px 34px rgba(97,66,47,.08); transform: translateY(-1px); }
.home-note-composer > button { position: absolute; right: 13px; bottom: 13px; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 13px; background: var(--peach); color: #40281e; box-shadow: 0 7px 18px rgba(86,53,38,.16); cursor: pointer; transition: transform 150ms ease, box-shadow 150ms ease; }
.home-note-composer > button:hover { transform: translateY(-1px); box-shadow: 0 10px 23px rgba(86,53,38,.2); }
.home-note-composer > button:active { transform: scale(.97); }
.home-note-composer > button svg { width: 19px; height: 19px; }
.home-note-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: -12px; color: var(--faint); font-size: var(--type-meta); text-align: left; }
.home-note-meta > button { min-height: 44px; padding: 0; border: 0; background: transparent; color: #9d4f2e; font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.home-detail-grid { margin-top: 28px; }
.query-action-card { display: flex; min-width: 0; min-height: 220px; flex-direction: column; padding: clamp(25px, 3.5vw, 34px); border: 1px solid #cad7d0; border-radius: 25px; background: linear-gradient(145deg, #e4ece7, #f2eee4); box-shadow: var(--shadow-sm); }
.query-action-card .mini-label { margin: 0 0 18px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.query-action-card h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: clamp(29px, 3.5vw, 39px); font-weight: 500; line-height: 1.06; letter-spacing: -.032em; }
.query-action-card > p:not(.mini-label) { max-width: 430px; margin: 15px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.6; }
.query-locked-note { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; margin-bottom: 17px; padding: 7px 10px; border: 1px solid rgba(80,112,94,.18); border-radius: 999px; background: rgba(255,255,255,.46); color: var(--forest-mid); font-size: var(--type-meta); letter-spacing: .02em; }
.query-locked-note span { display: grid; place-items: center; color: #a65735; }
.query-awaiting-first-contact { background: linear-gradient(145deg, rgba(228,236,231,.72), rgba(242,238,228,.76)); box-shadow: none; }
.query-awaiting-first-contact .query-awaiting-copy { max-width: 470px; margin-top: 12px; }
.home-query-form { display: flex; gap: 7px; margin-top: 20px; }
.home-query-form input { min-width: 0; flex: 1; height: 46px; padding: 0 14px; border: 1px solid #bccbc2; border-radius: 13px; background: rgba(255,255,255,.78); color: var(--ink); font-size: var(--type-meta); outline: 0; }
.home-query-form input:focus { border-color: #839c8d; box-shadow: 0 0 0 3px rgba(116,149,131,.12); }
.home-query-form button { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border: 0; border-radius: 13px; background: var(--forest); color: white; cursor: pointer; }
.home-query-form input:disabled { border-style: dashed; background: rgba(255,255,255,.42); color: var(--faint); cursor: default; }
.home-query-form button:disabled { background: #aebbb4; color: rgba(255,255,255,.86); cursor: default; }
.first-contact-reassurance { display: flex; align-items: center; justify-content: center; gap: 10px; width: min(660px, calc(100% - 32px)); margin: 22px auto 0; color: var(--muted); text-align: center; }
.first-contact-reassurance > span { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: #e2ece6; color: var(--forest-mid); }
.first-contact-reassurance p { margin: 0; font-size: var(--type-meta); line-height: 1.5; }
.first-contact-reassurance strong { color: var(--forest); }
.query-action-card .prompt-chip { background: rgba(255,255,255,.54); }
.query-suggestion-marquee { width: 100%; margin-top: 11px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.query-suggestion-track { display: flex; width: max-content; animation: query-suggestion-scroll 42s linear infinite; }
.query-suggestion-set { display: flex; flex: 0 0 auto; gap: 7px; padding-right: 7px; }
.query-suggestion-marquee:hover .query-suggestion-track, .query-suggestion-marquee:focus-within .query-suggestion-track { animation-play-state: paused; }
.query-suggestion-marquee .prompt-chip { flex: 0 0 auto; white-space: nowrap; }
@keyframes query-suggestion-scroll { to { transform: translateX(-50%); } }

.capture-draft-card { position: relative; margin-top: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,.78); backdrop-filter: blur(6px); }
.capture-draft-card > span { display: block; color: #9d4f2e; font-size: var(--type-meta); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.hero-card .capture-draft-card > p { display: -webkit-box; overflow: hidden; margin: 8px 0 11px; color: var(--ink); font-family: var(--serif); font-size: var(--type-meta); line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.capture-draft-card > div { display: flex; align-items: center; gap: 12px; }
.capture-draft-card button { padding: 0; border: 0; background: transparent; font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.capture-draft-card .draft-resume { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.capture-draft-card .draft-discard { color: var(--muted); }
.capture-draft-card .draft-confirm { flex-wrap: wrap; }
.capture-draft-card .draft-confirm strong { color: var(--ink); font-size: var(--type-meta); }
.capture-draft-card .draft-delete { color: #ffc4aa; text-decoration: underline; text-underline-offset: 3px; }

.memory-list { display: grid; gap: 9px; }
.memory-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.76); box-shadow: var(--shadow-sm); cursor: pointer; transition: 160ms ease; }
.memory-row:hover { transform: translateY(-1px); border-color: var(--line-strong); background: var(--card); }
.person-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--avatar, #dce6df); color: var(--forest); font-family: var(--serif); font-size: 14px; font-weight: 800; }
.memory-row strong { display: block; margin-bottom: 4px; font-size: var(--type-meta); }
.memory-row p { overflow: hidden; margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.memory-date { color: var(--faint); font-size: var(--type-meta); white-space: nowrap; }

.activity-page { max-width: 880px; margin: 0 auto; }
.activity-back { margin: 0 0 18px; padding: 0; border: 0; background: transparent; color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.activity-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.activity-heading .mini-label { margin: 0 0 8px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.activity-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(27px, 4vw, 36px); font-weight: 500; letter-spacing: -.025em; }
.activity-heading div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.activity-heading > span { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: var(--forest-soft); color: var(--forest); font-size: var(--type-meta); font-weight: 750; }
.activity-list { display: grid; gap: 9px; }
.activity-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; gap: 14px; align-items: center; width: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.78); color: inherit; text-align: left; box-shadow: var(--shadow-sm); cursor: pointer; transition: 160ms ease; }
.activity-row:hover { border-color: var(--line-strong); background: var(--card); transform: translateY(-1px); }
.activity-copy { min-width: 0; }
.activity-copy > span { display: block; margin-bottom: 4px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.activity-copy strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: var(--type-meta); }
.activity-copy p { margin: 0; color: var(--muted); font-family: var(--serif); font-size: var(--type-meta); line-height: 1.45; }
.activity-open { display: grid; place-items: center; color: var(--faint); }

.panel-card { padding: 20px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,253,248,.78); box-shadow: var(--shadow-sm); }
.panel-card + .panel-card { margin-top: 14px; }
.panel-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-card header h3 { margin: 0; font-family: var(--serif); font-size: 17px; }
.panel-card header span { color: var(--muted); font-size: var(--type-meta); }
.reminder-list { display: grid; gap: 4px; }
.reminder-row { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid #e8e7e0; }
.reminder-row:last-child { border-bottom: 0; }
.reminder-row[data-reminder-id] { scroll-margin-block: 110px; }
.reminder-row.search-evidence-focus {
  border-radius: 14px;
  background: #fff4e9;
  box-shadow: 0 0 0 5px rgba(239,156,112,.24), 0 12px 28px rgba(69,47,36,.12);
  animation: reminder-evidence-focus 4s ease-out;
}
.reminder-row.search-evidence-focus .reminder-content:focus-visible { outline: 0; }
.reminder-check { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid #b8c0ba; border-radius: 50%; background: transparent; cursor: pointer; }
.reminder-check:hover { border-color: var(--forest); background: var(--forest-soft); }
.reminder-check svg { width: 12px; height: 12px; opacity: 0; }
.reminder-content { min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.reminder-content:hover strong { color: var(--forest); }
.reminder-row strong { display: block; color: #39443e; font-size: var(--type-meta); font-weight: 650; line-height: 1.4; }
.reminder-row span { display: block; margin-top: 3px; color: var(--faint); font-size: var(--type-meta); }
.empty-mini { padding: 18px 4px 8px; color: var(--muted); font-size: var(--type-meta); line-height: 1.55; text-align: center; }

.prompt-list { display: flex; flex-wrap: wrap; gap: 7px; }
.prompt-chip { padding: 8px 11px; border: 1px solid #dadbd4; border-radius: 999px; background: #fbfaf6; color: #536059; font-size: var(--type-meta); cursor: pointer; }
.prompt-chip:hover { border-color: #9fac9f; color: var(--forest); }
.ask-prompt-list { margin-top: 13px; }

.search-control { position: relative; flex: 0 1 320px; }
.search-control [data-standalone-icon] { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; color: #8d968f; transform: translateY(-50%); }
.search-control input { width: 100%; height: 41px; padding: 0 15px 0 39px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,.75); color: var(--ink); font-size: var(--type-meta); }
.search-control:has(.search-clear) input { padding-right: 44px; }
.search-clear { position: absolute; top: 50%; right: 5px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transform: translateY(-50%); }
.search-clear:hover { background: var(--forest-soft); color: var(--forest); }
.group-member-tools { display: flex; margin: -4px 0 14px; }
.group-member-tools .search-control { flex-basis: min(100%, 420px); width: min(100%, 420px); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--card); color: var(--forest); font-size: var(--type-meta); font-weight: 750; cursor: pointer; }
.button:hover { border-color: #aeb8b1; background: white; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { border-color: var(--forest); background: var(--forest); color: white; }
.button.primary:hover { background: #214c3f; }
.button.peach { border-color: var(--peach); background: var(--peach); color: #38231a; }
.button.ghost { border-color: transparent; background: transparent; }
.button.danger { border-color: #e8cac4; color: var(--red); }
.button svg { width: 16px; height: 16px; }
.vault-gate-sign-out { max-width: 100%; padding-inline: 10px; }
.page-action-buttons { display: flex; align-items: center; gap: 8px; }
.export-icon-button { width: 40px; padding: 0; }
.compact-add-button { width: 40px; padding: 0; }
.group-add-button { width: 40px; padding: 0; }

.people-grid, .group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.person-card, .group-card { position: relative; isolation: isolate; overflow: hidden; min-height: 195px; padding: 20px; border: 1px solid var(--network-card-border); border-radius: var(--network-card-radius); background: var(--network-card-surface); box-shadow: var(--network-card-shadow); -webkit-backdrop-filter: none; backdrop-filter: none; cursor: pointer; transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease, background-color 170ms ease; }
.person-card::before, .group-card::before { display: none; }
.person-card::after, .group-card::after { display: none; }
.person-card > *, .group-card > * { position: relative; z-index: 1; }
.person-card:hover, .group-card:hover { transform: translateY(-1px); border-color: var(--network-card-border-hover); background: var(--network-card-surface-hover); box-shadow: var(--network-card-shadow-hover); }
.person-card .person-avatar { width: 48px; height: 48px; margin-bottom: 18px; }
.person-card h3, .group-card h3 { margin: 0 0 5px; color: var(--ink); font-family: var(--serif); font-size: 19px; line-height: 1.18; }
.person-card .headline, .group-card .headline { min-height: 32px; margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }
.person-card footer, .group-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid rgba(209,211,203,.82); color: var(--faint); font-size: var(--type-meta); }
.person-card.network-person-card { min-height: 0; padding: 16px; }
.person-card-main { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; }
.network-person-card .person-avatar { width: 44px; height: 44px; margin: 0; }
.network-person-card h3 { margin-bottom: 3px; }
.network-person-card .headline { min-height: 0; }
.network-person-card h3, .network-group-card h3 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.network-person-card .headline, .network-group-card .headline { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.network-person-card .group-pills { height: auto; margin-top: 11px; }
.network-person-card footer { margin-top: 12px; padding-top: 10px; }
.group-card.network-group-card { min-height: 0; padding: 16px; }
.group-card-main { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; }
.network-group-card .group-icon { width: 44px; height: 44px; margin: 0; border-radius: 13px; }
.network-group-card h3 { margin-bottom: 3px; }
.network-group-card .headline { min-height: 0; }
.network-group-card footer { margin-top: 12px; padding-top: 10px; }
.group-pills { display: flex; flex-wrap: wrap; gap: 5px; height: 24px; overflow: hidden; margin-top: 10px; }
.group-pill { display: inline-flex; align-items: center; height: 23px; padding: 0 8px; border: 1px solid rgba(199,214,205,.68); border-radius: 999px; background: rgba(223,233,227,.64); color: #2f5748; font-size: var(--type-meta); font-weight: 700; }
.contact-group-pills { gap: 7px; }
.contact-group-pill { display: inline-flex; align-items: center; overflow: hidden; height: 27px; border-radius: 999px; background: var(--forest-soft); }
.contact-group-pill .group-pill-link { height: 27px; padding: 0 5px 0 10px; border: 0; border-radius: 0; background: transparent; cursor: pointer; }
.group-pill-remove { display: grid; place-items: center; width: 26px; height: 27px; padding: 0 5px 0 2px; border: 0; background: transparent; color: var(--forest-mid); cursor: pointer; }
.group-pill-remove:hover { color: var(--red); }
.group-pill-remove svg { width: 11px; height: 11px; }
.group-card { min-height: 175px; }
.group-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 20px; border-radius: 12px; background: var(--forest); color: white; }
.group-icon svg { width: 19px; height: 19px; }
.group-icon-color-forest { background: #174c3d; }
.group-icon-color-clay { background: #995b42; }
.group-icon-color-ocean { background: #39566d; }
.group-icon-color-plum { background: #70536b; }
.group-icon-color-amber { background: #8a682b; }
.group-icon-color-teal { background: #316e67; }
.group-icon-color-rose { background: #8f5963; }
.group-icon-color-slate { background: #566460; }
.group-icon-large { width: 44px; height: 44px; flex: 0 0 44px; margin: 0; border-radius: 13px; }
.group-icon-large svg { width: 19px; height: 19px; }
.group-icon-monogram { font-family: var(--serif); font-size: 14px; font-weight: 800; letter-spacing: -.04em; }
.group-icon-large .group-icon-monogram { font-size: 16px; }

.empty-state { display: grid; place-items: center; min-height: 380px; padding: 50px 20px; border: 1px dashed #c8cdc7; border-radius: 22px; background: rgba(255,253,248,.35); text-align: center; }
.empty-state .empty-orbit { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 20px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); }
.empty-state .empty-orbit svg { width: 28px; height: 28px; }
.empty-state h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; }
.empty-state p { max-width: 390px; margin: 0 0 20px; color: var(--muted); font-size: var(--type-meta); line-height: 1.6; }

.detail-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 26px; }
.nested-back-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(200,202,193,.85); border-radius: 10px; background: rgba(255,253,248,.62); color: var(--forest-mid); cursor: pointer; transition: 150ms ease; }
.nested-back-button:hover { border-color: #aeb8b1; background: white; color: var(--forest); }
.nested-back-button svg { width: 15px; height: 15px; }
.detail-top .person-avatar { width: 68px; height: 68px; font-size: 21px; }
.detail-top h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 30px; letter-spacing: -.025em; }
.detail-top p { margin: 0; color: var(--muted); font-size: var(--type-meta); }
.group-title-row { display: flex; align-items: center; gap: 8px; }
.group-title-row h2 { margin-bottom: 4px; }
.detail-actions { display: flex; gap: 8px; }
.detail-top-contact { grid-template-columns: 36px 44px minmax(0, 1fr); column-gap: 5px; align-items: start; margin-bottom: 25px; }
.detail-top-group .nested-back-button,
.detail-top-contact .nested-back-button { width: 44px; height: 44px; transform: translateX(-4px); border-color: transparent; border-radius: 50%; background: transparent; }
.detail-top-group .nested-back-button:hover,
.detail-top-contact .nested-back-button:hover { border-color: transparent; background: rgba(223,233,227,.72); }
.detail-top-group .nested-back-button svg,
.detail-top-contact .nested-back-button svg { width: 18px; height: 18px; }
.detail-top-contact .person-avatar { width: 44px; height: 44px; flex: 0 0 44px; font-size: 16px; }
.person-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.contact-photo-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.contact-photo-editor { display: grid; gap: 16px; padding: 16px; text-align: center; }
.contact-photo-editor [data-photo-preview] { display: flex; justify-content: center; }
.contact-photo-editor .person-avatar { width: 96px; height: 96px; flex: 0 0 96px; }
.contact-photo-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.contact-photo-editor [hidden] { display: none !important; }
.contact-photo-crop { display: block; width: min(100%, 240px, 36dvh); height: auto; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; touch-action: none; cursor: grab; }
.contact-photo-crop:active { cursor: grabbing; }
.contact-photo-zoom { display: flex; align-items: center; gap: 12px; max-width: 300px; margin: 8px auto; }
.contact-photo-zoom input { flex: 1; min-width: 0; min-height: 44px; accent-color: var(--green); }
.contact-identity-copy { position: relative; min-width: 0; margin-left: 5px; padding: 1px 0 5px; border-radius: 10px; }
.contact-identity-copy > :not(.contact-identity-edit-target) { position: relative; z-index: 1; pointer-events: none; }
.contact-identity-edit-target { position: absolute; z-index: 2; inset: -6px -7px; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
/* Paint hover feedback behind the text, never on the overlaid edit target. */
@media (hover: hover) and (pointer: fine) {
  .contact-identity-copy:has(> .contact-identity-edit-target:hover) { background: rgba(223,233,227,.28); }
}
.contact-identity-edit-target:focus-visible { outline: 3px solid rgba(239,156,112,.35); outline-offset: 2px; }
.contact-identity-meta { display: grid; min-width: 0; gap: 2px; margin-top: 6px; }
.contact-identity-role,
.contact-identity-company,
.contact-identity-location { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-top-group { grid-template-columns: 32px auto minmax(0, 1fr) auto; gap: 14px; }
.detail-top-group .detail-actions { grid-column: 4; }
.memory-add-button { white-space: nowrap; }
.memory-section-heading { align-items: center; }
.contact-log-button { min-height: 42px; padding: 0 13px; border-color: #bdcec3; background: rgba(255,253,248,.66); box-shadow: none; white-space: nowrap; }
.contact-log-button:hover { border-color: #94aa9d; background: var(--card); }
.detail-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(270px,.7fr); gap: 22px; align-items: start; }
.fact-strip { display: grid; grid-template-columns: repeat(var(--fact-count, 3), 1fr); gap: 1px; overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.fact-cell { min-height: 83px; padding: 16px; background: var(--card); }
.fact-cell span { display: block; margin-bottom: 7px; color: var(--faint); font-size: var(--type-meta); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.fact-cell strong { display: block; color: #36433c; font-size: var(--type-meta); font-weight: 650; line-height: 1.35; }
.timeline { position: relative; display: grid; gap: 11px; }
.timeline::before { content: ''; position: absolute; left: 12px; top: 18px; bottom: 18px; width: 1px; background: #d9ddd8; }
.note-timeline-item { position: relative; width: calc(100% - 30px); margin-left: 30px; }
.note-timeline-item::before { content: ''; position: absolute; z-index: 3; width: 9px; height: 9px; left: -23px; top: 22px; border: 3px solid var(--paper); border-radius: 50%; background: var(--forest-mid); box-shadow: 0 0 0 1px #bac5bd; }
.note-swipe-row { position: relative; overflow: hidden; border-radius: 16px; background: #b95145; }
.note-delete-reveal { position: absolute; z-index: 0; inset: 0 0 0 auto; display: flex; width: 82px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; border: 0; background: #b95145; color: white; font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.note-delete-reveal svg { width: 18px; height: 18px; }
.note-card { position: relative; z-index: 1; display: block; width: 100%; margin: 0; padding: 18px 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); text-align: left; cursor: pointer; touch-action: pan-y; user-select: none; transition: border-color 140ms ease, box-shadow 140ms ease, transform 180ms ease; }
.note-card:hover { border-color: #bdc9c1; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.note-card:focus-visible { outline: 3px solid rgba(116,149,131,.18); outline-offset: 2px; }
.note-timeline-item { scroll-margin-block: 96px; }
.note-timeline-item.search-evidence-focus .note-card {
  border-color: #df895d;
  background: #fff4e9;
  box-shadow: 0 0 0 5px rgba(239,156,112,.24), 0 14px 34px rgba(69,47,36,.15);
  animation: search-evidence-note 4s ease-out;
}
.detail-top-contact.search-evidence-focus {
  filter: drop-shadow(0 0 12px rgba(239,156,112,.45));
  animation: search-evidence-profile 3.4s ease-out;
}
@keyframes search-evidence-note {
  0%, 18% { border-color: #df895d; background: #fff4e9; box-shadow: 0 0 0 5px rgba(239,156,112,.24), 0 14px 34px rgba(69,47,36,.15); }
  48% { border-color: #ef9c70; background: #fff9f2; box-shadow: 0 0 0 3px rgba(239,156,112,.14), var(--shadow-md); }
  100% { border-color: var(--line); background: var(--card); box-shadow: var(--shadow-sm); }
}
@keyframes search-evidence-profile {
  0%, 22% { filter: drop-shadow(0 0 12px rgba(239,156,112,.45)); }
  100% { filter: none; }
}
@keyframes reminder-evidence-focus {
  0%, 20% { background: #fff0e2; box-shadow: 0 0 0 5px rgba(239,156,112,.27), 0 12px 28px rgba(69,47,36,.14); }
  48% { background: #fff8f1; box-shadow: 0 0 0 3px rgba(239,156,112,.15), 0 8px 20px rgba(69,47,36,.08); }
  100% { background: transparent; box-shadow: none; }
}
.note-swipe-row.swiped .note-card { transform: translateX(-82px); }
.group-member-item { display: grid; grid-template-rows: minmax(0, 1fr); min-width: 0; }
.member-swipe-row { position: relative; height: 100%; overflow: hidden; border-radius: var(--network-card-radius); background: transparent; }
.member-remove-reveal { position: absolute; z-index: 0; inset: 0 0 0 auto; display: flex; width: 96px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0; border: 0; background: #9b574b; color: white; font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.member-remove-reveal svg { width: 18px; height: 18px; }
.group-member-card { z-index: 1; width: 100%; height: 100%; margin: 0; border-color: var(--network-card-border); background: var(--network-card-surface); box-shadow: var(--network-card-shadow); -webkit-backdrop-filter: none; backdrop-filter: none; touch-action: pan-y; user-select: none; transition: border-color 170ms ease, box-shadow 170ms ease, transform 180ms ease, background-color 170ms ease; }
.group-member-card::before { display: none; }
.member-swipe-row.swiped .group-member-card { transform: translateX(-96px); }
.member-swipe-row:not(.swiped) .group-member-card:hover { border-color: var(--network-card-border-hover); background: var(--network-card-surface-hover); box-shadow: var(--network-card-shadow-hover); transform: none; }
.member-swipe-row:not(.swiped) .member-remove-reveal:focus-visible + .group-member-card { transform: translateX(-96px); }
.note-card time { display: block; margin-bottom: 9px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.note-card p { margin: 0; color: #3f4944; font-family: var(--serif); font-size: 14px; line-height: 1.62; }
.note-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.note-card-footer .source-badge { margin-top: 0; }
.note-edit-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; }
.source-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; color: var(--faint); font-size: var(--type-meta); }
.source-badge svg { width: 11px; height: 11px; }
.completed-reminder-timeline-item::before { background: var(--peach); }
.completed-reminder-card { border-color: #e5d8cd; background: linear-gradient(145deg, #fffaf5, var(--card)); }
.completed-reminder-card time { color: #a5684c; }
.completed-reminder-card .source-badge { color: #8e6958; }

.ask-hero { padding: clamp(26px, 4vw, 42px); border: 1px solid #cad7d0; border-radius: 24px; background: linear-gradient(135deg, #e6eee9, #f1eee5); cursor: text; }
.ask-hero button { cursor: pointer; }
.ask-hero .mini-label { color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ask-hero h2 { max-width: 650px; margin: 10px 0 12px; font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); font-weight: 500; line-height: 1.1; letter-spacing: -.03em; }
.ask-hero > p { max-width: 610px; margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.55; }
.ask-form { display: flex; gap: 8px; margin-top: 24px; padding: 7px; border: 1px solid #c7d1ca; border-radius: 15px; background: rgba(255,255,255,.76); box-shadow: 0 8px 30px rgba(31,44,37,.06); }
.ask-form textarea { flex: 1; min-width: 0; min-height: 43px; max-height: 132px; padding: 12px; overflow-y: auto; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font: var(--type-body)/1.5 var(--sans); }
.ask-form button { width: 43px; height: 43px; border: 0; border-radius: 11px; background: var(--forest); color: white; cursor: pointer; }
.ask-form[aria-disabled="true"] { border-style: dashed; background: rgba(235,239,235,.65); box-shadow: none; }
.ask-form textarea:disabled { color: var(--faint); cursor: default; }
.ask-form button:disabled { background: #aebbb4; color: rgba(255,255,255,.86); cursor: default; }
.ask-form svg { width: 17px; height: 17px; }
.ask-results { overflow-anchor: none; }
.query-result { margin-top: 25px; }
.query-result-toolbar { margin-bottom: 15px; }
.query-result-toolbar .query-summary { min-width: 0; margin-bottom: 0; }
.deep-search-button { min-height: 40px; padding: 8px 13px; border-color: #c7d4cd; background: rgba(255,255,255,.78); color: var(--forest); font-weight: 800; }
.deep-search-button img { width: 22px; height: 22px; object-fit: contain; }
.deep-search-button:hover { border-color: #9fb4a8; background: #fffdf8; }
.deep-search-button:disabled { cursor: wait; opacity: .65; }
.deep-search-invitation {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  margin: 0 0 18px;
  padding: 9px 13px;
  overflow: hidden;
  border: 1px solid #b8cec2;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(226,238,231,.9), rgba(255,248,239,.9));
  color: var(--forest);
  font: 800 var(--type-body)/1.25 var(--sans);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(28,53,42,.07);
}
.deep-search-invitation:hover { border-color: #94b3a3; background: linear-gradient(135deg, #dcebe2, #fff5e9); }
.deep-search-invitation > img { width: 30px; height: 30px; object-fit: contain; }
.deep-search-invitation > span { display: grid; place-items: center; }
.deep-search-invitation.is-loading { border-color: #9ebcaf; cursor: wait; }
.deep-search-progress { display: flex; align-items: center; gap: 5px; padding: 0 15px; }
.deep-search-progress i { width: 8px; height: 8px; border-radius: 50%; background: var(--forest-mid); animation: deep-search-progress 1.15s ease-in-out infinite; }
.deep-search-progress i:nth-child(2) { animation-delay: 140ms; }
.deep-search-progress i:nth-child(3) { animation-delay: 280ms; }
@keyframes deep-search-progress { 0%, 70%, 100% { opacity: .28; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-5px); } }
.query-export { display: flex; justify-content: center; margin-top: 18px; }
.query-export-button { min-height: 40px; padding: 8px 10px; border: 0; background: transparent; color: var(--forest); font: 750 var(--type-meta)/1.4 var(--sans); cursor: pointer; }
.query-export-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.query-export-button:disabled { cursor: wait; opacity: .6; }
.query-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; color: #4a5850; font-family: var(--serif); font-size: 17px; }
.query-summary span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--peach-soft); color: #9d4f2e; }
.query-summary svg { width: 15px; height: 15px; }
.query-match-section + .query-match-section { margin-top: 22px; }
.query-match-heading { margin: 0 0 9px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.result-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.result-title-row h3 { min-width: 0; }
.deep-search-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px 5px 6px; border: 1px solid #d9cdbf; border-radius: 999px; background: #fff9f1; color: #8a553d; font: 800 var(--type-meta)/1.3 var(--sans); white-space: nowrap; }
.deep-search-badge img { width: 15px; height: 15px; object-fit: contain; }
.deep-search-panel { margin: 18px 0 22px; padding: 18px; border: 1px solid #c8d7cf; border-radius: 18px; background: linear-gradient(135deg, rgba(229,239,233,.9), rgba(255,247,237,.9)); box-shadow: 0 12px 34px rgba(33,53,43,.06); }
.deep-search-panel-header, .deep-search-loading { display: flex; align-items: flex-start; gap: 12px; }
.deep-search-panel-header > div:nth-child(2) { min-width: 0; flex: 1; }
.deep-search-panel-mark { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(177,192,183,.7); border-radius: 13px; background: rgba(255,255,255,.75); }
.deep-search-panel-mark img { width: 30px; height: 30px; object-fit: contain; }
.deep-search-kicker { display: block; margin: 1px 0 5px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.deep-search-panel h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.25; }
.deep-search-panel-header p, .deep-search-loading p { margin: 5px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.deep-search-match-block { margin-top: 17px; }
.deep-search-match-block > h3 { margin: 0 0 8px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.deep-search-match-block.is-high > h3 { color: #235c43; }
.deep-search-match-block.is-low > h3 { color: #8a6030; }
.deep-search-match-block.is-low { opacity: .9; }
.deep-search-entity-heading { margin: 12px 0 7px; color: var(--muted); font-size: var(--type-meta); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.deep-search-match-block > .deep-search-entity-heading:first-of-type { margin-top: 0; }
.deep-result-card { border-color: #c6d5cd; background: rgba(255,253,248,.9); }
.deep-search-match-block.is-high .deep-result-card { border-color: #9fc5b0; box-shadow: 0 9px 24px rgba(35,92,67,.08); }
.deep-search-match-block.is-low .deep-result-card { border-color: #dac9ac; background: rgba(250,249,245,.88); }
.deep-match-strength { display: grid; grid-template-columns: auto minmax(80px, 150px) auto; gap: 8px; align-items: center; margin: 8px 0; }
.deep-match-strength > strong { padding: 4px 8px; border-radius: 999px; font-size: var(--type-meta); font-weight: 900; white-space: nowrap; }
.deep-match-strength > small { color: var(--muted); font-size: var(--type-meta); font-weight: 750; white-space: nowrap; }
.deep-match-strength.is-high > strong { background: #dceee4; color: #19553a; }
.deep-match-strength.is-low > strong { background: #f4e8d3; color: #7c5426; }
.deep-match-meter { position: relative; height: 6px; overflow: hidden; border-radius: 999px; background: #e3e6e2; }
.deep-match-meter i { display: block; height: 100%; border-radius: inherit; background: #86928b; }
.deep-match-strength.is-high .deep-match-meter i { background: linear-gradient(90deg, #4d8a69, #1f6446); }
.deep-match-strength.is-low .deep-match-meter i { background: linear-gradient(90deg, #d7aa69, #aa7437); }
.deep-search-reason { margin: 7px 0 9px; color: #43534a; font-size: var(--type-meta); font-weight: 650; line-height: 1.48; }
.deep-lower-potential-toggle { width: fit-content; margin-top: 13px; padding: 4px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: #7a623f; font: 800 var(--type-meta)/1.5 var(--sans); cursor: pointer; }
.deep-lower-potential-toggle:hover { color: var(--forest); }
.deep-search-panel footer { margin-top: 14px; color: var(--faint); font-size: var(--type-meta); }
.deep-search-status { margin: 17px 0 22px; }
.deep-search-status-line { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid #d4ded8; border-radius: 12px; background: rgba(235,242,238,.62); color: #5d6962; font-size: var(--type-meta); line-height: 1.4; }
.deep-search-status-line > img { flex: 0 0 auto; width: 28px; height: 28px; object-fit: contain; }
.deep-search-status-line > strong { color: var(--forest); font-size: var(--type-meta); font-weight: 750; line-height: 1.4; }
.deep-search-status-line .deep-lower-potential-toggle { margin: 0 0 0 auto; white-space: nowrap; }
.deep-search-status > .deep-search-match-block { margin-top: 12px; padding: 14px; border: 1px solid #ddd4c5; border-radius: 15px; background: rgba(255,251,245,.72); }
.result-list { display: grid; gap: 9px; }
.result-card { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; }
.result-card:hover { border-color: #bbc4bd; }
.result-card h3 { margin: 2px 0 3px; font-size: var(--type-meta); }
.result-card .result-meta { margin: 0 0 8px; color: var(--muted); font-size: var(--type-meta); }
.evidence { padding: 9px 11px; border-left: 2px solid #a7bdae; background: #f2f5f1; color: #59635d; font-family: var(--serif); font-size: var(--type-meta); line-height: 1.45; }
.result-arrow { margin-top: 10px; color: var(--faint); }
.result-arrow svg { width: 15px; height: 15px; }
.query-group-result-list { display: grid; gap: 9px; }
.query-group-result-card { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid #cad7d0; border-radius: 16px; background: linear-gradient(135deg, #f7faf7, var(--card)); cursor: pointer; transition: border-color 150ms ease, transform 150ms ease; }
.query-group-result-card:hover { border-color: #aebfb5; transform: translateY(-1px); }
.query-group-result-card .result-arrow { margin-top: 0; }
.query-group-result-copy { min-width: 0; }
.query-group-result-copy h3 { margin: 0 0 3px; font-size: var(--type-meta); }
.query-group-result-copy p { margin: 0 0 7px; overflow: hidden; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.query-group-result-copy small { display: block; color: var(--forest-mid); font-size: var(--type-meta); line-height: 1.4; }

@keyframes voice-pulse { 50% { box-shadow: 0 0 0 8px rgba(239,156,112,.18), 0 14px 35px rgba(97,56,37,.2); } }
kbd { display: inline-grid; place-items: center; min-width: 15px; height: 15px; margin: 0 1px; padding: 0 3px; border: 1px solid #d1d2cc; border-radius: 3px; background: rgba(255,255,255,.65); font-family: inherit; font-size: var(--type-meta); }
.mobile-nav { display: none; }

.capture-dialog { width: min(880px, calc(100vw - 32px)); max-height: min(820px, calc(100dvh - 32px)); padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 24px; background: var(--card); box-shadow: var(--shadow-lg); }
.capture-dialog.note-composer-dialog,
.capture-dialog.voice-dictation-dialog { width: min(900px, calc(100vw - 32px)); border-color: #ead4c5; background: linear-gradient(145deg, rgba(255,253,248,.99), rgba(248,228,215,.94)); }
.note-composer-dialog .dialog-header,
.voice-dictation-dialog .dialog-header { display: none; }
.note-composer-dialog .capture-content { min-height: min(680px, calc(100dvh - 32px)); padding: clamp(22px, 4vw, 42px); }
.note-composer-dialog .dictation-stage { max-width: 690px; min-height: 100%; align-content: center; }
.note-composer-dialog .dictation-form textarea { min-height: clamp(290px, 43vh, 430px); }
.voice-dictation-dialog .capture-content { min-height: min(620px, calc(100dvh - 32px)); padding: clamp(22px, 4vw, 42px); }
.capture-dialog::backdrop { background: rgba(19, 35, 29, .38); backdrop-filter: blur(6px); }
.feedback-dialog { width: min(690px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 32px)); padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 24px; background: var(--card); box-shadow: var(--shadow-lg); }
.feedback-dialog::backdrop { background: rgba(19,35,29,.38); backdrop-filter: blur(6px); }
.profile-dialog { width: min(610px, calc(100vw - 32px)); }
.feedback-shell { display: flex; flex-direction: column; max-height: min(760px, calc(100dvh - 32px)); }
.feedback-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 24px 25px 20px; border-bottom: 1px solid var(--line); background: #faf8f2; }
.feedback-header .mini-label { margin: 0 0 8px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.feedback-header h2 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 550; letter-spacing: -.02em; }
.feedback-header p:last-child { margin: 6px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.feedback-body { display: grid; gap: 17px; padding: 22px 25px; overflow: auto; }
.feedback-body .field textarea { min-height: 145px; font-size: 14px; }
.profile-body { display: grid; gap: 15px; padding: 22px 25px 25px; overflow: auto; }
.account-panel { width: min(610px, calc(100vw - 32px)); }
.account-panel .feedback-header { flex-shrink: 0; align-items: center; }
.account-panel .feedback-footer { flex-shrink: 0; }
.account-panel-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 25px 25px; }
.account-panel-body > .profile-ai-usage { padding: 0; border: 0; background: transparent; }
.account-panel-body .profile-ai-usage > header .mini-label { display: none; }
.install-status { display: grid; justify-items: center; margin: 2px 0; padding: 28px 18px 30px; color: var(--forest); text-align: center; }
.install-status[hidden] { display: none; }
.install-status-check { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 999px; background: var(--forest-soft); font-family: var(--sans); font-size: 30px; font-weight: 800; }
.profile-ai-usage { display: grid; gap: 13px; padding: 17px; border: 1px solid #cbdad1; border-radius: 17px; background: linear-gradient(145deg, rgba(233,242,237,.92), rgba(250,248,242,.94)); }
.profile-ai-usage > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.profile-ai-usage .mini-label { margin: 0 0 4px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.profile-ai-usage h3 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 20px; font-weight: 550; }
.profile-ai-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.profile-ai-metrics > div { min-width: 0; padding: 11px 10px; border: 1px solid rgba(203,218,209,.9); border-radius: 12px; background: rgba(255,255,255,.78); }
.profile-ai-metrics strong { display: block; overflow: hidden; color: var(--forest); font-family: var(--serif); font-size: 19px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.profile-ai-metrics span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--type-meta); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.profile-ai-breakdown { display: grid; gap: 7px; padding-top: 3px; border-top: 1px solid rgba(203,218,209,.85); }
.profile-ai-breakdown-row { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: var(--type-meta); line-height: 1.4; }
.profile-ai-breakdown-row span:first-child { color: var(--ink); font-weight: 750; }
.profile-ai-breakdown-row span:last-child { text-align: right; }
.profile-ai-note { margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.profile-vault-security { border-color: rgba(93,126,112,.35); background: linear-gradient(145deg, rgba(229,240,234,.96), rgba(250,248,242,.94)); }
.vault-device-list { display: grid; gap: 7px; }
.vault-device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid rgba(203,218,209,.9); border-radius: 12px; background: rgba(255,255,255,.78); }
.vault-device-row > span { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--forest); }
.vault-device-row > span > span { display: grid; min-width: 0; gap: 2px; }
.vault-device-row strong { overflow: hidden; color: var(--ink); font-size: var(--type-meta); text-overflow: ellipsis; white-space: nowrap; }
.vault-device-row small { color: var(--muted); font-size: var(--type-meta); }
.vault-device-row em { color: var(--forest-mid); font-size: var(--type-meta); font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.vault-device-row button { padding: 6px 8px; border: 1px solid rgba(141,73,63,.22); border-radius: 8px; background: #fff9f6; color: #8d493f; font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.vault-pairing-row { border-color: rgba(239,156,112,.55); background: #fff8f2; }
.vault-pairing-row button { border-color: rgba(73,112,96,.3); background: var(--forest); color: white; }
.vault-revoked-note { margin: 3px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }
.feedback-upload { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 14px; border: 1px dashed #cbd0c9; border-radius: 15px; background: #faf9f5; transition: 150ms ease; }
.feedback-upload.dragging { border-color: var(--forest-mid); background: var(--forest-soft); }
.feedback-upload-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--forest-soft); color: var(--forest); }
.feedback-upload-icon svg { width: 19px; height: 19px; }
.feedback-upload strong { display: block; margin-bottom: 3px; font-size: var(--type-meta); }
.feedback-upload p { margin: 0; color: var(--muted); font-size: var(--type-meta); }
.feedback-upload .button { cursor: pointer; }
.feedback-previews { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.feedback-preview { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.feedback-preview img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-deep); }
.feedback-preview figcaption { display: grid; gap: 2px; padding: 8px 9px; }
.feedback-preview figcaption span { overflow: hidden; font-size: var(--type-meta); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.feedback-preview figcaption small { color: var(--faint); font-size: var(--type-meta); }
.feedback-preview > button { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 8px; background: rgba(24,37,31,.82); color: white; cursor: pointer; }
.feedback-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 25px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #faf8f2; }
.feedback-footer-actions-only { justify-content: flex-end; }
.feedback-footer p { max-width: 310px; margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }
.feedback-footer > div { display: flex; gap: 8px; }
/* Keep profile actions together at normal phone widths. Let whole buttons
   move to another row when enlarged text needs more space. */
.profile-footer { flex-wrap: wrap; gap: 8px; }
.profile-footer > div { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; margin-left: auto; }
.profile-footer .button { flex: 0 0 auto; max-width: 100%; padding-inline: 12px; }
.install-dialog { width: min(570px, calc(100vw - 32px)); }
.install-shell { max-height: min(720px, calc(100dvh - 32px)); }
.install-body { display: grid; gap: 20px; padding: 22px 25px 25px; overflow-y: auto; }
.install-intro { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 16px; }
.install-app-icon { display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden; border: 1px solid #d8ded8; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-sm); }
.install-app-icon img { display: block; width: 64px; height: 64px; object-fit: contain; }
.install-intro strong { display: block; color: var(--forest); font-family: var(--serif); font-size: 19px; font-weight: 600; }
.install-intro p { margin: 5px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.55; }
.install-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.install-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(250,249,245,.82); }
.install-steps li > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: var(--forest); color: white; font-family: var(--serif); font-size: 15px; font-weight: 700; }
.install-steps strong { display: block; color: var(--ink); font-size: var(--type-meta); }
.install-steps p { margin: 3px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }
.install-security-note { margin: 0; padding: 11px 13px; border-left: 2px solid var(--forest-mid); background: var(--forest-soft); color: #53645b; font-size: var(--type-meta); line-height: 1.5; }
.install-footer { justify-content: flex-end; }
.install-footer .button.primary { min-width: 150px; }
.dialog-shell { display: flex; flex-direction: column; max-height: min(820px, calc(100dvh - 32px)); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 17px 21px; border-bottom: 1px solid #e1e1da; background: #faf8f2; }
.dialog-identity { display: flex; align-items: center; gap: 13px; }
.assistant-orb { display: block; width: 38px; height: 38px; flex: 0 0 38px; }
.dialog-identity strong { display: block; margin-bottom: 3px; font-family: var(--serif); font-size: 16px; }
.dialog-identity strong:empty { display: none; }
.dialog-identity span { display: block; color: var(--muted); font-size: var(--type-meta); }
.dialog-identity span:empty { display: none; }
.capture-dialog.new-contact-review .dialog-header { border-bottom-color: #ead3c5; background: linear-gradient(135deg, #fdf2ea, #faf7f1); }
.capture-dialog.existing-contact-review .dialog-header { border-bottom-color: #cbdad1; background: linear-gradient(135deg, #e9f2ed, #f7f8f3); }
.capture-dialog.new-contact-review .dialog-identity strong,
.capture-dialog.existing-contact-review .dialog-identity strong { color: var(--forest); font-size: 18px; }
.capture-dialog.new-contact-review .dialog-identity span,
.capture-dialog.existing-contact-review .dialog-identity span { color: var(--muted); font-family: var(--sans); font-size: var(--type-meta); font-weight: 400; }
.icon-button { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { border-color: var(--line); background: white; color: var(--ink); }
.icon-button svg { width: 17px; height: 17px; }
.field input:read-only, .field input:disabled, .field textarea:disabled, .field select:disabled { border-color: #e1e2dc; background: #f0f0eb; color: #747d77; cursor: not-allowed; }
.field input:read-only:focus, .field input:disabled:focus { border-color: #e1e2dc; box-shadow: none; }

.confirm-dialog { width: min(410px, calc(100vw - 32px)); padding: 0; border: 1px solid rgba(255,255,255,.6); border-radius: 22px; background: var(--card); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgba(19,35,29,.42); backdrop-filter: blur(5px); }
.confirm-shell { display: grid; justify-items: center; padding: 28px; text-align: center; }
.confirm-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 16px; border-radius: 50%; background: #f5e2de; color: var(--red); }
.confirm-icon svg { width: 21px; height: 21px; }
.confirm-shell h2 { margin: 0 0 8px; font: 550 25px/1.15 var(--serif); }
/* Start on the question, so opening a confirmation never highlights a choice.
   The title stays out of the Tab order; both buttons retain keyboard outlines. */
.confirm-shell h2:focus { outline: none; }
.confirm-shell p { margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.55; }
.confirm-actions { display: flex; flex-wrap: wrap; width: 100%; gap: 9px; margin-top: 23px; }
.confirm-actions .button { flex: 1 0 auto; max-width: 100%; }
.confirm-actions .button.danger { border-color: #9b443c; background: #9b443c; color: white; }
.capture-content { min-height: 330px; padding: 25px; overflow: auto; }

.voice-choice-dialog .dialog-header { display: none; }
.voice-choice-dialog:focus { outline: 0; }
.voice-choice-dialog .capture-content { min-height: 0; padding: 14px; }
.voice-choice-view { display: grid; gap: 10px; }
.voice-choice-close { display: grid; place-items: center; justify-self: end; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.voice-choice-close:hover { background: var(--paper); color: var(--ink); }
.voice-choice-stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-height: 280px; align-items: stretch; }
.voice-choice-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: clamp(22px, 4vw, 34px); overflow: hidden; border: 1px solid transparent; border-radius: 21px; color: inherit; text-align: left; cursor: pointer; transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease; }
.voice-choice-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.voice-choice-card:focus-visible { outline: 3px solid rgba(116,149,131,.2); outline-offset: 2px; }
.voice-choice-card.capture-choice { background: var(--forest); color: white; }
.voice-choice-card.ask-choice { border-color: #cad7d0; background: #e7ede9; color: var(--forest); }
.voice-choice-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 34px; border-radius: 15px; }
.capture-choice .voice-choice-icon { background: var(--peach); color: #40281e; }
.ask-choice .voice-choice-icon { background: var(--forest); color: white; }
.voice-choice-copy { display: grid; gap: 2px; }
.voice-choice-copy strong { font-family: var(--serif); font-size: clamp(36px, 5vw, 48px); font-weight: 500; line-height: 1; letter-spacing: -.04em; }
.voice-choice-copy span { font-family: var(--serif); font-size: clamp(17px, 2.5vw, 22px); line-height: 1.15; }
.capture-choice .voice-choice-copy span { color: #c2d0ca; }
.ask-choice .voice-choice-copy span { color: var(--forest-mid); }
.voice-choice-arrow { display: grid; place-items: center; width: 32px; height: 32px; margin-top: auto; border-radius: 50%; }
.capture-choice .voice-choice-arrow { background: rgba(255,255,255,.1); }
.ask-choice .voice-choice-arrow { background: rgba(24,61,50,.08); }
.voice-choice-arrow svg { width: 16px; height: 16px; transition: transform 160ms ease; }
.voice-choice-card:hover .voice-choice-arrow svg { transform: translateX(2px); }

.listening-stage { display: grid; place-items: center; min-height: 340px; text-align: center; }
.waveform { display: flex; align-items: center; justify-content: center; gap: 4px; height: 52px; margin-bottom: 20px; }
.waveform i { width: 3px; height: 16px; border-radius: 999px; background: var(--peach); animation: wave .8s ease-in-out infinite alternate; }
.waveform i:nth-child(2), .waveform i:nth-child(6) { animation-delay: -.25s; height: 30px; }
.waveform i:nth-child(3), .waveform i:nth-child(5) { animation-delay: -.5s; height: 42px; }
.waveform i:nth-child(4) { animation-delay: -.7s; height: 50px; }
@keyframes wave { to { transform: scaleY(.35); opacity: .55; } }
.live-label { margin: 0 0 10px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.live-transcript { max-width: 650px; min-height: 70px; margin: 0; color: #314039; font-family: var(--serif); font-size: clamp(20px, 3vw, 28px); line-height: 1.35; }
.live-transcript .interim { color: var(--faint); }
.listening-actions { display: flex; gap: 9px; margin-top: 26px; }
.voice-dictation-view { position: relative; grid-template-rows: auto minmax(0, 1fr) auto; place-items: stretch; gap: 20px; width: min(720px, 100%); min-height: min(536px, calc(100dvh - 116px)); margin: 0 auto; text-align: left; }
.voice-listening-heading { display: flex; align-items: center; gap: 12px; padding-right: 48px; }
.voice-listening-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; background: var(--peach); color: #40281e; box-shadow: 0 8px 20px rgba(86,53,38,.12); }
.voice-listening-heading .live-label { margin: 0 0 3px; color: #9b5637; }
.voice-listening-heading p:last-child { margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }
.voice-listening-heading .waveform { height: 38px; margin: 0 0 0 auto; }
.voice-listening-heading .waveform i { width: 3px; max-height: 34px; }
.voice-transcript-card { min-height: 0; padding: clamp(22px, 4vw, 34px); overflow-y: auto; border: 1px solid #d6bca9; border-radius: 22px; background: rgba(255,255,255,.82); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 14px 36px rgba(97,66,47,.07); }
.voice-transcript-card .live-transcript { max-width: none; min-height: 100%; color: var(--ink); font-size: clamp(22px, 3.3vw, 31px); line-height: 1.48; white-space: pre-wrap; }
.voice-transcript-placeholder { color: var(--faint); }
.voice-dictation-view .listening-actions { align-items: center; justify-content: flex-end; gap: 10px; margin: 0; }
.voice-dictation-view .listening-actions .button { min-height: 44px; border-radius: 999px; }
.voice-dictation-view .listening-actions .button.primary { min-width: 150px; }

.dictation-stage { display: grid; gap: 18px; max-width: 620px; min-height: 280px; margin: 0 auto; align-content: center; }
.dictation-guide { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; align-items: start; padding: 14px; border: 1px solid #ead7c9; border-radius: 14px; background: #fdf4ed; }
.dictation-guide > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--peach); color: #40281e; }
.dictation-guide strong { display: block; margin: 2px 0 4px; font-family: var(--serif); font-size: 15px; }
.dictation-guide p { margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.dictation-form { display: grid; gap: 14px; }
.dictation-purpose { margin: 0; color: #536059; font-size: var(--type-meta); line-height: 1.5; }
.dictation-form textarea { min-height: 140px; font-size: 16px; }
.dictation-actions { display: flex; justify-content: flex-end; gap: 8px; }
.note-composer-view { position: relative; width: 100%; }
.note-composer-close { position: absolute; z-index: 2; top: 0; right: 0; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(196,167,147,.45); border-radius: 50%; background: rgba(255,255,255,.48); color: #6d706d; cursor: pointer; transition: background 150ms ease, color 150ms ease, transform 150ms ease; }
.note-composer-close:hover { transform: translateY(-1px); background: rgba(255,255,255,.9); color: var(--ink); }
.note-composer-heading { text-align: center; }
.note-composer-heading h2 { margin: 0; color: var(--ink); font: 500 clamp(38px, 5vw, 54px)/1.05 var(--serif); letter-spacing: -.035em; }
.note-composer-heading p { margin: 8px 0 0; color: #766d68; font: 16px/1.35 var(--serif); }
.note-composer-view .dictation-form { gap: 12px; margin-top: 27px; }
.note-composer-input-wrap { position: relative; min-height: 0; }
.note-composer-input-wrap .note-composer-field { display: block; height: 100%; }
.note-composer-field textarea { overscroll-behavior: none; display: block; width: 100%; padding: 22px 24px; resize: none; border: 1px solid #d6bca9; border-radius: 20px; background: rgba(255,255,255,.82); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 14px 36px rgba(97,66,47,.07); font: 17px/1.58 var(--serif); outline: 0; transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.note-composer-input-wrap .note-composer-field textarea { padding-right: 76px; padding-bottom: 66px; }
.note-composer-field textarea::placeholder { color: var(--faint); opacity: 1; }
.note-composer-dialog #dictationText { resize: none; }
.note-composer-dialog #dictationText:placeholder-shown { overflow-y: hidden; }
.note-composer-field textarea:focus { border-color: #c58968; background: white; box-shadow: 0 0 0 4px rgba(239,156,112,.14), 0 18px 42px rgba(97,66,47,.09); }
.note-dictate-button { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: var(--peach); color: #40281e; box-shadow: 0 7px 18px rgba(86,53,38,.16); cursor: pointer; transition: transform 150ms ease, box-shadow 150ms ease; }
.note-dictate-button:hover { transform: translateY(-1px); box-shadow: 0 10px 23px rgba(86,53,38,.2); }
.note-dictate-button:active { transform: scale(.97); }
.note-composer-tip { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.note-composer-tip > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; background: rgba(239,156,112,.22); color: #8a4b30; }
.note-composer-tip p { margin: 0; font-size: var(--type-meta); line-height: 1.45; }
.note-composer-view .dictation-actions { margin-top: 3px; }

.processing-stage { display: grid; place-items: center; min-height: 300px; text-align: center; }
.processing-stage h3 { margin: 18px 0 5px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.processing-stage p { margin: 0; color: var(--muted); font-size: var(--type-meta); }

.draft-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; }
.draft-layout-minimal { grid-template-columns: minmax(0, 1fr); width: min(620px, 100%); margin: 0 auto; }
.group-add-options { display: grid; width: min(620px, 100%); gap: 11px; margin: 0 auto; }
.group-add-option { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 13px; align-items: center; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: white; color: inherit; text-align: left; cursor: pointer; transition: 150ms ease; }
.group-add-option:hover { border-color: #aebdb4; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.group-add-option > svg { width: 16px; height: 16px; color: var(--forest-mid); }
.group-add-option-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--forest-soft); color: var(--forest); }
.group-add-option-icon.peach { background: var(--peach-soft); color: #9d4f2e; }
.group-add-option strong { display: block; margin-bottom: 4px; font-family: var(--serif); font-size: 17px; }
.group-add-option small { display: block; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }
.group-merge-form { display: grid; width: min(620px, 100%); gap: 14px; margin: 0 auto; }
.contact-merge-search { display: grid; gap: 7px; font-size: var(--type-meta); color: var(--muted); }
.contact-merge-search input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: 16px; }
.group-merge-form .group-merge-list { max-height: min(430px, 48vh); overflow-y: auto; overscroll-behavior: contain; padding: 3px; min-width: 0; align-content: start; }
.contact-merge-list .group-merge-choice[hidden] { display: none; }
.group-merge-choice:has(input:focus-visible) { outline: 3px solid rgba(239, 156, 112, .8); outline-offset: 1px; }
.group-merge-list { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.group-merge-list legend { margin-bottom: 4px; color: var(--muted); font-size: var(--type-meta); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.group-merge-choice { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; gap: 11px; align-items: center; min-height: 66px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.82); cursor: pointer; transition: 150ms ease; }
.group-merge-choice:hover { border-color: #b3c0b7; background: white; }
.group-merge-choice:has(input:checked) { border-color: #799689; background: #e8f0eb; box-shadow: inset 0 0 0 1px rgba(84,121,107,.18); }
.group-merge-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.group-merge-choice .group-icon { width: 40px; height: 40px; margin: 0; border-radius: 11px; }
.group-merge-choice strong, .group-merge-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-merge-choice strong { font-family: var(--serif); font-size: 16px; }
.group-merge-choice small { margin-top: 3px; color: var(--muted); font-size: var(--type-meta); }
.group-merge-check { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid #b8c1ba; border-radius: 50%; color: transparent; }
.group-merge-choice:has(input:checked) .group-merge-check { border-color: var(--forest); background: var(--forest); color: white; }
.group-merge-note { margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.group-member-picker { display: grid; width: min(620px, 100%); gap: 14px; margin: 0 auto; }
.picker-fields { display: grid; min-width: 0; gap: 14px; }
.group-member-picker .contact-picker-search { position: sticky; z-index: 3; top: -1px; order: 0; width: calc(100% + 6px); max-width: none; flex-basis: auto; margin: -3px; padding: 3px; background: var(--card); }
.contact-picker-search > span { position: absolute; z-index: 1; left: 16px; top: 50%; display: grid; width: 16px; height: 16px; color: #8d968f; transform: translateY(-50%); }
.contact-picker-list { display: grid; gap: 7px; max-height: min(430px, 48vh); overflow-y: auto; overscroll-behavior: contain; }
.contact-picker-row { position: relative; display: block; min-height: 74px; padding: 14px 50px 14px 14px; border: 1px solid var(--network-card-border); border-radius: var(--network-card-radius); background: var(--network-card-surface); box-shadow: var(--network-card-shadow); cursor: pointer; transition: border-color 170ms ease, box-shadow 170ms ease, background-color 170ms ease; }
.contact-picker-row:hover { border-color: var(--network-card-border-hover); background: var(--network-card-surface-hover); box-shadow: var(--network-card-shadow-hover); }
.contact-picker-row:has(input:checked) { border-color: #9eb3a7; background: #f1f6f2; box-shadow: inset 0 0 0 1px rgba(84,121,107,.1), var(--network-card-shadow); }
.contact-picker-row .person-card-main { grid-template-columns: 44px minmax(0, 1fr); }
.contact-picker-row .person-avatar { width: 44px; height: 44px; margin: 0; }
.contact-picker-row h3 { margin: 0 0 3px; font-family: var(--serif); font-size: 16px; line-height: 1.2; }
.contact-picker-row .headline { min-height: 0; margin: 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.45; }
.contact-picker-row input { position: absolute; top: 50%; right: 16px; width: 20px; height: 20px; margin: 0; accent-color: var(--forest); cursor: pointer; transform: translateY(-50%); }
.contact-picker-empty { padding: 35px 18px; border: 1px dashed #c8cdc7; border-radius: 14px; color: var(--muted); font-size: var(--type-meta); line-height: 1.5; text-align: center; }
.contact-picker-empty[hidden], .contact-picker-row[hidden] { display: none; }
.group-assignment-picker { display: grid; width: min(620px, 100%); gap: 14px; margin: 0 auto; }
.group-assignment-picker .group-assignment-search { order: 0; width: 100%; max-width: none; }
.group-assignment-search input:focus-visible { outline: none; border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.group-assignment-search > span { position: absolute; z-index: 1; left: 13px; top: 50%; display: grid; width: 16px; height: 16px; color: #8d968f; transform: translateY(-50%); }
.group-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 9px; max-height: min(390px, 45vh); overflow-y: auto; overscroll-behavior: contain; }
.group-choice { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 22px; gap: 10px; align-items: center; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.82); cursor: pointer; transition: 150ms ease; }
.group-choice:hover { border-color: #b3c0b7; background: white; }
.group-choice:has(input:checked) { border-color: #799689; background: #e8f0eb; box-shadow: inset 0 0 0 1px rgba(84,121,107,.18); }
.group-choice .group-icon { width: 36px; height: 36px; margin: 0; border-radius: 10px; }
.group-choice .group-icon svg { width: 17px; height: 17px; }
.group-choice .group-icon-monogram { font-size: var(--type-meta); }
.group-choice-copy { min-width: 0; }
.group-choice-copy strong, .group-choice-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-choice-copy strong { margin-bottom: 3px; font-family: var(--serif); font-size: 15px; }
.group-choice-copy small { color: var(--muted); font-size: var(--type-meta); }
.group-choice-check { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid #b8c1ba; border-radius: 50%; color: transparent; }
.group-choice:has(input:checked) .group-choice-check { border-color: var(--forest); background: var(--forest); color: white; }
.group-choice-check svg { width: 12px; height: 12px; }
.group-choice[hidden] { display: none; }
.group-assignment-empty { grid-column: 1 / -1; display: grid; place-items: center; gap: 6px; padding: 25px 16px; border: 1px dashed #c8cdc7; border-radius: 15px; color: var(--muted); text-align: center; }
.group-assignment-empty[hidden] { display: none; }
.group-assignment-empty strong { color: var(--ink); font-family: var(--serif); font-size: 16px; }
.group-assignment-empty > span { max-width: 330px; font-size: var(--type-meta); line-height: 1.45; }
.group-assignment-empty .button { margin-top: 5px; }
.group-new-section { display: grid; grid-column: 1 / -1; }
.group-new-trigger { display: inline-flex; align-items: center; justify-self: start; gap: 7px; padding: 7px 0; border: 0; background: transparent; color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.group-new-trigger[hidden], .group-new-field[hidden] { display: none; }
.group-new-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 7px; }
.group-new-input-row .icon-button { width: 44px; height: 44px; border-color: var(--line); background: white; }
.action-rail { padding: 18px; border-radius: 16px; background: #eef2ee; }
.intent-pill { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 17px; padding: 6px 9px; border-radius: 999px; background: white; color: var(--forest); font-size: var(--type-meta); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.intent-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--peach); }
.action-rail h3 { margin: 0 0 17px; font-family: var(--serif); font-size: 19px; line-height: 1.2; }
.action-steps { display: grid; gap: 12px; }
.action-step { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; color: var(--muted); font-size: var(--type-meta); line-height: 1.4; }
.action-step span { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #d7e3db; color: var(--forest); }
.action-step svg { width: 10px; height: 10px; }
.confidence { margin-top: 20px; padding-top: 15px; border-top: 1px solid #d9e0db; color: var(--muted); font-size: var(--type-meta); }
.confidence strong { color: var(--forest); }
.draft-form { display: grid; gap: 14px; }
.edit-form-fields { display: grid; grid-auto-rows: max-content; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span, .field > .field-label { color: var(--muted); font-size: var(--type-meta); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #d8d9d2; border-radius: 11px; background: white; color: var(--ink); font-size: var(--type-meta); transition: border-color 140ms ease, box-shadow 140ms ease; }
.field input, .field select { height: 41px; padding: 0 12px; }
.field textarea { min-height: 105px; padding: 11px 12px; resize: vertical; line-height: 1.5; }
.direct-note-input-wrap { position: relative; }
.direct-note-input-wrap textarea { display: block; min-height: 132px; padding-right: 68px; padding-bottom: 58px; }
.direct-note-dictate-button { z-index: 2; right: 12px; bottom: 12px; }
.edit-memory-field textarea { min-height: 132px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #8da397; outline: 0; box-shadow: 0 0 0 3px rgba(116,149,131,.1); }
.field input[aria-invalid="true"] { border-color: #b65b50; box-shadow: 0 0 0 3px rgba(182,91,80,.1); }
.form-save-error { margin: -2px 0 0; padding: 10px 12px; border: 1px solid #e4bdb7; border-radius: 11px; background: #fae9e6; color: #823b33; font-size: var(--type-meta); line-height: 1.45; }
.form-save-error[hidden] { display: none; }
.group-picker { position: relative; }
.group-picker-control { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 41px; padding: 5px 8px; border: 1px solid #d8d9d2; border-radius: 11px; background: white; transition: border-color 140ms ease, box-shadow 140ms ease; }
.group-picker-control:focus-within { border-color: #8da397; box-shadow: 0 0 0 3px rgba(116,149,131,.1); }
.group-picker-selection { display: contents; }
.group-picker-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 27px; padding: 3px 4px 3px 8px; border-radius: 999px; background: var(--forest-soft); color: var(--forest); font-size: var(--type-meta); font-weight: 750; }
.group-picker-chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(24,61,50,.08); color: inherit; cursor: pointer; }
.group-picker-chip svg { width: 11px; height: 11px; }
.field .group-picker-search { flex: 1; width: auto; min-width: 125px; height: 29px; padding: 0 3px; border: 0; border-radius: 0; box-shadow: none; }
.field .group-picker-search:focus { border: 0; box-shadow: none; }
.group-picker-suggestions { position: absolute; z-index: 8; top: calc(100% + 6px); right: 0; left: 0; display: grid; max-height: 230px; overflow-y: auto; padding: 5px; border: 1px solid #d7d9d2; border-radius: 13px; background: rgba(255,253,248,.98); box-shadow: 0 16px 40px rgba(25,42,34,.17); backdrop-filter: blur(16px); }
.group-picker-suggestions[hidden] { display: none; }
.group-picker-suggestion { display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.group-picker-suggestion:hover, .group-picker-suggestion:focus-visible { background: var(--forest-soft); }
.group-picker-suggestion .group-icon { width: 30px; height: 30px; border-radius: 9px; }
.group-picker-suggestion > span:last-child { min-width: 0; }
.group-picker-suggestion strong, .group-picker-suggestion small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-picker-suggestion strong { font-size: var(--type-meta); }
.group-picker-suggestion small { margin-top: 2px; color: var(--muted); font-size: var(--type-meta); font-weight: 500; }
.group-picker-suggestion.create > span:first-child { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--peach-soft); color: #8a4c31; }
.memory-date-field { width: min(210px, 100%); }
.memory-date-field input[type="date"] { text-align: left; }
.memory-date-field input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.memory-original-date { display: grid; gap: 4px; width: min(260px, 100%); padding: 11px 12px; border: 1px solid #dfe3dd; border-radius: 11px; background: #f5f7f4; }
.memory-original-date > span { color: var(--muted); font-size: var(--type-meta); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.memory-original-date strong { color: var(--ink); font-family: var(--serif); font-size: 14px; font-weight: 600; }
.memory-original-date small { color: var(--faint); font-size: var(--type-meta); }
.field.provisional input, .field.provisional textarea { border-style: dashed; background: #fffdfa; }
.form-hint { color: var(--faint); font-size: var(--type-meta); line-height: 1.45; }
.field-alternative { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--type-meta); font-weight: 500; letter-spacing: 0; text-transform: none; }
.field-alternative button { padding: 0; border: 0; background: transparent; color: var(--forest); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.duplicate-contact-suggestions { display: grid; gap: 7px; margin-top: 3px; padding: 11px; border: 1px solid #d7e2da; border-radius: 12px; background: #f2f7f3; }
.duplicate-contact-suggestions[hidden] { display: none; }
.duplicate-contact-suggestions > span { color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: 0; text-transform: none; }
.duplicate-contact-suggestions > div { display: grid; gap: 6px; }
.duplicate-contact-suggestions > div[hidden] { display: none; }
.duplicate-contact-option { display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; gap: 9px; align-items: center; width: 100%; padding: 7px 8px; border: 1px solid #d9e2dc; border-radius: 10px; background: rgba(255,255,255,.8); color: var(--ink); text-align: left; cursor: pointer; }
.duplicate-contact-option:hover { border-color: #aebfb5; background: white; }
.duplicate-contact-option .person-avatar { width: 34px; height: 34px; font-size: var(--type-meta); }
.duplicate-contact-option strong, .duplicate-contact-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duplicate-contact-option strong { font-family: var(--serif); font-size: var(--type-meta); }
.duplicate-contact-option small { margin-top: 2px; color: var(--muted); font-size: var(--type-meta); }
.duplicate-contact-option > svg { color: var(--forest-mid); }
.duplicate-contact-search-all { display: grid; grid-template-columns: 30px minmax(0, 1fr) 14px; gap: 8px; align-items: center; width: 100%; padding: 7px 8px; border: 0; border-top: 1px solid #d7e2da; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.duplicate-contact-search-all:hover { color: var(--forest); }
.duplicate-contact-search-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #dfebe3; color: var(--forest); }
.duplicate-contact-search-all > span:nth-child(2) { min-width: 0; }
.duplicate-contact-search-all strong, .duplicate-contact-search-all small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duplicate-contact-search-all strong { color: var(--forest); font-size: var(--type-meta); }
.duplicate-contact-search-all small { margin-top: 1px; color: var(--muted); font-size: var(--type-meta); }
.duplicate-contact-search-all > svg { color: var(--forest-mid); }
.contact-reassignment { display: grid; gap: 8px; padding: 10px 11px; border: 1px solid #dfe3dd; border-radius: 12px; background: #f7f8f5; }
.contact-reassignment-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; }
.contact-reassignment-summary > span { grid-column: 1; color: var(--muted); font-size: var(--type-meta); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.contact-reassignment-summary strong { grid-column: 1; font-family: var(--serif); font-size: 14px; }
.contact-reassignment-summary button { grid-column: 2; grid-row: 1 / 3; padding: 6px 8px; border: 1px solid #ccd7d0; border-radius: 9px; background: white; color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.contact-reassignment-panel { display: grid; gap: 7px; padding-top: 8px; border-top: 1px solid #dfe3dd; }
.contact-reassignment-panel[hidden] { display: none; }
.contact-reassignment-panel .search-control { order: 0; width: 100%; max-width: none; }
.contact-reassignment-options { display: grid; gap: 5px; max-height: 220px; overflow-y: auto; }
.contact-reassignment-option { display: grid; grid-template-columns: 32px minmax(0, 1fr) 14px; align-items: center; gap: 8px; width: 100%; padding: 6px 7px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.contact-reassignment-option:hover, .contact-reassignment-option:focus-visible, .contact-reassignment-option.selected { border-color: #d5e0d9; background: white; }
.contact-reassignment-option[hidden] { display: none; }
.contact-reassignment-option .person-avatar { width: 32px; height: 32px; font-size: var(--type-meta); }
.contact-reassignment-option strong, .contact-reassignment-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-reassignment-option strong { font-family: var(--serif); font-size: var(--type-meta); }
.contact-reassignment-option small { margin-top: 1px; color: var(--muted); font-size: var(--type-meta); }
.contact-reassignment-option > svg { color: var(--forest-mid); }
.contact-reassignment-empty { margin: 0; padding: 12px; color: var(--muted); font-size: var(--type-meta); text-align: center; }
.reminder-contact-picker { display: grid; gap: 6px; }
.reminder-contact-picker > .field-label { color: var(--muted); font-size: var(--type-meta); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.reminder-contact-search-control { min-height: 44px; border-color: #d8d9d2; }
.reminder-contact-search-control input { height: 42px; font-size: var(--type-meta); }
.reminder-contact-options { max-height: min(260px, 36vh); padding: 5px; border: 1px solid #d8e0da; border-radius: 12px; background: #f7f8f5; box-shadow: 0 12px 28px rgba(25,42,34,.1); overscroll-behavior: contain; }
.reminder-contact-options[hidden] { display: none; }
.contact-chooser { display: grid; gap: 10px; }
.contact-likely-matches, .contact-chooser-search { display: grid; gap: 7px; }
.contact-likely-matches > span, .contact-chooser-search > span { color: var(--forest-mid); font-size: var(--type-meta); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.contact-likely-matches > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 7px; }
.contact-choice { position: relative; display: grid; grid-template-columns: 24px 36px minmax(0, 1fr); gap: 9px; align-items: center; min-width: 0; padding: 8px 9px; border: 1px solid #d6e0da; border-radius: 11px; background: rgba(255,255,255,.84); color: var(--ink); cursor: pointer; transition: 140ms ease; }
.contact-choice:hover { border-color: #aebfb5; background: white; }
.contact-choice:has(input:checked) { border-color: #759382; background: #edf5f0; box-shadow: 0 0 0 2px rgba(117,147,130,.13); }
.contact-choice[hidden] { display: none; }
.contact-choice > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.contact-choice-check { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #bdcbc3; border-radius: 7px; background: white; color: transparent; }
.contact-choice input:checked + .contact-choice-check { border-color: var(--forest); background: var(--forest); color: white; }
.contact-choice .person-avatar { width: 36px; height: 36px; font-size: var(--type-meta); }
.contact-choice-copy { min-width: 0; }
.contact-choice-copy strong, .contact-choice-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-choice-copy strong { color: var(--ink); font-family: var(--serif); font-size: var(--type-meta); }
.contact-choice-copy small { margin-top: 2px; color: var(--muted); font-size: var(--type-meta); }
.contact-chooser-search { padding-top: 2px; }
.contact-search-control { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 7px; align-items: center; min-height: 40px; padding: 0 11px; border: 1px solid #d8d9d2; border-radius: 11px; background: white; color: var(--forest-mid); }
.contact-search-control:focus-within { border-color: #8da397; box-shadow: 0 0 0 3px rgba(116,149,131,.1); }
.contact-search-control input { width: 100%; height: 38px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: var(--type-meta); }
.contact-search-results { display: grid; gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.contact-search-results[hidden] { display: none; }
.contact-chooser-empty { margin: 0; padding: 9px; border-radius: 9px; background: #f5f5f1; color: var(--muted); font-size: var(--type-meta); text-align: center; }
.contact-chooser-empty[hidden] { display: none; }
.contact-create-new { display: grid; grid-template-columns: 32px minmax(0, 1fr) 14px; gap: 9px; align-items: center; width: 100%; padding: 9px 10px; border: 1px solid #e2d3c8; border-radius: 11px; background: #fcf7f2; color: var(--ink); text-align: left; cursor: pointer; transition: 140ms ease; }
.contact-create-new:hover { border-color: #cfae99; background: #fffaf6; box-shadow: var(--shadow-sm); }
.contact-create-new-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--peach-soft); color: #8b543c; }
.contact-create-new > span:nth-child(2) { min-width: 0; }
.contact-create-new strong, .contact-create-new small { display: block; }
.contact-create-new strong { color: var(--forest); font-size: var(--type-meta); }
.contact-create-new small { margin-top: 2px; color: var(--muted); font-size: var(--type-meta); }
.contact-create-new > svg { color: #9b654a; }
.capture-target-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 12px; border: 1px solid #cbdad1; border-radius: 13px; background: #eef5f0; }
.capture-target-card .person-avatar { width: 42px; height: 42px; }
.capture-target-copy { min-width: 0; }
.capture-target-card small, .capture-target-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capture-target-card small { margin-bottom: 2px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.capture-target-card strong { color: var(--ink); font-family: var(--serif); font-size: 17px; }
.capture-target-meta { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: var(--type-meta); line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.capture-target-card button { padding: 7px 9px; border: 1px solid #bdcec3; border-radius: 9px; background: rgba(255,255,255,.82); color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.capture-target-card button:hover { border-color: #8da397; background: white; }
.existing-contact-note-form { gap: 12px; }
.spoken-groups { padding: 12px; border: 1px solid #d7e2da; border-radius: 12px; background: #f2f7f3; }
.reminder-fields { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; padding: 13px; border: 1px solid #ead7c9; border-radius: 13px; background: #fdf4ed; }
.reminder-fields .field { min-width: 0; }
.reminder-fields input, .reminder-fields textarea { display: block; min-width: 0; max-width: 100%; }
.reminder-fields textarea { min-height: 96px; resize: vertical; }
.reminder-due-fields { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 9px; align-content: start; }
.reminder-fields input[type="date"], .reminder-fields input[type="time"] { inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; padding-top: 0; padding-bottom: 0; text-align: left; }
.reminder-fields input[type="date"]::-webkit-date-and-time-value, .reminder-fields input[type="time"]::-webkit-date-and-time-value { display: flex; min-height: 39px; align-items: center; text-align: left; }
.draft-warning { padding: 10px 12px; border: 1px solid #edd5a9; border-radius: 10px; background: #fff7e7; color: #775c2c; font-size: var(--type-meta); line-height: 1.45; }
.original-words { padding: 12px 13px; border: 1px solid #d7e2da; border-radius: 12px; background: #f2f7f3; }
.original-words summary { color: var(--forest); font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.original-words summary span { margin-left: 5px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 700; }
.original-words p { max-height: 100px; overflow: auto; margin: 10px 0; color: #4e5b54; font-family: var(--serif); font-size: var(--type-meta); line-height: 1.5; white-space: pre-wrap; }
.original-words button { padding: 0; border: 0; background: transparent; color: var(--forest); font-size: var(--type-meta); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.delete-memory-link { display: inline-flex; align-items: center; justify-self: start; gap: 6px; margin-top: 1px; padding: 5px 0; border: 0; background: transparent; color: #9b675f; font-size: var(--type-meta); font-weight: 750; cursor: pointer; }
.delete-memory-link:hover { color: var(--red); }
.delete-memory-link svg { width: 13px; height: 13px; }
.contact-profile-footer { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 13px; border-top: 1px solid rgba(207,208,200,.72); }
.group-profile-footer { align-items: center; justify-content: space-between; gap: 18px; }
.merge-group-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 750; cursor: pointer; }
.merge-group-link:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.merge-group-link svg { width: 13px; height: 13px; }
.delete-contact-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: #9b675f; font-size: var(--type-meta); font-weight: 750; cursor: pointer; }
.delete-contact-link:hover { color: var(--red); }
.delete-contact-link svg { width: 13px; height: 13px; }
.draft-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 7px; }

.how-page { width: min(980px, 100%); margin: 0 auto; }
.how-hero { max-width: 760px; padding: 48px 0 64px; }
.how-kicker { margin: 0 0 13px; color: #9d4f2e; font-size: var(--type-meta); font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }
.how-hero h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-size: 48px; font-weight: 500; letter-spacing: 0; line-height: 1.06; }
.how-hero > p:last-child { max-width: 650px; margin: 20px 0 0; color: #5e6962; font-size: 15px; line-height: 1.7; }
.how-steps { border-top: 1px solid var(--line-strong); }
.how-step { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(180px, .72fr) minmax(320px, 1.25fr); gap: 42px; align-items: start; padding: 54px 0; border-bottom: 1px solid var(--line); }
.how-step-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 13px; align-items: start; }
.how-step-number { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #b9c9bf; border-radius: 50%; color: var(--forest); font-family: var(--serif); font-size: 16px; }
.how-step-heading p { margin: 0 0 5px; color: var(--forest-mid); font-size: var(--type-meta); font-weight: 850; letter-spacing: .02em; line-height: 1.2; text-transform: uppercase; }
.how-step-heading h3 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0; line-height: 1.18; }
.how-step-description { margin: 3px 0 0; color: var(--muted); font-size: var(--type-meta); line-height: 1.65; }
.how-example-stack { display: grid; gap: 10px; }
.how-log-examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.how-note-example { min-width: 0; margin: 0; padding: 17px; border: 1px solid #d5d9d3; border-radius: 8px; background: rgba(255,253,248,.72); box-shadow: var(--shadow-sm); }
.how-note-example > p { margin: 0; color: #36423b; font-family: var(--serif); font-size: var(--type-meta); line-height: 1.55; }
.how-note-example footer { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 15px; }
.how-note-example footer strong { margin-right: 2px; color: var(--forest); font-size: var(--type-meta); }
.how-note-example footer span { padding: 4px 7px; border-radius: 999px; background: var(--forest-soft); color: var(--forest); font-size: var(--type-meta); font-weight: 750; }
.how-query-examples { display: grid; gap: 7px; }
.how-query-examples button { display: flex; justify-content: space-between; gap: 16px; align-items: center; width: 100%; min-height: 44px; padding: 10px 12px 10px 14px; border: 1px solid #d5d9d3; border-radius: 8px; background: rgba(255,253,248,.62); color: #3e4b44; font-family: var(--serif); font-size: var(--type-meta); text-align: left; cursor: pointer; transition: 150ms ease; }
.how-query-examples button:hover { border-color: #aebdb4; background: var(--card); color: var(--forest); transform: translateX(2px); }
.how-query-examples button svg { flex: 0 0 auto; color: var(--forest-mid); }
.how-reminder-panel { padding: 18px 20px; border-radius: 16px; background: rgba(255,253,248,.74); }
.how-reminder-panel header { margin-bottom: 7px; }
.how-reminder-panel header h3 { font-size: 17px; }
.how-reminder-row .reminder-check, .how-reminder-row .reminder-content { cursor: default; }
.how-reminder-row .reminder-check:hover { border-color: #b8c0ba; background: transparent; }
.how-reminder-row .reminder-content:hover strong { color: #39443e; }
.how-save-rule { display: grid; grid-template-columns: minmax(200px, .75fr) minmax(320px, 1.7fr); gap: 42px; align-items: start; padding: 56px 0; }
.how-save-rule h2 { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: 0; line-height: 1.15; }
.how-save-rule div { display: grid; gap: 10px; color: var(--muted); font-family: var(--serif); font-size: 14px; line-height: 1.4; }
.how-save-rule div strong { color: var(--forest); font-weight: 600; }
.how-save-rule div span::before { content: ''; display: inline-block; width: 14px; height: 1px; margin: 0 10px 4px 0; background: var(--peach); }
.how-closing { padding: 52px 18px 56px; border-top: 1px solid var(--line-strong); text-align: center; }
.how-closing p { margin: 0 0 14px; color: #9d4f2e; font-size: var(--type-meta); font-weight: 850; letter-spacing: 0; text-transform: uppercase; }
.how-closing h2 { max-width: 690px; margin: 0 auto; color: var(--forest); font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: 0; line-height: 1.35; }

.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: #203a31; color: white; box-shadow: 0 14px 40px rgba(18,37,30,.25); animation: toast-in 220ms ease-out; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast > span { min-width: 0; overflow-wrap: anywhere; flex: 1; font-size: var(--type-meta); line-height: 1.4; }
.toast button { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 6px 9px; border: 0; border-radius: 8px; background: rgba(255,255,255,.13); color: #f8c4a6; font-size: var(--type-meta); font-weight: 800; cursor: pointer; }
.toast.error { background: #6c302b; }
/* Give the popover an intrinsic block height instead of viewport-sized grid tracks. */
.toast-region.notification-surface { display: block; height: auto; min-height: 0; position: fixed; inset: auto; z-index: 2147483647; box-sizing: border-box; margin: 0; padding: 0; border: 0; overflow: auto; overscroll-behavior: contain; background: transparent; color: inherit; transform: translateY(-100%); pointer-events: none; }
.toast-region.notification-surface[hidden] { display: none; }
.toast-region.notification-surface::backdrop { background: transparent; pointer-events: none; }
/* The scrolling host clips outer shadows into gray squares at rounded corners. */
.notification-surface > .toast { pointer-events: auto; box-shadow: none; }
.notification-surface > .toast + .toast { margin-top: 8px; }
.notification-surface .toast > span { max-height: var(--notification-copy-height); overflow-y: auto; overscroll-behavior: contain; }
/* Without Popover API, a modal descendant still avoids native inertness. */
dialog.notification-fallback-host { overflow: visible !important; transform: none !important; filter: none !important; perspective: none !important; contain: none !important; }

@media (max-width: 1050px) {
  .people-grid, .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-grid { grid-template-columns: minmax(0,1fr) 280px; }
  .home-action-grid { grid-template-columns: minmax(0, 780px); }
  .how-step { grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 22px 32px; }
  .how-step-heading { grid-row: 1 / span 2; }
  .how-step-description,
  .how-step > .how-example-stack,
  .how-step > .how-query-examples { grid-column: 2; }
  .how-save-rule { grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 16px 32px; }
  .how-save-rule > p { grid-row: 1 / span 2; }
  .how-save-rule h2,
  .how-save-rule div { grid-column: 2; }
}

@media (max-width: 900px) {
  .how-step { grid-template-columns: minmax(0, 1fr); }
  .how-step-heading,
  .how-step-description,
  .how-step > .how-example-stack,
  .how-step > .how-query-examples { grid-column: auto; grid-row: auto; }
  .how-save-rule { grid-template-columns: minmax(0, 1fr); }
  .how-save-rule > p,
  .how-save-rule h2,
  .how-save-rule div { grid-column: auto; grid-row: auto; }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .app-main { min-height: 100vh; }
  .topbar {
    min-height: 76px;
    padding: max(14px, env(safe-area-inset-top)) 18px 14px;
    border-bottom: 1px solid rgba(207,208,200,.6);
    background: linear-gradient(
      to bottom,
      var(--paper) 0%,
      rgba(245, 242, 234, .72) 42%,
      rgba(245, 242, 234, 0) 100%
    );
  }
  .topbar > div:nth-child(2) { display: none; }
  .mobile-brand { display: flex; padding: 0; font-size: 20px; }
  /* Keep the full tap target while shrinking the header artwork by 15%. */
  .mobile-brand .brand-mark { width: 51px; height: 51px; flex-basis: 51px; padding: 0; }
  .mobile-brand .brand-mark img { width: 85%; height: 85%; }
  .mobile-brand .brand-loader-trigger::before { inset: 7.5%; }
  .mobile-brand .brand-loader-trigger::after { top: -24.375%; left: 7.5%; width: 85%; height: 116.875%; }
  .mobile-brand .brand-home { min-height: 44px; }
  .mobile-brand .reminder-badge { top: 0; right: -1px; border-color: #f7f2e8; }
  .reminder-tray-scrim { background: rgba(24, 37, 31, .16); }
  .reminder-tray { top: calc(max(76px, env(safe-area-inset-top) + 61px)); right: 12px; left: 12px; width: auto; max-height: calc(var(--visual-viewport-height) - max(90px, env(safe-area-inset-top) + 75px)); border-radius: 18px; }
  .reminder-tray-header { padding: 13px 14px 11px; }
  .reminder-tray-header h2 { font-size: 22px; }
  .reminder-tray-body { padding: 2px 14px calc(14px + env(safe-area-inset-bottom)); }
  .reminder-tray-actions button { min-height: 42px; padding: 0 10px; font-size: var(--type-meta); }
  .reminder-snooze-options button { min-height: 42px; }
  .feedback-button { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .how-it-works-button { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .how-it-works-button strong { display: none; }
  .feedback-button strong { display: none; }
  .avatar-button { width: 44px; height: 44px; }
  .main-content { padding: 22px 16px 132px; }
  .page-grid, .detail-grid { grid-template-columns: 1fr; }
  .home-action-grid { grid-template-columns: 1fr; gap: 14px; }
  .page-grid { gap: 22px; }
  .hero-card { min-height: 0; padding: 20px 8px; }
  .home-action-grid .hero-card { min-height: 310px; padding: 30px 18px; }
  .hero-card-inner { gap: 19px; }
  .home-note-composer textarea { min-height: 126px; padding: 15px 58px 15px 15px; font-size: 16px; }
  .home-note-composer > button { right: 11px; bottom: 11px; width: 44px; height: 44px; }
  .home-note-meta { align-items: center; margin-top: -8px; }
  .query-action-card { min-height: 0; padding: 24px 22px; }
  .first-contact-home .hero-card { min-height: 0; padding-top: 26px; padding-bottom: 26px; }
  .first-contact-reassurance { align-items: flex-start; width: calc(100% - 16px); margin-top: 18px; text-align: left; }
  .query-action-card h2, .hero-card h2 { font-size: 30px; }
  .people-grid, .group-grid { grid-template-columns: 1fr; }
  .person-card { min-height: 175px; }
  .page-actions-row { align-items: center; flex-wrap: wrap; }
  .page-list-header { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; margin-bottom: 12px; }
  .network-page-heading { display: flex; align-items: center; justify-content: space-between; min-height: 40px; text-align: left; }
  .network-page-heading::after { display: none; }
  .network-page-heading h2 { font-size: 30px; }
  .network-heading-actions { position: static; transform: none; }
  .network-page-heading > .compact-add-button { position: static; transform: none; }
  .network-page-heading > .compact-add-button,
  .network-heading-actions .compact-import-button,
  .network-heading-actions .compact-add-button { width: 38px; min-width: 38px; min-height: 38px; height: 38px; border-radius: 10px; }
  .page-list-header > div:first-child { grid-column: 1 / -1; grid-row: 1; }
  .page-list-header > .page-action-buttons { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; margin: 0; }
  .page-list-header > .page-action-buttons .button.primary { flex: 1; }
  .page-list-header > .people-list-tools,
  .page-list-header > .group-list-tools { position: sticky; z-index: 8; top: env(safe-area-inset-top); grid-column: 1 / -1; grid-row: 2; margin: 0 -16px; padding: 4px 16px; background: var(--paper); }
  /* The header scrolls away. Dock list controls at the safe viewport edge,
     and mask the status-bar inset so cards cannot reappear above them. */
  body:is([data-page-route="people"], [data-page-route="groups"]) .main-content::before {
    content: ''; position: fixed; z-index: 9; top: 0; left: 0; right: 0;
    height: env(safe-area-inset-top); background: var(--paper); pointer-events: none;
  }
  .page-action-buttons { margin-left: auto; }
  .search-control { order: 3; flex-basis: 100%; }
  .people-list-tools, .group-list-tools { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .people-list-tools .search-control, .group-list-tools .search-control { order: 0; }
  .people-list-tools .list-sort-toggle, .group-list-tools .list-sort-toggle { justify-self: start; }
  .list-sort-toggle { grid-template-columns: repeat(2, minmax(max-content, 1fr)); width: max-content; max-width: 100%; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .list-sort-thumb { top: auto; bottom: 0; left: 0; width: 50%; height: 2px; border-radius: 999px; background: var(--forest); box-shadow: none; }
  .list-sort-toggle button { min-height: 30px; padding: 0 9px 3px; border-radius: 0; font-size: var(--type-meta); }
  .button, .export-icon-button, .group-add-button, .search-clear, .icon-button { min-width: 44px; min-height: 44px; }
  .network-page-heading > .compact-add-button,
  .network-heading-actions .compact-import-button,
  .network-heading-actions .compact-add-button { min-width: 38px; min-height: 38px; }
  .group-card.network-group-card { padding: 14px 15px; }
  .network-group-card footer { margin: 4px 0 0 56px; padding: 0; border-top: 0; }
  .detail-top { grid-template-columns: auto 1fr; }
  .detail-actions { grid-column: 1 / -1; }
  .detail-top-group { grid-template-columns: 32px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  .detail-top-group .detail-actions { grid-column: 4; }
  .detail-top-contact { grid-template-columns: 36px 44px minmax(0, 1fr); column-gap: 4px; }
  .detail-top-contact .contact-identity-copy { margin-left: 5px; }
  .fact-strip { grid-template-columns: 1fr; }
  .fact-cell { min-height: 70px; }
  .mobile-nav {
    position: fixed;
    z-index: 25;
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr 58px 1fr 1fr;
    align-items: end;
    width: min(calc(100% - 24px), 520px);
    height: 64px;
    padding: 7px 8px 6px;
    transform: translateX(-50%);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 25px;
    background: linear-gradient(145deg, rgba(255,255,255,.7), rgba(248,246,239,.56));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 12px 34px rgba(29,43,36,.14), 0 2px 7px rgba(29,43,36,.06);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    backdrop-filter: blur(24px) saturate(145%);
  }
  .mobile-nav-item {
    position: relative;
    display: grid;
    grid-template-rows: 20px 11px 4px;
    place-items: center;
    gap: 2px;
    height: 49px;
    padding: 3px 2px 0;
    border: 0;
    border-radius: 17px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
    transition: color 150ms ease, transform 150ms ease;
  }
  .mobile-nav-item::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: transparent; transform: scale(.5); transition: background 150ms ease, transform 150ms ease; }
  .mobile-nav-item > span { width: 18px; height: 18px; }
  .mobile-nav-item em { font-size: var(--type-meta); font-style: normal; font-weight: 720; line-height: 1; letter-spacing: -.01em; }
  .mobile-nav-item.active { color: var(--forest); }
  .mobile-nav-item.active::after { background: var(--peach); transform: scale(1); }
  .mobile-nav-item:active { transform: scale(.96); }
  .mobile-nav-capture {
    position: relative;
    align-self: center;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border: 4px solid rgba(255,253,248,.76);
    border-radius: 50%;
    background: linear-gradient(145deg, #f7ac82, var(--peach));
    color: #3e281e;
    box-shadow: 0 0 0 1px rgba(255,255,255,.8), 0 9px 22px rgba(81,53,39,.2);
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
  }
  .mobile-nav-capture:active { transform: scale(.96); box-shadow: 0 0 0 1px rgba(255,255,255,.8), 0 5px 13px rgba(81,53,39,.18); }
  .mobile-nav-capture.listening { animation: voice-pulse 1.3s ease-in-out infinite; }
  .mobile-nav-capture svg { width: 20px; height: 20px; }
  .capture-dialog { width: 100%; max-width: none; max-height: calc(var(--visual-viewport-height) - 8px); margin: auto 0 0; border-radius: 23px 23px 0 0; }
  .capture-dialog::backdrop { background: rgba(19,35,29,.46); }
  .feedback-dialog { width: 100%; max-width: none; max-height: calc(var(--visual-viewport-height) - 8px); margin: auto 0 0; border-radius: 23px 23px 0 0; }
  .feedback-dialog::backdrop { background: rgba(19,35,29,.46); }
  .feedback-shell { max-height: calc(var(--visual-viewport-height) - 8px); }
  .feedback-header { padding: 20px 18px 17px; }
  .feedback-header h2 { font-size: 24px; }
  .feedback-body, .profile-body, .account-panel-body { padding: 18px 16px; }
  .install-body { gap: 17px; padding: 18px 16px; }
  .install-intro { grid-template-columns: 62px minmax(0, 1fr); gap: 13px; }
  .install-app-icon { width: 62px; height: 62px; border-radius: 16px; }
  .install-app-icon img { width: 55px; height: 55px; }
  .install-intro strong { font-size: 18px; }
  .install-steps li { min-height: 62px; padding: 10px 11px; }
  .install-steps strong { font-size: var(--type-meta); }
  .install-steps p { font-size: var(--type-meta); }
  .install-footer { grid-template-columns: auto minmax(0, 1fr); }
  .install-footer .button.primary { min-width: 0; }
  .feedback-upload { grid-template-columns: 38px minmax(0,1fr); padding: 12px; }
  .feedback-upload-icon { width: 38px; height: 38px; }
  .feedback-upload .button { grid-column: 1 / -1; justify-content: center; }
  .feedback-previews { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .feedback-footer { position: sticky; bottom: 0; display: grid; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .feedback-footer p { max-width: none; }
  .feedback-footer > div { width: 100%; }
  .feedback-footer .button.primary { flex: 1; }
  .profile-footer { display: flex; gap: 8px; }
  .profile-footer > div { width: auto; }
  .profile-footer .button.primary { flex: 0 0 auto; }
  .dialog-shell { max-height: calc(var(--visual-viewport-height) - 8px); }
  .dialog-header { min-height: 70px; padding: 14px 16px; }
  .capture-content { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .voice-choice-dialog .capture-content { padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
  .voice-choice-view { gap: 8px; }
  .voice-choice-close { width: 32px; height: 32px; }
  .voice-choice-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; min-height: 300px; }
  .voice-choice-card { padding: 20px 15px 16px; border-radius: 18px; }
  .voice-choice-icon { width: 43px; height: 43px; margin-bottom: 32px; border-radius: 13px; }
  .voice-choice-copy strong { font-size: clamp(33px, 9.5vw, 38px); }
  .voice-choice-copy span { font-size: 16px; }
  .field input, .field textarea, .field select, .feedback-body .field textarea, .search-control input, .contact-search-control input, .ask-form textarea, .home-query-form input { font-size: 16px; }
  .dictation-stage { min-height: 360px; align-content: start; }
  .dictation-guide { grid-template-columns: 38px minmax(0, 1fr); padding: 12px; }
  .dictation-guide > span { width: 38px; height: 38px; }
  .dictation-form textarea { min-height: 180px; }
  .capture-dialog.note-composer-dialog,
  .capture-dialog.voice-dictation-dialog { width: 100vw; max-width: 100vw; height: calc(var(--visual-viewport-height) - 8px); }
  .note-composer-dialog .dialog-shell { height: 100%; max-height: none; }
  .note-composer-dialog .capture-content { min-height: 0; flex: 1; overflow: hidden; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  .note-composer-dialog .dictation-stage { grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; align-content: start; padding-top: 24px; }
  .note-composer-heading h2 { font-size: clamp(35px, 10.5vw, 43px); }
  .note-composer-heading p { margin-top: 4px; font-size: 15px; }
  .note-composer-view .dictation-form { grid-template-rows: minmax(0, 1fr) auto auto; min-height: 0; margin-top: 19px; }
  .note-composer-dialog .note-composer-field textarea { height: 100%; min-height: 0; padding: 17px; border-radius: 18px; font-size: 16px; }
  .note-composer-tip p { font-size: var(--type-meta); }
  .note-composer-close { top: -10px; right: 0; width: 44px; height: 44px; }
  .note-composer-view .dictation-actions { position: static; align-items: center; gap: 10px; margin: 3px 0 0; padding: 4px 0 0; border: 0; background: transparent; backdrop-filter: none; }
  .note-composer-view .dictation-actions .button { min-height: 44px; border-radius: 999px; }
  .note-composer-view .dictation-actions .button.ghost { min-width: 72px; padding-right: 13px; padding-left: 13px; border-color: transparent; background: rgba(255,255,255,.34); }
  .note-composer-view .dictation-actions .button.primary { flex: 1; box-shadow: 0 8px 20px rgba(24,61,50,.14); }
  .voice-dictation-dialog .dialog-shell { height: 100%; max-height: none; }
  .voice-dictation-dialog .capture-content { min-height: 0; flex: 1; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  .voice-dictation-view { gap: 14px; width: 100%; min-height: 100%; }
  .voice-listening-heading { gap: 10px; padding-right: 46px; }
  .voice-listening-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
  .voice-listening-heading p:last-child { font-size: var(--type-meta); }
  .voice-listening-heading .waveform { display: none; }
  .voice-transcript-card { padding: 18px; border-radius: 18px; }
  .voice-transcript-card .live-transcript { font-size: clamp(21px, 6.4vw, 27px); }
  .voice-dictation-view .listening-actions .button.ghost { min-width: 72px; border-color: transparent; background: rgba(255,255,255,.34); }
  .voice-dictation-view .listening-actions .button.primary { flex: 1; min-width: 0; box-shadow: 0 8px 20px rgba(24,61,50,.14); }
  .dictation-actions { position: sticky; bottom: -18px; margin: 3px -16px -18px; padding: 13px 16px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(12px); }
  .dictation-actions .button.primary { flex: 1; }
  .draft-layout { grid-template-columns: 1fr; }
  .group-choice-grid { grid-template-columns: 1fr; max-height: min(330px, 42vh); }
  .action-rail { padding: 14px; }
  .action-steps { grid-template-columns: repeat(2, 1fr); }
  .confidence { display: none; }
  .form-row, .reminder-fields { grid-template-columns: minmax(0, 1fr); }
  .reminder-fields { width: 100%; overflow: hidden; }
  .reminder-contact-search-control input { font-size: 16px; }
  .reminder-fields textarea { min-height: 128px; }
  .reminder-due-fields { grid-template-columns: minmax(0, 1fr) minmax(132px, .72fr); }
  .reminder-fields input[type="date"], .reminder-fields input[type="time"] { display: block; width: 100%; min-width: 0; max-width: 100%; height: 48px; -webkit-appearance: none; appearance: none; text-align: left; }
  .reminder-fields input[type="date"]::-webkit-date-and-time-value, .reminder-fields input[type="time"]::-webkit-date-and-time-value { min-width: 0; min-height: 46px; align-items: center; text-align: left; }
  .draft-actions { position: sticky; bottom: -18px; margin: 3px -16px -18px; padding: 13px 16px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(12px); }
  .draft-actions .button.primary { flex: 1; }
  .memory-date-field { width: min(180px, 100%); }
  .deep-search-button { flex: 1; justify-content: center; }
  .deep-search-panel { padding: 15px; }
  .deep-search-panel-header, .deep-search-loading { gap: 10px; }
  .deep-search-invitation { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; padding: 9px 13px; }
  .deep-search-progress { min-height: 30px; padding: 0 4px; }
  .deep-search-panel-header { flex-wrap: wrap; }
  .deep-search-panel-mark { width: 36px; height: 36px; }
  .deep-search-panel-mark img { width: 27px; height: 27px; }
  .deep-search-status-line { align-items: flex-start; flex-wrap: wrap; }
  .deep-search-status-line .deep-lower-potential-toggle { margin-left: 38px; }
  .deep-match-strength { grid-template-columns: auto minmax(55px, 1fr); gap: 6px; }
  .deep-match-strength > small { grid-column: 1 / -1; }
  .toast-region { right: 16px; bottom: 94px; }
  .how-hero { padding: 26px 0 40px; }
  .how-hero h2 { font-size: 36px; }
  .how-hero > p:last-child { margin-top: 16px; font-size: var(--type-meta); line-height: 1.65; }
  .how-step { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 36px 0; }
  .how-step-description { max-width: 520px; margin: -6px 0 0 47px; }
  .how-log-examples { grid-template-columns: minmax(0, 1fr); }
  .how-note-example { padding: 15px; }
  .how-reminder-panel { padding: 16px; }
  .how-save-rule { grid-template-columns: minmax(0, 1fr); gap: 13px; padding: 42px 0; }
  .how-save-rule > p { margin: 0; }
  .how-save-rule div { margin-top: 5px; }
  .how-closing { padding: 40px 8px 26px; }
  .how-closing h2 { font-size: 24px; }
}

@media (hover: none) and (pointer: coarse) {
  .field input, .field textarea, .field select, .feedback-body .field textarea, .search-control input, .contact-search-control input, .ask-form textarea, .home-query-form input, .auth-gate input, .auth-gate textarea, .auth-gate select { font-size: 16px !important; }
}

.keyboard-visible .auth-gate { position: fixed; inset: var(--visual-viewport-offset-top) auto auto var(--visual-viewport-offset-left); width: var(--visual-viewport-width); height: var(--visual-viewport-height); min-height: 0; padding: 0; overflow-y: auto; place-items: stretch; overscroll-behavior: contain; }
.keyboard-visible .auth-layout { width: 100%; min-height: 100%; }
.keyboard-visible .auth-waitlist-callout { display: none !important; }
.keyboard-visible .auth-card { width: 100%; min-height: 100%; margin: 0; padding: 12px 16px; border: 0; border-radius: 0; box-shadow: none; }
.keyboard-visible .auth-card > img,
.keyboard-visible .vault-card .mini-label { display: none; }
.keyboard-visible .auth-card h1 { font-size: clamp(24px, 7vw, 30px); }
.keyboard-visible .auth-intro { margin-top: 6px; font-size: var(--type-meta); line-height: 1.4; }
.keyboard-visible .auth-mount,
.keyboard-visible .vault-card form { margin-top: 12px; }
.keyboard-visible .vault-card form { gap: 9px; }
.keyboard-visible .vault-gate-sign-out { margin-top: 8px; }
.keyboard-visible .capture-dialog,
.keyboard-visible .feedback-dialog { position: fixed; inset: calc(var(--visual-viewport-offset-top) + 4px) 0 auto; height: calc(var(--visual-viewport-height) - 4px); max-height: calc(var(--visual-viewport-height) - 4px); margin: 0; border-radius: 18px 18px 0 0; }
.keyboard-visible :is(.capture-dialog, .feedback-dialog) { right: auto; left: var(--visual-viewport-offset-left); width: var(--visual-viewport-width); max-width: var(--visual-viewport-width); }
.keyboard-visible .dialog-shell,
.keyboard-visible .feedback-shell { height: 100%; max-height: none; }
.keyboard-visible .capture-content,
.keyboard-visible .feedback-body,
.keyboard-visible .profile-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.keyboard-visible .mobile-nav { display: none; }
.keyboard-visible .main-content { padding-bottom: 24px; }
.keyboard-visible .action-rail { display: none; }
.keyboard-visible .capture-content { padding-top: 12px; }
/* Fields scroll above a separate action row. The visual viewport already ends
   at the keyboard, so do not add the Home Screen home-indicator inset again. */
.keyboard-visible .form-editor-dialog .dialog-header { flex-shrink: 0; min-height: 64px; padding: 8px 12px; }
.keyboard-visible .form-editor-dialog .dialog-identity,
.keyboard-visible .form-editor-dialog .dialog-identity > div { min-width: 0; }
.keyboard-visible .form-editor-dialog .dialog-identity strong,
.keyboard-visible .form-editor-dialog .dialog-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyboard-visible .form-editor-dialog .capture-content { overflow: hidden; padding: 0; }
.keyboard-visible .form-editor-dialog .draft-layout { width: 100%; height: 100%; min-height: 0; }
.keyboard-visible .form-editor-dialog .draft-form { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 0; }
.keyboard-visible .form-editor-dialog .edit-form-fields { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 16px; align-content: start; }
.keyboard-visible .form-editor-dialog .draft-actions { position: static; margin: 0; padding: 12px 16px; }
/* Let the active note use the measured space between the header and actions.
   The field scroller keeps its contact/date controls reachable; a fixed cap
   wastes room when Safari returns space after a keyboard or orientation change. */
.keyboard-visible .capture-dialog.form-editor-dialog .edit-form-fields textarea:focus,
.keyboard-visible .feedback-body textarea:focus { height: var(--edit-field-height, 132px); min-height: 0; max-height: none; resize: none; }
/* Safari's native Previous control skips a name field pushed out of view by
   a full-height About editor. Leave room for both fields in the group form. */
.keyboard-visible .capture-dialog.form-editor-dialog #groupForm textarea:focus { height: 132px; max-height: 132px; }
.keyboard-visible .capture-dialog.form-editor-dialog .reminder-fields textarea:focus { height: 104px; max-height: 116px; }
/* A focused contact note must not sit inside a second scrolling form. iOS
   hands gestures between nested native scrollers, including on a reversal.
   Keep the contact name in the header and the date visible for Safari's
   native Next field control, without introducing a second scroller. */
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .edit-form-fields {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0;
  padding: 6px 16px;
}
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .edit-form-fields > :not(.direct-note-field):not(.memory-date-field) { display: none; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .memory-date-field { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) minmax(150px, 1fr); align-items: center; flex: 0 0 auto; gap: 8px; margin-top: 8px; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .memory-date-field > span { font-size: var(--type-meta); letter-spacing: .04em; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .dialog-header { min-height: 52px; padding-block: 4px; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .dialog-identity strong { line-height: 1.1; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .dialog-identity span { line-height: 1.2; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .draft-actions { padding-block: 8px; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .direct-note-field {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 0;
}
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .direct-note-field > :not(.direct-note-input-wrap) { display: none; }
.keyboard-visible .form-editor-dialog:has(.direct-note-input-wrap:focus-within) .direct-note-input-wrap { flex: 1; min-height: 0; }
.keyboard-visible .capture-dialog.form-editor-dialog:has(.direct-note-input-wrap:focus-within) .edit-form-fields #directContactNote {
  height: 100%;
  min-height: 0;
  padding-bottom: 12px;
  overflow-y: auto;
  overscroll-behavior-y: none;
  resize: none;
}
.keyboard-visible .group-picker-suggestions { position: static; max-height: 150px; margin-top: 6px; box-shadow: none; }
  .keyboard-visible .reminder-dialog .dialog-header { min-height: 58px; padding-top: 9px; padding-bottom: 9px; }
  .keyboard-visible .reminder-dialog .capture-content { padding: 10px 16px 0; }
  .keyboard-visible .reminder-dialog .reminder-fields { gap: 10px; padding: 10px; }
  .keyboard-visible .reminder-dialog .reminder-text-field { scroll-margin-top: 8px; scroll-margin-bottom: 76px; }
  .keyboard-visible .reminder-dialog .reminder-fields textarea { min-height: 104px; max-height: 116px; resize: none; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .dialog-header { min-height: 54px; padding: 7px 12px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .dialog-identity { gap: 9px; min-width: 0; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .assistant-orb { width: 30px; height: 30px; flex-basis: 30px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .dialog-identity > div { min-width: 0; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .dialog-identity strong { overflow: hidden; margin-bottom: 1px; font-size: 15px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .dialog-identity span { overflow: hidden; font-size: var(--type-meta); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .icon-button { width: 32px; height: 32px; flex: 0 0 32px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .capture-content { overflow: hidden; padding: 8px 12px 0; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .draft-layout { width: 100%; height: 100%; min-height: 0; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .draft-form { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; min-height: 0; gap: 8px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .edit-form-fields { display: flex; min-height: 0; padding: 0; flex-direction: column; overflow: hidden; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .edit-form-fields > :not(.contact-chooser) { display: none; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser { display: flex; min-height: 0; flex-direction: column; gap: 7px; overflow: hidden; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-likely-matches { min-height: 0; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-likely-matches > div { max-height: 116px; overflow-y: auto; overscroll-behavior: contain; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser-search { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 6px; overflow: hidden; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-search-control { flex: 0 0 auto; min-height: 44px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-search-control input { height: 42px; font-size: 16px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-search-results { min-height: 0; max-height: none; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser-empty { flex: 0 0 auto; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-create-new { flex: 0 0 auto; padding-top: 7px; padding-bottom: 7px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .draft-actions { position: static; margin: 0 -12px; padding: 8px 12px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .draft-actions .button { min-height: 40px; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser.is-searching .contact-likely-matches,
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser.is-searching .contact-chooser-search > span,
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser.is-searching .contact-create-new,
  .keyboard-visible .contact-picker-review.contact-picker-search-active .draft-form:has(.contact-chooser.is-searching) .draft-actions { display: none; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser.is-searching .contact-chooser-search { flex: 1 1 auto; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser.is-searching .contact-search-results { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  /* Before a query is entered, suggestions and the create-new option can be
     taller than the remaining window. Scroll them instead of shrinking the
     search container until its focused input is clipped. */
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser:not(.is-searching) { overflow-y: auto; overscroll-behavior: contain; }
  .keyboard-visible .contact-picker-review.contact-picker-search-active .contact-chooser:not(.is-searching) > :is(.contact-likely-matches, .contact-chooser-search) { flex: 0 0 auto; overflow: visible; }
  .keyboard-visible .group-member-picker-dialog .capture-content { overflow: hidden; padding: 12px 16px 0; }
  .keyboard-visible .group-member-picker { grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; gap: 10px; }
  .keyboard-visible .group-member-picker .contact-picker-list { min-height: 0; max-height: none; }
  .keyboard-visible .group-member-picker .draft-actions { position: static; margin: 0 -16px; padding: 8px 16px; }
  .keyboard-visible .group-assignment-picker-dialog .capture-content { overflow: hidden; padding: 12px 16px 0; }
  .keyboard-visible .group-assignment-picker { grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100%; min-height: 0; gap: 10px; }
  .keyboard-visible .group-assignment-picker .group-choice-grid { min-height: 0; max-height: none; }
  .keyboard-visible .group-assignment-picker .draft-actions { position: static; margin: 0 -16px; padding: 8px 16px; }
  .keyboard-visible .dictation-stage { min-height: 0; }
  .keyboard-visible .dictation-guide { display: none; }
  .keyboard-visible .dictation-form textarea { min-height: 120px; max-height: 120px; }
  .keyboard-visible .note-composer-dialog .capture-content { overflow: hidden; padding: 8px 14px 6px; }
  .keyboard-visible .note-composer-dialog .dictation-stage { grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100%; min-height: 100%; padding-top: 5px; }
  .keyboard-visible .note-composer-heading h2 { font-size: 34px; }
  .keyboard-visible .note-composer-heading p { margin-top: 1px; font-size: var(--type-meta); }
  .keyboard-visible .note-composer-view .dictation-form { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; gap: 7px; margin-top: 12px; }
  .keyboard-visible .note-composer-field { display: block; min-height: 0; }
  .keyboard-visible .dictation-form .note-composer-field textarea { height: 100%; min-height: 0; max-height: none; padding: 13px 14px; border-radius: 15px; }
  .keyboard-visible .note-composer-tip { display: none; }
  .keyboard-visible .note-composer-close { top: -3px; right: 0; width: 44px; height: 44px; }
  .keyboard-visible .note-composer-view .dictation-actions { gap: 8px; margin-top: 1px; padding-top: 2px; }
  .keyboard-visible .note-composer-view .dictation-actions .button { min-height: 40px; }
  .keyboard-visible .feedback-header { align-items: center; padding-top: 12px; padding-bottom: 12px; }
  .keyboard-visible .feedback-header .mini-label,
  .keyboard-visible .feedback-header p:last-child { display: none; }
  .keyboard-visible .feedback-header h2 { font-size: 20px; }
  .keyboard-visible .feedback-footer { position: static; padding-bottom: 12px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .dialog-header { min-height: 56px; padding: 8px 12px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .dialog-identity { min-width: 0; gap: 9px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .assistant-orb { width: 32px; height: 32px; flex-basis: 32px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .dialog-identity > div { min-width: 0; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .dialog-identity strong,
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .dialog-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .capture-content { padding: 8px 12px 0; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .existing-contact-note-form { gap: 9px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .capture-target-card { grid-template-columns: 34px minmax(0, 1fr) auto; min-height: 44px; gap: 8px; padding: 5px 8px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .capture-target-card .person-avatar { width: 34px; height: 34px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .capture-target-card small,
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .capture-target-meta { display: none; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) textarea[name="note"] { min-height: 112px; resize: none; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .draft-actions { position: static; margin: 0 -12px; padding: 8px 12px; }
  .keyboard-visible .existing-contact-review:not(.contact-picker-review) .draft-actions .button { min-height: 40px; }

@media (max-width: 800px) and (max-height: 520px) {
  .capture-dialog,
  .feedback-dialog { position: fixed; inset: 4px 0 auto; height: calc(100dvh - 4px); max-height: calc(100dvh - 4px); margin: 0; border-radius: 18px 18px 0 0; }
  .dialog-shell,
  .feedback-shell { height: 100%; max-height: none; }
  .capture-content,
  .feedback-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
  .action-rail { display: none; }
  .dictation-stage { min-height: 0; }
  .dictation-guide { display: none; }
  .dictation-form textarea { min-height: 120px; max-height: 120px; }
}

@media (max-width: 430px) {
  .auth-gate { padding: 12px 16px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 22px; }
  .auth-card > img { width: 58px; height: 58px; margin-bottom: 12px; }
  .auth-card h1 { font-size: 30px; }
  .auth-mount { margin-top: 22px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-layout { gap: 10px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-waitlist-callout { padding: 12px 14px 13px; border-radius: 18px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-card { padding: 14px 20px 13px; border-radius: 20px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-legal { margin-top: 10px; }
  .hero-card h2 { font-size: 30px; }
  .ask-hero { padding-right: 18px; padding-left: 18px; }
  .ask-prompt-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .ask-prompt-list .prompt-chip { width: 100%; min-width: 0; min-height: 44px; padding: 7px 6px; line-height: 1.2; text-wrap: balance; }
  .memory-row { grid-template-columns: 39px minmax(0,1fr); }
  .memory-date { display: none; }
  .activity-heading { align-items: start; }
  .activity-row { grid-template-columns: 40px minmax(0, 1fr); padding: 13px; }
  .activity-row .person-avatar { width: 40px; height: 40px; }
  .activity-open { display: none; }
  .section-heading { align-items: start; }
  .reminder-due-fields { grid-template-columns: minmax(0, 1fr); }
  .action-steps { grid-template-columns: 1fr; }
  .detail-top .person-avatar { width: 56px; height: 56px; }
  .detail-top h2 { font-size: 25px; }
}

@media (max-width: 430px) and (max-height: 700px) {
  .auth-gate { padding: 8px 14px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-layout { gap: 8px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-waitlist-callout { gap: 6px; padding: 10px 12px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-waitlist-button { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-card { padding: 10px 18px 9px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-card > img { width: 38px; height: 38px; margin-bottom: 2px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-card h1 { font-size: 28px; }
  .auth-gate[data-auth-screen="sign-in"] .auth-intro { margin-top: 2px; line-height: 1.25; }
  .auth-gate[data-auth-screen="sign-in"] .auth-legal { margin-top: 8px; }
}

/*
 * Accessible type scale
 * - 1rem (16px at the browser default) for text people read as content.
 * - .875rem (14px) is the absolute floor for labels, metadata, and controls.
 * Relative units preserve browser and operating-system text enlargement.
 */
.auth-intro,
.auth-message,
.section-heading p,
.page-actions-row p,
.hero-card p,
.first-contact-hero .log-action-copy > p,
.query-action-card > p:not(.mini-label),
.first-contact-reassurance p,
.memory-row p,
.activity-heading div > p:last-child,
.activity-copy p,
.empty-mini,
.person-card .headline,
.group-card .headline,
.empty-state p,
.detail-top p,
.fact-cell strong,
.note-card p,
.ask-hero > p,
.deep-search-invitation-copy p,
.deep-search-panel-header p,
.deep-search-loading p,
.deep-search-reason,
.evidence,
.query-group-result-copy p,
.feedback-header p:last-child,
.profile-ai-note,
.install-intro p,
.install-steps p,
.install-security-note,
.confirm-shell p,
.voice-listening-heading p:last-child,
.dictation-guide p,
.dictation-purpose,
.note-composer-tip p,
.processing-stage p,
.contact-picker-empty,
.group-assignment-empty > span,
.draft-warning,
.original-words p,
.how-hero > p:last-child,
.how-step-description,
.how-note-example > p,
.how-save-rule div {
  font-size: var(--type-body);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reminder-tray-content strong,
.memory-row strong,
.activity-copy strong,
.reminder-row strong,
.feedback-upload strong,
.install-steps strong,
.vault-device-row strong,
.duplicate-contact-option strong,
.contact-reassignment-option strong,
.contact-choice-copy strong,
.contact-create-new strong {
  font-size: var(--type-body);
  line-height: 1.45;
}

.result-card h3,
.query-group-result-copy h3 {
  font-size: var(--type-body-large);
  line-height: 1.3;
}

.deep-search-status-line,
.deep-search-status-line > strong {
  font-size: var(--type-body);
  line-height: 1.5;
}

.query-summary-meta {
  flex: 0 0 auto;
  color: var(--faint);
  font: var(--type-meta)/1.4 var(--sans);
}

.field input,
.field textarea,
.field select,
.feedback-body .field textarea,
.search-control input,
.contact-search-control input,
.reminder-contact-search-control input,
.ask-form textarea,
.home-query-form input {
  font-size: var(--type-body);
}

kbd {
  min-width: 24px;
  height: auto;
  min-height: 24px;
  padding: 2px 6px;
  line-height: 1.3;
}

.group-pill {
  height: auto;
  min-height: 28px;
  padding: 4px 9px;
  line-height: 1.3;
}

.query-summary {
  flex-wrap: wrap;
  line-height: 1.4;
}

.detail-top-contact .contact-identity-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  color: var(--forest);
  font-family: var(--serif);
  font-size: clamp(27px, 2.7vw, 30px);
  font-weight: 650;
  letter-spacing: -.03em;
  line-height: 1.24;
  padding-bottom: .08em;
  overflow-wrap: anywhere;
}
.detail-top-contact .contact-identity-role { color: #344b41; font-size: var(--type-body); font-weight: 700; line-height: 1.35; }
.detail-top-contact .contact-identity-company { color: var(--muted); font-size: .9375rem; font-weight: 600; line-height: 1.35; }
.detail-top-contact .contact-identity-location { color: var(--faint); font-size: var(--type-meta); font-weight: 550; line-height: 1.35; }

@media (max-width: 800px) {
  body[data-page-route="contact"] .main-content { padding-top: 16px; }
  .detail-top-contact { grid-template-columns: 36px 44px minmax(0, 1fr); column-gap: 4px; margin-bottom: 24px; }
  .detail-top-contact .person-avatar { width: 44px; height: 44px; flex-basis: 44px; font-size: 16px; }
  .detail-top-contact .contact-identity-name { font-size: clamp(27px, 7.6vw, 29px); }
  .contact-log-button { min-width: 0; min-height: 44px; }
  .main-content { padding-bottom: 150px; }
  .mobile-nav { height: 76px; padding-top: 8px; padding-bottom: 7px; }
  .mobile-nav-item {
    grid-template-rows: 20px minmax(18px, auto) 4px;
    gap: 3px;
    height: 61px;
    padding-top: 3px;
  }
  .mobile-nav-item em { line-height: 1.2; }
  .reminder-badge { min-width: 22px; height: 22px; padding: 0 6px; }
  .reminder-tray-actions button,
  .reminder-snooze-options button { padding: 8px 10px; line-height: 1.3; }
  .reminder-tray-actions button { flex: 1 1 92px; }
  .profile-ai-metrics { grid-template-columns: minmax(0, 1fr); }
  .profile-ai-breakdown-row { align-items: flex-start; flex-direction: column; gap: 3px; }
  .profile-ai-breakdown-row span:last-child { text-align: left; }
  .vault-device-row { align-items: flex-start; flex-wrap: wrap; }
  .vault-device-row > span { flex: 1 1 210px; }
  .deep-match-strength { grid-template-columns: minmax(0, 1fr); }
  .deep-match-strength > small { grid-column: auto; white-space: normal; }
  .deep-search-status-line { align-items: flex-start; }
  .deep-search-status-line .deep-lower-potential-toggle { width: 100%; margin-left: 38px; white-space: normal; }
  .result-card,
  .query-group-result-card { grid-template-columns: 43px minmax(0, 1fr); }
  .result-arrow { display: none; }
  .query-group-result-copy p { white-space: normal; }
  .memory-row p,
  .vault-device-row strong,
  .group-choice-copy strong,
  .group-choice-copy small,
  .group-picker-suggestion strong,
  .group-picker-suggestion small,
  .duplicate-contact-option strong,
  .duplicate-contact-option small,
  .duplicate-contact-search-all strong,
  .duplicate-contact-search-all small,
  .contact-reassignment-option strong,
  .contact-reassignment-option small,
  .contact-choice-copy strong,
  .contact-choice-copy small,
  .capture-target-card small,
  .capture-target-card strong,
  .capture-target-meta {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .network-person-card h3,
  .network-group-card h3,
  .network-person-card .headline,
  .network-group-card .headline {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
  }
  .feedback-upload { grid-template-columns: 42px minmax(0, 1fr); }
  .feedback-upload .button { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .query-suggestion-marquee { overflow-x: auto; mask-image: none; }
  .query-suggestion-track { animation: none !important; }
  .query-suggestion-set[aria-hidden="true"] { display: none; }
  .brand-mark.reminder-alerting { animation: none !important; }
}

/* Mobile QA hardening: consistent touch targets, stable chrome, short-viewport
   density, and keyboard-safe editing across real mobile browser profiles. */
@media (max-width: 800px) {
  body[data-page-route="people"] .topbar,
  body[data-page-route="groups"] .topbar { min-height: 76px; height: max(76px, calc(env(safe-area-inset-top) + 55px)); padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .section-link { min-height: 40px; padding: 0 8px; }
  .prompt-chip { min-height: 40px; }
  .reminder-check { position: relative; width: 40px; height: 40px; border: 0; }
  .reminder-row { grid-template-columns: 40px minmax(0, 1fr); column-gap: 4px; }
  .reminder-check::before { content: ''; position: absolute; width: 20px; height: 20px; border: 1.5px solid #b8c0ba; border-radius: 50%; }
  .reminder-check:hover::before { border-color: var(--forest); background: var(--forest-soft); }
  .reminder-check svg { position: relative; z-index: 1; }
  .page-list-header { display: contents; }
  .page-list-header > div:first-child { margin-bottom: 8px; }
  .page-list-header > .people-list-tools,
  .page-list-header > .group-list-tools { margin-bottom: 12px; }
  .network-page-heading > .compact-add-button,
  .network-heading-actions .compact-import-button,
  .network-heading-actions .compact-add-button { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
  .list-sort-toggle button { min-height: 40px; }
  .nested-back-button { width: 40px; height: 40px; }
  .delete-contact-link, .merge-group-link { min-height: 40px; padding-top: 9px; padding-bottom: 9px; }
  .contact-group-pill { min-height: 40px; height: 40px; }
  .contact-group-pill .group-pill-link { height: 40px; }
  .contact-group-pill .group-pill-remove { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; }
  .field-group-search { min-height: 44px; }
  .group-picker-search { height: 44px; min-height: 44px; }
  [data-action="change-note-contact"] { min-height: 40px; }
  .network-person-card h3,
  .network-group-card h3,
  .network-person-card .headline,
  .network-group-card .headline { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .network-person-card .group-pills { display: flex; flex-wrap: wrap; gap: 5px; }
  .capture-dialog.new-contact-review .draft-actions { position: static; margin-bottom: 0; }
  .main-content:has(.ask-hero.ask-query-active) { padding-top: 8px; }
  .ask-hero.ask-query-active { padding: 8px 12px; }
  .ask-hero.ask-query-active h2 { font-size: 22px; }
  .ask-hero.ask-query-active > p,
  .ask-hero.ask-query-active .ask-prompt-list { display: none; }
  .ask-hero.ask-query-active .ask-form { margin-top: 6px; }
}

@media (max-width: 800px) and (min-height: 521px) and (max-height: 700px) {
  .home-action-grid .hero-card { min-height: 210px; padding: 18px; }
  .home-note-composer textarea { min-height: 90px; }
  .hero-card-inner { gap: 12px; }
  .home-detail-grid { margin-top: 18px; padding-bottom: 96px; }
  .query-action-card { min-height: 0; padding: 14px; }
  .query-action-card h2 { font-size: 26px; }
  .query-action-card > p:not(.mini-label) { margin-top: 8px; }
  .detail-page { padding-bottom: 96px; }
}

@media (max-width: 350px) {
  .detail-top-group { grid-template-columns: 32px auto minmax(0, 1fr); align-items: start; }
  .detail-top-group .detail-actions { grid-column: 3; grid-row: 2; justify-self: end; }
  .group-title-row h2 { font-size: 24px; }
  .group-detail-page { padding-top: 8px; }
}

.keyboard-visible .main-content { padding-top: 8px; }
.keyboard-visible .page-list-header > .people-list-tools,
.keyboard-visible .page-list-header > .group-list-tools { top: calc(var(--visual-viewport-offset-top) + 10px); }
.keyboard-visible .ask-hero { padding: 8px 12px; }
.keyboard-visible .ask-hero h2 { font-size: 22px; }
.keyboard-visible .ask-hero > p,
.keyboard-visible .ask-prompt-list { display: none; }
.keyboard-visible .ask-form { margin-top: 6px; }
.keyboard-visible body:has(#homeAskForm input:focus) .home-action-grid .hero-card { display: none; }
.keyboard-visible body:has(#homeAskForm input:focus) .home-detail-grid { margin-top: 0; padding-bottom: 0; }
.keyboard-visible body:has(#homeAskForm input:focus) .query-action-card { min-height: 0; padding: 12px; }
.keyboard-visible body:has(#homeAskForm input:focus) .query-action-card > :not(.home-query-form) { display: none; }
.keyboard-visible body:has(#homeAskForm input:focus) .home-query-form { margin-top: 0; }
.keyboard-visible .capture-content { padding-top: 4px; }
.keyboard-visible .capture-dialog.new-contact-review .dialog-header { min-height: 54px; padding: 7px 12px; }
.keyboard-visible .capture-dialog.new-contact-review .draft-actions { position: static; }


@media (max-width: 800px) and (max-height: 600px) {
  .keyboard-visible .ask-hero h2 { display: none; }
  .keyboard-visible .ask-form textarea { height: 44px; min-height: 44px; max-height: 44px; }
}

@media (max-width: 350px) and (max-height: 600px) {
  .keyboard-visible .group-member-picker-dialog .dialog-header { min-height: 54px; padding: 6px 10px; }
  .keyboard-visible .group-member-picker-dialog .dialog-identity strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .keyboard-visible .group-member-picker-dialog .dialog-identity span:last-child { display: none; }
  .keyboard-visible .group-member-picker-dialog .capture-content { padding: 4px 12px 0; }
}

/* A landscape keyboard can leave only a few lines of height. Use the actual
   visual viewport rather than orientation queries (which keyboards can alter).
   Keep the same textarea mounted so rotation preserves dictation and selection. */
.short-keyboard-viewport .note-composer-dialog .capture-content {
  padding: 6px max(8px, env(safe-area-inset-right)) 14px max(8px, env(safe-area-inset-left));
}
.short-keyboard-viewport .note-composer-dialog .dictation-stage {
  grid-template-rows: minmax(0, 1fr);
  max-width: none;
  min-height: 0;
  padding: 0;
  gap: 0;
}
.short-keyboard-viewport .note-composer-heading,
.short-keyboard-viewport .note-composer-close { display: none; }
.short-keyboard-viewport .note-composer-view .dictation-form {
  grid-template-columns: minmax(0, 1fr) 112px;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  margin: 0;
}
.short-keyboard-viewport .dictation-form .note-composer-field textarea {
  padding: 10px 64px 10px 12px;
  line-height: 1.45;
}
.short-keyboard-viewport .note-dictate-button { right: 10px; bottom: 10px; }
.short-keyboard-viewport .note-composer-view .dictation-actions {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.short-keyboard-viewport .note-composer-view .dictation-actions .button {
  flex: 0 0 auto;
  min-height: 44px;
  width: 100%;
  padding: 8px;
}

/* Two stacked 44px buttons do not fit once browser chrome and the keyboard
   leave less than 120px. Keep both actions in one row beside the note. */
.tiny-keyboard-viewport .note-composer-view .dictation-form {
  grid-template-columns: minmax(0, 1fr) 208px;
}
.tiny-keyboard-viewport .note-composer-view .dictation-actions {
  flex-direction: row;
  align-items: center;
}
.tiny-keyboard-viewport .note-composer-view .dictation-actions .button {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

/* All editable dialogs share a bounded field area and an action row. Keep the
   available space in the field scroller, not extra padding under the buttons. */
.keyboard-visible .capture-dialog.form-editor-dialog .capture-content { padding: 0; overflow: hidden; }
.keyboard-visible .capture-dialog.form-editor-dialog .draft-actions { margin: 0; padding: 8px 16px; }
.keyboard-visible .form-editor-dialog .reminder-fields { overflow: visible; min-width: 0; }
/* This longer editor keeps one field scroller through keyboard transitions.
   A textarea collapsing on blur can move an Add button between tap and click. */
.capture-dialog.form-editor-dialog.contact-details-dialog { height: min(820px, calc(var(--visual-viewport-height) - 16px)); }
.capture-dialog.form-editor-dialog.contact-details-dialog .dialog-shell { height: 100%; max-height: none; }
.capture-dialog.form-editor-dialog.contact-details-dialog .dialog-header { flex-shrink: 0; min-height: 64px; padding: 12px 16px; }
.capture-dialog.form-editor-dialog.contact-details-dialog .capture-content { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.capture-dialog.form-editor-dialog.contact-details-dialog .draft-layout { width: 100%; height: 100%; min-height: 0; }
.capture-dialog.form-editor-dialog.contact-details-dialog .draft-form { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 0; }
.capture-dialog.form-editor-dialog.contact-details-dialog .edit-form-fields { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 16px; align-content: start; }
.capture-dialog.form-editor-dialog.contact-details-dialog .draft-actions { position: static; margin: 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.keyboard-visible .capture-dialog.form-editor-dialog.contact-details-dialog .draft-actions { padding-bottom: 8px; }
.capture-dialog.form-editor-dialog.contact-details-dialog .edit-form-fields textarea,
.keyboard-visible .capture-dialog.form-editor-dialog.contact-details-dialog .edit-form-fields textarea:focus { height: 132px; min-height: 132px; max-height: none; resize: vertical; }
.keyboard-visible .feedback-header,
.keyboard-visible .feedback-footer { flex-shrink: 0; }
.keyboard-visible .feedback-body,
.keyboard-visible .profile-body { align-content: start; }
.keyboard-visible .feedback-footer { padding: 8px 16px; }
.keyboard-visible :is(.group-member-picker-dialog, .group-assignment-picker-dialog) .dialog-header { flex-shrink: 0; min-height: 64px; padding: 8px 12px; }
.keyboard-visible :is(.group-member-picker-dialog, .group-assignment-picker-dialog) .dialog-identity,
.keyboard-visible :is(.group-member-picker-dialog, .group-assignment-picker-dialog) .dialog-identity > div { min-width: 0; }
.keyboard-visible :is(.group-member-picker-dialog, .group-assignment-picker-dialog) .dialog-identity strong,
.keyboard-visible :is(.group-member-picker-dialog, .group-assignment-picker-dialog) .dialog-identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* In short landscape windows, place actions beside the editing area so the
   keyboard leaves room for text. Normal touch targets and all fields remain. */
.short-keyboard-viewport .form-editor-dialog .dialog-header,
.short-keyboard-viewport :is(#feedbackDialog, #profileDialog) .feedback-header { display: none; }
.short-keyboard-viewport .form-editor-dialog .draft-form,
.short-keyboard-viewport :is(#feedbackDialog, #profileDialog) .feedback-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: minmax(0, 1fr);
}
.short-keyboard-viewport .form-editor-dialog .draft-actions,
.short-keyboard-viewport :is(#feedbackDialog, #profileDialog) .feedback-footer { flex-direction: column; justify-content: center; padding: 6px 8px; border-top: 0; border-left: 1px solid var(--line); gap: 6px; }
.short-keyboard-viewport .form-editor-dialog .draft-actions .button { flex: 0 0 auto; width: 100%; min-height: 44px; padding-inline: 8px; white-space: nowrap; }
.short-keyboard-viewport :is(#feedbackDialog, #profileDialog) .feedback-footer > div { flex-direction: column; width: 100%; margin: 0; gap: 6px; }
.short-keyboard-viewport :is(#feedbackDialog, #profileDialog) .feedback-footer .button { min-height: 44px; padding-inline: 8px; white-space: nowrap; }

.keyboard-visible :is(.group-member-picker, .group-assignment-picker, .group-merge-form) { width: 100%; grid-template-rows: minmax(0, 1fr) auto; }
.keyboard-visible .picker-fields { display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; gap: 10px; }
.keyboard-visible .picker-fields > :is(.contact-picker-list, .group-choice-grid, .group-merge-list) { flex: 1; min-height: 0; max-height: none; }
/* Generic search controls reserve width in a horizontal toolbar. These fields
   become a column above the keyboard: never turn that basis into a full-height
   search wrapper that squeezes the results to zero. */
.keyboard-visible .picker-fields > :is(.search-control, .group-new-section, .contact-merge-search) { flex: 0 0 auto; }
.short-keyboard-viewport :is(.group-member-picker-dialog, .group-assignment-picker-dialog, .contact-picker-review) .dialog-header { display: none; }
.short-keyboard-viewport :is(.group-member-picker, .group-assignment-picker, .group-merge-form) { grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: minmax(0, 1fr); }
.short-keyboard-viewport :is(.group-member-picker, .group-assignment-picker, .group-merge-form) .draft-actions { flex-direction: column; justify-content: center; margin: 0; padding: 6px 0 6px 8px; border-top: 0; border-left: 1px solid var(--line); }
.short-keyboard-viewport :is(.group-member-picker, .group-assignment-picker, .group-merge-form) .draft-actions .button { flex: 0 0 auto; min-height: 44px; padding-inline: 8px; white-space: nowrap; }
.short-keyboard-viewport .picker-fields:has(input[name="newGroupName"]:focus) > .group-assignment-search,
.short-keyboard-viewport .picker-fields:has(input[name="newGroupName"]:focus) .group-choice-grid > :not(.group-new-section) { display: none; }
.short-keyboard-viewport .picker-fields:has(input[name="newGroupName"]:focus) { overflow-y: auto; }
.short-keyboard-viewport .ask-hero h2 { display: none; }
/* A wide phone is still a phone while its keyboard is open. Do not spend its
   short search window on the desktop sidebar/header above the result page. */
.short-keyboard-viewport body:has(#mainContent input:focus, #askForm textarea:focus) .app-shell { display: block; }
.short-keyboard-viewport body:has(#mainContent input:focus, #askForm textarea:focus) :is(.sidebar, .topbar) { display: none; }
.short-keyboard-viewport body:has(#mainContent input:focus, #askForm textarea:focus) .main-content { width: 100%; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
/* Apply the composer's very-short-window fallback to the other editors too. */
.tiny-keyboard-viewport :is(.form-editor-dialog .draft-actions, #feedbackDialog .feedback-footer, #profileDialog .feedback-footer, .group-member-picker .draft-actions, .group-assignment-picker .draft-actions) { flex-direction: row; align-items: center; }
.tiny-keyboard-viewport .form-editor-dialog .draft-actions .button { width: auto; }
.tiny-keyboard-viewport :is(#feedbackDialog, #profileDialog) .feedback-footer > div { flex-direction: row; width: auto; }
.tiny-keyboard-viewport .contact-picker-review.contact-picker-search-active .draft-form { grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: minmax(0, 1fr); }
.tiny-keyboard-viewport .contact-picker-review.contact-picker-search-active .draft-form:has(.contact-chooser.is-searching) { grid-template-columns: minmax(0, 1fr); }
.tiny-keyboard-viewport .contact-picker-review.contact-picker-search-active .draft-actions { flex-direction: row; align-items: center; margin: 0; padding: 6px 0 6px 8px; border-top: 0; border-left: 1px solid var(--line); }
.tiny-keyboard-viewport .contact-picker-review.contact-picker-search-active .draft-actions .button { flex: 0 0 auto; min-height: 44px; padding-inline: 8px; white-space: nowrap; }
.short-keyboard-viewport .ask-form textarea { max-height: clamp(44px, calc(var(--visual-viewport-height) - 40px), 132px); }

/* Merge pickers share the bounded search/results/footer layout. Only results
   scroll, so the last match remains reachable above the keyboard and buttons. */
.keyboard-visible .group-merge-form { height: 100%; min-height: 0; gap: 10px; }
.keyboard-visible .group-merge-form .draft-actions { position: static; margin: 0; padding: 4px 0; }
.keyboard-visible .capture-dialog:has(.group-merge-form) .capture-content { padding-top: 6px; }
.keyboard-visible .capture-dialog:has(.group-merge-form) .dialog-header { min-height: 48px; padding: 4px 12px; }
.keyboard-visible .capture-dialog:has(.group-merge-form) #dialogSubtitle { display: none; }
.keyboard-visible .group-merge-form .merge-picker-help { display: none; }
.keyboard-visible .group-merge-form .contact-merge-search { font-size: 0; gap: 0; }
.short-keyboard-viewport .group-merge-form .draft-actions { padding: 6px 0 6px 8px; }

/* Contact defaults stay compact; populated details are always visible. */
.preferences-dialog.feedback-dialog { position: fixed; inset: 0; margin: auto; width: min(480px, calc(100vw - 32px)); height: fit-content; max-height: calc(var(--app-height, 100dvh) - 32px); border-radius: 22px; }
.preferences-dialog .feedback-shell { height: auto; min-height: 0; max-height: calc(var(--app-height, 100dvh) - 32px); }
.usage-options { gap: 12px; }
.usage-option { width: 100%; min-height: 52px; font-size: 17px; }
.contact-detail-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.contact-detail-fields [hidden] { display: none; }
.customize-fields-link { justify-self: start; min-height: 44px; text-align: left; }
.contact-fields-choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.contact-fields-choices legend { font-weight: 600; margin-bottom: 8px; }
.contact-field-choice { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.contact-field-choice input { width: 20px; height: 20px; accent-color: var(--accent, #9b5b39); }
.contact-identity-family { overflow-wrap: anywhere; }
.contact-identity-family span { font-weight: 600; }
.form-error { color: #9a2424; font-size: 14px; margin: 0; }
@media (max-width: 600px) { .contact-detail-fields { grid-template-columns: minmax(0, 1fr); } }

.preferences-dialog .feedback-header p:last-child { display: block; margin: 8px 0 0; font-size: 14px; line-height: 1.5; }

.preferences-body { display: grid; gap: 15px; min-height: 0; padding: 20px; overflow: auto; overscroll-behavior: contain; }
.preferences-body.usage-options { gap: 12px; }

.settings-header { gap: 8px; padding: 18px 16px; }
.settings-header h2 { flex: 1; min-width: 0; font-size: 24px; }
.settings-header .icon-button { flex-shrink: 0; }
.settings-dialog[data-section="fields"] [data-close-settings] { display: none; }
.settings-dialog[data-section="fields"] .settings-header h2 { font-size: 22px; }
.settings-dialog [hidden] { display: none !important; }
.settings-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--forest); font: 650 var(--type-body)/1.4 var(--sans); text-align: left; cursor: pointer; }
.settings-entry:hover { background: var(--forest-soft); }
.settings-entry > span:last-child { display: flex; flex-shrink: 0; }
.settings-theme { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.settings-theme legend { padding: 0 6px; color: var(--forest); font-size: var(--type-body); font-weight: 650; }
.theme-toggle { display: flex; padding: 4px; border-radius: 12px; background: var(--paper-deep); }
.theme-toggle label { position: relative; flex: 1; cursor: pointer; }
.theme-toggle input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme-toggle span { display: grid; place-items: center; min-height: 44px; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 650; }
.theme-toggle input:checked + span { background: var(--card); color: var(--forest); box-shadow: var(--shadow-sm); }
.theme-toggle input:focus-visible + span { outline: 3px solid var(--forest-mid); outline-offset: -3px; }
.theme-toggle input:disabled + span { opacity: .6; cursor: wait; }
.settings-detail { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.settings-help { flex-shrink: 0; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--forest-soft); }
.settings-dialog #contactFieldChoices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.settings-dialog .contact-field-choice { min-height: 44px; }
.settings-preview-section { min-width: 0; }
.settings-preview-section h3 { margin: 0 0 10px; color: var(--muted); font-size: var(--type-meta); font-weight: 700; }
.settings-preview { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.settings-contact-preview.detail-top-contact { grid-template-columns: 44px minmax(0, 1fr); min-height: 160px; margin: 0; }
.settings-dialog .form-hint { margin: 0; line-height: 1.5; }

/* A captured note only needs an identity decision, not a second contact form. */
.contact-clarification-dialog { width: min(520px, calc(100vw - 24px)); }
@media (max-width: 800px) {
  .contact-clarification-dialog { width: 100%; }
}
.contact-clarification-dialog .dialog-identity > div { min-width: 0; }
.contact-clarification-dialog .dialog-identity strong { white-space: normal; overflow-wrap: anywhere; }
.contact-clarification { display: grid; gap: 21px; min-width: 0; }
.clarification-summary { padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--type-meta); }
.clarification-summary summary { min-height: 32px; padding: 5px 0; cursor: pointer; }
.clarification-summary p { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.clarification-contact { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.clarification-contact:hover { background: var(--forest-soft); }
.clarification-contact > span:not(.person-avatar) { display: grid; min-width: 0; flex: 1; gap: 5px; }
.clarification-contact strong { font-size: var(--type-body); font-weight: 650; overflow-wrap: anywhere; }
.clarification-contact small { color: var(--muted); font-size: var(--type-meta); line-height: 1.45; overflow-wrap: anywhere; }
.clarification-contact > svg { flex-shrink: 0; color: var(--forest); }
.clarification-contact .person-avatar { flex: 0 0 42px; width: 42px; height: 42px; }
.clarification-new { min-height: 52px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--forest); background: var(--card); }
.clarification-new > svg:first-child { margin-right: 3px; }
.clarification-section-label { display: block; margin: 0; color: var(--ink); font-family: var(--sans); font-size: var(--type-body); font-weight: 650; line-height: 1.4; letter-spacing: normal; text-transform: none; }
.clarification-suggestions h3 { margin-bottom: 4px; }
.clarification-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--type-meta); }
.clarification-divider::before, .clarification-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.clarification-search { display: grid; gap: 9px; }
.clarification-search-heading { display: flex; align-items: center; gap: 12px; }
.clarification-search-back { display: none; align-items: center; flex: 0 0 auto; gap: 5px; min-height: 44px; padding: 0 8px 0 0; border: 0; background: transparent; color: var(--forest); font: inherit; cursor: pointer; }
.clarification-empty { color: var(--muted); font-size: var(--type-meta); line-height: 1.5; }
.clarification-error { margin: 0; color: var(--red); font-size: var(--type-meta); }
.clarification-reminder { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.clarification-reminder legend { padding: 0 4px; font-size: var(--type-body); }
.clarification-reminder p { margin: 0; color: var(--muted); font-size: var(--type-meta); }
.contact-clarification [aria-busy="true"] { opacity: .65; }
.keyboard-visible .contact-clarification-dialog .capture-content { overflow-y: auto; }
.keyboard-visible .contact-clarification-dialog .dialog-header { flex-shrink: 0; }

/* Search owns the visible window, so its results never depend on scrolling
   past the new-contact option and suggestions when the keyboard opens. */
.contact-clarification-dialog.clarification-search-active { height: min(620px, calc(var(--visual-viewport-height, 100dvh) - 24px)); }
.clarification-search-active .dialog-shell { height: 100%; max-height: none; }
.clarification-search-active .dialog-header { min-height: 54px; flex-shrink: 0; padding: 6px 12px; }
.clarification-search-active .assistant-orb { width: 28px; height: 28px; flex-basis: 28px; }
.clarification-search-active #dialogSubtitle { display: none; }
.clarification-search-active .capture-content { min-height: 0; flex: 1; overflow: hidden; padding: 8px 16px 12px; }
.clarification-search-active .contact-clarification { display: flex; height: 100%; min-height: 0; flex-direction: column; gap: 0; }
.clarification-search-active .contact-clarification > :not(.clarification-search) { display: none; }
.clarification-search-active .clarification-search { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 8px; overflow: hidden; }
.clarification-search-active .clarification-search-heading,
.clarification-search-active .clarification-search .field { flex: 0 0 auto; }
.clarification-search-active .clarification-search-back { display: inline-flex; }
.clarification-search-active [data-clarification-results] { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.keyboard-visible .contact-clarification-dialog.clarification-search-active { height: calc(var(--visual-viewport-height) - 4px); }
.keyboard-visible .clarification-search-active .capture-content { overflow: hidden; }

/* New-contact and group-assignment sheets keep their action row outside the
   field scroller even after the keyboard closes. */
.capture-dialog.new-contact-review,
.capture-dialog.group-assignment-picker-dialog { height: min(760px, calc(var(--visual-viewport-height) - 8px)); }
.capture-dialog:is(.new-contact-review, .group-assignment-picker-dialog) .dialog-shell { height: 100%; max-height: none; }
.capture-dialog:is(.new-contact-review, .group-assignment-picker-dialog) .dialog-header { flex-shrink: 0; }
.capture-dialog:is(.new-contact-review, .group-assignment-picker-dialog) .capture-content { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.capture-dialog.new-contact-review .draft-layout { width: 100%; height: 100%; min-height: 0; }
.capture-dialog.new-contact-review .draft-form,
.capture-dialog.group-assignment-picker-dialog .group-assignment-picker { width: 100%; height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 0; }
.capture-dialog.new-contact-review .edit-form-fields { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.capture-dialog.group-assignment-picker-dialog .picker-fields { display: flex; min-height: 0; flex-direction: column; padding: 16px; overflow: hidden; }
.capture-dialog.group-assignment-picker-dialog .group-assignment-search { flex: 0 0 auto; }
.capture-dialog.group-assignment-picker-dialog .group-choice-grid { flex: 1; min-height: 0; max-height: none; }
.capture-dialog:is(.new-contact-review, .group-assignment-picker-dialog) .draft-actions { position: static; margin: 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.group-new-section, .group-new-field, .group-new-input-row,
.group-new-input-row input { min-width: 0; max-width: 100%; }

.profile-shell > .profile-body { min-height: 0; flex: 1; overscroll-behavior: contain; }
.profile-shell > :is(.feedback-header, .feedback-footer) { flex-shrink: 0; }
.keyboard-visible .capture-dialog.form-editor-dialog.contact-picker-review.contact-picker-search-active .capture-content { padding: 8px 16px 0; }
.keyboard-visible .capture-dialog.form-editor-dialog.contact-picker-review.contact-picker-search-active .draft-actions { margin-inline: -16px; }

/* A hardware keyboard can leave Safari's field-accessory bar over an
   otherwise full visual viewport. Software keyboards already reduce it. */
.keyboard-accessory-only :is(.capture-dialog, .feedback-dialog) {
  height: calc(var(--visual-viewport-height) - 48px);
  max-height: calc(var(--visual-viewport-height) - 48px);
}
.keyboard-visible .capture-dialog:is(.new-contact-review, .group-assignment-picker-dialog) .draft-actions { padding-bottom: 8px; }
.short-keyboard-viewport .capture-dialog.new-contact-review .draft-form,
.short-keyboard-viewport .capture-dialog.group-assignment-picker-dialog .group-assignment-picker { grid-template-columns: minmax(0, 1fr) max-content; grid-template-rows: minmax(0, 1fr); }
.short-keyboard-viewport .capture-dialog:is(.new-contact-review, .group-assignment-picker-dialog) .draft-actions { padding: 6px 8px; border-top: 0; border-left: 1px solid var(--line); }
#confirmMessage { white-space: pre-line; }

.keyboard-visible .capture-dialog.group-assignment-picker-dialog .picker-fields { padding: 4px 16px; gap: 8px; }

.vault-device-row { flex-wrap: wrap; }
.vault-device-row > span { flex: 1 1 180px; }
.vault-device-row button { min-height: 40px; }
