/* Soothfast handoff demo. Identity board: Paper, Ink, Harbor, Stone, Dusk rose, Brass. No green anywhere.
   Fonts are shared with the landing page (../fonts). */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000; font-style: normal; font-display: swap;
}

:root {
  --paper: #f5f1ea; --ink: #1c2438; --harbor: #4f6380; --stone: #d9d2c5;
  --rose: #c9847c; --rose-text: #9e4a43; --brass: #b98b3e;
  --surface: #fbf9f5; --stone-soft: #ebe6dd; --ink-raised: #2b3550; --ink-text-soft: #c9cfdb;
  --harbor-tint: #e4e8ee; --rose-tint: #f4e3df; --brass-text: #85621f; --brass-tint: #f2e8d5;
  --body: #39445c;
  --radius: 12px;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 19px; margin-bottom: 10px; }
p { margin: 0 0 10px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; background: var(--stone-soft); padding: 1px 5px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.note { font-size: 13px; color: var(--harbor); margin-top: 10px; }

/* Top bar and tabs */
.topbar { display: flex; align-items: center; gap: 20px; padding: 14px 24px; border-bottom: 1px solid var(--stone); background: var(--paper); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.deal-head { display: flex; flex-direction: column; line-height: 1.3; }
.deal-head strong { font-family: var(--font-display); font-size: 16px; }
.deal-head span { color: var(--harbor); font-size: 13px; }
.sample-tag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brass-text); background: var(--brass-tint); padding: 4px 10px; border-radius: 999px; }
.tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--stone); background: var(--paper); position: sticky; top: 0; z-index: 5; overflow-x: auto; }
.tabs button { font: inherit; border: 0; background: none; padding: 14px 12px 12px; color: var(--harbor); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab-num { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--stone-soft); font-size: 11px; margin-right: 7px; }
.notes-toggle { margin-left: auto; }
.notes-toggle[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 40px; }
.intro { max-width: 760px; margin-bottom: 24px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--harbor); margin-bottom: 8px; }
.intro h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; margin-bottom: 10px; }
.lede { font-size: 16.5px; color: var(--body); }
.source { font-size: 13px; color: var(--harbor); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--harbor); flex: none; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--stone); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-card-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stat-label { font-size: 12.5px; color: var(--harbor); }
.stat-card-ink .stat-label, .stat-card-ink .stat-sub { color: var(--ink-text-soft); }
.stat { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.15; }
.stat-sub { font-size: 12.5px; color: var(--harbor); }

/* Panels and layout */
.panel { background: var(--surface); border: 1px solid var(--stone); border-radius: var(--radius); padding: 20px; }
.panel p { color: var(--body); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-msgs { display: grid; grid-template-columns: minmax(0, 1.1fr) 300px 300px; gap: 16px; align-items: start; }
.side { display: grid; gap: 16px; }
.legend { font-size: 12px; color: var(--harbor); display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sw-harbor { background: var(--harbor); } .sw-rose { background: var(--rose); margin-left: 6px; }
.dash { display: inline-block; width: 14px; border-top: 1px dashed var(--rose-text); margin-left: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--harbor); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--stone); }
td { padding: 11px 8px; border-bottom: 1px solid var(--stone-soft); vertical-align: top; }
.customers .why { color: var(--harbor); font-size: 13px; margin-top: 2px; }
.customers td:nth-child(2) div { margin-bottom: 4px; }
.customers.compact td { padding: 8px; vertical-align: middle; }
.bars-cell { vertical-align: middle; }
.bars { display: block; }
.who { font-size: 12px; color: var(--harbor); }
.nowrap { white-space: nowrap; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.chip-ink { background: var(--ink); color: var(--paper); }
.chip-stone { background: var(--stone-soft); color: var(--ink); }
.chip-harbor { background: var(--harbor-tint); color: var(--harbor); }
.chip-brass { background: var(--brass-tint); color: var(--brass-text); }
.chip-rose { background: var(--rose-tint); color: var(--rose-text); }
.chip-rose-solid { background: var(--rose-text); color: #fff; }

.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 10px; }
.alert:last-child { margin-bottom: 0; }
.alert em { display: block; margin-top: 4px; font-style: normal; font-weight: 600; }
.alert-rose { background: var(--rose-tint); color: #5c2a26; }
.alert-brass { background: var(--brass-tint); color: #4f3a12; }
.alert-ink { background: var(--harbor-tint); color: var(--ink); }
.handoff-only { border-top: 1px solid var(--stone-soft); padding-top: 10px; margin-top: 10px; display: grid; gap: 4px; }
.handoff-only:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.handoff-only span:not(.chip) { color: var(--harbor); font-size: 13px; }
.handoff-only .chip { justify-self: start; }
.handoff-only p { font-size: 13px; margin: 0; }

.btn { font: inherit; font-weight: 600; font-size: 14px; padding: 9px 14px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--stone); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Exhibit A sheet */
.paper-sheet { background: #fffdf9; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; letter-spacing: 0.1em; color: var(--harbor); border-bottom: 1px solid var(--stone); padding-bottom: 10px; margin-bottom: 6px; font-weight: 600; }
.terms { margin: 0; }
.terms > div { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--stone-soft); }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; color: var(--body); }
.sheet-sub { font-size: 16px; margin: 18px 0 6px; }
.schedule .aliases code { margin: 0 4px 4px 0; display: inline-block; }
.schedule .total td { font-weight: 600; border-bottom: 0; }
.sign-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--stone); font-size: 13px; color: var(--harbor); font-family: var(--font-display); font-style: italic; }
.print { margin-top: 10px; font-size: 12.5px; color: var(--harbor); }
.field { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 4px 0 12px; }
select { font: inherit; padding: 6px 10px; border: 1px solid var(--stone); border-radius: 8px; background: #fff; color: var(--ink); }
.plain { margin: 0; padding-left: 18px; color: var(--body); display: grid; gap: 4px; }

/* Statements */
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.tl-step { background: var(--surface); border: 1px solid var(--stone); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: grid; gap: 2px; color: var(--body); }
.tl-date { font-weight: 600; color: var(--ink); }
.tl-done { background: var(--ink); color: var(--ink-text-soft); border-color: var(--ink); }
.tl-done .tl-date { color: var(--paper); }
.calc { margin: 6px 0 0; }
.calc > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--stone-soft); }
.calc dt { color: var(--body); }
.calc dd { margin: 0; text-align: right; }
.calc-total dt, .calc-total dd { font-weight: 700; color: var(--ink); }

