/* DevOps Nimbus Bash and shell. Calm, product-page styling: system font, solid surfaces,
   hairline borders, one green accent. */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, .08);
  --accent: #41831e; --accent-fill: #7bd64a; --accent-fill-hover: #6cbc41; --on-fill: #1d1d1f;
  --accent-hover: #376f1a;
  --accent-2: #41831e;
  --stage-accent: #7bd64a; /* the dark stage keeps the dark-mode accent */
  --accent-soft: #effae9;
  --on-accent: #ffffff;
  --ok: #1d7a34;
  --ok-soft: #e9f6ec;
  --bad: #c9001a;
  --bad-soft: #fdecee;
  --warn: #b26b00;
  --warn-text: #8a5300;
  --warn-soft: #fff4e0;
  --code-bg: #f0f0f3;
  --stage: #0b0b0d;
  --stage-text: #f5f5f7;
  --stage-muted: #8e8e93;
  --stage-line: rgba(255, 255, 255, .09);
  --shadow: 0 2px 8px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #161618;
    --surface-2: #1c1c1e;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #424245;
    --hair: rgba(255, 255, 255, .1);
    --accent: #7bd64a; --accent-fill: #7bd64a; --accent-fill-hover: #8fdc65; --on-fill: #000000;
    --accent-hover: #95de6e;
    --accent-2: #7bd64a;
    --accent-soft: #283921;
    --on-accent: #000000;
    --ok: #30d158;
    --ok-soft: #0f2e18;
    --bad: #ff6961;
    --bad-soft: #3a1414;
    --warn: #ffb340;
    --warn-text: #ffcc80;
    --warn-soft: #3a2a0c;
    --code-bg: #2c2c2e;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.015em; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd, .mono { font-family: var(--mono); letter-spacing: 0; }
code, pre { font-size: .86em; }
:not(pre) > code { background: var(--code-bg); padding: .12em .4em; border-radius: 6px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; margin: 0; line-height: 1.6; }
h1, h2, h3, h4 { letter-spacing: -.03em; line-height: 1.1; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
button { font: inherit; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 30; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: .88rem; }
.small { font-size: .9rem; }
.lede { color: var(--muted); font-size: 1.15rem; margin: -6px 0 24px; max-width: 700px; }

/* Navigation: quiet and solid. */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--hair); }
.top-inner { display: flex; align-items: center; gap: 20px; height: 52px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 22px; height: 22px; }
.kbd-btn { display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); background: var(--code-bg); border: 1px solid transparent; border-radius: 99px; padding: 5px 6px 5px 14px; cursor: pointer; }
.kbd-btn:hover { border-color: var(--line); }
kbd { font-size: .72rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }

main { padding-bottom: 64px; min-height: 70vh; }
.tab > h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; margin: 48px 0 14px; }

/* Hero: split composition, the text beside the dark stage. */
.hero { padding: 72px 0 8px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 1.1rem; margin: 0 0 6px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 700; margin: 0 0 18px; }
.hero .sub { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--muted); line-height: 1.38; max-width: 560px; margin: 0 0 30px; }
.ctas { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.text-link { font-size: 1.05rem; }
.text-link::after { content: " ›"; }
/* The doors sit in a full-width row under the headline and the stage. */
.hero-grid > .doors { grid-column: 1 / -1; grid-row: 2; }
.doors { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.door { padding: 24px 26px; border-radius: var(--radius); border: 1px solid var(--hair); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.door h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.door p { margin: 0; color: var(--muted); }
.door .door-k { font-size: .85rem; font-weight: 600; color: var(--accent); }
.door.fix { background: var(--oncall); border-color: transparent; color: var(--on-oncall); }
.door.fix p, .door.fix .door-k { color: color-mix(in srgb, var(--on-oncall) 72%, transparent); }
.door .ctas { margin-top: 10px; }
.door-search { display: flex; gap: 8px; margin-top: 10px; }
.door-search input { flex: 1; min-width: 0; border-radius: 99px; }
.mode-banner { margin: 32px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--hair); box-shadow: inset 3px 0 0 var(--oncall); font-size: .95rem; }
.mode-banner + h2 { margin-top: 32px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 22px;
  border-radius: 99px; font-size: 1rem; color: var(--accent); background: transparent; border: 1px solid var(--accent);
  cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease);
}
.pill:hover { text-decoration: none; background: var(--accent-soft); }
.pill:active { transform: scale(.98); }
.pill.primary { background: var(--accent-fill); color: var(--on-fill); border-color: var(--accent-fill); }
.pill.primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill); }
.small-pill { min-height: 36px; padding: 0 18px; font-size: .9rem; }

