/* Case portal — calm, legible, private.
   Typeface: Atkinson Hyperlegible, designed for readers with low vision. */

:root {
  --mist: #edf2f0;
  --paper: #ffffff;
  --ink: #1c2a31;
  --ink-soft: #4d5f66;
  --teal: #1f5e66;
  --teal-ink: #ffffff;
  --glass: #d5e7e2;
  --line: #c6d6d1;
  --marigold: #e3a73a;
  --marigold-soft: #fbefd6;
  --danger: #a8352f;
  --danger-soft: #f8e3e1;
  --you: #1f5e66;
  --you-ink: #ffffff;
  --team: #ffffff;
  --focus: #e3a73a;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Atkinson Hyperlegible', Verdana, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mist: #0f1a1e; --paper: #16252a; --ink: #e4edeb; --ink-soft: #a3b6b4; --teal: #74c3c3; --teal-ink: #0f1a1e;
    --glass: #1f3a3d; --line: #2b4448; --marigold: #f0bd5c; --marigold-soft: #3a2f17; --danger: #f08a83; --danger-soft: #3a1f1d;
    --you: #2b6f77; --you-ink: #ffffff; --team: #1c2f34; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --mist: #0f1a1e; --paper: #16252a; --ink: #e4edeb; --ink-soft: #a3b6b4; --teal: #74c3c3; --teal-ink: #0f1a1e;
  --glass: #1f3a3d; --line: #2b4448; --marigold: #f0bd5c; --marigold-soft: #3a2f17; --danger: #f08a83; --danger-soft: #3a1f1d;
  --you: #2b6f77; --you-ink: #ffffff; --team: #1c2f34; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--mist); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ── frame ── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 44rem; margin: 0 auto; padding: 20px 16px 8px;
}
.brand { font-weight: 700; color: var(--teal); text-decoration: none; font-size: 1.05rem; }
.top a.quiet { color: var(--ink-soft); font-size: 0.95rem; }
main { max-width: 44rem; margin: 0 auto; padding: 12px 16px 64px; }
.narrow { max-width: 36rem; }
footer { max-width: 44rem; margin: 0 auto; padding: 24px 16px 48px; color: var(--ink-soft); font-size: 0.9rem; }

h1 { font-size: clamp(2rem, 7vw, 3.1rem); line-height: 1.08; letter-spacing: -0.02em; margin: 28px 0 16px; font-weight: 700; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 10px; }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 34rem; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.92rem; }

/* ── buttons & fields ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px; border-radius: var(--radius);
  border: 2px solid var(--teal); background: var(--teal); color: var(--teal-ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--teal); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--teal); padding-inline: 8px; min-height: 44px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

label.field { display: block; font-weight: 700; margin: 18px 0 6px; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; margin-top: 2px; }
input[type=text], input[type=email], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--radius); padding: 13px 14px;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--glass); }
.key-input { letter-spacing: 0.08em; text-transform: uppercase; }

.notice { border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; background: var(--glass); }
.notice.warn { background: var(--marigold-soft); }
.notice.error { background: var(--danger-soft); color: var(--ink); border-left: 4px solid var(--danger); }
.notice strong { display: block; margin-bottom: 2px; }

/* ── landing ── */
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
.journey { list-style: none; padding: 0; margin: 48px 0 0; counter-reset: step; }
.journey li {
  position: relative; padding: 0 0 28px 56px; counter-increment: step;
}
.journey li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: var(--paper); color: var(--teal); border: 2px solid var(--teal);
}
.journey li:not(:last-child)::after {
  content: ''; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--line);
}
.promise {
  margin-top: 40px; background: var(--paper); border-radius: var(--radius-lg); padding: 24px 22px;
  border: 2px solid var(--glass);
}
.promise ul { margin: 8px 0 0; padding-left: 20px; }
.promise li { margin-bottom: 6px; }

/* ── report wizard ── */
.wizard-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.progress { height: 6px; background: var(--glass); border-radius: 99px; overflow: hidden; margin: 10px 0 8px; }
.progress span { display: block; height: 100%; background: var(--teal); width: 0; transition: width .3s ease; }
.step h1 { font-size: clamp(1.6rem, 5.5vw, 2.2rem); margin: 22px 0 10px; }
.choices { display: grid; gap: 10px; margin-top: 18px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 60px; padding: 14px 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--paper); color: var(--ink); border: 2px solid var(--line); font: inherit;
}
.choice:hover { border-color: var(--teal); }
.choice[aria-pressed="true"] { border-color: var(--teal); background: var(--glass); font-weight: 700; }
.choice .icon { font-size: 1.4rem; width: 1.8rem; text-align: center; flex: none; }
.filelist { list-style: none; padding: 0; margin: 12px 0 0; }
.filelist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: var(--paper); border-radius: var(--radius-sm); margin-bottom: 8px; }
.drop {
  display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--paper); cursor: pointer; margin-top: 16px; font-weight: 700; color: var(--teal);
}
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.review dl { margin: 0; }
.review dt { font-weight: 700; margin-top: 14px; }
.review dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-soft); }
.review .edit { font-size: 0.95rem; margin-left: 8px; }

