/* They Served - a family service file: olive-drab ink on parchment, a manila folder with three tabbed piles of index
 * cards, and a cast bronze plaque for the name. Quiet colours, no reds of alarm. */
:root {
  --bg: #f1efe6; --paper: #fbfaf5; --card: #e9e6d8; --ink: #23261c; --muted: #555a48; --line: #cfcab4;
  --olive: #3f4a2a; --olive-ink: #fbfaf5; --olive-soft: #e3e7d3;
  --manila: #e8d49c; --manila-edge: #c8ad66; --manila-ink: #3a2e12; --index: #fffdf6; --index-rule: #b9cde0; --index-red: #d7a6a0;
  --bronze1: #b08448; --bronze2: #dcbb85; --bronze3: #5e4021; --bronze-ink: #2b1c0c; --bronze-hi: #f3dcae;
  --p-record: #2f5a3a; --p-record-bg: #dcebdc; --p-story: #6a4a10; --p-story-bg: #f4e6c4; --p-unknown: #3c4e6a; --p-unknown-bg: #dfe6f1;
  --ok: #2f5a3a; --ok-bg: #e0ecdc; --warn: #7a2e17; --warn-bg: #f6e0d6; --note: #64480c; --note-bg: #f6ecd0;
  --v-check: #7a4b10; --v-stories: #3c4e6a; --v-record: #2f5a3a;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.03), 0 6px 18px rgba(50, 45, 20, 0.09);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #14150f; --paper: #1c1e16; --card: #26291e; --ink: #ecead9; --muted: #b3b29b; --line: #3a3d2d;
  --olive: #c4d19c; --olive-ink: #181a12; --olive-soft: #2a3020;
  --manila: #5a4c26; --manila-edge: #7d6a37; --manila-ink: #f3e6bf; --index: #2a2b22; --index-rule: #3c4a5a; --index-red: #6b4440;
  --bronze1: #b08448; --bronze2: #dcbb85; --bronze3: #4a3218; --bronze-ink: #24170a; --bronze-hi: #f0d6a2;
  --p-record: #a9d8ae; --p-record-bg: #22351f; --p-story: #f0cf86; --p-story-bg: #3a2f16; --p-unknown: #b4c8ec; --p-unknown-bg: #232f43;
  --ok: #a9d8ae; --ok-bg: #20301e; --warn: #ffb59c; --warn-bg: #3c2017; --note: #f0d38a; --note-bg: #352c14;
  --v-check: #f0c27a; --v-stories: #b4c8ec; --v-record: #a9d8ae;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { font-family: "Baskerville", "Libre Baskerville", "Book Antiqua", Georgia, serif; line-height: 1.2; overflow-wrap: anywhere; }
a { color: var(--olive); }
.hidden { display: none !important; }
.small { font-size: 0.88rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* header: a thin olive band with a double rule */
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--paper); border-bottom: 3px double var(--olive); flex-wrap: nowrap; }
.back { text-decoration: none; font-size: 0.9rem; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; font-family: "Baskerville", Georgia, serif; font-size: 1.15rem; letter-spacing: 0.02em; }
.brand strong { white-space: nowrap; }
.logo { width: 30px; height: 30px; flex: none; }
.lg-plate { fill: #a37a43; stroke: #5e4021; stroke-width: 1.4; }
.lg-lines { fill: none; stroke: #2b1c0c; stroke-width: 1.8; stroke-linecap: round; }
.lg-rivet { fill: #f3dcae; }
.session { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 6px; border: 1.5px solid var(--olive); background: transparent; color: var(--olive);
  padding: 6px 14px; font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pill:hover:not(:disabled) { background: var(--olive-soft); }
.pill.solid { background: var(--olive); color: var(--olive-ink); }
.pill.solid:hover:not(:disabled) { background: var(--olive); filter: brightness(1.12); }
.pill.ghost { border-color: var(--line); color: var(--ink); cursor: default; }
.pill.tiny { padding: 3px 10px; font-size: 0.8rem; }
.pill.big { padding: 10px 22px; font-size: 1rem; }
.pill:disabled { opacity: 0.5; cursor: not-allowed; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.hero { padding: 24px 0 6px; }
.kicker { display: inline-block; margin: 0 0 10px; padding: 6px 12px; border-radius: 4px; background: var(--olive-soft); color: var(--ink); font-size: 0.86rem; border-left: 4px solid var(--olive); }
.hero h1 { font-size: clamp(1.65rem, 4.4vw, 2.6rem); margin: 4px 0 8px; max-width: 900px; }
.lede { max-width: 780px; margin: 0 0 12px; }
.samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border-radius: 4px; border: 1.5px dashed var(--olive); background: var(--paper); color: var(--ink); padding: 5px 12px; font: inherit; font-size: 0.86rem; cursor: pointer; }
.chip.on { border-style: solid; background: var(--olive); border-color: var(--olive); color: var(--olive-ink); }

.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-top: 16px; box-shadow: var(--shadow); min-width: 0; }
.layout .panel { margin-top: 0; }
.ph { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin: 0 0 10px; }
.step-no { display: inline-flex; width: 30px; height: 30px; flex: none; border-radius: 4px; align-items: center; justify-content: center; background: var(--olive); color: var(--olive-ink); font-family: Georgia, serif; font-size: 1rem; }
.lbl { display: block; font-size: 0.86rem; font-weight: 600; margin: 10px 0 4px; color: var(--ink); }
input[type="text"], textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 6px; padding: 8px 10px; min-width: 0; }
textarea { resize: vertical; font-size: 0.95rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--olive); outline-offset: 1px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.note { background: var(--note-bg); color: var(--note); border-radius: 6px; padding: 8px 10px; }

/* the manila service file: three tabs, three piles of ruled index cards */
.file-host { margin: 10px 0 12px; }
.folder { position: relative; padding-top: 34px; }
.ftabs { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 10px; }
.ftab { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 36px; padding: 0 12px; background: var(--manila); border: 1.5px solid var(--manila-edge); border-bottom: none;
  border-radius: 10px 10px 0 0; color: var(--manila-ink); font-family: Georgia, serif; font-weight: 700; font-size: 0.92rem; min-width: 0; }
.tab-name, .tab-short { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-short { display: none; }
.tab-count { flex: none; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--paper); color: var(--ink); font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--manila-edge); }
.piles { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 12px 16px; background: var(--manila); border: 1.5px solid var(--manila-edge); border-radius: 4px 4px 10px 10px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25); }
.pile { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pile-head { margin: 0; color: var(--manila-ink); font-size: 0.8rem; }
.pile-head b { font-family: Georgia, serif; font-size: 0.95rem; }
.card { margin: 0; background: var(--index); color: var(--ink); border-radius: 3px; padding: 10px 12px 8px; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 2px 4px rgba(40, 30, 10, 0.18);
  background-image: linear-gradient(var(--index-red), var(--index-red)); background-size: 100% 1.5px; background-position: 0 7px; background-repeat: no-repeat;
  padding-top: 16px; border-top: 4px solid var(--line); }
.card-record { border-top-color: var(--p-record); } .card-story { border-top-color: var(--p-story); } .card-unknown { border-top-color: var(--p-unknown); }
.card.empty { color: var(--muted); font-style: italic; font-size: 0.88rem; transform: none; }
.card-text { margin: 0 0 6px; font-size: 0.93rem; line-height: 22px; overflow-wrap: anywhere; }
.card-foot { display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card-set { font-size: 0.72rem; color: var(--muted); }
.card-answer { margin-left: auto; }
.use-stamp { display: inline-block; padding: 1px 8px; border: 1.5px solid currentColor; border-radius: 3px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; transform: rotate(-2deg); background: var(--paper); }
.u-stated { color: var(--p-record); } .u-framed { color: var(--p-story); } .u-left_out { color: var(--p-unknown); } .u-none { color: var(--muted); }
.plate-verdict { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--olive-soft); border: 1px solid var(--line); }
.plate-verdict b { font-family: Georgia, serif; font-size: 1.2rem; display: block; }
.v-check_first { color: var(--v-check); } .v-mostly_stories { color: var(--v-stories); } .v-on_record { color: var(--v-record); } .v-none { color: var(--muted); }

/* the bronze plaque */
.plaque-host { margin: 14px 0 6px; display: flex; justify-content: center; }
.plaque { position: relative; width: min(100%, 560px); padding: 22px 34px 20px; border-radius: 6px; text-align: center; color: var(--bronze-ink);
  background: linear-gradient(160deg, var(--bronze2) 0%, var(--bronze1) 48%, var(--bronze2) 100%); border: 3px solid var(--bronze3);
  box-shadow: inset 0 0 0 4px rgba(255, 240, 200, 0.18), inset 0 0 0 7px var(--bronze3), 0 6px 16px rgba(30, 20, 5, 0.3); }
.plaque-name { margin: 0; font-family: "Baskerville", Georgia, serif; font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--bronze-ink); text-shadow: 0 1px 0 rgba(255, 236, 190, 0.55); overflow-wrap: anywhere; }
.plaque-rule { display: block; width: 60%; height: 2px; margin: 10px auto; background: var(--bronze3); box-shadow: 0 1px 0 rgba(255, 236, 190, 0.45); }
.plaque-line { margin: 0; font-family: Georgia, serif; font-style: italic; font-size: 1rem; color: var(--bronze-ink); text-shadow: 0 1px 0 rgba(255, 236, 190, 0.45); overflow-wrap: anywhere; }
.plaque-line.ghost { opacity: 0.7; }
.rivet { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--bronze-hi), var(--bronze3)); }
.rivet.tl { top: 9px; left: 9px; } .rivet.tr { top: 9px; right: 9px; } .rivet.bl { bottom: 9px; left: 9px; } .rivet.br { bottom: 9px; right: 9px; }

