:root {
  --alert-bg: #fdecea;
  --alert-line: #e3a9a2;
  --alert-ink: #8c2f22;
  --ok-bg: #e8f6ec;
  --ok-line: #8cc79e;
  --ok-ink: #145c2c;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #5f6b7a;
  --line: #dfe3e9;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --warn-bg: #fff8e6;
  --warn-line: #e8d08a;
  --error: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --card: #181d25;
    --ink: #e9edf3;
    --muted: #9aa7b6;
    --line: #2a323d;
    --accent: #4c8dff;
    --alert-bg: #331916;
    --alert-line: #6d3a33;
    --alert-ink: #ffa89c;
    --ok-bg: #16301f;
    --ok-line: #2f6b42;
    --ok-ink: #7fd69a;
    --warn-bg: #2b2415;
    --warn-line: #5e5027;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* ── Masthead ──────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 22px;
}
.masthead .logo {
  height: 38px;
  width: auto;
  flex: none;
}
.masthead-text h1 { font-size: 21px; letter-spacing: -.01em; margin: 0; }
.practice {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 16px;
}
.hero-text { flex: 1 1 300px; min-width: 0; }
.pitch {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.hero-text p { margin: 0; color: var(--muted); font-size: 14px; }
.hero-art { flex: 0 1 320px; width: 100%; max-width: 320px; height: auto; }

.art-paper rect { fill: var(--card); stroke: var(--line); stroke-width: 2; }
.art-fold { fill: var(--line); }
.art-line rect { fill: var(--line); }
.art-label, .art-file, .art-sub { font-family: inherit; }
.art-label { font-size: 11px; font-weight: 600; fill: var(--muted); letter-spacing: .08em; }
.art-arrow { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.art-card rect { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.art-check circle { fill: var(--accent); }
.art-tick { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.art-file { font-size: 11.5px; font-weight: 700; fill: var(--ink); }
.art-sub { font-size: 10.5px; fill: var(--muted); }

/* ── What it does ──────────────────────────────────────────────────────── */

.points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.points li {
  flex: 1 1 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.points svg {
  width: 22px;
  height: 22px;
  display: block;
  margin-bottom: 10px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.points b { display: block; font-size: 14px; margin-bottom: 3px; }
.points span { color: var(--muted); font-size: 13px; }

@media (max-width: 620px) {
  /* Stacked, the flex main axis is vertical — so the basis above would become
     a height and leave a tall gap under each block. */
  .hero { flex-direction: column; align-items: stretch; gap: 16px; }
  .hero-text, .hero-art { flex: 0 0 auto; }
  .hero-art { max-width: 300px; align-self: center; }
  .pitch { font-size: 18px; }

  /* This is a tool someone opens every morning, so on a phone the upload form
     matters more than the explanation. The three points keep their headings
     and lose their descriptions rather than pushing the form off the screen. */
  .points { gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .points li {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 11px 14px;
  }
  .points li:last-child { border-bottom: none; }
  .points svg { margin: 0; width: 18px; height: 18px; flex: none; }
  .points b { font-size: 13.5px; margin: 0; }
  .points span { display: none; }
}

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 8px; }
.sub, .muted { color: var(--muted); }
.sub { margin: 0 0 24px; }
.muted { font-weight: 400; font-size: 13px; }

form, section, details, footer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

footer { background: none; border: none; padding: 0; }
footer p { color: var(--muted); font-size: 13px; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 20px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(31, 111, 235, .06); }
.drop-title { font-weight: 600; }
.drop-name { color: var(--muted); font-size: 13px; word-break: break-all; }

.field { margin-top: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
button.link {
  background: none;
  color: var(--accent);
  border: none;
  padding: 4px 0;
  font-weight: 500;
}
#submit { margin-top: 20px; width: 100%; }

.error { color: var(--error); font-weight: 600; }
.status { color: var(--muted); }

.counts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.count {
  flex: 1 1 120px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.count b { display: block; font-size: 22px; }
.count span { color: var(--muted); font-size: 12px; }

.downloads { display: flex; flex-wrap: wrap; gap: 10px; }
.downloads button { flex: 1 1 240px; }

/* A download the browser has been handed. Stays put — it answers a question
   asked minutes later, not seconds. */
.download.done,
.download.done.secondary {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok-ink);
}
.download.done::before { content: "\2713\00a0\00a0"; font-weight: 700; }

.downloaded {
  margin-top: 14px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--ok-ink);
}
.downloaded ul { margin: 0; padding: 0; list-style: none; }
.downloaded li { font-weight: 600; font-size: 14px; padding: 2px 0; }
.downloaded li::before { content: "\2713\00a0\00a0"; }
.downloaded-hint { margin: 8px 0 0; font-size: 13px; opacity: .8; }

/* Louder than the yellow notices: a patient texted about the wrong
   appointment is a phone call to the office, not a tidy-up. */
.notice.alert { background: var(--alert-bg); border-color: var(--alert-line); }
.notice.alert h2 { color: var(--alert-ink); }

.dup + .dup { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--alert-line); }
.dup-who { margin: 0 0 8px; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.dup-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dup-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: none;
  padding: 2px 10px 4px 0;
  border: none;
}
.dup-table td { padding: 3px 10px 3px 0; border: none; }
.dup-table td:first-child { font-weight: 700; width: 4.8em; }
.dup-kept td:first-child { color: var(--ok-ink); }
.dup-dropped td { color: var(--muted); text-decoration: line-through; }
.dup-dropped td:first-child { color: var(--alert-ink); text-decoration: none; }

.notice.warn { margin-top: 12px; font-size: 13px; }
.notice.warn code {
  background: rgba(0, 0, 0, .06);
  padding: 1px 5px;
  border-radius: 4px;
}

.notice {
  margin-top: 20px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  padding: 14px 16px;
}
.notice h2 { margin-top: 0; }
.notice p { font-size: 13px; color: var(--muted); margin-top: 0; }

.map-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.map-row input { flex: 1 1 200px; }
.map-row .remove {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 10px;
}
.map-arrow { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--bg); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }
td.flag { color: var(--error); font-weight: 600; }

summary { cursor: pointer; font-weight: 600; }
.settings-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.saved { color: var(--muted); font-size: 13px; }
