@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Zoley Signature";
  src: url("/static/fonts/dancing-script-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: block;
}
@font-face {
  font-family: "DM Sans";
  src: url("/static/fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --ink: #1b2430;
  --muted: #5c6b76;
  --cream: #fff9ef;
  --paper: #ffffff;
  --sand: #faf3e7;
  --line: #e7dcc6;
  --navy: #14457a;
  --navy-deep: #0d2d50;
  --gold: #e3a72e;
  --gold-soft: #f6e4b8;
  --sage: #7a8b69;
  --sage-soft: #e6ecdf;
  --red: #a23b2a;
  --red-soft: #f6e2dd;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3 { font-family: "Newsreader", Georgia, serif; font-weight: 500; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 30px; }
h2 { font-size: 22px; margin-top: 36px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
a { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.brand { font-family: "Newsreader", Georgia, serif; font-size: 22px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand span { color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 14px; font-weight: 400; margin-left: 8px; }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.who form { margin: 0; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; }

main { max-width: 760px; margin: 0 auto; padding: 28px 16px 64px; }
main.wide { max-width: 1040px; }
main.narrow { max-width: 440px; padding-top: 56px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 0 0 16px; }
.card > :last-child { margin-bottom: 0; }

.items { list-style: none; margin: 0 0 16px; padding: 0; }
.items li { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.items a.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 56px; color: var(--ink); text-decoration: none; }
.items a.row:hover { background: var(--sand); border-radius: 12px; }
.items .title { font-weight: 600; }
.items .meta { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }

.tag { display: inline-block; white-space: nowrap; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--sand); color: var(--muted); }
.tag.wait { background: var(--gold-soft); color: #6b4a00; }
.tag.ok { background: var(--sage-soft); color: #3f4f31; }
.tag.no { background: var(--red-soft); color: var(--red); }

label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 11px 12px; min-height: 44px; border: 1px solid #c7d0d6; border-radius: 8px; background: var(--paper);
}
textarea { min-height: 96px; resize: vertical; }
.field { margin: 0 0 16px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 44px; }
.check input { width: 18px; height: 18px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 16px; min-height: 44px; padding: 10px 18px;
  border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: #fff;
  cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--navy-deep); }
button.secondary, .button.secondary { background: var(--paper); color: var(--navy); }
button.secondary:hover, .button.secondary:hover { background: var(--sand); }
button.danger { background: var(--paper); color: var(--red); border-color: var(--red); }
button.danger:hover { background: var(--red-soft); }
button.link { background: none; border: 0; color: var(--navy); padding: 0; min-height: 0; font-weight: 400; text-decoration: underline; font-size: inherit; }
button.link:hover { background: none; color: var(--navy-deep); }
button.wide { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.actions form { margin: 0; }

.notice { border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; background: var(--sand); border: 1px solid var(--line); }
.notice.ok { background: var(--sage-soft); border-color: #c9d6bd; }
.notice.error { background: var(--red-soft); border-color: #e6bfb6; color: #6e2518; }

.tablewrap { overflow-x: auto; margin: 0 0 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.when { white-space: nowrap; color: var(--muted); }

.split { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }

.copybox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; background: var(--sand); border: 1px dashed #c9b98f; border-radius: 8px; padding: 12px; user-select: all; }
blockquote { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--sand); border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.back { display: inline-block; margin-bottom: 16px; font-size: 15px; }
.mt { margin-top: 16px; }
.status { min-height: 24px; }

/* Social posts: tags, the approve row, the pop-up box, the calendar */
.tag.done { background: #dfe8f3; color: var(--navy-deep); }
blockquote.caption { margin-top: 0; }
.decide { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.decide form { margin: 0; }
.decide button, .decide .button { min-width: 170px; }
@media (max-width: 480px) { .decide > *, .decide button, .decide .button { width: 100%; } }

dialog.modal { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(13, 45, 80, 0.3); }
dialog.modal::backdrop { background: rgba(13, 45, 80, 0.45); }
dialog.modal:not(:modal) { position: static; margin: 0 0 16px; width: 100%; box-shadow: none; }
dialog.modal h2 { margin-top: 0; }
dialog.modal form { margin: 0; }
dialog.modal textarea { min-height: 130px; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cal-head h1 { margin: 0; }
.cal-nav { display: flex; gap: 8px; }
.cal { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); display: grid; gap: 1px; margin: 16px 0; }
.cal-row, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.cal-weekdays div { background: var(--sand); font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 8px; }
.cal-day { background: var(--paper); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal-day.out { background: #fdfaf3; }
.cal-day.out .cal-num { opacity: 0.45; }
.cal-num { font-size: 13px; font-weight: 600; color: var(--muted); align-self: flex-start; min-width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 12px; }
.cal-day.today .cal-num { background: var(--navy); color: #fff; }
.cal-post { display: block; text-decoration: none; color: var(--ink); background: var(--sand); border-left: 4px solid var(--muted); border-radius: 6px; padding: 5px 7px; font-size: 13px; line-height: 1.3; min-width: 0; }
.cal-post:hover { background: var(--gold-soft); }
.cal-post-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cal-post-stage { display: block; font-size: 12px; color: var(--muted); }
.cal-post.s-needs_approval { border-left-color: var(--gold); background: #fdf3d9; }
.cal-post.s-needs_approval .cal-post-stage { color: #6b4a00; font-weight: 600; }
.cal-post.s-changes_requested { border-left-color: var(--red); }
.cal-post.s-approved { border-left-color: var(--sage); }
.cal-post.s-posted { border-left-color: var(--navy); }
/* Phones: seven columns are too narrow to read, so show the month as a list instead. */
.cal-list { display: none; }
@media (max-width: 720px) { .cal { display: none; } .cal-list { display: block; margin-top: 16px; } }

/* ---------- App layout for signed-in clients: sidebar on the left ---------- */
body.app { background: var(--cream); }
.shell { display: flex; min-height: 100vh; }
.side { flex: none; width: 248px; box-sizing: border-box; background: var(--navy-deep); color: var(--cream); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; }
.side-brand { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; text-decoration: none; color: var(--cream); }
.side-logo { font-family: "Newsreader", Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1.1; }
.side-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #f0c463; }
.side-account { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; }
.side-account span { font-size: 12px; color: #c3d0de; }
.side-account b { font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; font-size: 15px; font-weight: 500; color: #dfe7f0; }
.side-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side-link.on { background: var(--cream); color: var(--navy-deep); font-weight: 700; }
.side-link svg { flex: none; }
.side-label { flex: 1; }
.side-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: var(--ink); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.side-foot { margin-top: auto; padding: 12px 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.16); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: #dfe7f0; }
.side-foot form { margin: 0; }
.side-foot button.link, .side-foot button.link:hover { color: #f0c463; min-height: 44px; }
.side a:focus-visible, .side button:focus-visible { outline-color: #f0c463; }
main.app-main { flex: 1; min-width: 0; max-width: 980px; margin: 0; padding: 28px 32px 64px; }
main.app-main.wide { max-width: 1160px; }

.page-head { margin: 0 0 20px; }
.page-head h1 { margin: 0 0 4px; }
.page-head p { margin: 0; }
.post-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.post-head h1 { margin: 0; }

.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #f1e7d3; border-radius: 10px; padding: 3px; margin: 0 0 20px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--muted); }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 45, 80, 0.15); }
.tab-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold-soft); color: #6b4a00; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* Home: snapshot boxes */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 0 0 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-decoration: none; color: var(--ink); }
.stat:hover { border-color: var(--navy); }
.stat-num { font-family: "Newsreader", Georgia, serif; font-size: 44px; font-weight: 500; line-height: 1.1; }
.stat-label { font-size: 15px; color: var(--muted); }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.panel h2 { margin: 0 0 12px; }
.panel > :last-child { margin-bottom: 0; }
.panel .items li { background: var(--cream); }
.panel .items a.row:hover { background: var(--sand); }

.cal-head .tabs { margin: 0; }
.cal-nav { align-items: center; }
.cal-month { font-family: "Newsreader", Georgia, serif; font-size: 22px; min-width: 170px; text-align: center; }
.cal-list.always { display: block; margin-top: 16px; }

/* Key dates from Octane's calendar ("Newsletter launch"): a navy marker with a gold diamond, nothing to open */
.cal-date { display: block; background: var(--navy-deep); color: var(--cream); border-radius: 6px; padding: 5px 7px; font-size: 13px; line-height: 1.3; min-width: 0; cursor: default; }
.cal-date-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.cal-date-label { display: block; font-size: 12px; color: var(--gold-soft); }
.cal-date-title::before, .tag.key::before { content: "\25C6"; content: "\25C6" / ""; color: var(--gold); margin-right: 5px; font-size: 0.85em; }
.items .row.key-date { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 56px; color: var(--ink); }
.items li:has(> .key-date) { border-left: 4px solid var(--gold); }
.tag.key { background: var(--navy-deep); color: var(--cream); }

/* ---------- Admin: client colours, sidebar client list, client cards ---------- */
.c-blue  { --cc: #5b8fd0; --cc-soft: #e6eef9; }
.c-teal  { --cc: #3e9e94; --cc-soft: #dff1ee; }
.c-green { --cc: #7a9a5c; --cc-soft: #e7efdc; }
.c-gold  { --cc: #d9a033; --cc-soft: #f8ecd0; }
.c-coral { --cc: #e07a55; --cc-soft: #fbe6dd; }
.c-rose  { --cc: #c9637f; --cc-soft: #f8e1e8; }
.c-plum  { --cc: #8c66b3; --cc-soft: #ece4f5; }
.c-slate { --cc: #6f7f8c; --cc-soft: #e7ebee; }
.dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--cc, var(--muted)); }
.dot.big { width: 14px; height: 14px; }

.side-clients { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 18px; padding-left: 8px; border-left: 2px solid rgba(255, 255, 255, 0.28); }
.side-client { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--cream); }
.side-client:hover { background: rgba(255, 255, 255, 0.12); }
.side-client.on { background: var(--cream); color: var(--navy-deep); font-weight: 700; }
.side-client.off { opacity: 0.6; }
.side-client .side-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-client .dot { box-shadow: 0 0 0 2px rgba(255, 249, 239, 0.9); }
.side-add { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 6px 0 12px; padding: 0 12px; border-radius: 8px; background: var(--gold); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 700; }
.side-add:hover, .side-add.on { background: #f0c463; color: var(--ink); }
.side-me { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
.side-me:hover { color: #fff; }

.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.wait-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.client-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; background: var(--paper); border: 2px solid var(--cc); border-radius: 14px; color: var(--ink); text-decoration: none; transition: box-shadow 0.15s, transform 0.15s; }
.client-card:hover { box-shadow: 0 6px 18px rgba(13, 45, 80, 0.12); transform: translateY(-1px); }
.client-card.off { border-style: dashed; opacity: 0.7; }
.cc-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.cc-name { font-family: "Newsreader", Georgia, serif; font-size: 22px; font-weight: 500; line-height: 1.2; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; width: 100%; font-size: 14px; color: var(--muted); }
.cc-fact b { display: block; font-family: "Newsreader", Georgia, serif; font-size: 26px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.cc-fact.hot b { color: var(--red); }
.cc-fact.wait b { color: #8a5d00; }
.cc-foot { width: 100%; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.id-chip { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--cc-soft, var(--sand)); color: var(--ink); }
.id-chip.none { font-family: inherit; font-weight: 400; background: var(--sand); color: var(--muted); }
.client-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.client-head h1 { margin: 0; }

.swatches { border: 0; padding: 0; margin: 0 0 16px; }
.swatches legend { font-weight: 600; font-size: 15px; margin: 0 0 8px; padding: 0; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 14px 0 10px; border: 2px solid var(--line); border-radius: 999px; font-weight: 500; font-size: 14px; cursor: pointer; background: var(--paper); }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch .sw { width: 18px; height: 18px; border-radius: 50%; background: var(--cc); }
.swatch:has(input:checked) { border-color: var(--cc); background: var(--cc-soft); font-weight: 700; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

.asks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ask-title { font-weight: 600; }

/* Narrow screens: the sidebar becomes a bar across the top with the menu in a scrolling row. */
@media (max-width: 820px) {
  .shell { flex-direction: column; min-height: 0; }
  .side { width: 100%; padding: 14px 12px 10px; gap: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-brand { flex-direction: row; align-items: baseline; gap: 8px; padding: 0 4px; }
  .side-logo { font-size: 24px; }
  .side-account, .side-clients { display: none; }
  .side-add { margin: 0; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-nav { order: 3; flex: 0 0 100%; flex-direction: row; overflow-x: auto; gap: 4px; }
  .side-link { flex: none; }
  main.app-main { padding: 20px 16px 48px; }
  .cal-month { min-width: 0; }
}

/* Contracts: the document viewer and the signature pad */
.pdf-view { background: #e9e3d6; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 16px; max-height: 78vh; overflow-y: auto; overscroll-behavior: contain; }
.pdf-view .pdf-status { margin: 24px 8px; text-align: center; }
.pdf-page { background: var(--paper); box-shadow: 0 1px 4px rgba(13, 45, 80, 0.18); margin: 0 auto 12px; width: 100%; max-width: 860px; }
.pdf-page:last-child { margin-bottom: 0; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-page.failed { display: grid; place-items: center; padding: 24px; color: var(--muted); font-size: 14px; }
.pdf-count { margin: 0 0 6px; }
@media (max-width: 720px) { .pdf-view { padding: 6px; max-height: 70vh; } }

/* Buttons set their own display, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
.label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.sign-card h2 { margin-top: 0; }
.sig-modes { display: inline-flex; border: 1px solid var(--navy); border-radius: 8px; overflow: hidden; margin: 0 0 8px; }
.sig-mode { border: 0; border-radius: 0; background: var(--paper); color: var(--navy); min-height: 38px; padding: 6px 18px; font-size: 15px; }
.sig-mode:hover { background: var(--sand); }
.sig-mode.on, .sig-mode.on:hover { background: var(--navy); color: #fff; }
.sig-box { position: relative; background: var(--paper); border: 1px solid #c7d0d6; border-radius: 8px; max-width: 600px; }
.sig-pad { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; }
.sig-pad.drawing { cursor: crosshair; }
.sig-line { position: absolute; left: 4%; right: 4%; top: 72%; border-top: 1px solid #c7d0d6; pointer-events: none; }
.sig-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 600px; margin-top: 6px; }
.sig .notice { margin-top: 10px; max-width: 600px; }
.sig-show { display: block; max-width: 260px; width: 100%; height: auto; margin: 4px 0 8px; }
.sig-saved { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 12px; }
.sig-saved .sig-show { max-width: 200px; margin: 0; }
.check.consent { align-items: flex-start; gap: 10px; margin: 4px 0 16px; line-height: 1.45; }
.check.consent input { margin-top: 3px; flex: none; }
.sign-button { max-width: 360px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }

/* Login drop box */
.safe { background: var(--sage-soft); border-color: #c9d6bd; }
.safe-list { margin: 0; padding-left: 20px; }
.safe-list li { margin: 0 0 8px; }
.safe-list li:last-child { margin-bottom: 0; }
.login-req .row-head { align-items: center; margin-bottom: 8px; }
.login-req .row-head h3 { margin: 0; }
.guide { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); }
.guide p:last-child { margin-bottom: 0; }
.guide .actions { margin: 10px 0; }
.guide-alt { margin: 12px 0; }
.guide-alt summary { cursor: pointer; color: var(--navy); font-size: 14px; }
.guide-alt form { margin-top: 8px; }
.seal-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.seal-form h4 { font-family: "Newsreader", Georgia, serif; font-weight: 500; font-size: 17px; margin: 0 0 10px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-show { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.reveal { margin: 12px 0; padding: 14px; border: 1px dashed #c9b98f; border-radius: 10px; background: var(--sand); }
.secret-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 6px 0; }
.secret-row .label { min-width: 84px; font-weight: 600; font-size: 14px; color: var(--muted); }
.secret-row code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; word-break: break-all; }
.pre { white-space: pre-wrap; }
.recovery { margin-top: 12px; }
.recovery .copybox { font-size: 18px; letter-spacing: 0.04em; text-align: center; }

/* ---------- Messages (chat) ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell.full { height: 100vh; height: 100dvh; min-height: 0; }
main.app-main.full { display: flex; max-width: none; padding: 0; overflow: hidden; }
.chat { flex: 1; display: flex; min-width: 0; min-height: 0; background: var(--paper); }
.chat-list { flex: none; width: 300px; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.chat-title { margin: 0; padding: 20px 20px 10px; font-size: 26px; }
.chat-convos { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; }
.chat-none { padding: 8px 12px; }
.convo-group { display: flex; align-items: center; gap: 8px; padding: 14px 12px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.convo { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.convo:hover { background: var(--sand); }
.convo.on { background: #f1e7d3; }
.convo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.convo-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.convo-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo.unread .convo-name { font-weight: 700; }
.convo-time { flex: none; font-size: 12px; color: var(--muted); }
.convo-preview { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo.unread .convo-preview { color: var(--ink); }
.badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.av { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--cc-soft, #e6eef9); color: var(--navy-deep); }
.av.zoley { background: var(--navy-deep); color: var(--cream); }
.av.big { width: 44px; height: 44px; font-size: 16px; border-radius: 10px; }

.chat-thread { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-blank { align-items: center; justify-content: center; text-align: center; padding: 24px; }
.chat-head { flex: none; display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.chat-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head h2 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.chat-back { display: none; }
.chat-extra { min-height: 40px; font-size: 14px; padding: 0 14px; flex: none; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; overscroll-behavior: contain; }
.chat-rows { margin-top: auto; padding: 8px 0 14px; }

.day { display: flex; align-items: center; gap: 12px; margin: 18px 24px 6px; }
.day::before, .day::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.day span { font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.newline { display: flex; align-items: center; gap: 10px; margin: 10px 24px 4px; }
.newline::before { content: ""; flex: 1; border-top: 1px solid var(--red); }
.newline span { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.msg { display: flex; gap: 12px; padding: 3px 24px; }
.msg:hover { background: var(--sand); }
.msg.head { padding-top: 8px; margin-top: 4px; }
.msg.head .av { margin-top: 2px; }
.msg-main { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-name { font-weight: 700; font-size: 15px; }
.msg-meta time { font-size: 12px; color: var(--muted); }
.msg-text { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.rest .msg-t { flex: none; width: 38px; text-align: right; font-size: 11px; color: var(--muted); line-height: 22px; visibility: hidden; }
.msg.rest:hover .msg-t { visibility: visible; }

.chat-compose { flex: none; padding: 4px 24px 16px; }
.composer { border: 1px solid #c7d0d6; border-radius: 12px; background: var(--paper); }
.composer:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px var(--gold-soft); }
.composer textarea { display: block; width: 100%; min-height: 52px; max-height: 40vh; padding: 12px 14px 4px; border: 0; background: transparent; resize: none; font-size: 15px; }
.composer textarea:focus-visible { outline: none; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 8px 14px; }
.composer-foot button { min-height: 40px; padding: 0 18px; font-size: 15px; }
.composer-foot button:disabled { opacity: 0.6; cursor: default; }
.chat-note { margin: 8px 2px 0; }
.chat-note.notice { padding: 8px 12px; }

@media (max-width: 820px) {
  .chat-list { width: 100%; border-right: 0; }
  .chat.mode-split.has-thread .chat-list { display: none; }
  .chat.mode-split:not(.has-thread) .chat-thread { display: none; }
  .chat-back { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: -10px; color: var(--navy); border-radius: 8px; }
  .chat-head { padding: 10px 14px; gap: 10px; }
  .chat-head h2 { font-size: 20px; }
  .chat-extra { padding: 0 10px; }
  .msg { padding-left: 16px; padding-right: 16px; }
  .day, .newline { margin-left: 16px; margin-right: 16px; }
  .chat-compose { padding: 8px 12px 12px; background: var(--cream); border-top: 1px solid var(--line); }
  .composer-foot .hint { display: none; }
  .composer-foot { justify-content: flex-end; }
  /* Clients have only a couple of conversations, so on a phone they become tabs above the thread. */
  .chat.mode-tabs { flex-direction: column; }
  .chat.mode-tabs .chat-list { flex: none; padding: 8px 12px; background: var(--cream); border-bottom: 1px solid var(--line); }
  .chat.mode-tabs .chat-title { display: none; }
  .chat.mode-tabs .chat-convos { flex: none; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #f1e7d3; overflow: visible; }
  .chat.mode-tabs .convo-section { display: contents; }
  .chat.mode-tabs .convo { flex: 1; min-width: 0; justify-content: center; min-height: 44px; font-weight: 600; }
  .chat.mode-tabs .convo.on { background: var(--paper); box-shadow: 0 1px 2px rgba(13, 45, 80, 0.15); }
  .chat.mode-tabs .convo .av, .chat.mode-tabs .convo-preview, .chat.mode-tabs .convo-time { display: none; }
  .chat.mode-tabs .convo-main { flex: 0 1 auto; }
}

/* Uploads */
.uploads .row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.uploads .grow { flex: 1; min-width: 0; }
.uploads .thumb { flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--sand); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.uploads .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kind { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 0 4px; }
.upload-preview { margin: 0 0 16px; display: flex; align-items: center; gap: 12px; }
.upload-preview canvas { max-width: 160px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.upload-preview .kind { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--sand); border: 1px solid var(--line); }
@media (max-width: 600px) { .uploads .row { flex-wrap: wrap; } }
.msg.alert { background: var(--gold-soft); border-left: 3px solid #b8860b; margin: 6px 0; padding: 8px 24px 8px 21px; }
.msg.alert:hover { background: var(--gold-soft); }
.alert-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b4a00; }
