/* ctzn-desk — the follow-up desk.
   Design brief of record: one card, one screen, one breath. The person's words
   get the only serif. The draft is the hero and is already editable. No counts,
   no streaks, no progress. Motion only for direct manipulation. */

:root {
  /* dark (default): near-black tinted toward the accent family, never #000 */
  --ground: #0f1211;
  --card: #171b1a;
  --field: #1e2322;
  --hairline: #2a302e;
  --ink: #f3f6f5;
  --ink-muted: #c2cac7;
  --whisper: #a3b0a9;
  --accent: #19c39c;
  --accent-press: #12a585;
  --accent-ink: #08110e;
  --hand: #c7a15c;
  --clay: #cd8a76;
  --danger-soft: #3a2c27;
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f5f4f0;
    --card: #ffffff;
    --field: #faf9f5;
    --hairline: #e7e5de;
    --ink: #1a1d1c;
    --ink-muted: #565f5b;
    --whisper: #656d68;
    --accent: #0f766e;
    --accent-press: #0c5f58;
    --accent-ink: #ffffff;
    --hand: #8a6d2e;
    --clay: #b4634c;
    --danger-soft: #f6e8e2;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "cv01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent); opacity: 0.7; z-index: 6;
  transition: width 200ms ease-out;
}
.brand-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 2px;
  background: #f50027; margin-right: 8px; vertical-align: 6%;
}