/* Phones */
.phone { background: var(--ink); border-radius: 28px; padding: 14px; color: var(--paper); display: flex; flex-direction: column; min-height: 520px; }
.phone-top { text-align: center; padding: 6px 0 12px; border-bottom: 1px solid var(--ink-raised); display: grid; }
.phone-top span { font-size: 12px; color: var(--ink-text-soft); }
.thread { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 2px; overflow-y: auto; max-height: 420px; }
.msg { border-radius: 14px; padding: 9px 12px; font-size: 13.5px; max-width: 90%; line-height: 1.45; }
.msg-in { background: var(--ink-raised); align-self: flex-start; }
.msg-out { background: var(--paper); color: var(--ink); align-self: flex-end; font-weight: 600; }
.replies { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid var(--ink-raised); }
.reply { font: inherit; font-size: 12.5px; font-weight: 600; background: var(--paper); color: var(--ink); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; }

/* Owner knowledge */
.grid-knowledge { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-two-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.profile-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.profile-item { width: 100%; text-align: left; font: inherit; background: none; border: 1px solid transparent; border-radius: 10px; padding: 9px 10px; cursor: pointer; display: grid; gap: 4px; color: var(--ink); }
.profile-item:hover { background: var(--stone-soft); }
.profile-item.is-on { background: var(--paper); border-color: var(--stone); }
.profile-item .chip { justify-self: start; }
.pi-name { font-weight: 600; }
.export { width: 100%; opacity: .6; cursor: not-allowed; }
.ai-tag { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--brass-text) !important; background: var(--brass-tint); border-radius: 8px; padding: 8px 10px; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); flex: none; }
.sub { font-size: 15px; margin: 14px 0 6px; }
.contacts, .profile-sections { margin: 0; }
.contacts > div, .profile-sections > div { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--stone-soft); }
.contacts dt, .profile-sections dt { font-weight: 600; }
.contacts dd, .profile-sections dd { margin: 0; color: var(--body); }
.letter { margin: 0; font-family: var(--font-display); font-size: 16px; line-height: 1.55; background: #fffdf9; border-left: 3px solid var(--brass); padding: 12px 16px; border-radius: 0 8px 8px 0; }
.panel-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.panel-ink p { color: var(--ink-text-soft); }
.panel-ink h2 { color: var(--paper); }
.note-dark { color: var(--ink-text-soft) !important; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--stone); text-underline-offset: 3px; }
.link-btn:hover { text-decoration-color: var(--harbor); }

/* Notes */
.notes { position: fixed; right: 20px; bottom: 20px; width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--stone); border-left: 4px solid var(--brass); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 16px 32px -20px rgba(28,36,56,.4); z-index: 20; }
.notes h2 { font-size: 16px; }
.notes ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--body); font-size: 14px; }

.foot { max-width: 1240px; margin: 0 auto; padding: 0 24px 32px; font-size: 12.5px; color: var(--harbor); }

/* Responsive */
@media (max-width: 1100px) {
  .grid-msgs { grid-template-columns: 1fr 1fr; }
  .grid-msgs .seller-view { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .grid-main, .grid-two, .grid-knowledge, .grid-two-even { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 640px) {
  main { padding: 22px 16px 32px; }
  .topbar, .tabs { padding-left: 16px; padding-right: 16px; }
  .sample-tag { margin-left: 0; }
  .grid-msgs { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat { font-size: 24px; }
  .terms > div, .contacts > div, .profile-sections > div { grid-template-columns: 1fr; gap: 2px; }
  .customers th:nth-child(3), .customers td.bars-cell { display: none; }
  .durability .rhythm { display: none; }
}
