:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #ffffff;
  --surface-secondary: #f7f7fa;
  --separator: rgba(60, 60, 67, .16);
  --separator-soft: rgba(60, 60, 67, .09);
  --label: #111113;
  --secondary: rgba(60, 60, 67, .68);
  --tertiary: rgba(60, 60, 67, .46);
  --blue: #007aff;
  --blue-soft: rgba(0, 122, 255, .11);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, .1);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, .11);
  --green: #34c759;
  --shadow: 0 10px 35px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--label); background: var(--bg); font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, textarea, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid rgba(0, 122, 255, .45); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 100; top: -80px; left: 12px; padding: 11px 15px; color: white; background: var(--blue); border-radius: 12px; font-weight: 650; }
.skip-link:focus { top: 12px; }
.app-shell { width: min(100%, 820px); margin: 0 auto; padding: env(safe-area-inset-top) 16px calc(42px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; z-index: 10; top: 0; min-height: 66px; display: flex; align-items: center; justify-content: space-between; margin-inline: -16px; padding: 8px 16px; background: rgba(242, 242, 247, .78); border-bottom: .5px solid var(--separator-soft); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); }
.brand-lockup, .identity { display: flex; align-items: center; min-width: 0; }
.brand-lockup { gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; color: white; background: var(--blue); border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 122, 255, .23); }
.brand-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin: 0; font-size: 17px; line-height: 1.15; font-weight: 650; letter-spacing: -.01em; }
.eyebrow { margin: 0 0 2px; color: var(--secondary); font-size: 11px; line-height: 1.15; font-weight: 550; }
.icon-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; color: var(--blue); border: 0; border-radius: 50%; background: transparent; transition: background .15s ease, transform .12s ease; }
.icon-button:hover { background: var(--blue-soft); }
.icon-button:active { transform: scale(.93); }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hero { padding: 28px 4px 18px; }
.hero h2 { margin: 0 0 7px; font-size: clamp(34px, 9vw, 44px); line-height: 1.04; font-weight: 720; letter-spacing: -.035em; }
.hero > div > p { max-width: 570px; margin-bottom: 0; color: var(--secondary); font-size: 15px; line-height: 1.42; }
.hero .inbox-summary { display: inline-flex; margin-top: 13px; padding: 7px 11px; color: var(--blue); background: var(--blue-soft); border-radius: 999px; font-size: 12px; line-height: 1; font-weight: 650; }
.filters { position: sticky; z-index: 8; top: 66px; margin: 0 -16px; padding: 8px 16px 13px; overflow: hidden; background: linear-gradient(to bottom, rgba(242,242,247,.96) 75%, rgba(242,242,247,0)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
#filter-list { display: flex; gap: 5px; padding: 3px; overflow-x: auto; background: rgba(118, 118, 128, .12); border-radius: 11px; scrollbar-width: none; }
#filter-list::-webkit-scrollbar { display: none; }
.filter-button { flex: 1 0 auto; min-height: 34px; padding: 0 11px; color: var(--secondary); border: 0; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 580; white-space: nowrap; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.filter-button[aria-pressed="true"] { color: var(--label); background: var(--surface-solid); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.filter-count { margin-left: 5px; color: var(--tertiary); font-variant-numeric: tabular-nums; }
.content { padding-top: 3px; }
.call-list { display: grid; gap: 14px; }
.call-card { position: relative; overflow: hidden; background: var(--surface); border: .5px solid var(--separator-soft); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.call-card[data-priority="true"] { border-color: rgba(255,149,0,.3); }
.call-card[data-priority="true"]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--orange); }
.card-main { padding: 18px 18px 16px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.identity { gap: 12px; }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.identity h3 { max-width: 50vw; margin: 0 0 3px; overflow: hidden; color: var(--label); font-size: 17px; line-height: 1.22; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.phone { color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
a.phone { color: var(--blue); text-decoration: none; }
.direction { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; color: var(--secondary); background: rgba(118,118,128,.1); border-radius: 999px; font-size: 10px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; }
.direction.missed { color: var(--red); background: var(--red-soft); }
.direction.outgoing { color: var(--blue); background: var(--blue-soft); }
.metadata { display: flex; flex-wrap: wrap; gap: 5px 14px; margin: 13px 0 0; color: var(--tertiary); font-size: 11px; }
.priority-reason { display: flex; gap: 8px; margin-top: 14px; padding: 11px 12px; color: #8a5000; background: var(--orange-soft); border-radius: 13px; font-size: 12px; line-height: 1.42; }
.priority-reason strong { color: inherit; }
.copy-block { margin-top: 15px; }
.copy-label { margin-bottom: 4px; color: var(--tertiary); font-size: 11px; font-weight: 580; text-transform: none; }
.copy-block p:last-child { margin-bottom: 0; color: var(--label); font-size: 14px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.action-copy { padding: 11px 12px; background: var(--surface-secondary); border-radius: 13px; }
.action-copy .copy-label { color: var(--blue); }
.audio-wrap { display: grid; gap: 8px; margin-top: 15px; padding: 11px 12px; background: var(--surface-secondary); border-radius: 14px; }
.audio-wrap > span:first-child { color: var(--secondary); font-size: 11px; font-weight: 560; }
.recording-play { width: 100%; min-height: 44px; padding: 0 16px; color: #fff; background: var(--blue); border: 0; border-radius: 12px; font-size: 14px; font-weight: 620; }
.recording-play:active { transform: scale(.985); }
.recording-play:disabled { opacity: .62; }
.recording-status { color: var(--tertiary) !important; min-height: 14px; }
audio { width: 100%; height: 38px; accent-color: var(--blue); }
audio[hidden] { display: none; }
.card-toolbar { display: flex; align-items: center; gap: 2px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom) * 0); overflow-x: auto; background: var(--surface-secondary); border-top: .5px solid var(--separator-soft); scrollbar-width: none; }
.card-toolbar::-webkit-scrollbar { display: none; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 46px; min-height: 44px; flex: 1 0 auto; padding: 0 9px; color: var(--blue); background: transparent; border: 0; border-radius: 11px; font-size: 11px; font-weight: 580; text-decoration: none; transition: background .15s ease, transform .12s ease; }
.tool-button:hover { background: var(--blue-soft); }
.tool-button:active { transform: scale(.96); }
.tool-button[data-active="true"] { color: var(--orange); }
.tool-button[data-action="archive"] { color: var(--secondary); }
.tool-button[data-action="trash"] { color: #ff3b30; }
.tool-button[data-action="project"][data-active="true"] { color: var(--blue); background: var(--blue-soft); }
.tool-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.call-button { color: white; background: var(--blue); }
.call-button:hover { color: white; background: #006ee6; }
.details { padding: 0 18px 18px; background: var(--surface-solid); border-top: .5px solid var(--separator); }
.details section { padding-top: 16px; }
.details h4 { margin: 0 0 6px; color: var(--secondary); font-size: 12px; font-weight: 650; }
.details p { margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-row { display: flex; gap: 8px; }
.note-row input, textarea { color: var(--label); background: var(--surface-secondary); border: .5px solid var(--separator); }
.note-row input { min-width: 0; min-height: 44px; flex: 1; padding: 0 13px; border-radius: 12px; }
.note-row button { min-width: 68px; min-height: 44px; color: white; background: var(--blue); border: 0; border-radius: 12px; font-weight: 630; }
.saved-note { margin-bottom: 10px !important; color: var(--label) !important; }
.state-card { display: flex; align-items: center; gap: 14px; min-height: 102px; padding: 19px; color: var(--secondary); background: var(--surface); border: .5px solid var(--separator-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.state-card strong { display: block; margin-bottom: 3px; color: var(--label); font-size: 15px; }
.state-card p { margin: 0; font-size: 13px; line-height: 1.45; }
.state-icon, .spinner { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; color: var(--blue); background: var(--blue-soft); border-radius: 50%; }
.spinner::after { content: ""; width: 17px; height: 17px; border: 2px solid rgba(0,122,255,.18); border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
.state-error .state-icon { color: var(--red); background: var(--red-soft); }
.text-button { min-height: 44px; margin-top: 4px; padding: 0; color: var(--blue); background: transparent; border: 0; font-weight: 600; }
.ask-button, .primary-button, .secondary-button { min-height: 46px; padding: 0 17px; border-radius: 13px; font-weight: 620; }
.ask-button, .primary-button { color: white; background: var(--blue); border: 0; }
.secondary-button { color: var(--blue); background: transparent; border: .5px solid var(--separator); }
.destructive-button { min-height: 46px; padding: 0 17px; color: white; background: #ff3b30; border: 0; border-radius: 13px; font-weight: 620; }
.followup-summary { margin-top: 14px; padding: 14px; background: var(--surface-secondary); border: .5px solid var(--separator-soft); border-radius: 14px; }
.followup-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.followup-summary p { margin: 7px 0 4px; color: var(--label); }
.followup-summary small { color: var(--secondary); }
.plan-priority { padding: 4px 8px; border-radius: 999px; color: var(--secondary); background: rgba(118,118,128,.14); font-size: 11px; text-transform: capitalize; }
.plan-priority.important { color: #9a5b00; background: rgba(255,149,0,.16); }
.plan-priority.urgent { color: #d70015; background: rgba(255,59,48,.14); }
.form-grid { display: grid; gap: 15px; }
.form-grid > p { margin: 0; color: var(--secondary); }
.form-grid label { display: grid; gap: 7px; color: var(--secondary); font-size: 13px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-height: 46px; padding: 11px 12px; color: var(--label); background: var(--surface-secondary); border: .5px solid var(--separator); border-radius: 11px; font: inherit; }
.form-grid textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compact-modal { text-align: center; }
.compact-modal .modal-body { padding-top: 26px; }
.compact-modal h2 { margin: 10px 0 8px; font-size: 22px; }
.compact-modal p { color: var(--secondary); line-height: 1.45; }
.destructive-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto; color: #ff3b30; background: rgba(255,59,48,.12); border-radius: 50%; font-size: 23px; }
dialog { width: min(calc(100% - 20px), 610px); max-height: calc(100vh - 20px); padding: 0; color: var(--label); background: var(--surface-solid); border: .5px solid var(--separator); border-radius: 24px; box-shadow: 0 28px 80px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(0,0,0,.32); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.modal-card { display: flex; max-height: calc(100vh - 20px); flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; background: var(--surface); border-bottom: .5px solid var(--separator); }
.modal-header h2 { margin: 0; font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
.close-button { color: var(--secondary); background: rgba(118,118,128,.14); font-size: 25px; }
.modal-body { padding: 19px; overflow-y: auto; }
.modal-body > p { color: var(--secondary); font-size: 13px; line-height: 1.5; }
.modal-body label { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 620; }
textarea { width: 100%; min-height: 125px; padding: 13px; resize: vertical; border-radius: 14px; line-height: 1.5; }
textarea::placeholder, input::placeholder { color: var(--tertiary); }
.recipient-card, .proposal, .safety-note { border-radius: 15px; background: var(--surface-secondary); }
.recipient-card { display: flex; align-items: center; min-height: 58px; margin: 14px 0 18px; padding: 11px 13px; }
.recipient-card span { display: grid; gap: 3px; }
.recipient-card small { color: var(--blue); font-variant-numeric: tabular-nums; }
.prompt-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.prompt-suggestions button { min-height: 44px; padding: 0 12px; color: var(--blue); background: var(--blue-soft); border: 0; border-radius: 999px; font-size: 11px; }
.safety-note { display: flex; gap: 11px; padding: 13px; color: var(--secondary); font-size: 12px; line-height: 1.45; }
.safety-note strong { display: block; margin-bottom: 2px; color: var(--label); }
.safety-note p { margin: 0; }
.request-review { display: grid; gap: .5px; margin: 16px 0; overflow: hidden; background: var(--separator); border-radius: 15px; }
.request-review div { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 11px 12px; background: var(--surface-solid); }
.request-review dt { color: var(--secondary); font-size: 11px; font-weight: 600; }
.request-review dd { margin: 0; color: var(--label); font-size: 13px; overflow-wrap: anywhere; }
.proposal { margin-top: 18px; padding: 15px; }
.proposal h3 { color: var(--blue); font-size: 12px; }
.proposal p { margin: 0; color: var(--label); line-height: 1.58; white-space: pre-wrap; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 19px calc(13px + env(safe-area-inset-bottom)); background: var(--surface); border-top: .5px solid var(--separator); }
.toast-region { position: fixed; z-index: 1000; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(calc(100% - 28px), 410px); transform: translateX(-50%); pointer-events: none; }
.toast { margin-top: 8px; padding: 13px 15px; color: white; background: rgba(28,28,30,.94); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.2); font-size: 13px; text-align: center; animation: toast-in .2s ease-out; backdrop-filter: blur(18px); }
.toast.error { background: rgba(190,25,20,.95); }
.noscript { margin: 20px; padding: 16px; background: var(--surface); border-radius: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 559px) {
  .card-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-button { width: 100%; min-width: 0; }
  .identity h3 { max-width: 43vw; }
  .request-review div { grid-template-columns: 70px 1fr; }
}
@media (min-width: 680px) {
  .app-shell { padding-inline: 26px; }
  .topbar, .filters { margin-inline: -26px; padding-inline: 26px; }
  .card-main { padding: 21px 22px 18px; }
  .details { padding-inline: 22px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: rgba(28, 28, 30, .88);
    --surface-solid: #1c1c1e;
    --surface-secondary: #2c2c2e;
    --separator: rgba(84, 84, 88, .65);
    --separator-soft: rgba(84, 84, 88, .42);
    --label: #ffffff;
    --secondary: rgba(235, 235, 245, .66);
    --tertiary: rgba(235, 235, 245, .42);
    --blue: #0a84ff;
    --blue-soft: rgba(10, 132, 255, .16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, .16);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, .16);
    --green: #30d158;
    --shadow: 0 12px 36px rgba(0,0,0,.28);
  }
  .topbar { background: rgba(0,0,0,.76); }
  .filters { background: linear-gradient(to bottom, rgba(0,0,0,.95) 75%, rgba(0,0,0,0)); }
  .priority-reason { color: #ffb340; }
  .filter-button[aria-pressed="true"] { background: #636366; box-shadow: none; }
  .toast { background: rgba(58,58,60,.96); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
