/* Alpha-War IDCC. White, gold, red and black.
   Black is the operations floor (header, command post); white is the reading room.
   Gold marks structure and rank; red is reserved for threat and urgency only. */
[hidden] { display: none !important; }
:root {
  --black: #000000;
  --white: #ffffff;
  --gold: #a8812f;        /* gold on white: rules, marks, focus */
  --gold-hi: #d8b25c;     /* gold on black: text, lines */
  --gold-wash: #f6efdf;
  --gold-ink: #7a5c1f;     /* gold text on white: 6.0:1 */   /* the only tint; used for highlight, never as a page ground */
  --red: #c8102e;         /* threat, exploited, live */
  --red-hi: #ff3b4f;      /* red on black */
  --ink: #000000;
  --graphite: #4b4b4b;
  --ash: #8a8a8a;
  --rule: #e4dfd3;
  --floor: #0d0d0d;       /* panels on the black floor */
  --floor-line: #2a2620;
  --radius: 2px;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", "Source Han Serif JP", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--white); line-height: 1.8; font-size: 16px;
  font-feature-settings: "palt" 1; font-variant-numeric: tabular-nums lining-nums; }
a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .88em; background: var(--gold-wash); padding: .08em .35em; }
pre { background: var(--black); color: #f2efe8; padding: 1rem 1.2rem; overflow-x: auto; line-height: 1.55; border-left: 3px solid var(--gold); }
pre code { background: none; padding: 0; color: inherit; }

/* ------------------------------------------------------------ chrome */
.skip { position: absolute; left: 1rem; top: -3rem; z-index: 50; background: var(--gold-hi); color: var(--black); padding: .5rem .9rem; font-weight: 600; }
.skip:focus { top: .6rem; }
header.site { background: var(--black); color: var(--white); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--floor-line); }
.bar { max-width: var(--wrap); margin: 0 auto; padding: .55rem 1.2rem; display: flex; align-items: center; gap: 1.4rem; }
.logo { display: flex; align-items: center; gap: .75rem; color: var(--white); text-decoration: none; flex-shrink: 0; }
.logo .mark { width: 38px; height: auto; display: block; }
.logo strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.02rem; letter-spacing: .04em; }
.logo small { display: block; font-size: .68rem; color: #b9b3a6; max-width: 30ch; line-height: 1.35; }
#nav { display: flex; gap: .1rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
#nav a { color: #d9d5cc; text-decoration: none; padding: .55rem .7rem; font-size: .9rem; white-space: nowrap; border-bottom: 2px solid transparent; }
#nav a:hover { color: var(--white); }
#nav a.active { color: var(--white); border-bottom-color: var(--gold-hi); }
#nav a .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red-hi); margin-left: .35rem; vertical-align: .15em; }
.tools { display: flex; gap: .4rem; flex-shrink: 0; }

main { max-width: var(--wrap); margin: 0 auto; padding: 2.2rem 1.2rem 5rem; outline: none; }
main.floor { max-width: none; padding: 0; background: var(--black); color: #ece8df; }
footer.site { border-top: 1px solid var(--rule); color: var(--graphite); padding: 1.6rem 0 2.4rem; font-size: .8rem; }
footer.site p { max-width: var(--wrap); margin: .2rem auto; padding: 0 1.2rem; }
body.on-floor .bar, body.on-floor footer.site p { max-width: 1480px; }
body.on-floor footer.site { background: var(--black); color: #8f8a80; border-top-color: var(--floor-line); }

/* ------------------------------------------------------------ type */
h1, h2, .display { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.35; margin: .2rem 0 1rem; }
h2 { font-size: 1.32rem; line-height: 1.45; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.02rem; line-height: 1.5; margin: .2rem 0 .4rem; font-weight: 700; }
h4 { font-size: .95rem; margin: 1rem 0 .3rem; }
.lead { font-size: 1.08rem; color: #262626; max-width: 62ch; }
.muted { color: var(--graphite); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.rule-gold { border: 0; border-top: 1px solid var(--gold); width: 48px; margin: 0 0 1rem; }

/* ------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--ink); background: var(--white); color: var(--ink);
  padding: .55rem 1.1rem; border-radius: var(--radius); font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; line-height: 1.4; }
.btn:hover { background: var(--gold-wash); }
.btn.primary { background: var(--black) linear-gradient(var(--gold-hi), var(--gold-hi)) no-repeat 0 100% / 0 2px; color: var(--white);
  border-color: var(--black); transition: background-size .28s cubic-bezier(.3, .7, .2, 1); }
.btn.primary:hover, .btn.primary:focus-visible { background-color: #1c1c1c; background-size: 100% 2px; }
.btn.gold { background: var(--gold-hi); border-color: var(--gold-hi); color: var(--black); font-weight: 600; }
.btn.gold:hover { background: #e6c375; }
.btn.ghost { background: transparent; color: var(--white); border-color: #5a554b; }
.btn.ghost:hover { border-color: var(--gold-hi); background: transparent; }
header.site .btn:not(.ghost) { background: var(--white); color: var(--black); border-color: var(--white); }
.btn.danger { color: var(--red); border-color: var(--red); background: var(--white); }
.btn:disabled { opacity: .55; cursor: wait; }
.cta { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.4rem; }

form label { display: block; margin: .8rem 0; font-size: .9rem; }
form input:not([type=radio]):not([type=checkbox]), form select { display: block; width: 100%; max-width: 420px; padding: .55rem .65rem;
  border: 1px solid #857f72; border-radius: var(--radius); font: inherit; margin-top: .3rem; background: var(--white); }
form input:focus, form select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-wash); }
label.check { display: flex; gap: .55rem; align-items: flex-start; }
input[type=checkbox], input[type=radio] { accent-color: var(--black); }
#card { min-height: 90px; margin: .3rem 0 .6rem; max-width: 460px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.4rem 0; }

/* ------------------------------------------------------------ surfaces */
.card { background: var(--white); border: 1px solid var(--rule); padding: 1.25rem 1.4rem; margin-bottom: 1rem; }
.card.narrow { max-width: 680px; }
.callout { border-left: 3px solid var(--gold); display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--rule); text-align: left; padding: .55rem .6rem; vertical-align: top; }
th { font-weight: 600; color: var(--graphite); border-bottom-color: var(--ink); }

.tag { display: inline-block; font-size: .74rem; padding: .05rem .5rem; border: 1px solid var(--rule); color: var(--graphite); white-space: nowrap; line-height: 1.6; }
.tag.ok { border-color: var(--ink); color: var(--ink); }
.tag.danger { background: var(--red); border-color: var(--red); color: var(--white); font-weight: 600; }
.tag.lock { border-color: var(--gold); color: var(--gold-ink); }
.tag.gold { background: var(--gold-wash); border-color: var(--gold); color: #6d521a; }
.tag.subtle { border-style: dashed; }

.belt { display: inline-block; font-size: .74rem; padding: .02rem .55rem; border: 1px solid var(--ink); }
.belt-white { background: #fff; }
.belt-yellow { background: #f7e27a; }
.belt-green { background: #bfe3c8; }
.belt-blue { background: #c7d8f5; }
.belt-brown { background: #d8c3ae; }
.belt-black { background: #000; color: var(--gold-hi); border-color: var(--gold-hi); }
.belt-none { color: var(--graphite); border-style: dashed; }

/* ------------------------------------------------------------ public home */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.4rem; align-items: center;
  padding: 1.2rem 0 2.8rem; }
.hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.32; }
.hero .preview { background: var(--black); padding: 1rem 1rem .7rem; }
.hero .preview figcaption { color: #b9b3a6; font-size: .78rem; margin-top: .4rem; }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.pillars > div { padding: 1.2rem 1.4rem 1.4rem 0; }
.pillars > div + div { padding-left: 1.4rem; border-left: 1px solid var(--rule); }

/* ------------------------------------------------------------ tracks & lessons */
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.track { display: block; color: inherit; text-decoration: none; position: relative; }
.track:hover { border-color: var(--gold); }
.track.locked { background: #fbfaf7; }
.track-head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.track .num { font-family: var(--serif); font-weight: 600; color: var(--gold); font-size: 1.5rem; margin-right: .3rem; line-height: 1; }
.attack code { font-size: .72rem; }
.modules { padding-left: 1.4rem; }
.modules li { margin: .5rem 0; }
.modules li::marker { color: var(--gold); font-family: var(--serif); }
.lesson { max-width: 74ch; }
.lesson blockquote { margin: 1.2rem 0; padding: .7rem 1.1rem; border-left: 3px solid var(--gold); background: var(--gold-wash); }
fieldset.q { border: 1px solid var(--rule); margin: 0 0 1rem; padding: .7rem 1rem; }
fieldset.q legend { font-weight: 600; padding: 0 .3rem; }
fieldset.q.right { border-color: var(--ink); border-left: 3px solid var(--gold); }
fieldset.q.wrong { border-color: var(--red); border-left: 3px solid var(--red); }
.choice { display: flex; gap: .5rem; align-items: flex-start; padding: .2rem 0; cursor: pointer; }
.feedback { font-size: .86rem; margin-top: .3rem; }

/* ------------------------------------------------------------ CVE brief */
.cve header { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.cve header h2 { margin: 0 .4rem 0 0; font-size: 1.1rem; font-family: var(--sans); font-weight: 700; }
.rank { width: 30px; height: 30px; border: 1px solid var(--ink); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: .95rem; }
.cve.kev { border-left: 3px solid var(--red); }
.cve details { margin-top: .6rem; }
.teaser li { margin: .35rem 0; }

/* ------------------------------------------------------------ plans */
.toggle { display: inline-flex; margin: 0 0 1.2rem; border: 1px solid var(--ink); }
.toggle .btn { border: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem; }
.plan { display: flex; flex-direction: column; }
.plan > :last-child { margin-top: auto; align-self: flex-start; }
.plan.note > :last-child { margin-top: 0; }
.plan.featured { border-top: 3px solid var(--gold); }
.plan.current { border: 1px solid var(--ink); box-shadow: inset 0 3px 0 var(--black); }
.price { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; margin: .3rem 0; }
.price span { font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--graphite); margin-left: .2rem; }
.plan ul { padding-left: 1.1rem; font-size: .9rem; }

/* ------------------------------------------------------------ welcome */
.welcome { max-width: var(--wrap); margin: 1rem auto 0; padding: 1rem 1.3rem; display: flex; gap: 1rem; align-items: flex-start;
  justify-content: space-between; background: var(--white); border: 1px solid var(--ink); border-left: 4px solid var(--gold); }
.welcome p { margin: .3rem 0 0; }
.btn.ghost-dark { background: transparent; border: 0; font-size: 1.4rem; line-height: 1; padding: .2rem .5rem; color: var(--graphite); }

/* ------------------------------------------------------------ subscriber dashboard */
.band { background: var(--black); color: #ece8df; margin: -2.2rem calc(50% - 50vw) 2rem; padding: 2rem calc(50vw - 50% + 1.2rem) 1.6rem; }
.band-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2rem; align-items: center; }
.band h1 { color: var(--white); margin-bottom: .3rem; }
.band .muted, .floor .muted { color: #a29c90; }
.band a { color: var(--gold-hi); }
.situation { display: flex; gap: 2.2rem; flex-wrap: wrap; margin-top: 1.2rem; }
.situation .k { font-size: .8rem; color: #a29c90; }
.situation .v { font-family: var(--serif); font-size: 1.9rem; line-height: 1.2; color: var(--white); }
.situation .v small { font-family: var(--sans); font-size: .8rem; color: #a29c90; margin-left: .25rem; }
.level { display: flex; gap: 4px; margin-top: .45rem; }
.level i { width: 22px; height: 8px; background: #2c2924; }
.level i.on { background: var(--gold-hi); }
.level[data-l="4"] i.on, .level[data-l="5"] i.on { background: var(--red-hi); }
.streak-days { display: flex; gap: 5px; margin-top: .55rem; }
.streak-days i { width: 10px; height: 10px; border: 1px solid #5a554b; }
.streak-days i.on { background: var(--gold-hi); border-color: var(--gold-hi); }
.dash { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2rem; }
.dash section > h2:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--ink); margin-bottom: .2rem; }
.panel-head h2 { margin: 0 0 .4rem; font-size: 1.15rem; }
.panel-head a { font-size: .85rem; white-space: nowrap; }
.progress { height: 6px; background: var(--rule); margin: .5rem 0; }
.progress > i { display: block; height: 100%; background: var(--gold); }

/* ------------------------------------------------------------ alerts */
.alerts { list-style: none; margin: 0; padding: 0; }
.alert { padding: 1rem 0 1rem 1.2rem; border-bottom: 1px solid var(--rule); box-shadow: inset 4px 0 0 var(--rule); }
.alert.critical { box-shadow: inset 4px 0 0 var(--red); }
.alert.high { box-shadow: inset 4px 0 0 var(--gold); }
.alert .meta { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--graphite); }
.alert h3 { margin: .25rem 0; font-size: 1.02rem; }
.alert h3 a { text-decoration: none; }
.alert h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.alert p { margin: .2rem 0; }
.alert details summary { cursor: pointer; font-size: .88rem; color: var(--graphite); }
.alert details[open] summary { color: var(--ink); }
.alert .analysis { border-left: 1px solid var(--gold); padding: .2rem 0 .2rem 1rem; margin: .6rem 0; }
.alert.compact { padding: .7rem 0 .7rem 1.2rem; }
.filters { display: flex; gap: 0; border: 1px solid var(--ink); width: max-content; max-width: 100%; overflow-x: auto; margin: 0 0 1rem; }
.filters button { border: 0; background: var(--white); font: inherit; font-size: .86rem; padding: .45rem .9rem; cursor: pointer; white-space: nowrap; }
.filters button[aria-pressed="true"] { background: var(--black); color: var(--white); }
.sources { font-size: .78rem; color: var(--graphite); border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: .8rem; }
.sources ul { list-style: none; padding: 0; margin: .3rem 0; display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.feed-ok::before, .feed-bad::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: .35rem; vertical-align: .12em; }
.feed-ok::before { background: var(--gold); }
.feed-bad::before { background: var(--red); }

/* ------------------------------------------------------------ command post */
.post { max-width: 1480px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.post-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--floor-line); padding-bottom: .9rem; }
.post-head h1 { color: var(--white); margin: 0; }
.post-head .clock { font-family: var(--serif); font-size: 1.5rem; color: var(--gold-hi); line-height: 1.1; text-align: right; }
.post-head .clock small { display: block; font-family: var(--sans); font-size: .76rem; color: #8f8a80; }
.live { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; color: #cfc9bd; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--red-hi); animation: blink 2s ease-in-out infinite; }
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "map side" "lower side"; align-items: start; gap: 1.2rem; margin-top: 1.2rem; }
.post-grid > .mapwrap { grid-area: map; }
.post-grid > .side { grid-area: side; }
.post-grid > .lower { grid-area: lower; margin-top: 0; }
.mapwrap { position: relative; background: var(--black); border: 1px solid var(--floor-line); }
.mapwrap svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; padding: .6rem .9rem; border-top: 1px solid var(--floor-line); font-size: .76rem; color: #a29c90; }
.legend .ramp { width: 120px; height: 8px; background: linear-gradient(90deg, #26221c 0%, #5c4820 30%, #a8812f 60%, #d8b25c 85%, #e84840 100%); }
.legend .arc { width: 26px; height: 0; border-top: 1px solid var(--gold-hi); }
.tip { position: absolute; pointer-events: none; background: var(--black); border: 1px solid var(--gold-hi); color: var(--white); padding: .45rem .65rem; font-size: .8rem; line-height: 1.5; max-width: 240px; z-index: 2; }
.side { display: flex; flex-direction: column; gap: 1rem; }
.fpanel { background: var(--floor); border: 1px solid var(--floor-line); padding: .9rem 1rem; }
.fpanel h2 { color: var(--white); font-size: 1rem; margin: 0 0 .6rem; }
.fpanel ol, .fpanel ul { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) 3.3em; gap: .5rem; align-items: center; font-size: .82rem; padding: .18rem 0; }
.bars li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .b { height: 6px; background: #2c2924; }
.bars .b > i { display: block; height: 100%; background: var(--gold-hi); transform-origin: left; }
.bars.red .b > i { background: var(--red-hi); }
.bars .n { text-align: right; color: #cfc9bd; }
.fpanel .empty { color: #8f8a80; font-size: .82rem; }
.fpanel a { color: var(--gold-hi); }
.fpanel .alert { border-bottom-color: var(--floor-line); padding: .6rem 0; }
.fpanel .alert { box-shadow: inset 3px 0 0 #2c2924; padding-left: 1rem; }
.fpanel .alert.critical { box-shadow: inset 3px 0 0 var(--red-hi); }
.fpanel .alert h3 { font-size: .88rem; color: #f2efe8; }
.fpanel .alert h3 a { color: inherit; }
.fpanel .alert .meta { color: #8f8a80; }
.lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin-top: 1.2rem; }
.floor td, .floor th { border-bottom-color: var(--floor-line); padding: .3rem .4rem; }
.floor td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9em; }
.floor .tag { border-color: #3a342a; color: #a29c90; }
.floor .tag.danger { border-color: var(--red); color: var(--white); }
.floor .sources { color: #8f8a80; border-top-color: var(--floor-line); }
.floor .sources a { color: #cfc9bd; }

/* signature motion: a slow gold sweep across the map, like a scope */
.sweep { position: relative; overflow: hidden; }
.sweep::after { content: ""; position: absolute; top: 0; bottom: 0; left: -16%; width: 16%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(216, 178, 92, .025) 70%, rgba(216, 178, 92, .12) 99.2%, rgba(216, 178, 92, .55));
  mix-blend-mode: screen; animation: sweep 8s linear infinite; }
.mapwrap.sweep::after { bottom: 2.4rem; }
@keyframes sweep { to { left: 100%; } }
.bars .b > i { animation: grow .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes grow { from { transform: scaleX(0); } }

/* map marks */
.land { fill: #141210; stroke: #3a342a; stroke-width: .45; }
.land.hot { stroke: #6b5527; }
.land.jp { stroke: var(--gold-hi); stroke-width: 1.1; }
.land:hover { stroke: var(--gold-hi); stroke-width: 1; }
.arc-path { fill: none; stroke: var(--gold-hi); stroke-linecap: round; opacity: .8; }
.arc-path.to-jp { stroke: var(--red-hi); opacity: .95; }
.node { fill: var(--red-hi); }
.pulse { fill: none; stroke: var(--red-hi); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: pulse 2.6s ease-out infinite; }
.jp-ring { fill: none; stroke: var(--gold-hi); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: pulse 3.2s ease-out infinite; }
.mini .land { stroke-width: .3; }
.preview .land { fill: #17140f; stroke: #6b5527; stroke-width: .5; }
.preview .land.jp { stroke: var(--gold-hi); fill: #3a2f17; }

@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.arc-path.draw { stroke-dasharray: var(--len); animation: draw 1.4s cubic-bezier(.3, .7, .2, 1) both; animation-delay: var(--d, 0s); }

.locked-panel { max-width: 640px; border-top: 3px solid var(--gold); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: 1fr; grid-template-areas: "map" "side" "lower"; }
  .side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  .hero, .band-grid, .dash { grid-template-columns: 1fr; }
  .pillars, .lower { grid-template-columns: 1fr; }
  .pillars > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: .5rem 1rem; }
  .logo small { display: none; }
  .tools { margin-left: auto; }
  #nav { order: 3; flex-basis: 100%; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 2rem; }
  main { padding-top: 1.4rem; }
  .band { margin-top: -1.4rem; }
  .situation { gap: 1.4rem; }
  .welcome { margin: 1rem 1rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sweep::after { display: none; }
  .arc-path.draw { stroke-dasharray: none; }
}

/* ------------------------------------------------------------ AI consultation */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.consult { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem; align-items: start; }
.consult > * { min-width: 0; }
.threads { position: sticky; top: 5.5rem; border-right: 1px solid var(--rule); padding-right: 1.2rem; }
.threads .btn { width: 100%; justify-content: center; }
.threads ul { list-style: none; margin: .8rem 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.threads li a { display: block; padding: .5rem .6rem; text-decoration: none; border-left: 2px solid transparent; }
.threads li a:hover { background: var(--gold-wash); }
.threads li a[aria-current] { border-left-color: var(--gold); background: var(--gold-wash); }
.threads li span { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threads li small { color: var(--graphite); font-size: .74rem; }
.chat { min-width: 0; }
.chat-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 1px solid var(--ink); padding-bottom: .6rem; }
.chat-head h1 { margin: 0; }
.chat-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.chat-actions .ghost-dark { font-size: .82rem; text-decoration: underline; text-decoration-color: var(--gold); }
.thread { min-height: 300px; padding: 1.2rem 0; max-width: 78ch; }
.msg { margin: 0 0 1.4rem; }
.msg .who { font-size: .76rem; color: var(--graphite); margin-bottom: .25rem; }
.msg.user p { margin: 0; background: var(--gold-wash); padding: .7rem 1rem; border-left: 3px solid var(--gold); }
.msg.ai .body { border-left: 3px solid var(--black); padding: .1rem 0 .1rem 1rem; }
.msg.ai .body > :first-child { margin-top: 0; }
.msg.ai .body > :last-child { margin-bottom: 0; }
.thinking span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 3px; animation: blink 1.2s infinite; }
.thinking span:nth-child(2) { animation-delay: .2s; }
.thinking span:nth-child(3) { animation-delay: .4s; }
.handed { border: 1px solid var(--ink); border-left: 4px solid var(--gold); padding: .6rem .9rem; }
.disclaimer { border-top: 1px solid var(--rule); padding-top: .6rem; margin-bottom: 1.5rem; }
.starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; }
.starters p { grid-column: 1 / -1; margin: 0 0 .2rem; }
.starter { text-align: left; font: inherit; font-size: .92rem; background: var(--white); border: 1px solid var(--rule); padding: .8rem 1rem; cursor: pointer; line-height: 1.6; }
.starter:hover { border-color: var(--gold); background: var(--gold-wash); }
.composer { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--ink); padding: .8rem 0 .4rem; max-width: 78ch; }
.composer textarea { width: 100%; font: inherit; padding: .7rem .8rem; border: 1px solid #857f72; resize: vertical; min-height: 4.5rem; }
.composer textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .5rem; }
.dlg { border: 1px solid var(--ink); border-top: 4px solid var(--gold); padding: 1.4rem 1.6rem; max-width: 520px; width: calc(100% - 2rem); }
.dlg::backdrop { background: rgba(0, 0, 0, .55); }
.dlg h2 { margin-top: 0; }
.dlg textarea { width: 100%; font: inherit; padding: .5rem; border: 1px solid #857f72; margin-top: .3rem; }
.ask { border: 1px solid var(--ink); padding: 1rem 1.2rem; }
.ask p { margin: .2rem 0 .7rem; }
@media (max-width: 860px) {
  .consult { grid-template-columns: 1fr; }
  .threads { position: static; border-right: 0; border-top: 1px solid var(--rule); padding: 1rem 0 0; order: 2; }
  .threads ul { max-height: 9rem; }
  .composer-row { flex-direction: column; align-items: stretch; }
  .chat-head { flex-direction: column; }
}
