/*
 * The interactive tools' stylesheet (Native Alpha, Seed readiness, AI Slop Check). Loaded after site.css.
 * Every colour is a frontiers-brand role or a site token, or a mix of two of them; no colour literal is stated here.
 */

/* layout: a form column and a result panel */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, .82fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.tool--wide-panel { grid-template-columns: minmax(0, .85fr) minmax(20rem, 1.15fr); }
.tool__panel { position: sticky; top: 6rem; }
.tool__box { background: var(--paper); border: 1px solid var(--rule); padding: 1.25rem 1.35rem; }
.tool__box h3 { font-size: 1.45rem; margin: 0 0 .5rem; }
.tool__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tool__count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 56rem) {
  .tool, .tool--wide-panel { grid-template-columns: 1fr; }
  .tool__panel { position: static; }
}

.label { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 600; color: var(--muted); margin: 0 0 .5rem; }
.small { font-size: .88rem; color: var(--muted); }
.fine { font-size: .8rem; color: var(--muted); }

/* form fields */
.fields { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.field { display: block; }
.field__label { display: block; font-size: .95rem; font-weight: 600; color: var(--ink); }
.field__help { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; line-height: 1.5; }
.field textarea, .field select, .field__sub select {
  display: block; width: 100%; margin-top: .5rem; font: inherit; font-size: .95rem; line-height: 1.5;
  color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 0; padding: .55rem .7rem;
}
.field textarea { resize: vertical; }
.field textarea:focus, .field select:focus, .prompt:focus, .field__sub select:focus {
  outline: 2px solid color-mix(in srgb, var(--brand-primary) 55%, var(--brand-surface)); outline-offset: 0; border-color: var(--ink);
}
.field__sub { display: block; margin-top: .75rem; }
.field__sub .field__label { font-size: .85rem; }
fieldset.field { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 1.25rem 0 0; min-width: 0; }
fieldset.field legend { padding: 0; font-weight: 600; font-size: .95rem; color: var(--ink); }
.field__num { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin-right: .5rem; }

/* generated prompt */
.prompt {
  display: block; width: 100%; min-height: 20rem; margin-top: 1rem; resize: vertical; border-radius: 0;
  font-family: var(--mono); font-size: .78rem; line-height: 1.55; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); padding: .9rem;
}
.prompt--tall { min-height: 30rem; }
.reveal { margin-top: 1rem; border: 1px solid var(--rule); background: var(--surface); padding: .9rem 1rem; }
.reveal > summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.tool__box .reveal { background: var(--surface); }

/* buttons: the site's .button on real <button> elements */
button.button { font: inherit; font-size: .95rem; cursor: pointer; border-radius: 0; }
.tool .actions { margin: 1rem 0 .5rem; gap: .5rem; }
.button--quiet { background: none; color: var(--ink); border-color: var(--rule); }
.button--quiet:hover { background: var(--wash); color: var(--ink); }
.button[aria-pressed="false"] { background: var(--surface); color: var(--ink); }
.button[aria-pressed="false"]:hover { background: var(--ink); color: var(--surface); }
.status { min-height: 1.4em; font-size: .82rem; color: var(--muted); margin: .25rem 0 0; }

/* the evidence gates */
.gates { margin: 1.25rem 0 0; border-top: 1px solid var(--rule); }
.gates div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.gates dt { color: var(--ink); }
.gates dd { margin: 0; color: var(--muted); white-space: nowrap; }
.gates dd[data-state="Pass"] { color: var(--brand-success); font-weight: 600; }
.gates dd[data-state="Not yet"] { color: var(--brand-danger); font-weight: 600; }

/* label/value lists */
.defs { display: grid; gap: .9rem; margin: 1rem 0 0; font-size: .95rem; }
.defs > div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: .25rem 1rem; }
.defs dt { font-weight: 600; color: var(--ink); }
.defs dd { margin: 0; color: var(--muted); }
.defs--bands > div { grid-template-columns: 3rem minmax(0, 1fr); }
.defs--bands dd strong { color: var(--ink); }
@media (max-width: 40rem) { .defs > div { grid-template-columns: 1fr; } }

/* ruled numbered tiles */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem 2rem; }
.tiles > li, .tiles > div { border-top: 1px solid var(--rule); padding-top: .9rem; }
.tiles h3 { font-size: 1.1rem; margin: .35rem 0 .35rem; }
.tiles h3 a { color: var(--ink); text-decoration: none; }
.tiles h3 a:hover { text-decoration: underline; }
.tiles p { margin: 0; color: var(--muted); font-size: .93rem; }
.tiles dt { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ink); }
.tiles dd { margin: .4rem 0 0; color: var(--muted); font-size: .93rem; }
dl.tiles { margin: 0; }

