/* Backbook app. Same system as the landing page: white, ink, ruled lines, one sky-blue highlight
   that always means "needs a follow-up", green only for done. */
:root {
  --bg: #ffffff;
  --ink: #0e1726;
  --muted: #5b6474;
  --rule: #e1e5eb;
  --mark: #c4e3ff;
  --wash: #f0f8ff;
  --blue: #1a73c8;
  --green: #11804c;
  --red: #c3341f;

  --sans: "Host Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Host Grotesk", "Helvetica Neue", Arial, sans-serif; /* figures use tabular numbers instead of a monospace face */

  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);

  --wrap: 1180px;
  --pad: max(16px, env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e14; --ink: #e8edf5; --muted: #98a1b0; --rule: #232a36;
    --mark: #1d4a70; --wash: #0f1a26; --blue: #86c3ff; --green: #5ccf98; --red: #ff8a73;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e14; --ink: #e8edf5; --muted: #98a1b0; --rule: #232a36;
  --mark: #1d4a70; --wash: #0f1a26; --blue: #86c3ff; --green: #5ccf98; --red: #ff8a73;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--t-md)/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
mark { background: var(--mark); color: inherit; padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); }

.wordmark { font: 600 1.125rem/1 var(--sans); letter-spacing: -0.03em; text-decoration: none; flex: none; }

.today { font-size: var(--t-xs); color: var(--muted); flex: none; }
@media (max-width: 700px) {
  
  .wordmark { order: 1; }
  .today { order: 2; margin-left: auto; }
  
  
}