/* ── access key ── */
.keycard { background: var(--paper); border-radius: var(--radius-lg); padding: 24px 20px; margin: 20px 0; border: 2px solid var(--teal); }
.keycard .ref { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: 8px; }
.key {
  font-size: clamp(1.25rem, 6vw, 1.9rem); font-weight: 700; letter-spacing: 0.06em; word-spacing: 0.2em;
  color: var(--ink); overflow-wrap: anywhere; margin: 4px 0 16px; font-variant-numeric: tabular-nums;
}
.check { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; font-weight: 700; }
.check input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--teal); flex: none; }

/* ── sign in ── */
.panel { background: var(--paper); border-radius: var(--radius-lg); padding: 22px 20px; margin: 18px 0; }
.or { text-align: center; color: var(--ink-soft); margin: 4px 0; }

/* ── case page ── */
.case-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-top: 18px; }
.case-head h1 { margin: 0; font-size: clamp(1.7rem, 6vw, 2.4rem); letter-spacing: 0.01em; }
.livebadge { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-soft); }
.livebadge i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.livebadge.on i { background: #3aa57a; }
.switcher { margin-top: 6px; }

/* The memorable element: the path of the case. */
.path { list-style: none; margin: 26px 0 8px; padding: 0; }
.path li { position: relative; padding: 0 0 22px 46px; color: var(--ink-soft); }
.path li::before {
  content: ''; position: absolute; left: 6px; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--line);
}
.path li:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 27px; bottom: 0; width: 3px; background: var(--line); }
.path li.done { color: var(--ink); }
.path li.done::before { background: var(--teal); border-color: var(--teal); }
.path li.done::after { background: var(--teal); }
.path li.current { color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.path li.current::before { left: 2px; top: 2px; width: 28px; height: 28px; background: var(--teal); border: 6px solid var(--glass); }
.path li.current.needs::before { background: var(--marigold); border-color: var(--marigold-soft); }
.path li.current .what { display: block; font-weight: 400; font-size: 1rem; color: var(--ink-soft); margin-top: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .path li.current.arrived::before { animation: arrive 1.2s ease-out 1; }
  @keyframes arrive { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
}
.needs-you { background: var(--marigold-soft); border-radius: var(--radius); padding: 14px 16px; margin: 6px 0 20px; }

.thread-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: 28px; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.msg { max-width: 85%; border-radius: var(--radius-lg); padding: 12px 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.team { align-self: flex-start; background: var(--team); border-bottom-left-radius: 6px; }
.msg.you { align-self: flex-end; background: var(--you); color: var(--you-ink); border-bottom-right-radius: 6px; }
.msg .meta { display: block; font-size: 0.85rem; opacity: 0.8; margin-bottom: 4px; white-space: normal; }
.msg.you .meta { color: var(--you-ink); }
.msg .file { display: block; margin-top: 8px; white-space: normal; }
.msg.you .file a { color: var(--you-ink); }
.msg img.thumb { display: block; max-height: 220px; border-radius: var(--radius-sm); margin-top: 8px; background: var(--glass); }
.sys { align-self: center; text-align: center; font-size: 0.92rem; color: var(--ink-soft); padding: 4px 12px; max-width: 90%; }
.empty { text-align: center; color: var(--ink-soft); padding: 18px; }

.composer {
  position: sticky; bottom: 0; margin: 18px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--mist); border-top: 1px solid var(--line);
}
.composer textarea { min-height: 3rem; max-height: 12rem; padding: 10px 14px; }
.composer .btn { min-height: 46px; }
.composer-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.composer-row .grow { flex: 1; font-size: 0.9rem; color: var(--ink-soft); }
.attach { position: relative; }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

details.box { background: var(--paper); border-radius: var(--radius); padding: 0 18px; margin: 14px 0; }
details.box > summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::after { content: '+'; float: right; font-size: 1.3rem; line-height: 1; color: var(--teal); }
details.box[open] > summary::after { content: '–'; }
details.box .inner { padding-bottom: 18px; }
.danger-zone { border-top: 2px solid var(--danger-soft); margin-top: 18px; padding-top: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10;
  background: var(--ink); color: var(--mist); padding: 12px 18px; border-radius: var(--radius); max-width: calc(100% - 32px);
}
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .progress span { transition: none; } }
select { font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-left: 8px; max-width: 100%; }
