/*!
 * The Next School Incident (free demo) - styles
 * Cybernetic Shield
 *
 * Every rule is scoped to .csd or .csd-root so nothing here changes the
 * rest of the page. Where the browser supports it the game also renders
 * inside a shadow root, which stops theme styles leaking in.
 * One deliberate light look (white and green) on every site theme.
 */

.csd-root { display: block; margin: 0 0 1.5em; }
/* The game shows its own focus styles, so stop theme focus rings drawing round the whole game. */
.csd-root:focus, .csd-root:focus-visible, .csd-root:focus-within { outline: none !important; box-shadow: none !important; }
/* Shown only if the scripts haven't replaced the loading box after 8 seconds (no JavaScript needed). */
.csd-root .csd-slow { max-height: 0; overflow: hidden; visibility: hidden; animation: csd-reveal 0.01s linear 8s forwards; }
.csd-root .csd-slow p { margin: 12px 0 0; }
@keyframes csd-reveal { to { max-height: 600px; visibility: visible; } }
.csd-root .csd-loading { padding: 32px 24px; border: 1px solid #DDE8D9; border-radius: 20px; background: #FFFFFF; color: #1A1A1A; font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }

/* ------------------------------------------------------------------ */
/* Tokens and reset                                                    */
/* ------------------------------------------------------------------ */

.csd {
  /* Layout: one centred column (max 1180px) with a sticky choice tray; rounds use main + side panel. */
  --bg: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #3F4A3C;
  --ink-3: #4B5748;
  --line: #DDE8D9;
  --line-2: #E3EBE0;
  --mint: #EEF7EB;
  --mint-2: #F3F8F1;
  --picked: #F3FAF0;
  --green: #57B947;
  --green-text: #2B7A26;
  --on-green: #10200C;
  --green-soft: #8FCF82;
  --orange: #E27423;
  --orange-text: #A4480C;
  --orange-tint: #FDF1E7;
  --orange-ink: #6B3A12;
  --grey-tint: #F7F8F6;
  --chip: #F2F4F1;
  --display: "CSD Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text: "CSD Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  box-sizing: border-box;
  display: block;
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: clip;
  -webkit-font-smoothing: antialiased;
  container-type: inline-size;
  container-name: csd;
}
.csd *, .csd *::before, .csd *::after { box-sizing: border-box; }
.csd :where(p, ul, ol, dl, dd, dt, h2, h3, h4, fieldset, legend, blockquote, figure) {
  margin: 0; padding: 0; border: 0; color: inherit; font-family: inherit; background: none; letter-spacing: normal; text-transform: none;
}
.csd :where(ul, ol) { list-style: none; }
.csd :where(strong, b) { font-weight: 700; }
.csd a { color: var(--green-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.csd a:hover { color: var(--ink); }
.csd [hidden] { display: none !important; }
.csd img { max-width: 100%; height: auto; }

.csd-icon { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.csd-art { display: block; line-height: 0; }
.csd-art svg { width: 100%; height: auto; display: block; }
.csd-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.csd :focus { outline: none; }
.csd :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.csd .csd-option:focus-visible, .csd .csd-btn:focus-visible, .csd .csd-input:focus-visible, .csd summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 7px rgba(87, 185, 71, 0.45); }
.csd .csd-radio:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.csd [tabindex="-1"]:focus { outline: none; }

/* ------------------------------------------------------------------ */
/* Type                                                                */
/* ------------------------------------------------------------------ */

.csd-display { font-family: var(--display); font-weight: 800; font-size: clamp(2.2em, 1.4em + 3vw, 3.75em); line-height: 1.03; letter-spacing: -0.02em; text-wrap: balance; }
.csd-display--sm { font-size: clamp(1.75em, 1.3em + 1.6vw, 2.3em); line-height: 1.1; }
.csd-h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.75em, 1.35em + 1.5vw, 2.6em); line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
.csd-h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.35em, 1.15em + 0.7vw, 1.75em); line-height: 1.2; text-wrap: balance; }
.csd-h3 { font-weight: 700; font-size: 1.2em; line-height: 1.3; }
.csd-h4 { font-weight: 700; font-size: 1.06em; line-height: 1.35; }
.csd-eyebrow { font-size: 0.82em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-text); }
.csd-label { font-size: 0.8em; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.csd-lead { font-size: 1.15em; color: var(--ink-2); max-width: 62ch; }
.csd-small { font-size: 0.85em; color: var(--ink-3); }
.csd-muted { color: var(--ink-3); }
.csd-strong { font-weight: 700; }
.csd-basis { font-size: 0.85em; color: var(--ink-3); }
.csd-with-icon { display: flex; gap: 10px; align-items: center; }
.csd-with-icon .csd-icon { color: var(--green-text); }
.csd-select { user-select: all; -webkit-user-select: all; font-weight: 700; }
.csd-list { display: flex; flex-direction: column; gap: 6px; padding-left: 1.2em; }
.csd ul.csd-list > li { list-style: disc; }
.csd-list > li::marker { color: var(--green); }
.csd ul.csd-list--plain { padding-left: 0; gap: 8px; }
.csd ul.csd-list--plain > li { list-style: none; }

/* ------------------------------------------------------------------ */
/* Frame                                                               */
/* ------------------------------------------------------------------ */

.csd-header {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); background: var(--bg);
}
.csd-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.csd-logo { max-height: 36px; width: auto; }
.csd-brand-text { font-weight: 700; font-size: 1em; }
.csd-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.csd-pill { font-size: 0.8em; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--green-text); background: var(--mint); padding: 6px 12px; border-radius: 999px; }