/* The stage: the signature, deploy.sh under the X-ray, lit by the accent. */
.stage { position: relative; margin: 0; background: var(--stage); color: var(--stage-text); border-radius: 30px; padding: 30px; min-height: 360px; overflow: hidden; isolation: isolate; box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent) 45%, transparent); }
.stage::before { content: ""; position: absolute; inset: -40% -10% auto; height: 120%; background: radial-gradient(closest-side, color-mix(in srgb, var(--stage-accent) 26%, transparent), transparent 70%); z-index: -1; pointer-events: none; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 13px; color: var(--stage-muted); }
.stage-bar strong { color: var(--stage-text); font-weight: 600; font-size: 15px; }
.toggle { border: 1px solid var(--stage-line); background: rgba(255, 255, 255, .06); color: var(--stage-text); border-radius: 99px; padding: 7px 14px; font-size: 13px; cursor: pointer; transition: background .2s, border-color .2s; white-space: nowrap; }
.toggle:hover, .toggle[aria-pressed="true"] { border-color: var(--stage-accent); background: color-mix(in srgb, var(--stage-accent) 18%, transparent); }
.stage-code { font-size: 13px; line-height: 1.65; }
/* Held open until app.js draws the script, so the hero does not move when it arrives. */
.stage-code:empty { min-height: 338px; }
@media (max-width: 760px) { .stage-code:empty { min-height: 325px; } }
@media (max-width: 480px) { .stage-code:empty { min-height: 365px; } }
.stage-code > div { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 12px; padding: 3px 8px; border-radius: 8px; transition: background .2s; }
.stage-code > div:hover { background: rgba(255, 255, 255, .06); }
.stage-code .n { color: var(--stage-muted); text-align: right; }
.stage-code .src { white-space: pre-wrap; overflow-wrap: anywhere; }
.stage-code .src.changed { color: var(--stage-accent); animation: sq-in .4s var(--ease); }
.stage-code .snote { grid-column: 2; font-size: 12px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
.snote.ok, .s-ok { color: #30d158; } .snote.warn { color: #ffd60a; } .snote.bad { color: #ff6961; }

/* Stats and bento */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: 22px; overflow: hidden; margin: 56px 0 0; }
.stats div { background: var(--surface); padding: 26px; }
.stats b { display: block; font-size: 40px; letter-spacing: -.04em; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 15px; }
.big-title { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.035em; line-height: 1.08; margin: 88px 0 36px; max-width: 760px; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.tile { background: var(--surface); border: 1px solid var(--hair); border-radius: 26px; padding: 28px; grid-column: span 2; min-height: 200px; display: flex; flex-direction: column; justify-content: space-between; color: var(--text); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .3); text-decoration: none; }
.tile.wide { grid-column: span 3; }
.tile .k { color: var(--accent); font-weight: 600; font-size: 15px; }
.tile h3 { font-size: 26px; letter-spacing: -.03em; line-height: 1.12; margin: 8px 0 0; }
.tile p { color: var(--muted); margin: 10px 0 0; font-size: 15px; }

.section-title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; margin: 88px 0 8px; }
.section-sub { color: var(--muted); font-size: 1.1rem; margin: 0 0 24px; }

/* Start */
.start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.start-grid h3 { font-size: 1.3rem; margin: 0 0 4px; }
.start-grid .muted { margin: 0 0 16px; }
pre.start { line-height: 1.7; }
pre.start .cm { color: var(--muted); }
.start-note { margin: 14px 0 0; font-size: .9rem; color: var(--muted); }