/* ── chrome ─────────────────────────────────────────────────────────── */
.chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
  z-index: 5;
}
.chrome-inner {
  width: min(620px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-cluster { display: inline-flex; align-items: center; gap: 4px; }
.nav-btn {
  appearance: none; border: none; background: none;
  color: var(--ink-muted); font-size: 22px; line-height: 1;
  width: 44px; height: 40px; border-radius: 10px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn:hover { background: var(--card); }
.nav-btn:disabled { color: var(--hairline); cursor: default; background: none; }
.wordmark {
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--whisper);
}
.chrome-right { font-size: 13px; color: var(--ink-muted); font-weight: 500;
  font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }

/* ── stage + card ───────────────────────────────────────────────────── */
.stage {
  height: 100dvh;
  display: flex;
  justify-content: center;
  padding: calc(60px + env(safe-area-inset-top)) 16px calc(34px + env(safe-area-inset-bottom));
}
.card {
  width: min(620px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  touch-action: pan-y;
  will-change: transform;
  scrollbar-width: thin;
}
@media (min-width: 700px) { .card { padding: 32px; gap: 24px; } }

.card.entering { animation: enter 140ms ease-out; }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }
.card.leaving { transition: opacity 160ms ease-out; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .card.entering, .card.leaving { animation: none; transition: none; opacity: 1; }
}

/* header block */
.person { display: flex; flex-direction: column; gap: 6px; }
.person h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.15;
}
@media (min-width: 700px) { .person h1 { font-size: 28px; } }
.ask {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 1.45;
  color: var(--ink-muted);
}

/* their words — the only serif in the app */
.quote {
  margin: 0;
  border-left: 2px solid var(--hairline);
  padding: 2px 0 2px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quote p {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 19px;
  font-weight: 420;
  line-height: 1.55;
  color: var(--ink-muted);
}
@media (min-width: 700px) { .quote p { font-size: 20px; } }
.quote .meta { font-size: 13px; font-weight: 450; color: var(--whisper); font-family: "Inter", sans-serif; font-style: normal; }

/* the desk's read */
.whisper-line { font-size: 14px; font-weight: 450; line-height: 1.55; color: var(--whisper); }

/* the draft — the hero */
.draft { display: flex; flex-direction: column; gap: 8px; position: relative; }
.draft .draft-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 450;
  color: var(--whisper);
}
.draft .channel { display: inline-flex; gap: 6px; align-items: baseline; }
.edited-tag {
  appearance: none; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--hand);
  padding: 0; text-decoration: underline; text-underline-offset: 3px;
}
.draft textarea {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font-family: "Inter", -apple-system, sans-serif;
  font-feature-settings: "cv01", "cv11";
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.05px;
  padding: 14px 16px;
  resize: none;
  outline: none;
  overflow: hidden;
  transition: height 120ms ease-out;
}
@media (min-width: 700px) { .draft textarea { font-size: 18px; } }
.draft textarea:focus { border-color: color-mix(in srgb, var(--accent) 40%, var(--hairline)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.draft.readonly textarea { color: var(--ink-muted); }
.draft .posting-edge {
  position: absolute; left: 12px; right: 12px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  display: none;
}
.posting .posting-edge { display: block; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* hold / caveat notes */
.hold {
  font-size: 14px;
  line-height: 1.5;
  color: var(--hand);
}
.footnote { font-size: 14px; line-height: 1.55; color: var(--whisper); }

/* ── actions ────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  position: sticky;
  bottom: -24px;
  margin: 0 -24px -24px;
  padding: 14px 24px 24px;
  background: linear-gradient(to top, var(--card) 78%, transparent);
}
@media (min-width: 700px) {
  .actions { bottom: -32px; margin: 0 -32px -32px; padding: 14px 32px 32px; }
}
.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  min-height: 48px;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 120ms ease-out, background 120ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn { white-space: nowrap; }
@media (max-width: 699px) {
  .btn.send, .btn.link { order: 2; flex: 1 1 100%; }
  .btn.ghost { order: 1; flex: 1 1 auto; }
}
.btn.send {
  flex: 1;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 550;
}
.btn.send:hover { background: var(--accent-press); }
.btn.send:disabled { background: var(--field); color: var(--whisper); cursor: default; }
.btn.ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--hairline);
}
.btn.ghost:hover { border-color: var(--whisper); }
.btn.take { color: var(--hand); border-color: color-mix(in srgb, var(--hand) 45%, var(--hairline)); }
.btn.link { background: var(--field); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; flex: 1; border: 1px solid var(--hairline); }
.kbd-hint { font-size: 11px; color: var(--whisper); opacity: 0.8; margin-left: 6px; }
@media (hover: none) { .kbd-hint { display: none; } }

/* swipe overlays */
.card .drag-label {
  position: absolute;
  top: 18px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}
.card .drag-skip { right: 20px; color: var(--whisper); }
.card .drag-take { left: 50%; transform: translateX(-50%); color: var(--hand); }
.card-wrap { position: relative; width: min(620px, 100%); margin: auto; max-height: 100%; display: flex; }

.note-row {
  display: flex; gap: 10px; align-items: center;
}
.note-row input {
  flex: 1; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--hairline); background: var(--field);
  color: var(--ink); font: inherit; font-size: 15px; padding: 0 14px; outline: none;
}
.note-row input:focus { border-color: color-mix(in srgb, var(--accent) 40%, var(--hairline)); }
.note-row .note-go { min-height: 44px; flex: 0 0 auto; }
.links-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chip {
  display: inline-flex; align-items: center; min-height: 38px;
  padding: 0 14px; border-radius: 10px; background: var(--field);
  border: 1px solid var(--hairline); color: var(--accent);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.link-chip:hover { border-color: var(--accent); }
.inline-link { color: var(--accent); text-underline-offset: 3px; }

/* ── toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 12px 10px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  color: var(--ink-muted);
  z-index: 10;
}
.toast .undo {
  appearance: none; border: none; background: none;
  color: var(--accent); font: inherit; font-weight: 550; cursor: pointer;
  padding: 4px 6px;
}

.deskfoot {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(8px + env(safe-area-inset-bottom));
  width: min(620px, calc(100% - 32px));
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--whisper);
  pointer-events: none; z-index: 4;
}
.foot-ver { opacity: 0.7; }

/* ── rest states ────────────────────────────────────────────────────── */
.rest {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  max-width: 40ch;
}
.rest .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.rest h1 { margin: 0; font-size: 22px; font-weight: 550; letter-spacing: -0.2px; }
.rest p { margin: 0; font-size: 14px; color: var(--whisper); line-height: 1.5; }

.error-banner {
  position: fixed;
  top: calc(52px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger-soft);
  color: var(--clay);
  font-size: 13px;
  border-radius: 10px;
  padding: 8px 14px;
  z-index: 8;
}

/* ── help ───────────────────────────────────────────────────────────── */
.help {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--ground) 80%, transparent);
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
}
.help-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 16px;
  padding: 28px 32px; min-width: 260px;
}
.help-card h2 { margin: 0 0 14px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--whisper); font-weight: 550; }
.help-card dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.help-card dl div { display: flex; gap: 16px; align-items: baseline; }
.help-card dt { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: var(--accent); min-width: 42px; }
.help-card dd { margin: 0; font-size: 14px; color: var(--ink-muted); }
.help-close { margin: 16px 0 0; font-size: 12px; color: var(--whisper); }
