/* W5PRO tools: shared styles. Same palette as the station page (public/index.html). */
:root {
  --bg: #0b1016;
  --panel: #121a23;
  --panel-2: #0f161e;
  --line: #1f2b38;
  --text: #e6edf3;
  --body: #c4ced8;
  --muted: #8b9aab;
  --accent: #ffb000;
  --accent-dim: rgba(255, 176, 0, .14);
  --good: #3fb950;
  --warn: #ffb000;
  --bad: #f85149;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* Same scaling as the station page: 16px up to ~1400px wide, ~19.5px at 1920, ~23px at 2560, capped at 24px. */
html { font-size: clamp(100%, calc(.6vw + 8px), 150%); }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255,176,0,.08), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  display: flex; flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
a:hover { border-bottom-color: var(--accent); }
.wrap { width: 100%; max-width: 57.5rem; margin: 0 auto; padding: 0 16px; }

/* top bar */
.topbar { border-bottom: 1px solid var(--line); background: rgba(11,16,22,.85); position: sticky; top: 0; z-index: 1000; backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { font-family: var(--mono); font-weight: 800; font-size: 1.15rem; color: var(--text); border: 0; letter-spacing: .04em; }
.brand b { color: var(--accent); font-weight: 800; }
.crumbs { font-family: var(--mono); font-size: .8rem; color: var(--muted); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs::before { content: "/ "; }
.crumbs a { color: var(--muted); border: 0; }
.crumbs a:hover { color: var(--text); }
.topbar .utc { margin-left: auto; font-family: var(--mono); font-size: .85rem; color: var(--accent); white-space: nowrap; }

/* page header */
.page-head { padding: 40px 0 20px; }
.page-head .eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.page-head h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.15; margin: 0 0 .5rem; }
.page-head p { color: var(--body); margin: 0; max-width: 64ch; }

main { flex: 1; padding-bottom: 40px; }
section + section { margin-top: 16px; }
/* A form.card followed by result cards (and any card after a card) needs the same gap. */
main .card + .card, main .card + section, main section + .card, main form + section { margin-top: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.card h2 { font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; }
.card h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.card p { color: var(--body); margin: 0 0 .6rem; }
.card p:last-child { margin-bottom: 0; }

/* forms */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; font-family: var(--mono); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.field-row { display: flex; gap: 8px; }
.field-row > * { flex: 1; }
.field-row > select { flex: 0 0 auto; width: auto; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.err { color: var(--bad); font-size: .85rem; margin-top: 6px; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 10px 16px; min-height: 44px;
  border: 1px solid var(--accent); background: var(--accent); color: #111; display: inline-flex; align-items: center; gap: 8px;
}
button.ghost { background: transparent; color: var(--accent); }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* results */
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat .k { font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--mono); font-size: 1.35rem; color: var(--text); margin-top: 2px; overflow-wrap: anywhere; }
.stat .v small { font-size: .8rem; color: var(--muted); }
.stat.hl .v { color: var(--accent); }
.stat.ok { border-color: rgba(63,185,80,.5); } .stat.ok .v { color: var(--good); }
.stat.no { border-color: rgba(248,81,73,.5); } .stat.no .v { color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; font-family: var(--mono); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.note { border-left: 3px solid var(--accent); background: linear-gradient(90deg, var(--accent-dim), var(--panel) 70%); }
.sources { font-size: .85rem; color: var(--muted); }
.sources li { margin: .25rem 0; }
.pill { display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

/* tools index */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tool {
  display: flex; flex-direction: column; gap: 6px; color: var(--text); border: 1px solid var(--line);
  background: var(--panel); border-radius: 12px; padding: 18px 20px; transition: border-color .15s, transform .15s;
}
.tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool .t { font-weight: 600; font-size: 1.05rem; }
.tool .t::after { content: " →"; color: var(--accent); }
.tool .d { color: var(--muted); font-size: .9rem; }
.tool-group { font-family: var(--mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }

footer.site { text-align: center; color: var(--muted); font-size: .8rem; padding: 28px 0; border-top: 1px solid var(--line); font-family: var(--mono); letter-spacing: .06em; }
footer.site a { color: var(--muted); }

@media (max-width: 520px) {
  /* Phones: breadcrumb gets its own row under the brand/clock so it's always there. */
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 4px; }
  .crumbs { order: 3; flex-basis: 100%; font-size: .8rem; }
  .crumbs::before { content: "‹ "; color: var(--accent); }
  .crumbs a { color: var(--accent); }
  .card { padding: 16px; }
}
