/* Cloud Education design system */
:root {
  --bg: #f2f5f8; --surface: #ffffff; --surface-2: #eaeff4; --surface-3: #dfe6ed; --line: #d3dbe3; --line-2: #c2ccd6;
  --ink: #122030; --ink-2: #46566a; --ink-3: #6c7b8c;
  --az: #1f64d6; --az-soft: #e2ebfb; --aws: #c46a0a; --aws-soft: #fbeedd;
  --ok: #17804d; --ok-soft: #dcf1e5; --bad: #c0281f; --bad-soft: #f9e0de; --warn: #8a6100; --warn-soft: #fbf0d2;
  --teal: #0f8a8a; --violet: #6c4fd1;
  --accent: var(--az); --accent-soft: var(--az-soft); --accent-ink: #fff;
  --term-bg: #0b131b; --term-ink: #d6e1ea; --term-dim: #7890a3; --term-acc: #8fd3ff; --term-ok: #6fe0a5; --term-bad: #ff8e85; --term-warn: #f1c35a;
  --shadow: 0 1px 2px rgba(18, 32, 48, .06), 0 6px 24px rgba(18, 32, 48, .06);
  --shadow-lg: 0 24px 64px rgba(18, 32, 48, .18);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1117; --surface: #121a22; --surface-2: #18222c; --surface-3: #202c38; --line: #26333f; --line-2: #33424f;
    --ink: #e3eaf0; --ink-2: #a8b6c3; --ink-3: #7c8b99;
    --az: #6aa2ff; --az-soft: #16294a; --aws: #f0a14a; --aws-soft: #3a2710;
    --ok: #5fd29a; --ok-soft: #10301f; --bad: #ff8a80; --bad-soft: #3a1714; --warn: #f1c35a; --warn-soft: #352a0e;
    --teal: #4fd1d1; --violet: #a896ff; --accent-ink: #081322;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1117; --surface: #121a22; --surface-2: #18222c; --surface-3: #202c38; --line: #26333f; --line-2: #33424f;
  --ink: #e3eaf0; --ink-2: #a8b6c3; --ink-3: #7c8b99;
  --az: #6aa2ff; --az-soft: #16294a; --aws: #f0a14a; --aws-soft: #3a2710;
  --ok: #5fd29a; --ok-soft: #10301f; --bad: #ff8a80; --bad-soft: #3a1714; --warn: #f1c35a; --warn-soft: #352a0e;
  --teal: #4fd1d1; --violet: #a896ff; --accent-ink: #081322;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
}
body.p-aws { --accent: var(--aws); --accent-soft: var(--aws-soft); --accent-ink: #1b1206; }
[data-provider="aws"] { --accent: var(--aws); --accent-soft: var(--aws-soft); --accent-ink: #1b1206; }
[data-provider="azure"] { --accent: var(--az); --accent-soft: var(--az-soft); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--cond); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3em; }
button { font: inherit; color: inherit; cursor: pointer; }
:where(svg:not([width])) { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.label { font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand b { font-family: var(--cond); font-size: 1.12rem; letter-spacing: .01em; white-space: nowrap; }
.brand small { display: block; font-size: .72rem; color: var(--ink-3); margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav .group { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .93rem; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--accent); opacity: 1; }
.nav .count { margin-left: auto; font-family: var(--mono); font-size: .7rem; color: var(--ink-3); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-family: var(--cond);
  background: linear-gradient(135deg, var(--az), var(--teal) 55%, var(--aws)); color: #fff; flex: none; }
.userchip .xp { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 58px; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: .9rem; min-width: 0; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.toggle button { border: 0; background: transparent; padding: 6px 12px; font-weight: 600; font-size: .82rem; color: var(--ink-2); }
.toggle button[aria-pressed="true"].az { background: var(--az); color: #fff; }
.toggle button[aria-pressed="true"].aws { background: var(--aws); color: #fff; }
.toggle button[aria-pressed="true"]:not(.az):not(.aws) { background: var(--ink); color: var(--bg); }
.iconbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-2); }
.iconbtn:hover { color: var(--ink); border-color: var(--line-2); }
.iconbtn svg { width: 18px; height: 18px; }
main { padding: 28px 28px 80px; max-width: 1320px; width: 100%; }
.menu-btn { display: none; }

/* ------------------------------------------------------------ primitives */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px;
  padding: 8px 14px; font-size: .9rem; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font-size: .74rem; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.az { background: var(--az-soft); color: var(--az); border-color: transparent; }
.pill.aws { background: var(--aws-soft); color: var(--aws); border-color: transparent; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill svg { width: 12px; height: 12px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: .92rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); min-width: 0; }
input.mono { font-family: var(--mono); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: .82rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.lede { color: var(--ink-2); max-width: 70ch; font-size: 1.02rem; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }
.md p + p, .md p + ul, .md ul + p { margin-top: 8px; }
.md ul { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.stars { display: inline-flex; gap: 1px; color: #e5a100; }
.stars svg { width: 15px; height: 15px; }
.stars .off { color: var(--surface-3); }

/* ------------------------------------------------------------ home */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: clamp(24px, 4vw, 44px); color: #fff;
  background: radial-gradient(1200px 400px at 90% -20%, rgba(63, 180, 217, .45), transparent 60%),
              radial-gradient(900px 500px at -10% 120%, rgba(240, 161, 74, .35), transparent 60%),
              linear-gradient(135deg, #0c1f3f, #123d7a 55%, #0f5a6b);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: center; box-shadow: var(--shadow-lg); }
.hero h1 { color: #fff; }
.hero p { color: rgba(255, 255, 255, .85); font-size: 1.05rem; max-width: 52ch; margin-top: 10px; }
.hero .btn { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; }
.hero .btn.primary { background: #fff; color: #0c1f3f; border-color: #fff; }
.hero-art { width: 100%; height: auto; }
.statrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-family: var(--cond); font-size: 1.7rem; line-height: 1; }
.stat span { font-size: .78rem; color: var(--ink-3); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--cond); font-weight: 700;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; overflow: hidden; }
.tile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.tile .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tile .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink-3); font-size: .8rem; }
.tile .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.tile .ico svg { width: 22px; height: 22px; }
.tile.done::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--ok); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); }
.badge .medal { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #f5b73b, #e27d19); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 4px 12px rgba(226, 125, 25, .3); }
.badge .medal svg { width: 26px; height: 26px; }
.badge.locked .medal { background: var(--surface-3); color: var(--ink-3); box-shadow: none; }
.badge.locked b { color: var(--ink-3); }
.badge b { font-size: .88rem; }
.badge small { font-size: .74rem; color: var(--ink-3); line-height: 1.35; }

/* ------------------------------------------------------------ workspace (lab, challenge, sandbox) */
.ws { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ws-side { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 2px; }
.ws-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.step > header { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; cursor: pointer; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: .78rem;
  border: 1.5px solid var(--line-2); color: var(--ink-2); }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step.current .n { border-color: var(--accent); color: var(--accent); }
.step.locked { opacity: .6; }
.step .t { font-weight: 600; font-size: .95rem; }
.step .body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; font-size: .92rem; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: .84rem; }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; color: var(--ink-2); }
.checks li svg { width: 16px; height: 16px; margin-top: 2px; }
.checks li.ok svg { color: var(--ok); }
.checks li.no svg { color: var(--ink-3); }
.hint { border: 1px dashed var(--line-2); border-radius: 10px; }
.hint summary { cursor: pointer; padding: 8px 12px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.code { position: relative; background: var(--term-bg); color: var(--term-ink); border-radius: 10px; font: .78rem/1.6 var(--mono); }
.code pre { margin: 0; padding: 32px 14px 12px; overflow-x: auto; white-space: pre; }
.code .tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.code .tools button { border: 1px solid #2d3b47; background: #16212b; color: var(--term-ink); border-radius: 6px; font-size: .7rem; padding: 3px 8px; }
.code .tools button:hover { background: #1f2d3a; }
.hint .code { border-radius: 0 0 10px 10px; }
.hint .code pre { white-space: pre-wrap; word-break: break-all; }

.viz { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viz-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.viz-bar select, .viz-bar input { padding: 5px 8px; font-size: .82rem; }
.viz-bar input[type=number] { width: 80px; }
.viz-canvas { position: relative; padding: 8px; min-height: 260px; display: grid; place-items: center;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.viz-canvas svg.topo { width: 100%; height: auto; display: block; margin: 0 auto; }
.viz-empty { text-align: center; color: var(--ink-3); padding: 50px 20px; max-width: 42ch; }
.viz-empty svg { width: 64px; height: 64px; opacity: .5; margin-bottom: 8px; }
.tracepanel { position: relative; border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.tracepanel .verdict svg { width: 20px; height: 20px; }
.tracepanel .verdict { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.tracepanel .verdict.ok { color: var(--ok); }
.tracepanel .verdict.bad { color: var(--bad); }
.hops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: hop; }
.hops li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 5px 8px; border-radius: 7px; font-size: .84rem; transition: background .2s, opacity .2s; opacity: .45; }
.hops li.seen { opacity: 1; }
.hops li.active { background: var(--accent-soft); }
.hops li.ret { margin-left: 16px; }
.hops li .m { font-weight: 700; text-align: center; }
.hops li.st-pass .m { color: var(--ok); }
.hops li.st-drop { background: var(--bad-soft); opacity: 1; }
.hops li.st-drop:not(.seen) { background: transparent; opacity: .45; }
.hops li.st-drop .m { color: var(--bad); }
.hops li.st-info .m { color: var(--ink-3); }
.hops li small { display: block; color: var(--ink-2); font-size: .78rem; }

/* topology svg */
.topo text { font-family: var(--sans); fill: var(--ink); }
.topo .net-box { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.topo .net-title { font-family: var(--cond); font-weight: 700; font-size: 14px; }
.topo .net-cidr, .topo .sub-cidr, .topo .vm-ip { font-family: var(--mono); font-size: 10px; fill: var(--ink-3); }
.topo .sub-box { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; }
.topo .sub-box.public { stroke: var(--teal); stroke-dasharray: 4 3; }
.topo .sub-title { font-weight: 600; font-size: 11.5px; }
.topo .vm { fill: var(--surface); stroke: var(--accent); stroke-width: 1.3; }
.topo .vm-name { font-size: 11px; font-weight: 600; }
.topo .tag { font-size: 9.5px; font-weight: 600; }
.topo .tag-bg { rx: 4; }
.topo .link { stroke: var(--line-2); stroke-width: 2; fill: none; }
.topo .link.peer { stroke: var(--accent); stroke-width: 2.4; }
.topo .link.pending { stroke-dasharray: 6 5; stroke: var(--ink-3); }
.topo .link.inet { stroke-dasharray: 3 5; stroke: var(--line-2); }
.topo .cloud { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.topo .gw { fill: var(--accent); }
.topo .gw-ico { stroke: var(--accent-ink); fill: none; stroke-width: 1.6; }
.topo .packet { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.topo .packet.ret { fill: var(--teal); filter: drop-shadow(0 0 6px var(--teal)); }
.topo .trail { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; fill: none; opacity: .55; }
.topo .trail.ret { stroke: var(--teal); stroke-dasharray: 5 5; }
.topo .pip-ok { fill: var(--ok); }
.topo .pip-bad { fill: var(--bad); }
.topo .hot { animation: hot 1s ease-in-out infinite; }
.topo .boom { fill: none; stroke: var(--bad); stroke-width: 3; animation: boom .8s ease-out forwards; }
@keyframes hot { 50% { opacity: .5; } }
@keyframes boom { from { r: 6; opacity: 1; } to { r: 34; opacity: 0; } }

/* terminal */
.term { background: var(--term-bg); color: var(--term-ink); border-radius: var(--radius); font: 12.5px/1.55 var(--mono); display: flex; flex-direction: column;
  border: 1px solid #1c2833; box-shadow: var(--shadow); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #1c2833; background: #0f1922; color: var(--term-dim); font-size: .74rem; }
.term-bar .dots { display: flex; gap: 6px; }
.term-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3945; }
.term-bar .dots i:nth-child(1) { background: #ff6159; } .term-bar .dots i:nth-child(2) { background: #ffbd2e; } .term-bar .dots i:nth-child(3) { background: #28c941; }
.term-bar .title { flex: 1; text-align: center; }
.term-bar button { border: 1px solid #2d3b47; background: #16212b; color: var(--term-ink); border-radius: 6px; font-size: .7rem; padding: 2px 8px; }
.term-out { padding: 12px 14px 4px; height: 340px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; scrollbar-color: #2a3945 transparent; }
.term-out .cmd { color: #fff; }
.term-out .cmd .ps { color: var(--term-ok); }
.term-out .err { color: var(--term-bad); }
.term-out .dim { color: var(--term-dim); }
.term-out .okl { color: var(--term-ok); }
.term-out .badl { color: var(--term-bad); }
.term-out .note { color: var(--term-warn); }
.term-out .json-key { color: var(--term-acc); }
.term-out .json-str { color: #c3e88d; }
.term-in { display: flex; align-items: flex-start; gap: 8px; padding: 6px 14px 12px; }
.term-in .ps { color: var(--term-ok); white-space: nowrap; padding-top: 1px; }
.term-in textarea { flex: 1; background: transparent; border: 0; color: #fff; font: inherit; resize: none; outline: none; padding: 0; min-height: 20px; line-height: 1.55; }
.term.busy .term-in .ps { opacity: .4; }
.term-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.term-suggest button { border: 1px solid #243240; background: #111c26; color: var(--term-dim); border-radius: 6px; font: .72rem var(--mono); padding: 2px 8px; }
.term-suggest button:hover { color: var(--term-ink); }

/* goals & timer */
.goal { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 9px 10px; border-radius: 9px; background: var(--surface-2); font-size: .88rem; }
.goal svg { width: 18px; height: 18px; margin-top: 1px; }
.goal.ok { background: var(--ok-soft); }
.goal.ok svg { color: var(--ok); }
.goal.no svg { color: var(--bad); }
.timer { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer.over { color: var(--warn); }

/* modal & toast */
.backdrop { position: fixed; inset: 0; background: rgba(8, 14, 20, .55); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(460px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow-y: auto; }
.modal.center { text-align: center; align-items: center; }
.modal .bigicon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.modal .bigicon svg { width: 38px; height: 38px; }
.modal .stars svg { width: 34px; height: 34px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; font-size: .9rem; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.form-error { color: var(--bad); font-size: .85rem; min-height: 1.2em; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 120; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: .88rem; animation: slidein .25s cubic-bezier(.2, .8, .2, 1); max-width: 360px; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.badge svg { color: #f5b73b; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 110; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateY(12px); opacity: 0; } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* static build loader */
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* iac */
.files { display: grid; grid-template-columns: 200px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.files nav { border-right: 1px solid var(--line); background: var(--surface-2); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.files nav button { text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; font: .8rem var(--mono); color: var(--ink-2); }
.files nav button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.files .code { border-radius: 0; min-height: 100%; }
.files .code pre { max-height: 520px; overflow: auto; }
.drop { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--ink-2); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.results li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); }
.results li.ok { background: var(--ok-soft); }
.results li.no { background: var(--bad-soft); }
.results li svg { width: 18px; height: 18px; }
.results li.ok svg { color: var(--ok); }
.results li.no svg { color: var(--bad); }

/* quiz */
.q-opts { display: flex; flex-direction: column; gap: 8px; }
.q-opts button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.q-opts button .k { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font: 600 .8rem var(--mono); flex: none; }
.q-opts button:hover:not(:disabled) { border-color: var(--accent); }
.q-opts button.right { background: var(--ok-soft); border-color: var(--ok); }
.q-opts button.wrong { background: var(--bad-soft); border-color: var(--bad); }
.q-opts button:disabled { cursor: default; }
.explain { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; color: var(--ink-2); }

/* reference modules */
td.az { color: var(--az); font-weight: 600; }
td.aws { color: var(--aws); font-weight: 600; }
td .note { display: block; color: var(--ink-2); font-weight: 400; font-size: .84rem; margin-top: 2px; }
.cat { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); white-space: nowrap; }
.bar { position: relative; display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--surface) 6px, var(--surface) 12px); }
.bar div { position: absolute; top: 0; height: 100%; border-right: 1px solid var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-family: var(--mono); color: #fff; overflow: hidden; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .84rem; }
.x { border: 0; background: transparent; color: var(--ink-3); font-size: 1rem; padding: 2px 6px; }
.x:hover { color: var(--bad); }
.verdict-box { border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.verdict-box.ok { background: var(--ok-soft); }
.verdict-box.bad { background: var(--bad-soft); }
.verdict-box.ok h3 { color: var(--ok); }
.verdict-box.bad h3 { color: var(--bad); }
tr.hit td { background: var(--accent-soft); }
tr.default td { color: var(--ink-3); }
.addrule { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; align-items: end; margin-top: 10px; }
.addrule label { display: flex; flex-direction: column; gap: 3px; font-size: .72rem; color: var(--ink-3); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.runbook { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.symptoms { display: flex; flex-direction: column; gap: 6px; }
.symptoms button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 10px 12px; font-size: .9rem; }
.symptoms button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.rb-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rb-checks li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.rb-checks input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); }
.rb-checks .tool { font-family: var(--mono); font-size: .78rem; color: var(--accent); display: block; margin-top: 4px; }
.rb-checks li.ticked { opacity: .6; }
.wt-step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.wt-step ul { margin: 0; padding-left: 18px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.why { background: var(--accent-soft); border-radius: 9px; padding: 10px 12px; font-size: .88rem; }
.cards dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .87rem; }
.cards dt { color: var(--ink-3); }
.cards dd { margin: 0; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  .ws-side { position: static; max-height: none; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-height: 220px; }
  .statrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 50; }
  .menu-btn { display: grid; }
  .topbar { padding: 10px 16px; }
  main { padding: 18px 16px 64px; }
  .two, .runbook { grid-template-columns: minmax(0, 1fr); }
  .files { grid-template-columns: minmax(0, 1fr); }
  .files nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .term-out { height: 280px; }
  .crumbs .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
