/* The page's one stylesheet, in ash-warden's dashboard style (Ren, 2026-10-19: "change it to be the same style as
   the ash warden dashboard"): parchment and moss, light only. Fraunces for headings, Inter Tight for text, JetBrains
   Mono for figures, all three served from `fonts/` (SIL Open Font License), and the grain and the lists' chevron from
   `images/`: nothing loads from outside, and no script. */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/fraunces-v38.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/inter-tight-v9.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/jetbrains-mono-v24.woff2") format("woff2"); }
:root {
  --bg: #f5f1e8;
  --panel: #fffdf8;
  --glass: rgb(255 253 248 / .8);
  --raise: #f7f0e5;
  --stripe: #fbf7ef;
  --ink: #151914;
  --ink-2: #3f4b40;
  --muted: #5c6159;
  --line: #e4dacb;
  --edge: #cbbca7;
  --field: #bbae9c;
  --field-hover: #8d8172;
  --accent: #0f5536;
  --accent-hover: #093e27;
  --accent-ink: #fffdf8;
  --accent-soft: #edf3e9;
  --maple: #c9301a;
  --good: #2d6a2f;
  --good-soft: #e3efdf;
  --warn: #8a6316;
  --warn-soft: #f6ecd6;
  --bad: #a52314;
  --bad-soft: #f8e4dd;
  --info: #3d5a8a;
  --info-soft: #e6ebf3;
  --wood: #8a5d31;
  --clay: #b5653f;
  --iron: #5f6d7d;
  --crop: #b8921c;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 12px;
  --gutter: 32px;
  --control: 32px;
  --shadow: 0 1px 2px rgb(65 48 28 / .05), 0 18px 40px -12px rgb(65 48 28 / .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 8rem; } /* a field scrolled to stays clear of the sticky masthead */
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--font-body); font-size: 14.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-ligatures: no-contextual;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 70% 45% at 68% -10%, rgb(224 190 135 / .14), transparent), url("images/grain-1.svg");
}
::selection { background: rgb(201 48 26 / .14); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; margin: 0; }
h2, h3, .brand h1 { font-family: var(--font-display); font-variation-settings: "opsz" 90, "SOFT" 70; font-weight: 450; letter-spacing: -.02em; }
h2 { font-size: 1.6rem; line-height: 1.15; }
h3 { font-size: 1.12rem; line-height: 1.25; letter-spacing: -.01em; margin-top: 10px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--font-mono); font-size: .84em; background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.hint { font-size: .8rem; color: var(--muted); display: block; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bad-text { color: var(--bad); font-weight: 500; }
.said { margin: 0; max-height: 22rem; overflow: auto; padding: 10px 12px; background: var(--raise); border: 1px solid var(--line); border-radius: 6px; font: .8rem/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.warn-text { color: var(--warn); font-weight: 500; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The masthead: the brand and the zone, the pages' tabs under them, one sticky block at the same edge on every page.
   The tab shown is underlined on the masthead's own rule. */
.top { position: sticky; top: 0; z-index: 5; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: rgb(245 241 232 / .9); backdrop-filter: blur(8px); }
.bar { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; padding: 12px 0 6px; }
.brand { margin-right: auto; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand h1 { font-size: 1.6rem; line-height: 1.2; font-weight: 400; font-variation-settings: "opsz" 144, "SOFT" 100; }
.brand .em-w { font-weight: 300; color: var(--maple); }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-2); }
.tabs { display: flex; gap: 26px; margin-bottom: -1px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { padding: 6px 0 10px; color: var(--muted); font-weight: 500; font-size: .95rem; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s; }
.tab:hover { color: var(--ink); text-decoration: none; box-shadow: inset 0 -2px 0 var(--edge); }
.tab[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.tab:focus-visible { outline-offset: -2px; } /* inside the tabs' box, which clips anything outside it */

/* Pills: quiet words with a tint, only where a state needs one */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 500; white-space: nowrap; line-height: 1.5; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-good { background: var(--good-soft); color: var(--good); box-shadow: inset 0 0 0 1px rgb(45 106 47 / .16); }
.p-warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px rgb(138 99 22 / .16); }
.p-bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px rgb(165 35 20 / .16); }
.p-info { background: var(--info-soft); color: var(--info); }
.p-acc { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgb(15 85 54 / .14); }
.p-plain { background: none; color: var(--muted); padding-inline: 0; }

/* The pane, with its column: the training form takes the whole width, the routes page a little more for its From and
   To, the login and error pages a narrow one. A form's card hugs its table, centred. */
.main { max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 64px; display: flex; flex-direction: column; gap: 20px; }
.main.full { max-width: none; }
.main.roomy { max-width: 1320px; }
.main.narrow { max-width: 620px; padding-top: 48px; }
.hug { width: fit-content; max-width: 100%; align-self: center; }

/* Cards: a heading with what it says about itself at the right, then the card's lines, none longer than reads well */
.card { background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 24px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-h { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.card-h .pill, .card-h > .small { margin-left: auto; }
.card > p, .card > .hint, .row-entry > p, ul.notes { max-width: 84ch; }
.card > p.hint { padding-top: 2px; }
.card > form.inline { align-self: flex-start; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row-entry { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.plain { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px; }
ul.notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--ink-2); }
ul.notes li::marker { color: var(--field); }

/* Notices: a form sent says what it did at the top of the page it lands on */
.flash { padding: 10px 14px; border-radius: 10px; font-weight: 500; }
.flash.good { background: var(--good-soft); color: var(--good); border: 1px solid rgb(45 106 47 / .18); }
.flash.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid rgb(165 35 20 / .18); }

/* Buttons, as tall as the fields beside them */
.inline { display: inline; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--control); border: 1px solid var(--edge); background: var(--panel); padding: 0 14px; border-radius: 7px; cursor: pointer; font-weight: 500; font-size: .86rem; color: var(--ink); line-height: 1.2; white-space: nowrap; box-shadow: 0 1px 0 rgb(65 48 28 / .05); transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--field-hover); background: #fffefa; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding-inline: 18px; box-shadow: 0 1px 0 rgb(9 62 39 / .3), inset 0 1px 0 rgb(255 255 255 / .1); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Fields: one height, one border, a list's own chevron instead of the system's; numbers in mono, with no spinner */
input:not([type="radio"]):not([type="checkbox"]), select { height: var(--control); padding: 0 10px; border: 1px solid var(--field); background-color: rgb(255 255 255 / .78); border-radius: 7px; transition: border-color .15s, box-shadow .15s; }
textarea { width: 100%; border: 1px solid var(--field); background: rgb(255 255 255 / .78); border-radius: 8px; font-family: var(--font-mono); font-size: .8rem; line-height: 1.6; padding: 10px 12px; resize: vertical; transition: border-color .15s, box-shadow .15s; }
textarea:hover, input:not([type="radio"]):not([type="checkbox"]):hover, select:hover { border-color: var(--field-hover); }
textarea:focus, input:focus, select:focus { border-color: var(--accent); background-color: #fffefa; box-shadow: 0 0 0 3px rgb(15 85 54 / .12); outline: none; }
select { appearance: none; padding-right: 28px; font-size: .86rem; cursor: pointer; text-overflow: ellipsis; background-image: url("images/chevron-1.svg"); background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 6px; }
input[type="number"] { font-family: var(--font-mono); font-size: .8rem; appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input::placeholder { color: var(--field-hover); }
input[type="radio"], input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); vertical-align: middle; cursor: pointer; }
label { font-size: .86rem; }
details > summary { list-style: none; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: .86rem; font-weight: 500; color: var(--ink-2); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "\25B8"; color: var(--muted); transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--accent); }
details[open] > summary { margin-bottom: 8px; }

/* Tables: small-caps heads over a firmer rule, lines between rows, figures in mono */
.wide { overflow-x: auto; }
.wide > table { min-width: 40rem; } /* on a phone the table scrolls in its box rather than breaking words */
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-top: 1px solid var(--line); }
thead th { padding-top: 2px; font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); border-top: none; border-bottom: 1px solid var(--edge); }
tbody th { font-weight: 600; }
tbody th .hint { font-family: var(--font-mono); font-weight: 400; font-size: .74rem; }
tbody tr:hover > * { background: var(--accent-soft); }
.num { text-align: right; font-family: var(--font-mono); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
thead th.num { font-family: var(--font-body); font-size: .68rem; }
.k { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.k-wood { background: var(--wood); } .k-clay { background: var(--clay); } .k-iron { background: var(--iron); } .k-crop { background: var(--crop); }

/* The training form: a village a line, its name kept in view sideways and the head kept in view downwards. */
.plan-box { width: fit-content; max-width: 100%; max-height: max(20rem, calc(100vh - 15rem)); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table.plan { width: auto; font-size: .85rem; }
table.plan th, table.plan td { white-space: nowrap; vertical-align: middle; padding: 4px 6px; }
table.plan tbody th { padding-right: 12px; }
table.plan .hint { display: inline; margin: 0 2px 0 5px; font-size: .74rem; }
table.plan label.hint { font-size: .8rem; }
table.plan label.hint input { vertical-align: middle; }
table.plan thead th { position: sticky; top: 0; z-index: 2; background: var(--raise); vertical-align: bottom; padding-top: 10px; padding-bottom: 8px; border-bottom: none; box-shadow: inset 0 -1px 0 var(--edge); }
table.plan tbody th { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: inset -1px 0 0 var(--line); }
table.plan thead th:first-child { left: 0; z-index: 3; }
table.plan tbody tr:nth-child(even) > * { background: var(--stripe); }
table.plan tbody tr:hover > * { background: var(--accent-soft); }
table.plan select, table.plan input:not([type="checkbox"]) { height: 27px; }
table.plan select { max-width: 8.4rem; padding: 0 20px 0 7px; background-position: right 7px center; font-size: .84rem; }
table.plan input[type="number"] { width: 5rem; padding: 0 6px; font-family: var(--font-mono); font-size: .8rem; }
table.plan input[name^="times:"], table.plan input[name="all:times"] { width: 3.2rem; }
/* A column's Apply: its fields under the column's name, the same as a row's. */
table.plan thead .apply { display: flex; align-items: center; gap: 3px; margin-top: 6px; font-weight: 400; text-transform: none; letter-spacing: normal; font-size: .8rem; color: var(--ink); }
table.plan thead .apply.hint { color: var(--muted); font-family: var(--font-body); }
table.plan thead .apply .btn { margin-left: 4px; padding: 2px 10px; font-size: .78rem; }
table.plan td.top-ups { color: var(--ink-2); }
table.plan td.unbuilt { color: var(--field); text-align: center; }
/* A column's Apply is a small arrow, about as wide as the hint under it, so the head is no wider than its column. */
table.plan thead .apply .btn.icon { min-height: 27px; height: 27px; margin-left: 3px; padding: 1px 6px; font-size: .8rem; color: var(--ink-2); }
table.plan thead .apply .btn.icon:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* A column's name with its help: shown when the mouse rests on it. */
.col-name[title] { cursor: help; text-decoration: underline dotted var(--field); text-underline-offset: 3px; }
.save-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.save-bar .hint, .fields .hint { display: inline; }
/* The account's fields, a line each: the NPC's mix reads as one sentence. */
.fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.fields input[type="number"] { width: 4.6rem; padding: 0 8px; }
.fields .pill { margin-left: 6px; }

/* Route tables */
table.routes { font-size: .86rem; }
table.routes td:nth-child(-n+2) { white-space: nowrap; }
table.routes .loads { white-space: nowrap; font-family: var(--font-mono); font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--muted); }
table.routes .neg { color: var(--bad); font-weight: 600; }
table.routes .minutes { min-width: 7rem; max-width: 15rem; }
table.routes .status { white-space: nowrap; }
table.routes tr.from th { background: var(--raise); color: var(--ink); font-family: var(--font-display); font-variation-settings: "opsz" 90, "SOFT" 70; font-weight: 500; font-size: 1rem; letter-spacing: -.01em; padding-top: 12px; }
table.routes tr.from th .hint { font-family: var(--font-body); letter-spacing: normal; }
table.routes tr.next td { border-top: 2px solid var(--edge); }
/* Builds: a village a line, its pick in line with its name; its next steps as tags, cut with … where the row runs
   out, each named in full on hover. */
table.builds th, table.builds td { vertical-align: middle; white-space: nowrap; }
table.builds tbody tr { height: 2.4rem; } /* every row one height, with tags or without */
table.builds tbody th, table.builds td:not(.steps) { width: 1%; padding-right: 24px; }
table.builds td > select { margin: -6px 0; }
table.builds td.count { font-variant-numeric: tabular-nums; }
table.builds td.done { color: var(--good); }
table.builds td.unread { color: var(--bad); font-weight: 600; }
table.builds td.steps { max-width: 0; overflow: hidden; text-overflow: ellipsis; }
table.builds .step { display: inline-block; margin-right: 6px; padding: 0 7px; line-height: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--raise); font-size: .8rem; vertical-align: top; }
table.builds .step .at { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
table.builds .step .at::before { content: "· "; color: var(--field); }
/* The queue: a village a line, its id beside its name; the times kept to their width, the words given the rest. */
table.queue thead th, table.queue tbody th { white-space: nowrap; }
table.queue tbody th .hint { display: inline; margin-left: 4px; }
table.queue tbody th, table.queue td:not(.text) { width: 1%; padding-right: 28px; }
table.queue td:not(.text) { white-space: nowrap; font-variant-numeric: tabular-nums; }
img.shot { display: block; max-width: min(100%, 360px); border: 1px solid var(--edge); border-radius: 6px; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .bar { padding-top: 10px; }
  .brand h1 { font-size: 1.35rem; }
  .tabs { gap: 20px; }
  .main { padding-top: 16px; padding-bottom: 48px; gap: 14px; }
  .main.narrow { padding-top: 24px; }
  .card { padding: 16px; }
  h2 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