.split { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

/* jump links */
.jump { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.75rem; margin: 0; }
.jump .label { margin: 0; }
.jump a { font-weight: 500; font-size: .95rem; }

/* scenarios */
.scenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: 2.5rem 2.5rem; margin-top: 2rem; }
@media (max-width: 34rem) { .scenarios { grid-template-columns: 1fr; } }
.scenario { border-top: 1px solid var(--rule); padding-top: 1.1rem; min-width: 0; }
.scenario__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; }
.scenario__top .label { white-space: nowrap; }
.scenario__sector { margin: 0; font-size: .8rem; color: var(--muted); text-align: right; max-width: 65%; }
.scenario h3 { font-size: 1.4rem; margin: .6rem 0 0; }
.scenario .defs { font-size: .9rem; }
.scenario .defs > div { grid-template-columns: 9.5rem minmax(0, 1fr); }
@media (max-width: 40rem) { .scenario .defs > div { grid-template-columns: 1fr; } }
.linkrow { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1rem 0 0; font-size: .88rem; }

/* the four stages */
.stages { border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); margin-top: 1.5rem; }
.stage { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 2rem; padding: clamp(1.25rem, 3vw, 2.25rem); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--surface); }
.stage h3 { font-size: 1.9rem; margin: .5rem 0 0; }
.stage__q { font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; color: var(--ink); }
.stage__body { color: var(--muted); max-width: 42rem; }
.stage ul { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.stage li { border-top: 1px solid var(--rule); padding: .45rem 0; font-size: .93rem; }
@media (max-width: 40rem) { .stage { grid-template-columns: 1fr; gap: .75rem; } }

/* next steps */
.nextsteps { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem 2rem; margin-top: 1.25rem; }
.nextsteps a { border-top: 1px solid var(--rule); padding-top: .9rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.nextsteps a:hover { text-decoration: underline; }

/* worksheet notice */
.worksheet { display: block; margin-top: 1rem; border: 1px solid var(--rule); padding: .9rem 1.1rem; color: var(--ink); text-decoration: none; font-weight: 500; }
a.worksheet:hover { background: var(--paper); }
.worksheet span { display: block; font-weight: 400; font-size: .82rem; color: var(--muted); margin-top: .2rem; }

/* see also */
.seealso { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .25rem 2rem; }
.seealso li { border-top: 1px solid var(--rule); padding: .6rem 0; font-size: .95rem; }

/* the readiness traps */
.traps { margin-top: 0; border: 1px solid var(--rule); background: var(--paper); }
.traps[open] { background: var(--surface); }
.traps > summary { cursor: pointer; padding: 1.25rem; list-style: none; }
.traps > summary::-webkit-details-marker { display: none; }
.traps > summary h2 { font-size: 1.6rem; margin: .25rem 0 .5rem; }
.traps > summary p { margin: 0; }
.traps > summary .label { color: var(--brand-primary); }
.traps__hint { display: inline-block; margin-top: .5rem; font-size: 1.1rem; line-height: 1; color: var(--muted); }
.traps__hint::before { content: "+"; }
.traps[open] .traps__hint::before { content: "\2212"; }
.traps__body { border-top: 1px solid var(--rule); padding: 1.5rem 1.25rem 1.25rem; }
.traps__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.5rem 2rem; }
.traps__list h3 { font-size: 1.1rem; margin: .25rem 0 .5rem; }
.traps__list p { font-size: .92rem; color: var(--muted); margin: 0 0 .5rem; }
.trap__no { font-size: .75rem; font-weight: 600; color: var(--muted); }
.trap__bad { color: var(--brand-danger); }
.trap__real { color: var(--ink); }
.trap__test { border-left: 2px solid var(--brand-primary); padding-left: .75rem; }
.trap__test, .trap__test span { color: var(--ink); }
.trap__test span { color: var(--muted); }

/* the operating-model figure */
.diagram { margin: 1.75rem 0 1rem; border: 1px solid var(--rule); background: var(--surface); padding: 1rem; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram--narrow { display: none; max-width: 22rem; margin-left: auto; margin-right: auto; }
@media (max-width: 40rem) { .diagram--wide { display: none; } .diagram--narrow { display: block; } }
.diagram figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.dg path, .dg rect, .dg ellipse, .dg line { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dg text { font-family: var(--serif); text-anchor: middle; stroke: none; }
.dg .t-ink { stroke: var(--ink); fill: none; }
.dg .t-blue { stroke: var(--brand-info); }
.dg .t-red { stroke: var(--brand-danger); }
.dg .t-green { stroke: var(--brand-success); }
.dg .t-purple { stroke: var(--brand-secondary); }
.dg text.t-ink { fill: var(--ink); stroke: none; }
.dg text.t-blue { fill: var(--brand-info); stroke: none; }
.dg text.t-red { fill: var(--brand-danger); stroke: none; }
.dg text.t-green { fill: var(--brand-success); stroke: none; }
.dg text.t-purple { fill: var(--brand-secondary); stroke: none; }
.dg .dash { stroke-dasharray: 6 6; }
h3.label { font-family: var(--sans); letter-spacing: .1em; margin-top: 1.75rem; }
