/* StepForge portal: the end users' website. Brand navy, royal blue and sky cyan from the logo,
   with a colourful accent palette for cards, learning modes and document formats. */
:root {
  --bg: #f4f7fc; --panel: #ffffff; --text: #0f1b2d; --muted: #5b6b80; --line: #e2e8f1; --line-strong: #cfd8e5;
  --accent: #0a5cff; --accent-hover: #0047d6; --accent-soft: #e9f1ff; --sky: #19b4ff;
  --brand: #01122d; --brand-2: #0d2350; --brand-3: #123a85;
  --note: #fff8e1; --link: #0a5cff; --ok: #12805c; --warn: #b45309; --radius: 14px;
  --grad-brand: linear-gradient(135deg, #0a5cff 0%, #19b4ff 100%);
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 2px 8px rgba(15, 27, 45, .05);
  --shadow-lift: 0 12px 32px rgba(15, 27, 45, .12), 0 2px 6px rgba(15, 27, 45, .06);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --panel: #121b2c; --text: #e7edf6; --muted: #98a6b9; --line: #223049; --line-strong: #2d3d5a;
    --accent: #4c8dff; --accent-hover: #74a6ff; --accent-soft: #15284a; --note: #3a3320; --link: #7fb0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lift: 0 12px 32px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text);
  background: radial-gradient(1200px 520px at 100% -10%, rgba(25, 180, 255, .10), transparent 60%),
              radial-gradient(900px 480px at -10% 0%, rgba(124, 92, 255, .07), transparent 60%), var(--bg);
  background-attachment: fixed;
  font: 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Containers focused after navigation (for screen readers) never draw a ring around the page. */
main:focus, main:focus-visible, .player:focus, .player:focus-visible { outline: none; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; padding: 8px 12px; background: var(--panel); border-radius: 6px; }
.skip:focus { left: 8px; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ---- header */
.bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  padding: 10px 32px; background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .bar { background: rgba(18, 27, 44, .85); } }
.brand { display: flex; align-items: center; gap: 11px; color: var(--brand); text-decoration: none; }
@media (prefers-color-scheme: dark) { .brand { color: var(--text); } }
.brand img { filter: drop-shadow(0 3px 6px rgba(10, 92, 255, .25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
#siteName { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.015em; }
.brand-tag { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); background: rgba(10, 92, 255, .06); }
.nav a.active { color: #fff; background: var(--grad-brand); box-shadow: 0 4px 14px rgba(10, 92, 255, .3); }
.context { display: flex; gap: 8px; align-items: center; }
.context select { padding: 7px 30px 7px 12px; border: 1px solid var(--line); border-radius: 10px; background-color: var(--panel); font-size: 14px; }
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b6b80' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px !important; }
select:hover { border-color: var(--accent) !important; }
select:focus-visible { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.search { flex: 1; min-width: 160px; display: flex; justify-content: flex-end; }
.search input { width: 100%; max-width: 340px; padding: 9px 16px 9px 40px; border: 1px solid var(--line); border-radius: 12px; background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.search input:focus { outline: none; border-color: var(--accent); background-color: var(--panel); box-shadow: 0 0 0 4px var(--accent-soft); }
.account { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.account a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); text-decoration: none; background: var(--panel); }
.account a:hover { border-color: var(--accent); color: var(--accent); }
.account button { padding: 7px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 600; }
.account button:hover { border-color: var(--accent); color: var(--accent); }
.account-menu { position: relative; }
.account-menu summary { list-style: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, #7c5cff, #0a5cff); color: #fff; font-weight: 700; font-size: 13.5px; user-select: none; box-shadow: 0 3px 10px rgba(10, 92, 255, .3); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu[open] summary { box-shadow: 0 0 0 4px var(--accent-soft); }
.account-menu .menu { position: absolute; right: 0; top: 48px; z-index: 6; min-width: 240px; padding: 14px; display: grid; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); }
.menu-user { color: var(--text); font-weight: 600; word-break: break-all; }
body.signed-out .bar .search, body.signed-out .bar .nav { display: none; }

/* ---- page */
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 32px 80px; outline: none; }
h1, h2, h3, .hero-title { font-family: var(--font-display); }
h1 { font-size: 32px; line-height: 1.2; letter-spacing: -.02em; margin: 6px 0 12px; }
h2 { font-size: 21px; margin: 36px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 18px; margin: 22px 0 6px; }
h4, h5, h6 { font-size: 16px; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.head-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 12px; border-radius: 10px; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent); }
.head-icon .icon { width: 19px; height: 19px; }
h1.section-title, h2.section-title { display: flex; align-items: center; font-size: 22px; margin: 40px 0 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h1, .section-head h2 { display: flex; align-items: center; }
.section-head > a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; text-decoration: none; }
.section-head > a .icon { transition: transform .15s; }
.section-head > a:hover .icon { transform: translateX(2px); }
.shelf > h2 { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 20px 0 4px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 24px 20px; margin: 18px 0 24px; box-shadow: var(--shadow); }
.panel h2 { display: flex; align-items: center; margin-top: 18px; font-size: 18px; }
.filter { width: 100%; max-width: 440px; margin: 8px 0 6px; padding: 11px 16px 11px 42px; border: 1px solid var(--line); border-radius: 12px; background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 5h18M6 12h12M10 19h4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center; box-shadow: var(--shadow); }
.filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---- hero (home) */
.hero { position: relative; overflow: hidden; isolation: isolate; margin: 0 0 22px; padding: 44px 48px 34px; border-radius: 24px; color: #fff;
  background: linear-gradient(125deg, #01122d 0%, #0d2350 45%, #123a85 80%, #0a5cff 130%); box-shadow: 0 20px 50px rgba(1, 18, 45, .28); }
.hero::before { content: ''; position: absolute; z-index: -1; right: -120px; top: -160px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 180, 255, .55), transparent 65%); }
.hero::after { content: ''; position: absolute; z-index: -1; left: 38%; bottom: -220px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, .45), transparent 65%); }
.hero-glow { position: absolute; z-index: -1; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 36px 36px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18); color: #d6e6ff; font-weight: 600; font-size: 13px; }
.hero .eyebrow .icon { color: #7fd3ff; }
.hero-title { margin: 16px 0 6px; font-size: 40px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12;
  background: linear-gradient(90deg, #fff 30%, #a9dcff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin: 0 0 22px; color: #c3d3ea; font-size: 17px; max-width: 620px; }
.hero-search { display: flex; gap: 10px; flex-wrap: wrap; max-width: 780px; }
.hero-input { flex: 1; min-width: 240px; padding: 15px 20px 15px 48px; border: 0; border-radius: 14px; font-size: 16px; color: #0f1b2d; background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230a5cff' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 17px center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.hero-input:focus { outline: none; box-shadow: 0 0 0 4px rgba(25, 180, 255, .45), 0 8px 24px rgba(0,0,0,.25); }
.hero-search button { padding: 13px 24px; border: 0; border-radius: 14px; background: var(--grad-brand); color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 20px rgba(10, 92, 255, .45); transition: transform .15s, box-shadow .15s; }
.hero-search button:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(10, 92, 255, .55); }
.hero-search button.secondary { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); box-shadow: none; }
.hero-search button.secondary:hover { background: rgba(255,255,255,.2); }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hero-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 99px; font-size: 13.5px; font-weight: 600; text-decoration: none;
  color: #e3edfb; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); transition: background .15s; }
.hero-chip:hover { background: rgba(255,255,255,.18); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 30px; max-width: 820px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #19b4ff, #0a5cff); }
.stat:nth-child(2) .stat-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.stat:nth-child(3) .stat-icon { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.stat:nth-child(4) .stat-icon { background: linear-gradient(135deg, #fbbf24, #ea580c); }
.stat-icon .icon { width: 19px; height: 19px; }
.stat-text { display: flex; flex-direction: column; line-height: 1.15; }
.stat strong { font-size: 22px; font-family: var(--font-display); }
.stat-text span { color: #b9c9e0; font-size: 13px; }

/* The home page's welcome: a compact band (title and search side by side), so the projects lead. */
.hero.compact { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; padding: 20px 26px; margin-bottom: 20px; border-radius: 18px;
  box-shadow: 0 10px 28px rgba(1, 18, 45, .2); }
.hero.compact::before { width: 300px; height: 300px; right: -80px; top: -150px; }
.hero.compact::after { display: none; }
.hero.compact .hero-text { min-width: 0; }
.hero.compact .eyebrow { padding: 3px 10px; font-size: 12px; }
.hero.compact .hero-title { margin: 8px 0 2px; font-size: 24px; }
.hero-summary { margin: 0; color: #b9c9e0; font-size: 14px; }
.hero.compact .hero-search { flex: 1 1 380px; max-width: 560px; }
.hero.compact .hero-input { min-width: 180px; padding: 11px 16px 11px 42px; font-size: 15px; background-position: 14px center; border-radius: 12px; }
.hero.compact .hero-search button { padding: 10px 18px; border-radius: 12px; }

/* ---- projects (home, several projects) */
.project-jump { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.project-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel);
  color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.project-jump a:hover { border-color: var(--accent); color: var(--accent); }
.project-jump .count { min-width: 24px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; text-align: center; }
.project-block { margin: 0 0 22px; padding: 20px 22px 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow);
  border-top: 4px solid var(--tone, var(--accent)); scroll-margin-top: 90px; }
.project-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.project-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; color: #fff; background: var(--tone-grad, var(--grad-brand)); }
.project-icon .icon { width: 22px; height: 22px; }
.project-title { flex: 1; min-width: 200px; }
.project-title h2 { margin: 0; font-size: 20px; }
.project-title p { margin: 2px 0 0; font-size: 14px; }
.project-open { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 14px; text-decoration: none; }
.project-open:hover { background: var(--accent); color: #fff; }
.project-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.project-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; font-weight: 600;
  color: var(--text); text-decoration: none; }
.project-chip:hover { border-color: var(--tone, var(--accent)); color: var(--tone, var(--accent)); }
.project-chip .icon { width: 15px; height: 15px; color: var(--tone, var(--accent)); }
.project-block .card-list { margin: 16px 0 12px; }
.project-more { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; font-weight: 600; font-size: 14px; text-decoration: none; }
.project-empty { margin: 4px 0 22px; }

/* ---- ways to learn (home) */
.ways.compact { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 26px 0 8px; }
.ways.compact .way { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; box-shadow: none; }
.ways.compact .way::after { display: none; }
.ways.compact .way strong { font-size: 14px; }
.ways.compact .way > span:last-child { font-size: 13.5px; }
.ways.compact .way-icon { width: 32px; height: 32px; margin: 0; flex: none; border-radius: 9px; box-shadow: none; }
.ways.compact .way-icon .icon { width: 17px; height: 17px; }
.ways { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.way { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.way::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--way-soft); opacity: .7; }
.way strong { font-size: 16px; }
.way > span:last-child { color: var(--muted); font-size: 14px; }
.way-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 13px;
  color: #fff; background: var(--way-grad); box-shadow: 0 6px 16px var(--way-shadow); }
.way-icon .icon { width: 22px; height: 22px; }
.way-show { --way-grad: linear-gradient(135deg, #19b4ff, #0a5cff); --way-soft: #e3f1ff; --way-shadow: rgba(10, 92, 255, .3); }
.way-try { --way-grad: linear-gradient(135deg, #2dd4bf, #0d9488); --way-soft: #dcfbf6; --way-shadow: rgba(13, 148, 136, .3); }
.way-test { --way-grad: linear-gradient(135deg, #a78bfa, #7c3aed); --way-soft: #efe9ff; --way-shadow: rgba(124, 58, 237, .3); }
.way-get { --way-grad: linear-gradient(135deg, #fbbf24, #ea580c); --way-soft: #fff1dc; --way-shadow: rgba(234, 88, 12, .3); }
@media (prefers-color-scheme: dark) { .way::after { opacity: .08; } }

/* ---- cards: a colour (tone) per instruction, book and process */
.tone-0 { --tone: #0a5cff; --tone-grad: linear-gradient(135deg, #19b4ff, #0a5cff); --tone-soft: #e6f0ff; }
.tone-1 { --tone: #7c3aed; --tone-grad: linear-gradient(135deg, #c084fc, #7c3aed); --tone-soft: #f1eaff; }
.tone-2 { --tone: #0d9488; --tone-grad: linear-gradient(135deg, #2dd4bf, #0d9488); --tone-soft: #dcfaf5; }
.tone-3 { --tone: #ea580c; --tone-grad: linear-gradient(135deg, #fbbf24, #ea580c); --tone-soft: #fff1e0; }
.tone-4 { --tone: #e11d48; --tone-grad: linear-gradient(135deg, #fb7185, #e11d48); --tone-soft: #ffe8ee; }
.tone-5 { --tone: #4338ca; --tone-grad: linear-gradient(135deg, #818cf8, #4338ca); --tone-soft: #e9ebff; }
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; padding: 0; margin: 14px 0; list-style: none; }
.card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover, .card:focus-visible { border-color: var(--tone, var(--accent)); box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.card strong { display: block; margin: 2px 0; font-size: 16.5px; line-height: 1.35; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.card-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; color: #fff;
  background: var(--tone-grad, var(--grad-brand)); box-shadow: 0 6px 16px color-mix(in srgb, var(--tone, #0a5cff) 35%, transparent); }
.card > .card-icon { margin-bottom: 12px; }
.card-icon .icon { width: 22px; height: 22px; }
.card-version { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--tone, var(--accent)); background: var(--tone-soft, var(--accent-soft)); }
.card-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--tone, var(--accent)); }
.card-cta .icon { transition: transform .15s; }
.card:hover .card-cta .icon { transform: translateX(3px); }
@media (prefers-color-scheme: dark) { .card-version { background: color-mix(in srgb, var(--tone, #4c8dff) 22%, transparent); color: #fff; } }

/* ---- downloads: a colour per format */
.downloads { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 20px; }
.downloads button { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); cursor: pointer; box-shadow: var(--shadow); font-weight: 600; transition: border-color .15s, transform .15s, box-shadow .15s; }
.downloads button:hover { border-color: var(--fmt, var(--accent)); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.format-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; background: var(--fmt, var(--accent)); }
.format-icon .icon { width: 17px; height: 17px; }
.format-get { color: var(--muted); }
.downloads button:hover .format-get { color: var(--fmt, var(--accent)); }
.format-pdf { --fmt: #e5383b; } .format-docx { --fmt: #2b67d1; } .format-pptx { --fmt: #e8672a; }
.format-mp4 { --fmt: #7c3aed; } .format-html { --fmt: #0d9488; } .format-web { --fmt: #475569; }
.format-name { font-weight: 600; }
.format-lang { padding: 1px 7px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* ---- the apps to install: home panel, install page */
.app-studio { --app: #0a5cff; } .app-extension { --app: #0d9488; }
.apps { margin: 30px 0 6px; }
.app-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; padding: 0; margin: 14px 0; list-style: none; }
.app { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--app);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.app-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: #fff;
  background: linear-gradient(135deg, var(--app, var(--accent)), color-mix(in srgb, var(--app, var(--accent)) 60%, #19b4ff)); }
.app-icon .icon { width: 24px; height: 24px; }
.app-text { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.app-text strong { color: var(--text); font-size: 16px; }
.app-meta { font-size: 12.5px; font-weight: 600; }
.app-get { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: 0; border-radius: 11px; cursor: pointer;
  background: var(--app, var(--accent)); color: #fff; font-weight: 700; transition: filter .15s, transform .15s; }
.app-get:hover { filter: brightness(1.1); transform: translateY(-1px); }
.app-get:disabled { opacity: .6; cursor: wait; transform: none; }
.app-get .icon { width: 17px; height: 17px; }
.menu-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.menu-link .icon { width: 17px; height: 17px; }
.install { margin: 22px 0; padding: 22px 24px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--app);
  border-radius: var(--radius); box-shadow: var(--shadow); max-width: 900px; }
.install { --app: #0d9488; }
.install[aria-label="StepForge Studio"] { --app: #0a5cff; }
.install-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.install-head > div { flex: 1; min-width: 200px; }
.install-head h2 { margin: 0; font-size: 19px; }
.install-head p { margin: 2px 0 0; font-size: 13.5px; }
.install-steps { margin: 18px 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.install-steps li::marker { color: var(--app); font-weight: 700; }
.install code, .settings code { padding: 1px 6px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
.settings { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: center; margin: 14px 0; padding: 14px 16px; border-radius: 12px; background: var(--bg); }
.settings dt { font-weight: 600; font-size: 14px; }
.settings dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.settings dd code { background: var(--panel); }
.copy { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.copied { color: var(--ok); border-color: var(--ok); }
.copy .icon { width: 16px; height: 16px; }
@media (max-width: 700px) {
  .app { flex-wrap: wrap; }
  .app-get { width: 100%; justify-content: center; }
  .settings { grid-template-columns: 1fr; }
  .settings dd { margin-bottom: 6px; }
}

/* ---- instruction page */
.page-head { position: relative; overflow: hidden; padding: 26px 28px 14px; margin: 8px 0 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.page-head::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, #0a5cff, #19b4ff, #7c5cff); }
.page-head::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(25,180,255,.14), transparent 70%); pointer-events: none; }
.page-head h1 { margin: 0; }
.page-head .meta { margin: 4px 0 14px; font-size: 14px; }
.learn-label { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.get-it { margin: 0 0 12px; }
.get-it summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.read.with-toc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.read.with-toc .toc { position: sticky; top: 96px; margin: 0; }
@media (max-width: 860px) { .read.with-toc { display: block; } .read.with-toc .toc { position: static; margin-bottom: 16px; } }
.steps { min-width: 0; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar select { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.toc { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0 20px; font-size: 14px; box-shadow: var(--shadow); }
.toc strong { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 8px 0 0; padding-left: 20px; }
.toc li { margin: 5px 0; }
.toc li::marker { color: var(--accent); font-weight: 700; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.note { padding: 14px 18px; background: var(--note); border-left: 4px solid #f59e0b; border-radius: 10px; margin: 14px 0; }
.caption { color: var(--muted); font-style: italic; margin: 14px 0 4px; }
.step { margin: 0 0 20px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.step p { margin: 0 0 12px; font-size: 16px; }
.step p strong { color: var(--accent); }
.step .no { display: inline-grid; place-items: center; min-width: 30px; height: 30px; margin-right: 12px; padding: 0 6px; border-radius: 10px;
  background: var(--grad-brand); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 4px 10px rgba(10, 92, 255, .3); }
.step.hit { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.shot { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
figure { margin: 10px 0 20px; }
figcaption { color: var(--muted); font-style: italic; margin-bottom: 6px; }

.results { list-style: none; padding: 0; display: grid; gap: 10px; }
.results li { padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.results li a { font-weight: 600; text-decoration: none; }
.results small { color: var(--muted); }

/* ---- sign-in, reset and set-password */
body.signed-out main { max-width: 1080px; display: flex; align-items: center; }
.signin-page { width: 100%; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 560px; margin: 24px 0; border-radius: 26px;
  overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(1, 18, 45, .18); }
.signin-brand { position: relative; overflow: hidden; isolation: isolate; padding: 48px 44px; color: #fff;
  background: linear-gradient(150deg, #01122d, #0d2350 55%, #123a85); }
.signin-brand::before { content: ''; position: absolute; z-index: -1; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(25,180,255,.5), transparent 65%); }
.signin-brand::after { content: ''; position: absolute; z-index: -1; left: -120px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(124,92,255,.35), transparent 65%); }
.signin-brand img { padding: 10px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); box-sizing: content-box; }
.signin-brand h2 { margin: 22px 0 8px; font-size: 30px; letter-spacing: -.02em; }
.signin-brand .lead { color: #c9d7ea; font-size: 17px; max-width: 400px; }
.signin-brand ul { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.signin-brand li { display: flex; align-items: center; gap: 12px; color: #e8eef6; }
.signin-brand li .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: #7fd3ff; }
.signin-secure { display: inline-flex; align-items: center; gap: 8px; margin: 32px 0 0; font-size: 13px; color: #9fb3cf; }
.signin { align-self: center; width: 100%; max-width: 430px; margin: 0 auto; padding: 44px; }
.signin h1 { font-size: 28px; }
.signin label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 14px; }
.signin input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.signin input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); background: var(--panel); }
.signin-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.signin button[type=submit] { padding: 12px 26px; border: 0; border-radius: 12px; background: var(--grad-brand); color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 20px rgba(10, 92, 255, .35); transition: transform .15s, box-shadow .15s; }
.signin button[type=submit]:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(10, 92, 255, .45); }
.signin button[type=submit]:disabled { opacity: .6; }
.signin .linkish { font-size: 14px; color: var(--link); text-decoration: none; font-weight: 600; }
@media (max-width: 820px) { .signin-page { grid-template-columns: 1fr; } .signin-brand { padding: 30px; } .signin { padding: 30px; } }
.error { color: #c0392b; margin-top: 10px; }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---- footer */
.footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 26px 32px;
  background: linear-gradient(120deg, #01122d, #0d2350); color: #9fb3cf; font-size: 13.5px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand div { display: flex; flex-direction: column; }
.footer-brand strong { color: #fff; font-family: var(--font-display); font-size: 15px; }
.footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.footer .powered { color: #7fd3ff; font-weight: 600; }
@media (max-width: 700px) { .footer-meta { align-items: flex-start; } }

/* ---- Ask page */
.ask-form textarea { width: 100%; max-width: 780px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 16px; box-shadow: var(--shadow); }
.ask-form textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }

@media print {
  .bar, .footer, .crumbs, .toolbar, .downloads, .toc, .get-it, .learn-label, .ways, .hero-chips, .apps, .app-get, .copy { display: none; }
  .step, .page-head { border: 0; box-shadow: none; }
  main { max-width: none; padding: 0; }
  .step { break-inside: avoid; }
  body { background: #fff; }
}

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 8px 0 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; font-size: 14.5px; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; font-size: 14px; box-shadow: var(--shadow); }
.grid th, .grid td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid th { font-weight: 700; color: var(--muted); background: var(--bg); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: var(--accent-soft); }
.grid code { font-size: 12px; word-break: break-all; }
.grid button, .inline button { padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; font-weight: 600; font-size: 14px; }
.grid button:hover { border-color: var(--accent); color: var(--accent); }
.inline button { background: var(--accent); border-color: var(--accent); color: #fff; }
.inline button:hover { background: var(--accent-hover); }
.inline button:disabled, .grid button:disabled { opacity: .6; cursor: wait; }
.grid select, .inline select, .inline input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background-color: var(--panel); }
.inline input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 14px; }
.inline input { min-width: 260px; }
.create-member { margin: 4px 0 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.create-member summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.create-member summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-radius: 6px; }
.create-member > p { margin: 10px 0 0; font-size: 14px; }
.create-form input { min-width: 220px; flex: 1 1 220px; }
.create-form input[type="checkbox"] { min-width: 0; flex: none; margin: 0; }
.create-form .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.project-access summary { cursor: pointer; font-weight: 600; color: var(--accent); white-space: nowrap; }
.project-access summary.none { color: #b45309; }
.project-access summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-radius: 6px; }
.project-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-width: 200px; }
.project-list label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.project-list button { align-self: flex-start; margin-top: 4px; background: var(--accent); border-color: var(--accent); color: #fff; }
.inline button.secondary { background: var(--panel); border-color: var(--line); color: inherit; }
.inline button.secondary:hover { background: var(--accent-soft); }

/* ------------------------------------------------------------------ simulation player */
.modes { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.mode { padding: 8px 18px; border-radius: 20px; border: 1px solid var(--accent); color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.mode:hover, .mode:focus { background: var(--accent); color: #fff; }

body.playing main { max-width: none; padding: 0; }
body.playing .bar .search, body.playing .footer { display: none; }
.player { display: flex; flex-direction: column; height: calc(100vh - 58px); outline: none; background: var(--bg); }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--brand-band, #01122d); color: #fff; flex-wrap: wrap; }
.player-mode { padding: 2px 10px; border-radius: 12px; background: var(--accent); font-size: 13px; font-weight: 600; }
.player-title { font-size: 15px; }
.player-chapter { color: #b7c3d4; font-size: 14px; }
.player-spacer { flex: 1; }
.player-progress { color: #b7c3d4; font-size: 13px; font-variant-numeric: tabular-nums; }
.player-btn { min-width: 34px; height: 30px; border: 1px solid #2a3f5f; border-radius: 6px; background: #14294d; color: #fff; cursor: pointer; font-size: 13px; }
.player-btn:hover:not(:disabled) { background: var(--accent); }
.player-btn:disabled { opacity: .4; cursor: default; }
.player-btn[aria-pressed=false] { opacity: .6; }
.player-meter { height: 4px; background: var(--line); }
.player-meter-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.player-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
.player-screen { position: relative; width: min(100%, calc((100vh - 120px) * var(--aspect, 1.6))); user-select: none; box-shadow: 0 4px 24px rgba(0,0,0,.18); border-radius: 4px; overflow: hidden; }
.player-screen[hidden], .player-card[hidden] { display: none; }
.player-img { display: block; width: 100%; height: auto; }
.player-target { position: absolute; padding: 0; margin: 0; border: 3px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; }
.player-target.pulse, .player-target.guide { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 106, 252, .25); }
.player-target.pulse { animation: sf-pulse 1.2s ease-out infinite; }
.player-target.reveal { border-color: #e86a10; box-shadow: 0 0 0 4px rgba(232, 106, 16, .3); }
.player-target.ok { border-color: #1e7f3c; box-shadow: 0 0 0 4px rgba(30, 127, 60, .3); animation: none; }
.player-target.hidden-target { cursor: default; }
@keyframes sf-pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 106, 252, .45); } 100% { box-shadow: 0 0 0 14px rgba(0, 106, 252, 0); } }
.player-pointer { position: absolute; width: 28px; height: 28px; margin: -2px 0 0 -4px; pointer-events: none; transition: left .85s cubic-bezier(.4,0,.2,1), top .85s cubic-bezier(.4,0,.2,1); filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); z-index: 3; }
.player-pointer.clicking::after { content: ''; position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -10px; border-radius: 50%; border: 3px solid var(--accent); animation: sf-ripple .35s ease-out; }
@keyframes sf-ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.player-typing, .player-entry { position: absolute; box-sizing: border-box; padding: 0 6px; font: 15px system-ui, sans-serif; display: flex; align-items: center; border: 2px solid var(--accent); border-radius: 3px; background: #fff; color: #111; }
.player-typing[hidden], .player-entry[hidden] { display: none; }
.player-entry { z-index: 2; outline: none; }
.player-bubble { position: absolute; z-index: 4; max-width: 38%; min-width: 220px; padding: 10px 14px; border-radius: 8px; background: #01122d; color: #fff; font-size: 15px; line-height: 1.45; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.player-bubble[hidden] { display: none; }
.player-bubble strong { color: #7cc6ff; }
.player-bubble.test { background: #14294d; }
.player-bubble.card { max-width: 50%; }
.player-bubble.shake { animation: sf-shake .35s; }
@keyframes sf-shake { 25% { margin-left: -6px; } 75% { margin-left: 6px; } }
.player-hint { display: block; margin-top: 6px; color: #ffd28a; font-size: 14px; }
.player-keys { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 4px; background: #fff; color: #01122d; font-weight: 600; }
.player-miss { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #d92d20; pointer-events: none; z-index: 3; }
.player-miss[hidden] { display: none; }
.player-miss.flash { animation: sf-miss .8s forwards; }
@keyframes sf-miss { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.3); } }
.player-card { max-width: 560px; padding: 28px 32px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.player-card-title { display: block; font-size: 22px; margin-bottom: 8px; }
.player-score { font-size: 17px; }
.player-missed ul { margin: 4px 0 0; padding-left: 20px; }
.player-actions { display: flex; gap: 10px; margin-top: 18px; }
.player-continue, .player-secondary { padding: 8px 18px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.player-continue { border: 0; background: var(--accent); color: #fff; }
.player-secondary { border: 1px solid var(--line); background: var(--panel); }
.player-bubble .player-continue { margin-top: 10px; }
@media (max-width: 700px) {
  .player-bubble { max-width: 70%; min-width: 0; font-size: 14px; }
  .player-chapter { display: none; }
}
@media print { .modes { display: none; } }

/* ------------------------------------------------------------------ course (SCORM) */
body.course .bar .search, body.course .bar .context, body.course .bar .nav { display: none; }
.course-modes { list-style: none; padding: 0; display: grid; gap: 12px; margin: 20px 0; }
.course-mode { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.course-mode.done { border-color: #1e7f3c; }
.course-mode a { flex: 1; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); }
.course-mode a strong { font-size: 18px; color: var(--accent); }
.course-status { color: var(--muted); }
.course-mode.done .course-status { color: #1e7f3c; font-weight: 600; }
.resume { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); }

/* ------------------------------------------------------------------ learning: progress and feedback */
.mode.done { border-color: #1e7f3c; color: #1e7f3c; }
.mode.tried { border-color: #9a5b00; color: #9a5b00; }
.mode-badge { font-weight: 700; }
.feedback { margin: 40px 0 0; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 10px; max-width: 640px; }
.feedback h2 { margin: 0; font-size: 18px; }
.rating-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stars { display: flex; gap: 2px; }
.star { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px; }
.star.on { color: #f5a524; }
.star:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.feedback textarea, .step-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font: inherit; }
.feedback .send { justify-self: start; padding: 7px 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.step-problem { display: block; margin: -4px 0 8px; font-size: 13px; }
.linkish { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
.step .linkish { visibility: hidden; }
.step:hover .linkish, .step .linkish:focus { visibility: visible; }
.step-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
@media print { .feedback, .step-problem { display: none; } }

/* ------------------------------------------------------------------ books and shelves */
.shelf { margin: 8px 0 24px; }
.shelf h2 { margin: 16px 0 6px; }
.book-card { border-left: 4px solid var(--accent); display: flex; flex-direction: column; gap: 4px; }
.book-list { margin: 4px 0 16px; padding-left: 24px; }
.book-list li { margin: 4px 0; }

/* ------------------------------------------------------------------ process flows */
.flow-card { border-left: 4px solid #00aefc; }
.flow-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; }
.flow { display: block; width: 100%; height: auto; min-width: 520px; max-height: 80vh; font: 14px system-ui, "Segoe UI", sans-serif; }
.flow-node rect, .flow-node polygon, .flow-node path { fill: var(--panel); stroke: var(--muted); stroke-width: 1.5; }
.flow-node text { fill: var(--text); }
.flow-start rect, .flow-end rect { fill: #01122d; stroke: #01122d; }
.flow-start text, .flow-end text { fill: #fff; font-weight: 600; }
.flow-decision polygon { fill: var(--accent-soft); stroke: var(--accent); }
.flow-note path { fill: #fff7d6; stroke: #d6b85a; }
.flow-note text { fill: #3a3520; font-style: italic; }
.flow-step.linked rect { stroke: var(--accent); stroke-width: 2.5; }
.flow-step.linked text { fill: var(--accent); font-weight: 600; text-decoration: underline; }
.flow-step.unpublished rect { stroke-dasharray: 5 4; }
a:hover .flow-step.linked rect, a:focus .flow-step.linked rect { fill: var(--accent-soft); }
.flow-edge { stroke: var(--muted); stroke-width: 1.6; }
.flow-arrowhead { fill: var(--muted); }
.flow-edge-label-bg { fill: var(--bg); }
.flow-edge-label { fill: var(--muted); font-size: 12px; font-weight: 600; }
.flow-text { margin-top: 10px; }
.flow-list { margin: 6px 0 0; }

/* ------------------------------------------------------------------ learning modes: a colour each */
.mode-show { --mode: #0a5cff; --mode-soft: #e6f0ff; }
.mode-try { --mode: #0d9488; --mode-soft: #dcfaf5; }
.mode-test { --mode: #7c3aed; --mode-soft: #f1eaff; }
.modes { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 16px; }
.mode { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 12px; border: 1px solid transparent;
  color: var(--mode, var(--accent)); background: var(--mode-soft, var(--accent-soft)); text-decoration: none; font-weight: 700; font-size: 14px;
  transition: background .15s, color .15s, transform .15s, box-shadow .15s; }
.mode:hover, .mode:focus-visible { background: var(--mode, var(--accent)); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px color-mix(in srgb, var(--mode, #0a5cff) 35%, transparent); }
.mode.done { border-color: #12805c; }
.mode.tried { border-color: #b45309; }
@media (prefers-color-scheme: dark) { .mode { background: color-mix(in srgb, var(--mode, #4c8dff) 18%, transparent); color: #fff; } }

/* Simulation modes under each instruction card. */
.card-item { display: flex; flex-direction: column; border-radius: var(--radius); transition: box-shadow .2s, transform .2s; }
.card-item:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.card-item .card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; flex: 1; box-shadow: none; }
.card-item .card:hover { transform: none; box-shadow: none; }
.card-item[hidden] { display: none; }
.card-modes { display: flex; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.card-mode { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0; font-size: 13px; font-weight: 700;
  color: var(--mode); text-decoration: none; transition: background .15s, color .15s; }
.card-mode + .card-mode { border-left: 1px solid var(--line); }
.card-mode:hover, .card-mode:focus-visible { background: var(--mode); color: #fff; }

/* What's new (home) and answers from the published instructions (search). */
.whats-new { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px 24px 16px; margin-bottom: 22px; box-shadow: var(--shadow); }
.whats-new::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: linear-gradient(180deg, #7c5cff, #0a5cff, #19b4ff); }
.whats-new h2 { margin: 14px 0 8px; font-size: 19px; }
.whats-new ul { list-style: none; padding: 0; margin: 0; }
.whats-new li { position: relative; padding: 12px 0 12px 24px; border-top: 1px solid var(--line); }
.whats-new li:first-child { border-top: 0; }
.whats-new li::before { content: ''; position: absolute; left: 2px; top: 20px; width: 10px; height: 10px; border-radius: 50%; background: #0a5cff; box-shadow: 0 0 0 4px var(--accent-soft); }
.whats-new li.news-added::before { background: #12805c; box-shadow: 0 0 0 4px #dff5ea; }
.whats-new li > a { font-weight: 700; text-decoration: none; color: var(--text); }
.whats-new li > a:hover { color: var(--accent); }
.whats-new p { margin: 4px 0 0; }
.news-change { margin-left: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.news-change.added { background: #dff5ea; color: #12805c; }
.ask-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.ask-row .muted { font-size: 13.5px; }
button.ask { padding: 10px 20px; border-radius: 12px; border: 0; background: var(--grad-brand); color: #fff; cursor: pointer; font: inherit; font-weight: 700;
  box-shadow: 0 6px 16px rgba(10, 92, 255, .3); }
button.ask:disabled { opacity: .6; cursor: wait; }
.answer-box .answer { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); }
.answer-sources { font-size: 14px; }

/* Books and process flows take their tone instead of a coloured edge. */
.book-card, .flow-card { border-left: 1px solid var(--line); }
.book-card:hover, .flow-card:hover { border-color: var(--tone, var(--accent)); }
.course-mode { border-radius: 14px; box-shadow: var(--shadow); }
.feedback { border-radius: 16px; box-shadow: var(--shadow); padding: 20px 24px; }
.feedback .send { padding: 9px 20px; border-radius: 10px; background: var(--grad-brand); }

/* ------------------------------------------------------------------ phones */
@media (max-width: 760px) {
  .bar { position: static; gap: 10px; padding: 10px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel); }
  .brand { order: 0; }
  .account { order: 1; margin-left: auto; }
  .search { order: 2; flex: 1 1 180px; min-width: 0; }
  .search input { max-width: none; }
  .context { order: 3; }
  .nav { order: 4; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 7px 11px; font-size: 14px; }
  main { padding: 20px 16px 60px; }
  h1 { font-size: 26px; }
  .hero { padding: 26px 20px 22px; border-radius: 18px; }
  .hero-title { font-size: 30px; }
  .hero-lead { font-size: 15.5px; }
  .hero-search button { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .page-head { padding: 20px 18px 10px; }
  .step { padding: 14px; }
  .footer { padding: 22px 16px; }
}