/* run area */
.runrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.gate { background: var(--note-bg); color: var(--note); border-radius: 6px; padding: 8px 10px; margin: 10px 0 6px; }
.progress h3 { margin: 0 0 6px; }
.steps { list-style: none; padding: 0; margin: 0; }
.step { padding: 3px 0; color: var(--muted); } .step.active { color: var(--ink); font-weight: 600; } .step.done { color: var(--ok); }
.step-ic { display: inline-block; width: 16px; font-family: ui-monospace, Menlo, monospace; }
.raw { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); padding: 10px; border-radius: 6px; max-height: 360px; overflow: auto; }

/* the result */
.res-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.res-head h2 { margin: 0; font-size: 1.45rem; min-width: 0; }
.stamp { display: inline-block; padding: 4px 12px; border-radius: 4px; border: 2px solid currentColor; font-family: Georgia, serif; font-weight: 700; background: var(--paper); white-space: nowrap; }
.result h3 { font-size: 1.1rem; margin: 18px 0 8px; }
.tribute { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--olive); border-radius: 6px; padding: 12px 16px; }
.tribute-text p { margin: 0 0 10px; font-family: Georgia, serif; font-size: 1.05rem; line-height: 1.65; }
.fact-uses { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.use-row { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.use-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.use-fact { margin: 6px 0 2px; overflow-wrap: anywhere; }
.use-how { margin: 0; color: var(--muted); }
.pile-tag { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 0.76rem; font-weight: 700; max-width: 100%; overflow-wrap: anywhere; }
.p-record { background: var(--p-record-bg); color: var(--p-record); } .p-story { background: var(--p-story-bg); color: var(--p-story); } .p-unknown { background: var(--p-unknown-bg); color: var(--p-unknown); }
.questions { margin: 0; padding-left: 22px; } .questions li { margin: 4px 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cardrow, .exports { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.exports { margin-top: 14px; }
.recon { list-style: none; padding: 0; margin: 0; }
.recon li { padding: 6px 10px; border-radius: 6px; margin: 4px 0; background: var(--ok-bg); color: var(--ok); }
.recon li.warn { background: var(--warn-bg); color: var(--warn); }
.recon li.note { background: var(--note-bg); color: var(--note); }
.recon li.none { background: var(--ok-bg); color: var(--ok); }
li.none { color: var(--muted); }

/* kept tributes */
.keptlist { list-style: none; padding: 0; margin: 10px 0 0; }
.hrow { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hinfo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.hinfo b { overflow-wrap: anywhere; }
.hbtns { display: flex; gap: 6px; flex: none; }
.mini { width: 44px; height: auto; flex: none; }
.mini-plate { fill: #a37a43; stroke: #5e4021; stroke-width: 1.5; }
.mini-inner { fill: none; stroke: #5e4021; stroke-width: 1; }
.mini-lines { stroke: #2b1c0c; stroke-width: 1.6; stroke-linecap: round; }
.mini.v-check_first .mini-plate { stroke: #c27a1a; stroke-width: 2.5; } .mini.v-mostly_stories .mini-plate { stroke: #4a6a9a; stroke-width: 2.5; } .mini.v-on_record .mini-plate { stroke: #3f7a4a; stroke-width: 2.5; }

.foot { max-width: 1120px; margin: 0 auto; padding: 10px 16px 40px; color: var(--muted); font-size: 0.86rem; }
.toasts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; width: min(92vw, 520px); }
.toast { padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); transition: opacity 0.5s; font-size: 0.92rem; }
.toast.err { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.toast a { color: inherit; font-weight: 700; }
.toast.gone { opacity: 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .piles { grid-template-columns: 1fr; }
  .ftabs { position: static; padding: 0 6px; }
  .folder { padding-top: 0; }
}
@media (max-width: 560px) {
  .bar { gap: 8px; padding: 8px 12px; }
  .back { display: none; }
  .brand { font-size: 1rem; }
  .pill { padding: 5px 10px; font-size: 0.84rem; }
  .two, .three { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .panel { padding: 14px 14px; }
  .hrow { flex-wrap: wrap; }
  .ftab { padding: 0 8px; font-size: 0.82rem; }
  .ftab .tab-name { display: none; } .ftab .tab-short { display: inline; }
  .plaque { padding: 20px 22px 18px; }
}