.csd-main { padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 48px) clamp(32px, 4vw, 56px); max-width: 1276px; margin: 0 auto; }
.csd-footer { border-top: 1px solid var(--line); padding: 16px clamp(16px, 4vw, 48px) 20px; font-size: 0.85em; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; }
.csd-footer-strong { display: flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 600; }
.csd-footer-strong .csd-icon { color: var(--orange-text); }

.csd-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.csd-row--end { justify-content: flex-end; }
.csd-stack { display: flex; flex-direction: column; gap: 28px; }
.csd-intro { display: flex; flex-direction: column; gap: 10px; }
.csd-sec { display: flex; flex-direction: column; gap: 12px; }

.csd-notice { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9em; color: var(--ink-3); max-width: 70ch; }
.csd-notice .csd-icon { margin-top: 2px; }
.csd-notice--box { max-width: none; background: var(--grey-tint); color: #2F382D; padding: 16px 20px; border-radius: 16px; font-size: 0.95em; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.csd .csd-btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; margin: 0; padding: 10px 20px;
  border: 2px solid var(--green); border-radius: 14px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 1em; font-weight: 700; line-height: 1.2;
  letter-spacing: normal; text-transform: none; text-decoration: none; text-shadow: none; box-shadow: none;
  cursor: pointer; width: auto; height: auto;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.csd .csd-btn:hover { background: var(--mint); color: var(--ink); }
.csd .csd-btn:active { transform: translateY(1px); }
.csd .csd-btn--primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.csd .csd-btn--primary:hover { background: #4CA83D; border-color: #4CA83D; color: var(--on-green); }
.csd .csd-btn--dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.csd .csd-btn--dark:hover { background: #333333; border-color: #333333; color: #FFFFFF; }
.csd .csd-btn--ghost { border-color: transparent; background: transparent; color: var(--green-text); padding-left: 10px; padding-right: 10px; }
.csd .csd-btn--ghost:hover { background: var(--mint); color: var(--ink); }
.csd .csd-btn--small { min-height: 44px; padding: 6px 14px; font-size: 0.9em; font-weight: 600; border: 1px solid var(--line); border-radius: 12px; }
.csd .csd-btn--small:hover { border-color: var(--green); }
.csd .csd-btn--large { min-height: 58px; padding: 12px 28px; font-size: 1.1em; }
.csd .csd-btn--block { width: 100%; }
.csd .csd-btn--inline { min-height: 36px; padding: 2px 8px; font-size: inherit; vertical-align: middle; }
.csd .csd-btn:disabled { cursor: not-allowed; background: var(--bg); color: var(--ink-3); border: 2px dashed #A9B7A4; transform: none; }
.csd a.csd-btn { text-decoration: none; }

/* ------------------------------------------------------------------ */
/* Welcome                                                             */
/* ------------------------------------------------------------------ */

.csd-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin-bottom: clamp(32px, 4vw, 56px); }
.csd-hero-text { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.csd-align-badge { align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; font-size: 0.9em; font-weight: 700; color: var(--green-text); background: var(--mint); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; }
.csd-align { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95em; color: var(--ink-2); background: var(--mint-2); border: 1px solid var(--line); padding: 14px 18px; border-radius: 16px; }
.csd-align .csd-icon, .csd-align-badge .csd-icon { color: var(--green-text); flex: none; }
.csd-align strong { color: var(--ink); }
.csd-hero-text .csd-lead { font-size: 1.25em; max-width: 36ch; }
.csd-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 0.95em; color: var(--ink-2); }
.csd-facts li { display: flex; gap: 8px; align-items: center; }
.csd-facts .csd-icon { color: var(--green-text); }
.csd-hero-art { min-width: 0; }

.csd-band { background: var(--mint-2); border-radius: 32px; padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 24px; margin-bottom: 28px; }
.csd-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.csd-step { display: flex; flex-direction: column; gap: 8px; }
.csd-step p { font-size: 0.95em; color: var(--ink-2); }
.csd-step-top { display: flex; align-items: center; gap: 12px; }
.csd-step-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--bg); border: 2px solid var(--green); display: grid; place-items: center; color: var(--green-text); }
.csd-step-icon .csd-icon { width: 26px; height: 26px; }
.csd-step.is-last .csd-step-icon { background: var(--green); color: var(--on-green); }
.csd-step-num { font-family: var(--display); font-weight: 800; font-size: 0.95em; color: var(--green-text); }

/* ------------------------------------------------------------------ */
/* Scenario cards                                                      */
/* ------------------------------------------------------------------ */

.csd-scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin: 28px 0; }
.csd-scenario { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 26px; overflow: hidden; background: var(--bg); }
.csd-scenario.is-open { border: 2px solid var(--green); box-shadow: 0 14px 34px rgba(43, 122, 38, 0.14); }
.csd-scenario-art { background: var(--mint); padding: 22px 22px 8px; }
.csd-scenario.is-locked .csd-scenario-art { background: var(--chip); }
.csd-scenario-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.csd-scenario-body .csd-h3 { font-family: var(--display); font-size: 1.6em; }
.csd-scenario.is-locked .csd-h3, .csd-scenario.is-locked p { color: var(--ink-2); }
.csd-scenario-foot { margin-top: auto; padding-top: 8px; }
.csd-picks { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.csd-choose-intro .csd-lead { max-width: 52ch; }
.csd-choose-intro .csd-facts { margin-top: 6px; }
.csd-switch { margin: -6px 0 -4px; }
.csd-locked { display: flex; gap: 10px; align-items: center; font-size: 0.95em; font-weight: 600; color: var(--ink-3); flex-wrap: wrap; }
.csd-push { margin-left: auto; font-weight: 700; }
.csd-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.csd-tag { font-size: 0.8em; font-weight: 600; color: var(--ink-2); background: var(--chip); padding: 4px 10px; border-radius: 999px; }
.csd-tag.is-key { color: var(--green-text); background: var(--mint); font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Progress                                                            */
/* ------------------------------------------------------------------ */

.csd-progress-wrap { margin: -8px 0 28px; }
.csd-progress-caption { display: none; font-size: 0.9em; font-weight: 700; margin-bottom: 8px; }
.csd-progress-caption span { color: var(--green-text); }
.csd-progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.csd-progress-step { display: flex; flex-direction: column; gap: 8px; }
.csd-progress-bar { height: 8px; border-radius: 999px; background: var(--line-2); }
.csd-progress-step.is-done .csd-progress-bar, .csd-progress-step.is-current .csd-progress-bar { background: var(--green); }
.csd-progress-label { font-size: 0.85em; font-weight: 600; color: var(--ink-3); }
.csd-progress-step.is-current .csd-progress-label { color: var(--ink); font-weight: 700; }
.csd-progress-num { color: inherit; }
.csd-progress-step.is-current .csd-progress-num { color: var(--green-text); }

/* ------------------------------------------------------------------ */
/* Round                                                               */
/* ------------------------------------------------------------------ */

.csd-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.csd-col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.csd-col-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; }

.csd-panel { border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.csd-panel--mint { background: var(--mint-2); border-color: transparent; }
.csd-panel .csd-list { font-size: 0.95em; color: #2F382D; }

.csd-ind-list { display: flex; flex-direction: column; gap: 14px; }
.csd-ind { display: flex; gap: 12px; align-items: flex-start; }
.csd-ind-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--mint); display: grid; place-items: center; color: var(--green-text); }
.csd-ind-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.csd-ind-label { font-size: 0.95em; font-weight: 700; line-height: 1.3; }
.csd-ind-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.csd-meter { display: inline-flex; gap: 3px; }
.csd-meter-seg { width: 22px; height: 8px; border-radius: 4px; background: var(--line-2); }
.csd-meter--lg .csd-meter-seg { width: 30px; height: 10px; border-radius: 5px; }
.csd-meter--b0 .is-on { background: var(--orange); }
.csd-meter--b1 .is-on { background: var(--green-soft); }
.csd-meter--b2 .is-on { background: var(--green); }
.csd-level { font-size: 0.9em; font-weight: 700; }
.csd-level--0 { color: var(--orange-text); }
.csd-level--1 { color: #2F382D; }
.csd-level--2 { color: var(--green-text); }
.csd-change { display: inline-flex; gap: 4px; align-items: center; font-size: 0.8em; font-weight: 600; }
.csd-change .csd-icon { width: 1em; height: 1em; }
.csd-change--up { color: var(--green-text); }
.csd-change--down { color: var(--orange-text); }

.csd-devs { display: flex; flex-direction: column; gap: 12px; }
.csd-dev { border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.csd-dev--unavoidable { background: var(--grey-tint); }
.csd-dev--linked { background: var(--mint); }
.csd-dev-tag { display: flex; align-items: center; gap: 8px; font-size: 0.78em; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.csd-dev--linked .csd-dev-tag { color: var(--green-text); }
.csd-dev-tag--alert { color: var(--orange-text); }
.csd-despite { font-size: 0.93em; color: #2F382D; padding: 8px 12px; border-radius: 10px; background: var(--mint); }

.csd-story { border: 1px solid var(--line); border-radius: 26px; padding: clamp(20px, 3vw, 28px) clamp(18px, 3vw, 30px); display: flex; gap: 24px; align-items: flex-start; }
.csd-story-art { flex: none; width: 150px; }
.csd-story-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.csd-quote { padding: 12px 16px; background: var(--grey-tint); border-radius: 14px; font-style: italic; }

.csd-essential { border: 2px solid var(--orange); background: var(--orange-tint); border-radius: 22px; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.csd-essential .csd-h3 { display: flex; gap: 10px; align-items: center; color: var(--orange-ink); }
.csd-essential.is-done { border-style: dashed; background: var(--bg); }

.csd-prompt { display: flex; flex-direction: column; gap: 4px; }
.csd-prompt p { color: var(--ink-2); }

.csd-options { display: flex; flex-direction: column; gap: 12px; }
.csd .csd-option {
  -webkit-appearance: none; appearance: none;
  display: flex; gap: 18px; align-items: flex-start; width: 100%; margin: 0;
  text-align: left; padding: 18px 20px; border: 2px solid var(--line-2); border-radius: 20px;
  background: var(--bg); color: var(--ink); font: inherit; line-height: 1.5;
  letter-spacing: normal; text-transform: none; box-shadow: none; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.csd .csd-option:hover { border-color: var(--green); background: var(--bg); color: var(--ink); }
.csd .csd-option.is-on { border-color: var(--green); background: var(--picked); }
.csd .csd-option.is-full { border-style: dashed; cursor: not-allowed; }
.csd .csd-option.is-full:hover { border-color: var(--line-2); }
.csd-option-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--mint-2); display: grid; place-items: center; color: var(--ink-3); }
.csd-option.is-on .csd-option-icon { background: var(--bg); color: var(--green-text); border: 1px solid #CFE3C8; }
.csd-option-icon .csd-icon { width: 24px; height: 24px; }
.csd-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.csd-option-title { font-weight: 700; font-size: 1.12em; line-height: 1.3; }
.csd-option-desc { font-size: 0.97em; color: var(--ink-2); }
.csd-chosen { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--green); color: var(--on-green); font-size: 0.85em; font-weight: 700; }
.csd-chosen .csd-icon { stroke-width: 3; width: 1.1em; height: 1.1em; }
.csd-unchosen { flex: none; width: 30px; height: 30px; border-radius: 999px; border: 2px solid #A9B7A4; }

.csd-tray {
  position: sticky; bottom: 12px; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(26, 26, 26, 0.12);
}
.csd-tray-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.csd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.csd-chip { font-size: 0.93em; font-weight: 600; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.csd-chip.is-green { background: var(--mint); border-color: transparent; color: var(--ink); }
.csd-chip.is-orange { background: var(--orange-tint); border-color: transparent; color: var(--orange-ink); font-weight: 700; }
.csd-chip.is-dashed { border: 2px dashed #A9B7A4; color: #2F382D; font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Outcome                                                             */
/* ------------------------------------------------------------------ */

.csd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.csd-tile { border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.csd-tile-head { display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.csd-delta { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 0.85em; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.csd-delta .csd-icon { width: 1em; height: 1em; stroke-width: 2.6; }
.csd-delta--up { color: var(--green-text); background: var(--mint); }
.csd-delta--down { color: var(--orange-text); background: var(--orange-tint); }
.csd-delta--same { color: var(--ink-3); background: var(--chip); }

.csd-clash { border: 2px solid var(--orange); background: var(--orange-tint); border-radius: 22px; padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.csd-clash .csd-h3 { display: flex; gap: 10px; align-items: center; color: var(--orange-ink); }

.csd-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.csd-result { border: 1px solid var(--line); border-radius: 24px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.csd-result.is-conflicted { border-color: var(--orange); border-style: dashed; }
.csd-result-head { display: flex; align-items: center; gap: 12px; }
.csd-result-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--green); color: var(--on-green); display: grid; place-items: center; }
.csd-result.is-conflicted .csd-result-icon { background: var(--orange-tint); color: var(--orange-ink); }
.csd-fx { display: flex; gap: 12px; }
.csd-fx .csd-icon { color: var(--green-text); margin-top: 3px; }

.csd-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.csd-box { border-radius: 24px; padding: 20px 24px; display: flex; gap: 14px; align-items: flex-start; }
.csd-box > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.csd-box-icon { width: 26px; height: 26px; margin-top: 1px; }
.csd-box--orange { background: var(--orange-tint); }
.csd-box--orange .csd-box-icon { color: var(--orange-text); }
.csd-box--mint { background: var(--mint-2); }
.csd-box--mint .csd-box-icon { color: var(--green-text); }

.csd-others { display: flex; flex-direction: column; gap: 12px; }
.csd-details { border: 1px solid var(--line); border-radius: 18px; padding: 0 20px; }
.csd-details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; cursor: pointer; font-weight: 700; }
.csd-details > summary::-webkit-details-marker { display: none; }
.csd-chev { color: var(--green-text); transition: transform 0.2s ease; }
.csd-details[open] .csd-chev { transform: rotate(180deg); }
.csd-details[open] { padding-bottom: 18px; }
.csd-dl { display: flex; flex-direction: column; gap: 4px; }
.csd-dl dt { font-weight: 700; margin-top: 10px; }
.csd-dl dd { color: var(--ink-2); }

.csd-reality { border: 2px solid var(--green); border-radius: 28px; padding: clamp(20px, 3vw, 30px) clamp(18px, 3vw, 32px); display: flex; flex-direction: column; gap: 18px; }
.csd-reality-top { display: flex; flex-wrap: wrap; gap: 20px 28px; justify-content: space-between; align-items: flex-start; }
.csd-reality-text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.csd-reality-text p:last-child { color: var(--ink-2); }
.csd-reality-prompts { flex: 0 1 320px; padding: 14px 18px 14px 36px; border-radius: 18px; background: var(--mint-2); font-size: 0.95em; display: flex; flex-direction: column; gap: 4px; }
.csd ul.csd-reality-prompts > li { list-style: disc; }
.csd-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; min-width: 0; }
.csd-choice { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border: 2px solid var(--line-2); border-radius: 16px; cursor: pointer; min-height: 56px; }
.csd-choice:hover { border-color: var(--green); }
.csd-choice.is-on { border-color: var(--green); background: var(--picked); }
.csd .csd-radio { -webkit-appearance: none; appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid #7E8A7A; border-radius: 50%; background: var(--bg); display: grid; place-content: center; cursor: pointer; }
.csd .csd-radio::before { content: ""; width: 12px; height: 12px; border-radius: 50%; transform: scale(0); background: var(--green-text); }
.csd .csd-radio:checked { border-color: var(--green-text); }
.csd .csd-radio:checked::before { transform: scale(1); }

/* ------------------------------------------------------------------ */
/* Snapshot                                                            */
/* ------------------------------------------------------------------ */

.csd-stack--wide { gap: 32px; }
.csd-snap-hero { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.csd-snap-hero-text { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.csd-snap-art { flex: 0 1 240px; max-width: 100%; }

.csd-disclaimer { display: flex; gap: 14px; align-items: flex-start; border: 2px solid var(--green); border-radius: 22px; padding: 18px 22px; background: var(--mint-2); }
.csd-disclaimer > div { display: flex; flex-direction: column; gap: 6px; }
.csd-disclaimer .csd-box-icon { color: var(--green-text); }
.csd-disclaimer p { font-size: 0.97em; color: #2F382D; }

.csd-tiles--compact .csd-tile { gap: 8px; }
.csd-card { border: 1px solid var(--line); border-radius: 24px; padding: 24px 26px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.csd-card--mint { background: var(--mint-2); border-color: transparent; }
.csd-card--orange { background: var(--orange-tint); border-color: transparent; }
.csd-card--orange .csd-basis { color: var(--orange-ink); }
.csd-ticks { display: flex; flex-direction: column; gap: 12px; }
.csd-ticks li { display: flex; gap: 12px; }
.csd-ticks .csd-icon { color: var(--green-text); stroke-width: 2.6; margin-top: 2px; }
.csd-ticks.is-alert .csd-icon { color: var(--orange-text); stroke-width: 2.2; }
.csd-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.csd-trio > div { display: flex; flex-direction: column; gap: 8px; }

.csd-plan { display: flex; flex-direction: column; gap: 14px; }
.csd-plan-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 200px) minmax(0, 170px); gap: 14px 16px; align-items: start; border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; min-width: 0; }
.csd-plan-num { width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: var(--on-green); font-family: var(--display); font-weight: 800; font-size: 1.2em; display: grid; place-items: center; margin-top: 24px; }
.csd-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.csd-field label { font-size: 0.82em; font-weight: 700; color: var(--ink-3); margin: 0; padding: 0; }
.csd .csd-input {
  -webkit-appearance: none; appearance: none; width: 100%; margin: 0;
  font: inherit; font-size: 1em; line-height: 1.4; color: var(--ink);
  padding: 10px 12px; border: 2px solid #A9B7A4; border-radius: 12px; background: var(--bg);
  box-shadow: none; min-height: 48px; height: auto;
}
.csd textarea.csd-input { resize: vertical; min-height: 72px; }
.csd .csd-input::placeholder { color: #6A7566; opacity: 1; }
.csd .csd-input:focus { border-color: var(--green-text); }

.csd-decisions { display: flex; flex-direction: column; gap: 14px; padding-left: 1.4em; }
.csd ol.csd-decisions > li { list-style: decimal; }
.csd-decisions > li::marker { color: var(--green-text); font-weight: 700; }
.csd-details--card { padding: 0 22px; }

.csd-share { display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--line); padding-top: 28px; }
.csd-share-head { display: flex; flex-direction: column; gap: 6px; }
.csd-share-head p { color: var(--ink-2); max-width: 70ch; }
.csd-share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.csd-share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.csd-status { min-height: 1.5em; font-weight: 600; color: var(--green-text); }

.csd-cta { border-radius: 32px; background: var(--green); color: var(--on-green); padding: clamp(24px, 4vw, 44px); display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.csd-cta-text { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.csd-cta-text p { font-size: 1.08em; max-width: 56ch; }
.csd-cta-art { flex: 0 1 220px; max-width: 100%; }
.csd-cta-phone { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; font-size: 1.05em; }
.csd-cta a.csd-btn--dark { color: #FFFFFF; }
.csd-sources a { color: var(--green-text); }

.csd-copy-fallback { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; }
.csd-copy-fallback.is-visible { position: static; width: 100%; height: 220px; padding: 12px; font: 0.85em/1.45 ui-monospace, Menlo, Consolas, monospace; color: var(--ink); background: var(--bg); border: 2px solid var(--green); border-radius: 12px; }

/* ------------------------------------------------------------------ */
/* Overlay, errors                                                     */
/* ------------------------------------------------------------------ */

.csd-overlay { position: absolute; inset: 0; z-index: 10; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; }
.csd-overlay[hidden] { display: none; }
.csd-dialog { position: sticky; top: 40px; width: 100%; max-width: 540px; background: var(--bg); border: 2px solid var(--green); border-radius: 24px; padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 24px 60px rgba(26, 26, 26, 0.18); }
.csd-dialog .csd-icon { color: var(--green-text); }

.csd-error { margin: 20px; padding: 22px; border: 2px solid var(--orange); border-radius: 18px; display: flex; flex-direction: column; gap: 10px; }
.csd-error .csd-h3 { display: flex; gap: 10px; align-items: center; color: var(--orange-ink); }
.csd-error-list { font: 0.8em/1.5 ui-monospace, Menlo, Consolas, monospace; padding-left: 1.3em; }
.csd ul.csd-error-list > li { list-style: disc; margin-bottom: 4px; }

/* ------------------------------------------------------------------ */
/* Responsive and motion                                               */
/* ------------------------------------------------------------------ */

@container csd (max-width: 900px) {
  .csd-hero { grid-template-columns: minmax(0, 1fr); }
  .csd-hero-art { max-width: 440px; }
  .csd-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csd-col-side { position: static; }
  .csd-plan-row { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); }
  .csd-field--action { grid-column: 2 / -1; }
  .csd-plan-row .csd-field:not(.csd-field--action) { grid-column: auto; }
  .csd-plan-row .csd-field:nth-of-type(2) { grid-column: 2 / 3; }
  .csd-plan-num { margin-top: 24px; }
}

@media (max-width: 600px) {
  .csd { font-size: 16px; border-radius: 0; border-left: 0; border-right: 0; }
}

@container csd (max-width: 600px) {
  .csd-steps { grid-template-columns: minmax(0, 1fr); }
  .csd-tiles { grid-template-columns: minmax(0, 1fr); }
  .csd-story { flex-direction: column; gap: 14px; }
  .csd-story-art { width: 110px; }
  .csd .csd-option { gap: 12px; padding: 14px; }
  .csd-option-icon { width: 40px; height: 40px; border-radius: 12px; }
  .csd-chosen span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .csd-chosen { padding: 6px; }
  .csd-tray { bottom: 0; border-radius: 18px 18px 0 0; margin: 0 -16px; padding: 12px 16px 16px; }
  .csd-tray .csd-btn { width: 100%; }
  .csd-tray .csd-chips { display: none; }
  .csd textarea.csd-input { min-height: 120px; }
  .csd-plan-row { grid-template-columns: minmax(0, 1fr); }
  .csd-plan-num { display: none; }
  .csd-field--action, .csd-plan-row .csd-field:nth-of-type(2) { grid-column: auto; }
  .csd-share-actions .csd-btn { flex: 1 1 100%; }
  .csd-row > .csd-btn--large { width: 100%; }
  .csd-progress { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .csd-progress-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .csd-progress-caption { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .csd *, .csd *::before, .csd *::after { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .csd .csd-option.is-on { border: 4px double CanvasText; }
  .csd-meter .is-on { background: CanvasText; }
}