/* Page */
.page { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--pad) 96px; outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-head h1 { font-size: var(--t-xl); letter-spacing: -0.03em; }
.page-head .count { font: 400 var(--t-sm)/1 var(--mono); color: var(--muted); margin-left: 10px; letter-spacing: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; font: 500 var(--t-sm)/1 var(--sans); padding: 0.85em 1.1em; border: 1px solid var(--ink); border-radius: 3px; background: var(--ink); color: var(--bg); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn svg { width: 1em; height: 1em; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-done { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.link { background: none; border: 0; padding: 0.85em 0; font: 500 var(--t-sm)/1 var(--sans); color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 5px; cursor: pointer; }
.link:hover { text-decoration-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

.filter { background: none; border: 0; padding: 6px 0; font-size: var(--t-sm); color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; }
.filter:hover { color: var(--ink); }

.filter .n { font: 400 var(--t-xs)/1 var(--mono); margin-left: 4px; }

/* Due now list */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.row { border-bottom: 1px solid var(--rule); }
.row > button {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: baseline;
  background: none; border: 0; padding: 16px 0; text-align: left; cursor: pointer;
}
.row > button:hover { background: var(--wash); }

@media (min-width: 720px) { .row > button { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) 11rem; } }

/* Empty states */
.empty { border-top: 1px solid var(--ink); padding: 40px 0; display: grid; gap: 16px; max-width: 62ch; }
.empty h2 { font-size: var(--t-lg); }
.empty p { color: var(--muted); }

/* Import */
.drop {
  display: grid; justify-items: start; gap: 12px; padding: 32px; border: 1px dashed var(--muted); border-radius: 3px;
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
.drop:hover, .drop.over { background: var(--wash); border-color: var(--blue); }
.drop svg { width: 24px; height: 24px; }
.drop strong { font-weight: 500; font-size: var(--t-lg); letter-spacing: -0.01em; }
.drop span { color: var(--muted); font-size: var(--t-sm); }

.help h2 { font-size: var(--t-lg); margin-bottom: 12px; }
.help ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.help li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); color: var(--muted); }
.help li strong { color: var(--ink); font-weight: 500; }

.table-scroll { overflow-x: auto; min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th, td { text-align: left; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
thead th { font: 400 var(--t-xs)/1.3 var(--mono); color: var(--muted); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.mapping { min-width: 640px; }
.mapping td.head { font-family: var(--mono); font-size: var(--t-xs); white-space: nowrap; }
.mapping td.ex { font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select, input[type="text"], input[type="search"], input[type="password"], input[type="email"], textarea {
  font: 400 var(--t-sm)/1.3 var(--sans); color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 3px; padding: 8px 10px; min-height: 38px;
}
select:hover, input:hover, textarea:hover { border-color: var(--muted); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.status { font: 400 var(--t-xs)/1 var(--mono); white-space: nowrap; }
@media (max-width: 640px) {
  .mapping { min-width: 0; }
  .mapping thead { display: none; }
  .mapping tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .mapping tbody { border-top: 1px solid var(--ink); display: block; }
  .mapping td { border: 0; padding: 0; }
  .mapping td.head { grid-column: 1; grid-row: 1; }
  .mapping td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .mapping td.ex { grid-column: 1 / -1; max-width: none; }
  .mapping td:nth-child(3) { grid-column: 1 / -1; }
  .mapping select { width: 100%; }
}
::placeholder { color: var(--muted); opacity: .6; }
.status.sure { color: var(--green); }
.status.guess { color: var(--blue); }
.status.none { color: var(--muted); }
.check { margin: 24px 0; display: grid; gap: 6px; font-size: var(--t-sm); }
.check .bad { color: var(--red); }
.check .ok { color: var(--green); }
.issues { margin-top: 24px; }
.issues h3 { font-size: var(--t-md); margin-bottom: 8px; }
.issues ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-height: 280px; overflow-y: auto; }
.issues li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.issues li .mono { color: var(--muted); font-size: var(--t-xs); padding-top: 2px; }
.replace-note { font-size: var(--t-sm); color: var(--muted); margin: 16px 0; }

/* Clients table */
.search { width: 100%; max-width: 360px; }
.clients { min-width: 760px; }
.clients tbody tr { cursor: pointer; }
.clients tbody tr:hover { background: var(--wash); }

/* Activity */
.activity { min-width: 640px; }
.activity td.date { font-family: var(--mono); font-size: var(--t-xs); white-space: nowrap; color: var(--muted); }

/* Settings */
.settings { display: grid; gap: 48px; max-width: 760px; }
.settings section { display: grid; gap: 16px; }
.settings h2 { font-size: var(--t-lg); padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--t-sm); color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
.field small { font-size: var(--t-xs); color: var(--muted); }
.two { display: grid; gap: 16px; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } }
.saved { font: 400 var(--t-xs)/1 var(--mono); color: var(--green); min-height: 1em; }
.facts-line { font-size: var(--t-sm); color: var(--muted); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; font-size: var(--t-sm); }

/* Client sheet */
.sheet {
  margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(560px, 100%); max-width: 100%;
  border: 0; border-left: 1px solid var(--rule); padding: 0; background: var(--bg); color: var(--ink);
}
.sheet::backdrop { background: rgba(14, 23, 38, .28); }
.sheet[open] { animation: none; } /* opened many times a day: instant (the more it's used, the less it moves) */
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet-inner { display: grid; gap: 24px; padding: calc(20px + env(safe-area-inset-top, 0px)) 24px calc(32px + env(safe-area-inset-bottom, 0px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.sheet-head h2 { font-size: var(--t-xl); letter-spacing: -0.03em; }
.close { background: none; border: 1px solid var(--rule); border-radius: 3px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; flex: none; }
.close svg { width: 16px; height: 16px; }
.close:hover { border-color: var(--ink); }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--t-sm); }
.facts { margin: 0; border-top: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts dd.mono { font-size: var(--t-xs); padding-top: 2px; }
.composer { display: grid; gap: 12px; border-top: 1px solid var(--ink); padding-top: 16px; }
.composer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.channel { display: flex; gap: 18px; }
.channel button { background: none; border: 0; padding: 6px 0; font-size: var(--t-sm); color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; }
.channel button[aria-selected="true"] { color: var(--ink); text-decoration-color: var(--ink); }
.channel button[disabled] { opacity: .4; cursor: not-allowed; }
.composer select { font-size: var(--t-xs); }
.subject { width: 100%; }
.message { width: 100%; min-height: 200px; resize: vertical; font: 400 var(--t-md)/1.55 var(--sans); padding: 12px; }
.message[aria-busy="true"] { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font: 400 var(--t-xs)/1.4 var(--mono); color: var(--muted); }
.meta .warn { color: var(--red); }
.sheet .note { font-size: var(--t-sm); color: var(--muted); }
.sheet .note a { color: var(--ink); }
.sheet-status { font-size: var(--t-sm); color: var(--green); min-height: 1.5em; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 3px; font-size: var(--t-sm);
  max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(14, 23, 38, .2);
}

/* Ready banner after import */
.ready { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 20px; margin-bottom: 24px; background: var(--wash); border: 1px solid var(--rule); border-left: 3px solid var(--blue); border-radius: 3px; }
.ready b { font-weight: 500; }
.ready span { color: var(--muted); font-size: var(--t-sm); }

.rv { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .rv { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; } }
.rv-client { display: grid; gap: 16px; align-content: start; }
.rv-client h1 { font-size: var(--t-xl); letter-spacing: -0.03em; }
.rv-compose { border-top: 0; padding-top: 0; }
.rv-to { font-size: var(--t-xs); }
.rv-compose .message { min-height: 220px; }
.rv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 4px; }
.rv-spacer { flex: 1 1 auto; }
.rv-send { padding-inline: 1.3em; }
.rv-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; background: var(--wash); border: 1px solid var(--rule); border-radius: 3px; font-size: var(--t-sm); }

/* Calmer demo pass */
.page-head { margin-bottom: 20px; }
.ready { display: block; margin: 0 0 20px; padding: 0; background: none; border: 0; color: var(--muted); font-size: var(--t-sm); }

.row > button { padding: 20px 0; }
@media (min-width: 720px) { .row > button { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) 8rem; } }

.rv-client { gap: 20px; }

.rv-compose .message { min-height: 200px; border-color: var(--rule); font-size: 1.0625rem; line-height: 1.6; padding: 16px; }
.rv-compose .meta { font-size: 11px; }
.link.quiet { color: var(--muted); font-weight: 400; text-decoration-color: transparent; }
.link.quiet:hover { color: var(--ink); text-decoration-color: var(--rule); }

.toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: auto; right: max(16px, env(safe-area-inset-right, 0px)); transform: none; }

/* Demo notes */
.demo-note { border-bottom: 1px solid var(--rule); background: var(--wash); }

.talk { border-top: 1px solid var(--ink); padding-top: 14px; display: grid; gap: 10px; }
.talk h2 { font-size: var(--t-sm); font-weight: 500; letter-spacing: 0; }
.talk ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.talk li { display: grid; gap: 3px; padding-left: 12px; border-left: 2px solid var(--mark); }
.talk li p { font-size: var(--t-sm); }
.talk .talk-from { font-size: var(--t-xs); color: var(--muted); }
.talk .link { justify-self: start; padding: 4px 0; font-size: var(--t-xs); }
.talk .link[disabled] { color: var(--green); text-decoration: none; cursor: default; }

.memo { display: grid; gap: 6px; }
.memo label { font-size: var(--t-xs); color: var(--muted); }
.memo textarea { width: 100%; resize: vertical; font-size: var(--t-sm); }
.sheet .talk { margin-top: -8px; }

/* ===== Structured pass: one spacing scale (4/8/12/16/24/32/48), one type scale (13/15/17/22/32), cards on a soft page ===== */
:root { --page: #f5f7fa; --card: #ffffff; --line: #e6e9ee; --r: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --page: #0b0e14; --card: #121823; --line: #232a36; } }
:root[data-theme="dark"] { --page: #0b0e14; --card: #121823; --line: #232a36; }
body { background: var(--page); }
.bar { background: var(--card); }
.page { padding-top: 32px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }

/* demo note: one calm line */
.demo-note { background: var(--card); border-bottom: 1px solid var(--line); }

.demo-badge { flex: none; font: 500 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--blue); border: 1px solid currentColor; border-radius: 999px; padding: 4px 8px; }

/* page head */
.page-head { align-items: flex-end; margin-bottom: 24px; }
.page-head .title { display: grid; gap: 6px; }
.page-head h1 { font-size: 32px; letter-spacing: -0.035em; line-height: 1.1; }
.summary { font-size: 15px; color: var(--muted); }

.card.rows { border-top: 1px solid var(--line); overflow: hidden; }
.card.rows .row { border-bottom: 1px solid var(--line); }
.card.rows .row:last-child { border-bottom: 0; }
.card.rows .row > button { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.card.rows .row > button:hover { background: var(--wash); }

.tag { font-size: 12px; line-height: 1; padding: 6px 10px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }

@media (max-width: 640px) {  .card.rows .row > button { padding: 14px 16px; } .tag { font-size: 11px; padding: 5px 8px; } }
.card.empty { padding: 32px; border-top: 1px solid var(--line); }

.rv { gap: 24px; }
@media (min-width: 960px) { .rv { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; } }
.rv-client { padding: 24px; display: grid; gap: 24px; align-content: start; }
.rv-who { display: grid; gap: 12px; }
.rv-who h1 { font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); }
.chip.hot { background: var(--mark); border-color: transparent; }
.rv-client .facts { border-top: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.rv-client .facts div { display: grid; grid-template-columns: none; gap: 4px; padding: 0; border: 0; font-size: 15px; }
.rv-client .facts dt { font-size: 12px; color: var(--muted); }
.rv-client .facts dd { font-family: var(--sans); font-size: 15px; padding: 0; }
.rv-client .facts dd.mono { font-family: var(--sans); font-size: 15px; padding: 0; }
.talk { border-top: 1px solid var(--line); padding-top: 20px; gap: 12px; }
.talk h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
.talk ul { gap: 8px; }
.talk li { padding: 12px 14px; border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 8px; gap: 4px; }
.talk li.on { border-color: var(--blue); background: var(--wash); }
.talk li p { font-size: 15px; line-height: 1.4; }
.talk .talk-from { font-size: 13px; color: var(--muted); }
.talk .link { margin-top: 4px; font-size: 13px; padding: 0; }
.talk-empty { font-size: 13px; color: var(--muted); }
.memo { gap: 8px; }
.memo label { font-size: 13px; color: var(--muted); }
.rv-compose { padding: 24px; display: grid; gap: 16px; align-content: start; }
.compose-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rv-to { font-size: 13px; color: var(--muted); }
.rv-compose .message { min-height: 160px; height: auto; font-size: 16px; line-height: 1.6; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.rv-compose .message:focus { border-color: var(--blue); }
.rv-compose .meta { font: 400 12px/1.4 var(--sans); color: var(--muted); margin-top: -4px; }
.sign { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.sign input { flex: 0 1 14rem; min-height: 36px; border-radius: 8px; border-color: var(--line); font-size: 15px; }
.rv-actions { padding-top: 16px; border-top: 1px solid var(--line); gap: 8px 16px; }
.btn, .btn-quiet { border-radius: 8px; }
.rv-confirm { border-radius: 8px; border-color: var(--line); }

@media (max-width: 640px) {
  
  
  
  .sign { flex-wrap: nowrap; }
  .sign label { white-space: nowrap; }
  .sign input { flex: 1 1 auto; min-width: 0; }
  .rv-actions .rv-spacer { display: none; }
  .rv-actions { display: grid; grid-template-columns: 1fr auto; }
  .rv-actions .link.quiet { justify-self: start; }
  .rv-compose .message { min-height: 220px; }
}
@media (max-width: 640px) {
  
  
  
  
  .rv-actions { display: flex; flex-wrap: wrap; }
  .rv-actions .rv-send { flex: 1 1 auto; justify-content: center; }
  .rv-actions .link.quiet { flex: 0 0 auto; }
  .rv-actions .link.quiet:first-of-type { margin-left: 0; }
}

@media (max-width: 640px) {  .rv-actions .link.quiet { padding: 4px 0; } }

/* Welcome popup: what Backbook does and how drafts are written */
.choice.cw { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 14px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 64px rgba(14, 23, 38, .22); overflow: auto; overscroll-behavior: contain; }
.choice.cw::backdrop { background: rgba(14, 23, 38, .34); }
.cw-head { position: relative; display: flex; align-items: flex-end; height: 96px; padding: 0 24px 16px; color: #fff; background: #6fb0e6; overflow: hidden; }
.cw-head img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.cw-head::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14, 40, 80, .4), rgba(14, 40, 80, 0) 80%); z-index: 1; }
.cw-head h2 { position: relative; z-index: 2; margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.cw-body { display: grid; gap: 12px; padding: 18px 24px 4px; }
.cw-lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.cw-body h3 { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.cw-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cw-opt { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; padding: 14px; border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; transition: border-color .15s; }
div.cw-opt { grid-template-columns: 1fr; cursor: default; }
.cw-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cw-opt.off { opacity: .5; cursor: default; }
.cw-opt input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--ink); }
.cw-opt > div { display: grid; gap: 6px; min-width: 0; }
.cw-t { font-size: 15px; font-weight: 600; color: var(--ink); }
.cw-t em { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 99px; font: 500 11px/1.5 var(--sans); font-style: normal; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); vertical-align: 2px; }
.cw-opt p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cw-opt dl { display: grid; gap: 0; margin: 4px 0 0; }
.cw-opt dl div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 12.5px; }
.cw-opt dt { color: var(--muted); }
.cw-opt dd { margin: 0; font-weight: 600; text-align: right; }
.cw-more { font-size: 13px; line-height: 1.5; color: var(--muted); }
.cw-more summary { cursor: pointer; color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.cw-more p { margin: 8px 0 0; }
.cw-more b { color: var(--ink); font-weight: 600; }
.cw-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cw-note b { color: var(--ink); font-weight: 600; }
.cw-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 12px 24px 18px; background: var(--bg); }
@media (max-width: 560px) {
  .cw-head { height: 80px; padding: 0 18px 14px; }
  .cw-head h2 { font-size: 22px; }
  .cw-body { padding: 16px 18px 4px; }
  .cw-opts { grid-template-columns: 1fr; }
  .cw-foot { padding: 10px 18px 14px; }
  .cw-foot .btn { flex: 1; }
}

/* Add a client: paste anything, check the details, add */
.ph-right { flex-wrap: wrap; }
.addc { width: min(600px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 14px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 64px rgba(14, 23, 38, .22); overflow: auto; overscroll-behavior: contain; }
.addc::backdrop { background: rgba(14, 23, 38, .34); }
.addc-inner { display: grid; gap: 12px; padding: 22px 24px 20px; }
.addc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.addc-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.addc-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.addc-x:hover { background: var(--side, #f2f4f7); color: var(--ink); }
.addc-x svg { width: 18px; height: 18px; }
.addc-l { font-size: 15px; font-weight: 500; }
.addc textarea, .addc input, .addc select { width: 100%; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 8px; font: 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
.addc textarea:focus, .addc input:focus, .addc select:focus { outline: none; border-color: var(--accent, var(--ink)); }
#addc-text { min-height: 190px; resize: vertical; }
.addc-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.addc-warn { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--ink); background: var(--wash, #f2f8ff); }
.addc-err { margin: 0; min-height: 0; font-size: 13px; color: var(--red, #b42318); }
.addc-err:empty { display: none; }
.addc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.addc-form label { display: grid; gap: 4px; min-width: 0; }
.addc-form label.wide { grid-column: 1 / -1; }
.addc-form label > span { font-size: 12px; color: var(--muted); }
.addc-acts { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.addc-folder { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 13px; color: var(--muted); }
.addc-folder select { width: auto; padding: 6px 8px; }
@media (max-width: 560px) {
  .addc-inner { padding: 18px 16px 16px; }
  .addc-form { grid-template-columns: 1fr; }
  .addc-acts .btn { flex: 1; }
}
.cw-more + .cw-more { margin-top: -4px; }

/* One-time suggestion to try online drafting, after the first on-device draft */
.nudge { position: fixed; z-index: 60; right: 88px; bottom: 24px; width: min(380px, calc(100% - 32px)); display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); color: var(--ink); box-shadow: 0 12px 36px rgba(14, 23, 38, .16); animation: nudge-in .25s ease-out; }
.nudge p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.nudge b { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 600; color: var(--ink); }
.nudge div { display: flex; align-items: center; gap: 14px; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nudge { animation: none; } }
@media (max-width: 560px) { .nudge { right: 16px; left: 16px; width: auto; bottom: 84px; } }

/* This browser keeps nothing (site data blocked): a bar that stays until it's fixed. */
.store-warn { position: sticky; top: 0; z-index: 60; padding: 10px var(--pad); background: var(--red); color: #fff; font-size: var(--t-sm); line-height: 1.4; overflow-wrap: anywhere; }
.store-warn b { font-weight: 600; }
:root[data-theme="dark"] .store-warn { color: #1a0a06; }

/* A long unbroken name, company or link never pushes the contact panel wider than a phone. */
.sheet :is(h1, h2, h3, dt, dd, p, li, blockquote), .voice-add :is(h2, p), .client-edit h2, .dup-ask :is(h2, p) { overflow-wrap: anywhere; min-width: 0; }
.sheet dd a, .sheet .ecom-links a { overflow-wrap: anywhere; word-break: break-word; }

/* Your own fields on a person (relationship OS): edited where they sit. */
.cf-facts { border-top: 0; }
.cf-facts .cf-in { width: 100%; font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin: -3px -7px; }
.cf-facts .cf-in:hover, .cf-facts .cf-in:focus { border-color: var(--rule); outline: none; }
.cf-facts .cf-in::placeholder { color: var(--muted); }
.setup-fields { margin-bottom: 18px; }
.sf-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.sf-add .sf-name { flex: 1 1 12rem; min-width: 0; }
.sf-add .sf-name, .sf-add .sf-type { font: inherit; font-size: 15px; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line-2, var(--rule)); background: transparent; color: inherit; }
.sf-add .sf-name:focus { outline: none; border-bottom-color: var(--cta, currentColor); }