/* Path */
.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 18px; }
.stage-card { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--hair); transition: transform .25s var(--ease); }
.stage-card:hover { text-decoration: none; transform: translateY(-2px); }
.stage-card strong { font-size: 1rem; }
.stage-card .muted { font-size: .8rem; }
.stage-num { font-size: .72rem; color: var(--muted); }
.ring { --p: 0; width: 28px; height: 28px; border-radius: 50%; margin-bottom: 8px; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px); mask: radial-gradient(circle, transparent 9px, #000 10px); }
.stage-card.complete .ring { background: var(--ok); }
.progress-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 8px; }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent-fill); border-radius: 99px; transition: width .5s var(--ease); }
#bar-text { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.stage-h { font-size: 1.25rem; font-weight: 700; margin: 40px 0 12px; }
.levels { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--hair); overflow: hidden; }
.level { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--hair); }
.level:first-child { border-top: 0; }
.level input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ok); }
.level .num { font: .82rem var(--mono); color: var(--muted); padding-top: 3px; }
.level summary { cursor: pointer; display: flex; flex-direction: column; list-style: none; }
.level summary::-webkit-details-marker { display: none; }
.level .title { font-weight: 600; }
.level.done .title { color: var(--muted); }
.level .topic { color: var(--muted); font-size: .88rem; }
.level-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; margin-top: 14px; }
.level-body h4 { margin: 0 0 6px; font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.level-body ul { margin: 0; padding-left: 18px; font-size: .95rem; }
.level-body pre { font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.level-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .88rem; }
.level .actions { padding-top: 2px; }

/* Cards and forms */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--hair); padding: 24px 26px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); max-width: 640px; margin-bottom: 22px; }
select, input[type="search"] { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; }
select:focus, input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.chip { font-size: .86rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 6px 14px; border-radius: 99px; cursor: pointer; transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.linkish, .link-btn { color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.linkish:hover, .link-btn:hover { text-decoration: underline; }

/* Quiz */
.score { position: sticky; top: 60px; z-index: 5; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 18px; display: grid; gap: 10px; font-variant-numeric: tabular-nums; }
.score .meter { display: block; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.score .fill { display: block; height: 100%; width: 0; background: var(--accent-fill); transition: width .35s var(--ease); }
.score .result { margin: 0; }
.question { margin-bottom: 16px; }
.question h3 { font-size: 1.12rem; margin: 0 0 16px; font-weight: 600; line-height: 1.4; letter-spacing: -.015em; }
.question pre { margin: -6px 0 16px; font-size: .82rem; }
.tag { margin: 0 0 6px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.options { display: grid; gap: 10px; }
.opt { font-size: 1rem; text-align: left; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 16px; cursor: pointer; transition: border-color .2s, background .2s; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right::before { content: "✓  "; color: var(--ok); font-weight: 700; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong::before { content: "✕  "; color: var(--bad); font-weight: 700; }
.opt:disabled:not(.right):not(.wrong) { opacity: .55; }
.feedback { margin: 14px 0 0; line-height: 1.5; }
.feedback:empty { display: none; }
.feedback.ok strong { color: var(--ok); }
.feedback.bad strong { color: var(--bad); }
.quiz-again { margin: -8px 0 20px; }

/* Script X-ray */
.xray { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.xray[hidden] { display: none; }
.code { list-style: none; margin: 0; padding: 10px 0; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow); border-radius: var(--radius); overflow-x: auto; counter-reset: ln; }
.code li { counter-increment: ln; display: flex; }
.code li::before { content: counter(ln); width: 38px; flex: none; text-align: right; padding-right: 12px; color: var(--muted); font: .78rem/2.1 var(--mono); opacity: .6; }
.line { flex: 1; text-align: left; border: 0; background: transparent; color: var(--text); font: .85rem/2.1 var(--mono); white-space: pre; padding: 0 14px 0 4px; cursor: pointer; border-radius: 6px; }
.line:hover { background: var(--accent-soft); }
.line.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.line.blank { cursor: default; }
.line.blank:hover { background: none; }
.line.warn { box-shadow: inset 3px 0 0 var(--warn); }
.line.bad { box-shadow: inset 3px 0 0 var(--bad); }
#xray-note { position: sticky; top: 72px; }
#xray-note pre { margin-bottom: 14px; white-space: pre-wrap; }
.xray-warn { color: var(--warn-text); background: var(--warn-soft); padding: 8px 12px; border-radius: 10px; font-size: .92rem; }
.xray-bad { color: var(--bad); background: var(--bad-soft); padding: 8px 12px; border-radius: 10px; font-size: .92rem; }
.xray-fix { font-size: .88rem; color: var(--muted); margin: -4px 0 12px; }
.xray-paste { margin-bottom: 18px; scroll-margin-top: 72px; }
.xray-paste-label { display: block; font-weight: 600; margin-bottom: 8px; }
#xray-input { width: 100%; font: .86rem/1.6 var(--mono); color: var(--text); background: var(--code-bg); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical; }
#xray-input:focus { outline: none; border-color: var(--accent); }
.xray-paste-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
#xray-error { margin: 12px 0 0; }
.xray-result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; }
.xray-result-bar .note { margin: 2px 0 0; }
.xray-result-title { margin: 0; font-weight: 600; font-size: 1.02rem; }
.xray-result-actions { display: flex; gap: 10px; }
#xray-review:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.xray-review { margin: 6px 0 0; padding-left: 20px; font-size: .92rem; }
.xray-review li { margin: 6px 0; }
.code li.note-slot { display: block; counter-increment: none; padding: 6px 10px 10px; }
.code li.note-slot::before { content: none; }
.code li.note-slot #xray-note { position: static; box-shadow: none; }

/* Troubleshoot */
.doctor-groups { margin: 0 0 20px; padding: 4px 20px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.doctor-group { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: start; gap: 8px 16px; padding: 12px 0; }
.doctor-group[hidden] { display: none; }
.doctor-group:not([hidden]) ~ .doctor-group:not([hidden]) { border-top: 1px solid var(--hair); }
.doctor-group-name { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: .84rem; font-weight: 600; }
.count { font-size: .72rem; font-weight: 500; color: var(--muted); background: var(--code-bg); border-radius: 99px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.doctor-group-items { display: flex; flex-wrap: wrap; gap: 8px; }
.doctor-group .chip { font-family: var(--mono); font-size: .8rem; text-align: left; }
.doctor-group .chip[hidden] { display: none; }
.no-answer { margin: 0 0 20px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.no-answer[hidden], .doctor-groups[hidden] { display: none; }
.no-answer h3 { margin: 0 0 4px; font-size: 1.05rem; }
.no-answer p { margin: 0; }
.no-answer-related { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.no-answer-related:not(:empty) { margin-top: 14px; }
.no-answer-related .chip { font-family: var(--mono); font-size: .8rem; text-align: left; }
#doctor-out { scroll-margin-top: 72px; }
.problem h3 { margin: 0 0 4px; font: 600 1.2rem var(--mono); letter-spacing: 0; }
.problem h4 { margin: 20px 0 6px; font-size: .86rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.problem p { margin: 0; }
.problem ul { margin: 0; padding-left: 20px; }
.problem pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.problem-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.err-line { color: var(--bad); background: var(--bad-soft); font-size: .85rem; }
.practise { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.learn-it { margin-top: 24px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--hair); }
.problem .learn-it h4 { margin-top: 0; color: var(--text); }
.learn-it > .practise { margin-top: 12px; }
.learn-it > .note { margin: 12px 0 0; }

/* Cheat sheet */
.group { font-size: 1rem; color: var(--muted); margin: 28px 0 10px; font-weight: 600; }
.cheats { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.cheats li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--hair); }
.cheats li:first-child { border-top: 0; }
.cheats li > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cheats code { background: none; padding: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cheats .muted { font-size: .86rem; }
.copy { font-size: .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--accent); padding: 5px 12px; border-radius: 99px; cursor: pointer; flex: none; }
.copy:hover { border-color: var(--accent); text-decoration: none; }
.copy.lab { color: var(--muted); }
.cheat-actions { display: flex; gap: 6px; flex: none; }
.cheat-actions > :first-child { min-width: 52px; text-align: center; }

/* Footer */
.foot { margin-top: 96px; background: var(--surface-2); border-top: 1px solid var(--hair); color: var(--muted); font-size: .86rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-top: 48px; padding-bottom: 36px; }
.foot-brand .brand { font-size: 1.05rem; gap: 10px; }
.foot-brand .brand img { width: 28px; height: 28px; }
.foot-brand p { margin: 14px 0 18px; max-width: 420px; line-height: 1.55; }
.foot-col { display: flex; flex-direction: column; gap: 10px; }
.foot-col h2 { margin: 4px 0; font-size: .8rem; font-weight: 600; color: var(--text); letter-spacing: 0; }
.foot-col a { color: var(--muted); width: fit-content; }
.foot-col a:hover { color: var(--text); text-decoration: none; }
.foot-base { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--hair); padding-top: 18px; padding-bottom: 40px; font-size: .8rem; }
.foot-base p { margin: 0; }
.foot-tm { margin-top: 4px; font-size: .76rem; }

/* "How to use this" */
.guide { margin: 0 0 24px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.guide summary { cursor: pointer; padding: 14px 20px; font-weight: 600; font-size: .95rem; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 8px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: "›"; display: inline-block; transition: transform .2s var(--ease); font-size: 1.1rem; line-height: 1; }
.guide[open] summary::before { transform: rotate(90deg); }
.guide-body { padding: 0 20px 18px; font-size: .95rem; }
.guide-body > p { margin: 0 0 14px; max-width: 760px; }
.guide-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px 32px; }
.guide h3 { font-size: .82rem; color: var(--muted); font-weight: 600; margin: 4px 0 6px; letter-spacing: 0; }
.guide ol, .guide ul { margin: 0 0 12px; padding-left: 20px; }
.guide li { margin: 5px 0; }

/* Command palette */
.palette { width: min(600px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .18); }
.palette::backdrop { background: rgba(0, 0, 0, .3); }
#palette-input { width: 100%; font: inherit; font-size: 1.1rem; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--hair); padding: 18px 20px; outline: none; }
#palette-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
#palette-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
#palette-list li[aria-selected="true"] { background: var(--accent-soft); }
#palette-list li[aria-selected="true"] .pal-label { color: var(--accent); }
.pal-kind { color: var(--muted); font-size: .78rem; flex: none; }
#palette-list .pal-empty { color: var(--muted); cursor: default; }
.palette-foot { font-size: .76rem; margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--hair); }

/* Playground: a terminal beside the server's status */
.pg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.pg-goal { margin: 0 0 24px; font-size: .9rem; font-weight: 500; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--hair); color: var(--muted); max-width: 100%; }
.pg-goal.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; animation: sq-in .3s var(--ease); }
.pg-scenarios { margin: 0 0 16px; padding: 4px 20px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.pg-group { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: start; gap: 8px 16px; padding: 12px 0; }
.pg-group + .pg-group { border-top: 1px solid var(--hair); }
.pg-group-name { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: .84rem; font-weight: 600; }
.pg-group-items { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-scn { font-size: .84rem; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .2s, background .2s; }
.pg-scn:hover { border-color: var(--accent); }
.pg-scn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pg-scn-done { color: var(--ok); font-weight: 700; }
.pg-scn[aria-pressed="true"] .pg-scn-done { color: inherit; }
.count.done { color: var(--ok); }
.pg-story { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 0 0 14px; }
.pg-story p { margin: 0; max-width: 760px; }
.pg-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pg-main { display: grid; gap: 12px; min-width: 0; }
.pg-term { background: #0d1117; color: #e6edf3; border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; cursor: text; border: 1px solid var(--hair); }
.pg-term:focus-within { border-color: var(--accent); }
.pg-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.pg-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a3f47; }
.pg-bar em { margin-left: auto; font-style: normal; font-size: .76rem; color: #8b949e; }
.pg-out { overflow: auto; padding: 14px 18px 4px; height: 360px; font: 13px/1.6 var(--mono); }
.pg-line { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.pg-line.dim { color: #8b949e; }
.pg-line.cmd { color: var(--stage-accent); }
.pg-line.err { color: #ffa198; }
.pg-line.ok { color: #56d364; font-weight: 600; }
.pg-form { display: flex; align-items: center; gap: 10px; padding: 10px 18px 16px; font: 13px var(--mono); }
.pg-form span { color: #56d364; }
#pg-input { flex: 1; min-width: 0; font: inherit; color: #e6edf3; background: transparent; border: 0; outline: none; padding: 4px 0; caret-color: #56d364; }
#pg-input::placeholder { color: #545d68; }
.pg-editor { padding: 16px; }
.pg-editor-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font: .86rem var(--mono); }
#pg-editor-text { width: 100%; min-height: 220px; font: .84rem/1.6 var(--mono); color: var(--text); background: var(--code-bg); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical; tab-size: 2; }
#pg-editor-text:focus { outline: none; border-color: var(--accent); }
.pg-editor-actions { display: flex; gap: 10px; margin-top: 10px; }
.pg-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pg-check { border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid var(--hair); background: var(--surface); display: grid; gap: 4px; }
.pg-check .lbl { font-size: .78rem; color: var(--muted); font-weight: 500; }
.pg-check .val { font-weight: 600; display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.pg-check .dot { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .7rem; font-weight: 700; color: #fff; margin-top: 2px; }
.pg-check.ok { background: var(--ok-soft); border-color: transparent; }
.pg-check.ok .dot { background: var(--ok); }
.pg-check.bad .dot { background: var(--bad); }
.pg-check.is-healed { animation: sq-heal .9s var(--ease); }
.pg-files { padding: 14px 16px; }
.pg-files h3 { margin: 0 0 8px; font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.pg-file { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font: .8rem var(--mono); }
.pg-file span { overflow-wrap: anywhere; }
.pg-file.main span { font-weight: 600; color: var(--accent); }
.pg-file .acts { display: flex; gap: 6px; flex: none; }
.pg-try { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Held open until the playground script fills them, so the page below does not move. */
.pg-check:empty { min-height: 102px; }
.pg-files:empty { min-height: 87px; }
.pg-try:empty { min-height: 72px; }
.arch:empty { min-height: 480px; }
@media (max-width: 960px) { .pg-check:empty { min-height: 77px; } .pg-try:empty { min-height: 32px; } }
@media (max-width: 760px) { .pg-check:empty { min-height: 76px; } .pg-files:empty { min-height: 95px; } }
@media (max-width: 550px) { .pg-try:empty { min-height: 72px; } }
@media (max-width: 435px) { .pg-check:empty { min-height: 99px; } }
.pg-try .chip { font-family: var(--mono); font-size: .76rem; padding: 6px 12px; }
@media (prefers-color-scheme: dark) {
  .pg-check .dot { color: #000; }
  .palette { box-shadow: 0 24px 64px rgba(0, 0, 0, .6); }
  .palette::backdrop { background: rgba(0, 0, 0, .55); }
  .stage { border: 1px solid var(--stage-line); background: #0e0f0d; }
  .tile:hover { box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .8); }
}

/* How bash runs: the stages of one command line */
.arch-trace { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.arch-trace input { flex: 1; min-width: 0; font: .95rem var(--mono); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; }
.arch-trace input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.arch-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.arch-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 14px; }
.arch-step::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.arch-step:first-child::before { top: 22px; }
.arch-step:last-child::before { bottom: calc(100% - 22px); }
.arch-dot { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); color: var(--muted); font: 600 .82rem var(--mono); cursor: pointer; transition: border-color .25s, background .25s, color .25s, transform .25s var(--ease); }
.arch-step.on .arch-dot { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-fill); transform: scale(1.06); }
.arch-step.past .arch-dot { border-color: var(--accent); color: var(--accent); }
.arch-card { margin: 0 0 12px; padding: 10px 16px 12px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; transition: background .2s, border-color .2s; }
.arch-card:hover { background: var(--surface); border-color: var(--hair); }
.arch-step.on .arch-card { background: var(--surface); border-color: var(--hair); box-shadow: var(--shadow); }
.arch-card h3 { margin: 0; font-size: 1.05rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.arch-card h3 code { font-size: .78rem; color: var(--muted); }
.arch-out { margin: 8px 0 0; font: .82rem/1.6 var(--mono); color: var(--accent); overflow-wrap: anywhere; white-space: pre-wrap; }
.arch-detail { display: none; margin-top: 8px; font-size: .94rem; }
.arch-step.on .arch-detail { display: block; animation: sq-in .25s var(--ease); }
.arch-detail p { margin: 0 0 8px; max-width: 760px; }
.arch-detail pre { font-size: .8rem; white-space: pre-wrap; margin-top: 6px; }
.arch-breaks { color: var(--warn-text); }
.arch-controls { display: flex; gap: 10px; margin: 0 0 22px; flex-wrap: wrap; }

@keyframes sq-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes sq-heal { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } to { box-shadow: 0 0 0 12px transparent; } }
@keyframes sq-pop { 0% { opacity: 0; transform: scale(.4); } 60% { transform: scale(1.25); } 100% { opacity: 1; transform: none; } }
@keyframes sq-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.tab.tab-in { animation: sq-in .24s var(--ease) both; }
.pg-scn.just-solved .pg-scn-done { display: inline-block; animation: sq-pop .5s var(--ease) both; }
.opt.wrong { animation: sq-shake .36s var(--ease); }
.feedback.ok, .feedback.bad { animation: sq-in .24s var(--ease) both; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero-grid > .doors { grid-row: auto; }
  .pg-body { grid-template-columns: minmax(0, 1fr); }
  .start-grid { grid-template-columns: minmax(0, 1fr); }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doctor-group, .pg-group { grid-template-columns: 1fr; gap: 8px; }
  .doctor-group-name, .pg-group-name { min-height: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .kbd-btn span { display: none; }
  .kbd-btn { padding: 5px; }
  .doors { grid-template-columns: 1fr; }
  .door-search { flex-direction: column; }
  .hero { padding-top: 44px; }
  .stage { padding: 20px; border-radius: 24px; min-height: 0; }
  .stage-bar { flex-direction: column; align-items: flex-start; }
  .stage-code { font-size: 12px; }
  .stage-code > div { grid-template-columns: 18px minmax(0, 1fr); gap: 0 8px; padding: 3px 4px; }
  .stats { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .tile, .tile.wide { grid-column: auto; min-height: 0; }
  .big-title { margin-top: 64px; }
  .level { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
  .level .num { display: none; }
  .level .actions { grid-column: 2; }
  .level-body { grid-template-columns: minmax(0, 1fr); }
  .xray { grid-template-columns: minmax(0, 1fr); }
  #xray-note { position: static; }
  .card { padding: 18px; }
  .guide-cols { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .foot-brand { grid-column: 1 / -1; }
  .cheats li { flex-direction: column; align-items: stretch; gap: 10px; }
  .pg-out { height: 300px; font-size: 12px; padding: 12px 14px 4px; }
  .pg-form { font-size: 12px; padding: 8px 14px 14px; }
  .pg-scenarios { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 2px 16px; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .pg-group, .pg-group-items { display: contents; }
  .pg-group-name { flex: none; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); white-space: nowrap; }
  .pg-group:first-child .pg-group-name { border-left: 0; padding-left: 0; }
  .pg-scn { flex: none; }
  .pg-story { flex-direction: column; }
  .problem-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Learning loop: continue, on-call shift, streak, and the order check in each level. */
.engage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 0; text-align: left; }
.eng-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hair); }
.eng-card h3 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.eng-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.eng-card > .pill, .eng-card > .eng-row { margin-top: auto; }
.eng-card > p:not(.eng-k) { margin-bottom: 10px; }
.eng-k { display: flex; align-items: center; gap: 8px; color: var(--accent) !important; font-weight: 600; font-size: .85rem !important; }
.eng-shift.paging { background: var(--warn-soft); border-color: var(--warn); }
.eng-shift.paging .eng-k { color: var(--warn-text) !important; }
.eng-time { font-variant-numeric: tabular-nums; }
.eng-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); animation: eng-page 1.2s ease-in-out infinite; }
@keyframes eng-page { 50% { opacity: .25; } }
.eng-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; }
.eng-row .more, .eng-orderbox .more { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.eng-score { display: flex; align-items: baseline; gap: 10px; color: var(--text) !important; font-size: 2.2rem !important; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.eng-score span { font-size: .95rem; font-weight: 600; letter-spacing: 0; color: var(--accent); }
.eng-bar { display: block; width: 100%; height: 6px; border-radius: 99px; background: var(--code-bg); overflow: hidden; margin: 4px 0; }
.eng-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent-fill); }
.eng-session { font-size: .85rem !important; font-variant-numeric: tabular-nums; }
.eng-board { grid-column: 1 / -1; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hair); display: grid; gap: 16px; }
.eng-panels { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.eng-panel { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--hair); }
.eng-panel p { margin: 0; color: var(--muted); font-size: .9rem; }
.eng-radar { width: 100%; max-width: 340px; align-self: center; margin: 4px 0; overflow: visible; }
.eng-r-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.eng-r-shape { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.eng-r-dot { fill: var(--accent); }
.eng-r-label { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.eng-slo { padding: 3px 10px; border-radius: 99px; font-size: .78rem !important; }
.eng-slo.ok { color: var(--ok) !important; background: var(--ok-soft); }
.eng-slo.low { color: var(--warn-text) !important; background: var(--warn-soft); }
.eng-uptime { display: flex; gap: 2px; height: 96px; margin-top: 14px; }
.eng-30 { display: none; }
.eng-up { flex: 1; border-radius: 2px; background: var(--code-bg); }
.eng-up.on { background: var(--accent-2); }
.eng-up-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.eng-budget { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; font-size: .88rem; }
.eng-pips { display: flex; gap: 4px; }
.eng-pips span { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--accent-2); }
.eng-pips span.on { background: var(--accent-2); }
.eng-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--hair); border-radius: 14px; overflow: hidden; border: 1px solid var(--hair); }
.eng-stats div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; }
.eng-stats b { font-size: 1.3rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.eng-stats span { color: var(--muted); font-size: .82rem; }
.eng-orderbox { display: grid; gap: 10px; }
.eng-order { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 6px; }
.eng-order li { counter-increment: step; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--hair); background: var(--surface-2); }
.eng-order li::before { content: counter(step); color: var(--muted); font-size: .8rem; width: 1ch; }
.eng-order li.ok { border-color: var(--ok); background: var(--ok-soft); }
.eng-order li.off { border-color: var(--bad); background: var(--bad-soft); }
.eng-order code { flex: 1; font-size: .8rem; overflow-wrap: anywhere; background: none; }
.eng-moves { display: flex; gap: 4px; }
.eng-moves button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.eng-moves button:disabled { opacity: .35; cursor: default; }
.eng-msg { margin: 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 860px) { .engage { grid-template-columns: 1fr; } .eng-panels, .eng-stats { grid-template-columns: 1fr 1fr; } .eng-panels { grid-template-columns: 1fr; } .eng-up:nth-child(-n+60), .eng-90 { display: none; } .eng-30 { display: inline; } .eng-uptime { height: 64px; gap: 3px; } .eng-stats div:last-child { grid-column: 1 / -1; } }

/* DevOps Nimbus brand: the loop mark in the header and footer, a command chip in the eyebrow. */
.brand img.mark { width: 37px; }
.foot-brand .brand img.mark { width: 47px; }
.brand-track { color: var(--accent); font-weight: 600; padding-left: 8px; border-left: 1px solid var(--line); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }

.eng-carry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eng-file { position: relative; }
.eng-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.eng-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: a Learn | Fix switch, then the current mode's pages. Learn is light; Fix is "on-call dark". */
:root { --oncall: #1d1d1f; --on-oncall: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --oncall: #f5f5f7; --on-oncall: #000000; } }
.top { padding-bottom: 0; }
.top-inner { justify-content: space-between; }
.switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 99px; background: var(--code-bg); flex: none; }
.switch::before { content: ""; position: absolute; inset: 3px auto 3px 3px; width: calc(50% - 3px); border-radius: 99px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); transition: transform .28s var(--ease, ease), background-color .28s; }
[data-mode="fix"] .switch::before { transform: translateX(100%); background: var(--oncall); }
.sw { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 96px; padding: 6px 16px; border-radius: 99px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; transition: color .28s; }
.sw:hover { text-decoration: none; color: var(--text); }
.sw.learn[aria-current] { color: var(--accent); }
.sw.fix[aria-current] { color: var(--on-oncall); }
.sub-row { box-shadow: 0 -1px 0 var(--hair); max-width: none; }
.sub-row > .subnav { max-width: 1080px; margin: 0 auto; }
.subnav { display: flex; justify-content: center; }
.subnav .mode { display: flex; align-items: center; gap: 4px; }
.subnav .mode.fix, [data-mode="fix"] .subnav .mode.learn { display: none; }
[data-mode="fix"] .subnav .mode.fix { display: flex; }
.subnav .mode-k { font-size: .78rem; color: var(--muted); margin-right: 14px; }
.subnav a { position: relative; padding: 11px 12px; font-size: .84rem; color: var(--text); opacity: .75; text-decoration: none; white-space: nowrap; }
.subnav a:hover { opacity: 1; text-decoration: none; }
.subnav a[aria-current="page"] { opacity: 1; font-weight: 600; }
.subnav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-fill); }
[data-mode="fix"] .subnav a[aria-current="page"]::after { background: var(--oncall); }
@media (max-width: 720px) {
  .top-inner { flex-wrap: wrap; height: auto; gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  .brand { flex: 1; }
  .switch { order: 3; flex-basis: 100%; }
  .subnav .mode-k { display: none; }
  .subnav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .sw { min-width: 0; padding: 6px 12px; }
  .subnav a { padding: 11px 8px; font-size: .8rem; }
  .subnav a[aria-current="page"]::after { left: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) { .switch::before, .sw { transition: none; } }
.door.fix .pill { background: var(--on-oncall); color: var(--oncall); border-color: transparent; font-weight: 600; }
.door.fix .pill:hover { background: color-mix(in srgb, var(--on-oncall) 88%, var(--oncall)); }
.door.fix input[type="search"] { border-color: transparent; }

/* Scripts catalogue */
.script-groups { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.script-groups .chip { display: inline-flex; align-items: center; gap: 6px; }
.script-cards { display: grid; gap: 10px; }
.card.script { padding: 0; scroll-margin-top: 112px; }
.card.script summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 4px 18px; align-items: baseline; padding: 16px 22px; }
.card.script summary::-webkit-details-marker { display: none; }
.card.script summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.script-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.script-name code { font: 600 .92rem var(--mono); overflow-wrap: anywhere; }
.script-what { color: var(--muted); font-size: .92rem; }
.badge-new { font-size: .7rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 8px; }
.script-body { padding: 0 22px 20px; border-top: 1px solid var(--hair); }
.script-body h4 { margin: 18px 0 6px; font-size: .86rem; color: var(--muted); font-weight: 600; }
.script-body p { margin: 0; font-size: .95rem; }
.script-body pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; }
.script-body .level-links { margin-top: 16px; }
@media (max-width: 760px) {
  .card.script summary { grid-template-columns: 1fr; padding: 14px 16px; }
  .script-body { padding: 0 16px 16px; }
}
@media (max-width: 760px) { .card.script { scroll-margin-top: 156px; } }

/* Header brand: a round back button and "DevOps Nimbus" go to all tracks; the track name goes to this track's start. */
.brand > a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-hub { color: inherit; }
.brand-back { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--code-bg); color: var(--text); transition: background .2s, transform .2s; }
.brand-back svg { display: block; margin-left: -1px; }
.brand-hub:hover .brand-back { background: var(--line); transform: translateX(-2px); }
.brand > a:hover { text-decoration: none; }
.brand-hub:hover > span:not(.brand-back) { opacity: .75; }
.brand-hub:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .brand-back { transition: none; } }
/* Narrow phones: the logo stands for DevOps Nimbus so the header keeps one row. */
@media (max-width: 440px) { .brand-hub > span:not([class]) { display: none; } }

/* While a feature's code is still arriving, its space shows calm grey lines in the shape it will
   fill, and the first screen fades in once as one piece. Both stop for reduced motion. */
.pg-try:empty, main:has(.pg-scenarios:empty) #pg-out:empty, #arch:empty, #quiz-list:empty {
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(to bottom, var(--code-bg) 0 12px, transparent 12px 28px) 0 0 / 100% 100% no-repeat;
}
.pg-check:empty, .pg-files:empty { background: var(--surface) repeating-linear-gradient(to bottom, var(--code-bg) 0 12px, transparent 12px 28px) 0 0 / 70% 100% no-repeat; background-origin: content-box; }
.pg-check:empty, .pg-files:empty, .pg-try:empty, main:has(.pg-scenarios:empty) #pg-out:empty, #arch:empty, #quiz-list:empty { animation: nimbus-skel 1.6s ease-in-out infinite alternate; }
main:has(.pg-scenarios:empty) #pg-out:empty { background-image: repeating-linear-gradient(to bottom, color-mix(in srgb, #fff 9%, transparent) 0 10px, transparent 10px 24px); background-size: 70% 82px; background-origin: content-box; background-clip: content-box; }
#quiz-list:empty { min-height: 320px; }
#arch:empty { min-height: 1594px; border-radius: 0; background: repeating-linear-gradient(to bottom, var(--code-bg) 0 12px, transparent 12px 40px) 104px 160px / min(560px, calc(100% - 104px)) calc(100% - 160px) no-repeat; }
#arch:empty::before { content: ""; display: block; height: 42px; border-radius: var(--radius-sm); background: var(--code-bg); }
@media (max-width: 720px) { #arch:empty { background-position: 56px 160px; background-size: calc(100% - 56px) calc(100% - 160px); } }
@keyframes nimbus-skel { from { opacity: .5; } to { opacity: 1; } }
#stage-code:not(:empty), #stats:not(:empty), #engage:not(:empty), #bento:not(:empty), #stages:not(:empty), #levels:not(:empty) { animation: nimbus-fade .2s ease-out both; }
@keyframes nimbus-fade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .pg-check:empty, .pg-files:empty, .pg-try:empty, main:has(.pg-scenarios:empty) #pg-out:empty, #arch:empty, #quiz-list:empty { animation: none; }
  #stage-code:not(:empty), #stats:not(:empty), #engage:not(:empty), #bento:not(:empty), #stages:not(:empty), #levels:not(:empty) { animation: none; }
}

/* The eyebrow's command chip stands for the track; the $ takes the track colour. */
.eyebrow-cmd { font: 500 .8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #1d1d1f; color: #f5f5f7;
  padding: 5px 8px; border-radius: 7px; white-space: nowrap; }
.eyebrow-cmd span { color: #7bd64a; }
.eyebrow:has(.eyebrow-cmd) { display: block; }
.eyebrow-cmd { display: inline-block; margin-right: 8px; vertical-align: .12em; }

/* A short light in the track colour travels round the edge of the home cards, each at its own point.
   On white it uses a deeper shade so it still shows; in dark mode the bright track colour. */
:root { --accent-edge: #4ca21d; }
@media (prefers-color-scheme: dark) { :root { --accent-edge: var(--accent-fill); } }
@property --edge { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.door, .tile, .stage-card { position: relative; }
.door::before, .tile::before, .stage-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2.5px; pointer-events: none;
  background: conic-gradient(from var(--edge), transparent 0 64%, color-mix(in srgb, var(--accent-edge) 55%, transparent) 80%, var(--accent-edge) 90%, var(--accent-edge) 97%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: edge 7s linear infinite; animation-delay: calc(var(--i, 0) * -1.3s); }
@keyframes edge { to { --edge: 360deg; } }
:is(.door, .tile, .stage-card):nth-child(2) { --i: 1; } :is(.door, .tile, .stage-card):nth-child(3) { --i: 2; }
:is(.door, .tile, .stage-card):nth-child(4) { --i: 3; } :is(.door, .tile, .stage-card):nth-child(5) { --i: 4; }
:is(.door, .tile, .stage-card):nth-child(6) { --i: 5; } :is(.door, .tile, .stage-card):nth-child(7) { --i: 6; }
@media (prefers-reduced-motion: reduce) { .door::before, .tile::before, .stage-card::before { display: none; } }

/* Troubleshoot: each cause with its own check and fix */
.problem ol.causes { list-style: none; counter-reset: cause; margin: 0; padding: 0; display: grid; gap: 12px; }
.problem li.cause { counter-increment: cause; position: relative; padding: 14px 16px 16px 46px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); }
.problem li.cause::before { content: counter(cause); position: absolute; left: 14px; top: 13px; width: 22px; height: 22px; border-radius: 50%; background: var(--code-bg); color: var(--muted); font-size: .78rem; font-weight: 600; line-height: 22px; text-align: center; }
.problem .cause-why { margin: 0 0 4px; }
.problem .cause-label { margin: 12px 0 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.problem li.cause pre { padding: 10px 12px; font-size: .84rem; }
@media (max-width: 560px) {
  .problem li.cause { padding: 12px 12px 14px 40px; }
  .problem li.cause::before { left: 10px; top: 11px; }
}
