/* ==============================================================
   Countava Academy — guide chrome.
   Layered ON TOP of the app's app.css: we inherit every design
   token (--surface, --accent, --border, shadows, radii) so the
   guide themes in lockstep with the app, then add an "Academy"
   identity: warm editorial serif + a single amber signature.
   Guide-only classes are namespaced g-* / mk-* / demo-* / anim-*
   so they never collide with the app's component classes.
   ============================================================== */

/* ---------- Academy tokens ---------- */
:root {
  --ac-display: "Fraunces", Georgia, "Times New Roman", serif;
  --ac-body: var(--font, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --ac-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;

  /* Amber = "learning energy": progress, milestones, primary CTAs. */
  --ac-amber: #ef7c2e;
  --ac-amber-2: #f7a45c;
  --ac-amber-ink: #b5541a;
  --ac-amber-soft: #fff2e7;
  --ac-amber-line: #ffd6b0;

  --ac-sidebar-w: 286px;
  --ac-measure: 68ch;
  --ac-ease: cubic-bezier(.22,.61,.36,1);
}
/* Dark-family themes: warm the amber, deepen its wash. */
:root:not([data-theme="light"]) {
  --ac-amber: #f7a45c;
  --ac-amber-2: #f9bd83;
  --ac-amber-ink: #f7a45c;
  --ac-amber-soft: #2a2013;
  --ac-amber-line: #4a3418;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
/* The `hidden` attribute must win over component `display` rules (e.g. the
   lightbox/scrim/search set `display:grid|flex` and would otherwise show
   through the attribute, covering the page with an invisible overlay). */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ac-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.g-skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--ac-amber); color: #fff; padding: 10px 16px;
  border-radius: 10px; transition: top .2s var(--ac-ease);
}
.g-skip:focus { top: 12px; text-decoration: none; }

:focus-visible { outline: 3px solid var(--ac-amber); outline-offset: 2px; border-radius: 4px; }

/* =====================================================================
   SIDEBAR
   ===================================================================== */
.g-sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--ac-sidebar-w);
  height: 100vh; overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.g-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.g-brand:hover { text-decoration: none; }
.g-brand-logo { height: 30px; width: auto; }
.logo-white { display: none; }
:root:not([data-theme="light"]) .logo-color { display: none; }
:root:not([data-theme="light"]) .logo-white { display: inline; }
.g-brand-badge {
  font-family: var(--ac-display); font-weight: 600; font-size: 15px;
  color: var(--ac-amber-ink);
  background: var(--ac-amber-soft); border: 1px solid var(--ac-amber-line);
  padding: 2px 10px; border-radius: 999px; letter-spacing: .01em;
}

/* Progress ring */
.g-progress {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.g-ring { --p: 0; flex: none; width: 46px; height: 46px; position: relative; }
.g-ring svg { transform: rotate(-90deg); display: block; }
.g-ring-track { stroke: var(--border-strong); }
.g-ring-fill { stroke: var(--ac-amber); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ac-ease); }
.g-ring-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.g-progress-txt { font-size: 12.5px; line-height: 1.35; }
.g-progress-txt b { display: block; font-family: var(--ac-display); font-size: 14px; color: var(--text); }
.g-progress-txt span { color: var(--text-muted); }

/* Chapter nav */
.g-nav { display: flex; flex-direction: column; gap: 2px; }
.g-nav-chapter { margin-bottom: 4px; }
.g-nav-head {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: none; background: none; cursor: pointer;
  border-radius: var(--radius-sm); color: var(--text); font: inherit;
  font-weight: 600; text-align: left;
}
.g-nav-head:hover { background: var(--surface-hover); }
.g-nav-head.active { color: var(--ac-amber-ink); }
.g-nav-ico { font-size: 16px; line-height: 1; }
.g-nav-title { flex: 1; }
.g-nav-count { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.g-nav-chev { color: var(--text-faint); transition: transform .25s var(--ac-ease); font-size: 11px; }
.g-nav-chapter.open .g-nav-chev { transform: rotate(90deg); }
.g-nav-sections {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s var(--ac-ease);
}
.g-nav-chapter.open .g-nav-sections { grid-template-rows: 1fr; }
.g-nav-sections > div { overflow: hidden; }
.g-nav-sec {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 34px; border-radius: 8px;
  color: var(--text-muted); font-size: 13.5px; cursor: pointer;
}
.g-nav-sec:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.g-nav-sec.active { background: var(--ac-amber-soft); color: var(--ac-amber-ink); font-weight: 600; }
.g-nav-tick { font-size: 11px; color: var(--success); opacity: 0; transition: opacity .2s; }
.g-nav-sec.done .g-nav-tick { opacity: 1; }

.g-side-foot { margin-top: auto; padding-top: 12px; }
.g-side-applink { font-size: 13px; color: var(--text-muted); }

/* =====================================================================
   MAIN COLUMN
   ===================================================================== */
.g-main { display: flex; flex-direction: column; min-width: 0; margin-left: var(--ac-sidebar-w); }
.g-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.g-menu { display: none; }
.g-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 17px; cursor: pointer;
  display: grid; place-items: center;
}
.g-icon:hover { background: var(--surface-hover); }
.g-search-wrap { position: relative; flex: 1; max-width: 520px; }
.g-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
#gSearch {
  width: 100%; padding: 11px 14px 11px 38px; font: inherit; font-size: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
}
#gSearch:focus { outline: none; border-color: var(--ac-amber); box-shadow: 0 0 0 3px var(--ac-amber-soft); }
.g-search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  max-height: 60vh; overflow-y: auto;
}
.g-sr-item { display: block; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--border); }
.g-sr-item:last-child { border-bottom: none; }
.g-sr-item:hover, .g-sr-item.active { background: var(--ac-amber-soft); text-decoration: none; }
.g-sr-crumb { font-size: 11.5px; color: var(--text-faint); }
.g-sr-title { font-weight: 600; color: var(--text); }
.g-sr-title mark { background: var(--ac-amber-line); color: var(--ac-amber-ink); border-radius: 3px; padding: 0 2px; }
.g-sr-empty { padding: 16px; color: var(--text-muted); font-size: 14px; }
.g-top-actions { display: flex; align-items: center; gap: 10px; }
.g-applink {
  font-size: 13.5px; font-weight: 600; color: var(--accent);
  padding: 9px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); white-space: nowrap;
}
.g-applink:hover { background: var(--accent-soft); text-decoration: none; }

.g-view { flex: 1; padding: 0 28px 80px; }
.g-foot {
  padding: 22px 28px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 13px; display: flex; gap: 8px; align-items: center;
}

/* =====================================================================
   LANDING
   ===================================================================== */
.g-hero { max-width: 1040px; margin: 0 auto; padding: 56px 0 8px; }
.g-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ac-amber-ink); background: var(--ac-amber-soft);
  border: 1px solid var(--ac-amber-line); padding: 5px 12px; border-radius: 999px;
}
.g-hero h1 {
  font-family: var(--ac-display); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(34px, 5.2vw, 60px); line-height: 1.04; margin: 18px 0 0;
  max-width: 18ch;
}
.g-hero h1 .g-ink-amber {
  color: var(--ac-amber);
  font-style: italic; font-weight: 500;
}
.g-hero-sub { font-size: clamp(17px, 2vw, 20px); color: var(--text-muted); max-width: 54ch; margin: 20px 0 26px; }
.g-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.g-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 13px; border: 1px solid transparent;
}
.g-btn-primary { background: var(--ac-amber); color: #fff; box-shadow: 0 8px 22px -8px var(--ac-amber); }
.g-btn-primary:hover { background: var(--ac-amber-ink); text-decoration: none; transform: translateY(-1px); }
.g-btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.g-btn-ghost:hover { background: var(--surface-hover); text-decoration: none; }
.g-hero-note { font-size: 13.5px; color: var(--text-faint); }

/* Learning-trail signature */
.g-trail-wrap { max-width: 1040px; margin: 40px auto 0; }
.g-trail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.g-trail-head h2 { font-family: var(--ac-display); font-weight: 600; font-size: 24px; margin: 0; }
.g-trail-head p { color: var(--text-muted); font-size: 14px; margin: 0; }
.g-trail { position: relative; }
.g-trail-path { width: 100%; height: auto; display: block; overflow: visible; }
.g-trail-line { fill: none; stroke: var(--border-strong); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; }
.g-trail-progress { fill: none; stroke: var(--ac-amber); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ac-ease); }
.g-node { cursor: pointer; }
.g-node-dot { fill: var(--surface); stroke: var(--border-strong); stroke-width: 3; transition: all .3s var(--ac-ease); }
.g-node.done .g-node-dot { fill: var(--ac-amber); stroke: var(--ac-amber); }
.g-node:hover .g-node-dot { stroke: var(--ac-amber); r: 15; }
.g-node-emoji { font-size: 17px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.g-node-label { font-size: 12px; font-weight: 600; fill: var(--text-muted); text-anchor: middle; pointer-events: none; }
.g-node.done .g-node-label { fill: var(--text); }

/* Chapter card grid (landing lower half) */
.g-cards {
  max-width: 1040px; margin: 46px auto 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px;
}
.g-card {
  display: block; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ac-ease), box-shadow .2s var(--ac-ease), border-color .2s;
}
.g-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ac-amber-line); text-decoration: none; }
.g-card-ico { font-size: 26px; }
.g-card h3 { font-family: var(--ac-display); font-weight: 600; font-size: 19px; margin: 12px 0 6px; color: var(--text); }
.g-card p { margin: 0 0 12px; color: var(--text-muted); font-size: 14px; }
.g-card-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-faint); }
.g-card-tag { color: var(--ac-amber-ink); background: var(--ac-amber-soft); border-radius: 999px; padding: 2px 9px; font-weight: 600; }

/* =====================================================================
   CHAPTER / SECTION CONTENT
   ===================================================================== */
.g-chapter { max-width: var(--ac-measure); margin: 0 auto; padding-top: 40px; }
.g-crumb { font-size: 13px; color: var(--text-faint); margin-bottom: 10px; }
.g-crumb a { color: var(--text-muted); }
.g-chapter-title { font-family: var(--ac-display); font-weight: 600; letter-spacing: -.02em; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; margin: 0; }
.g-chapter-ico { font-size: .9em; margin-right: .3em; }
.g-chapter-intro { font-size: 18px; color: var(--text-muted); margin: 16px 0 8px; }

.g-section { padding: 30px 0; border-top: 1px solid var(--border); scroll-margin-top: 84px; }
.g-section:first-of-type { border-top: none; }
.g-section > h2 {
  font-family: var(--ac-display); font-weight: 600; letter-spacing: -.01em;
  font-size: 27px; margin: 0 0 4px; scroll-margin-top: 84px;
}
.g-section h3 { font-family: var(--ac-display); font-weight: 600; font-size: 19px; margin: 26px 0 6px; }
.g-section p { margin: 12px 0; }
.g-section ul, .g-section ol { margin: 12px 0; padding-left: 22px; }
.g-section li { margin: 6px 0; }
.g-section strong { color: var(--text); font-weight: 700; }

/* Callouts */
.g-note, .g-tip, .g-warn {
  border-radius: var(--radius-sm); padding: 14px 16px 14px 46px;
  margin: 18px 0; position: relative; font-size: 14.5px; border: 1px solid var(--border);
}
.g-note::before, .g-tip::before, .g-warn::before {
  position: absolute; left: 14px; top: 13px; font-size: 18px; line-height: 1;
}
.g-note { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.g-note::before { content: "💡"; }
.g-tip { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.g-tip::before { content: "✅"; }
.g-warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.g-warn::before { content: "⚠️"; }
.g-callout-title { font-weight: 700; color: var(--text); display: block; margin-bottom: 2px; }

/* Numbered steps */
.g-steps { list-style: none; counter-reset: gstep; padding: 0; margin: 20px 0; }
.g-steps > li {
  position: relative; padding: 4px 0 18px 46px; margin: 0;
  border-left: 2px solid var(--border); margin-left: 15px;
}
.g-steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.g-steps > li::before {
  counter-increment: gstep; content: counter(gstep);
  position: absolute; left: -15px; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ac-amber); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; box-shadow: 0 0 0 4px var(--bg);
}
.g-step-do { font-weight: 600; color: var(--text); }
.g-step-then { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

/* Cross links + key chips */
.g-crosslinks { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 4px; }
.g-crosslink {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.g-crosslink:hover { border-color: var(--ac-amber-line); background: var(--ac-amber-soft); color: var(--ac-amber-ink); text-decoration: none; }
.g-key {
  font-family: var(--ac-mono); font-size: .86em;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; color: var(--text);
}

/* Glossary term */
.g-term {
  font: inherit; color: inherit; cursor: help;
  border: none; background: none; padding: 0;
  border-bottom: 2px dotted var(--ac-amber);
}
.g-term:hover { color: var(--ac-amber-ink); }
.g-pop {
  position: fixed; z-index: 120; max-width: 300px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 13px 15px;
  font-size: 13.5px; line-height: 1.5; color: var(--text);
}
.g-pop b { font-family: var(--ac-display); font-size: 14.5px; display: block; margin-bottom: 3px; }
.g-pop-see { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }

/* Section footer (mark complete) */
.g-sec-foot { margin-top: 22px; }
.g-done-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted);
}
.g-done-btn:hover { border-color: var(--ac-amber-line); }
.g-done-btn.done { background: var(--success-soft); border-color: var(--success); color: var(--success); }

/* Prev / next */
.g-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; }
.g-pager a {
  flex: 1; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.g-pager a:hover { border-color: var(--ac-amber-line); text-decoration: none; }
.g-pager .g-pager-dir { font-size: 12px; color: var(--text-faint); }
.g-pager .g-pager-ttl { font-family: var(--ac-display); font-weight: 600; }
.g-pager .next { text-align: right; }

/* =====================================================================
   MOCKSCREEN (Task 3) — self-contained recreation using app *tokens*.
   ===================================================================== */
.mk-frame { margin: 22px 0; }
.mk-caption { font-size: 12.5px; color: var(--text-faint); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.mk-caption::before { content: "◱"; }
.mk {
  position: relative; border: 1px solid var(--border-strong); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow); background: var(--surface);
  display: grid; grid-template-columns: 168px 1fr; height: 340px;
  font-size: 12px;
}
.mk-zoom {
  position: absolute; right: 10px; top: 10px; z-index: 5; cursor: pointer;
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text);
  display: grid; place-items: center; font-size: 14px;
}
.mk-side { background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); padding: 12px 8px; overflow: hidden; }
.mk-side-brand { font-family: var(--ac-display); font-weight: 700; color: var(--accent); padding: 4px 8px 12px; font-size: 14px; }
.mk-grp { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); padding: 8px 8px 3px; }
.mk-item { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; color: var(--sidebar-text); white-space: nowrap; }
.mk-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.mk-item .mk-ico { width: 13px; text-align: center; }
.mk-main { display: flex; flex-direction: column; min-width: 0; }
.mk-top { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.mk-search { flex: 1; height: 24px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.mk-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.mk-body { padding: 12px; overflow: auto; flex: 1; }
.mk-h { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; }
.mk-newbtn { background: var(--accent); color: #fff; border-radius: 8px; padding: 5px 11px; font-size: 11px; font-weight: 600; }
.mk-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mk-table { width: 100%; border-collapse: collapse; }
.mk-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mk-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.mk-table tr:last-child td { border-bottom: none; }
.mk-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.mk-badge.good { background: var(--success-soft); color: var(--success); }
.mk-badge.warn { background: var(--warning-soft); color: var(--warning); }
.mk-badge.info { background: var(--info-soft); color: var(--info); }
.mk-badge.muted { background: var(--surface-2); color: var(--text-muted); }
/* KPI row */
.mk-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.mk-kpi { border-radius: 12px; padding: 10px; }
.mk-kpi .mk-kpi-l { font-size: 10px; color: var(--text-muted); }
.mk-kpi .mk-kpi-v { font-size: 16px; font-weight: 800; color: var(--text); margin-top: 3px; }
.mk-kpi.k1 { background: var(--kpi-1); } .mk-kpi.k2 { background: var(--kpi-2); }
.mk-kpi.k3 { background: var(--kpi-3); } .mk-kpi.k4 { background: var(--kpi-4); }
/* Form (drawer) */
.mk-form { padding: 4px; }
.mk-field { margin-bottom: 10px; }
.mk-field label { display: block; font-size: 10.5px; color: var(--text-muted); margin-bottom: 3px; }
.mk-field .mk-input { height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); display: flex; align-items: center; padding: 0 9px; color: var(--text); font-size: 11.5px; }
.mk-field .mk-input.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mk-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.mk-btn { padding: 6px 13px; border-radius: 8px; font-size: 11.5px; font-weight: 600; }
.mk-btn.ghost { border: 1px solid var(--border-strong); color: var(--text); }
.mk-btn.primary { background: var(--accent); color: #fff; }
/* POS */
.mk-pos { display: grid; grid-template-columns: 1fr 200px; gap: 10px; height: 100%; }
.mk-pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-content: start; }
.mk-pos-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; }
.mk-pos-tile .p { font-weight: 700; color: var(--accent); font-size: 11px; }
.mk-pos-cart { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.mk-pos-total { margin-top: auto; font-weight: 800; font-size: 15px; color: var(--text); display: flex; justify-content: space-between; }

/* Lightbox for zoom */
.g-lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(10,14,25,.72);
  display: grid; place-items: center; padding: 4vw; backdrop-filter: blur(3px);
}
.g-lightbox-inner { width: min(1100px, 96vw); }
.g-lightbox .mk { height: min(640px, 82vh); font-size: 14px; }
.g-lightbox .mk-side { grid-template-columns: 210px 1fr; }

/* =====================================================================
   CLICKDEMO (Task 4)
   ===================================================================== */
.demo { margin: 24px 0; }
.demo-caption { font-family: var(--ac-display); font-weight: 600; font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.demo-caption .demo-chip { font-family: var(--ac-body); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ac-amber-ink); background: var(--ac-amber-soft); border: 1px solid var(--ac-amber-line); padding: 2px 9px; border-radius: 999px; }
/* overflow:hidden clips the spotlight's huge dimming box-shadow to the demo
   frame — without it the 9999px shadow bleeds across the whole page. */
.demo-stage { position: relative; overflow: hidden; border-radius: 14px; }
.demo-spot { position: absolute; z-index: 8; border-radius: 10px; box-shadow: 0 0 0 3px var(--ac-amber), 0 0 0 9999px rgba(10,14,25,.45); pointer-events: none; transition: all .35s var(--ac-ease); }
.demo-coach { position: absolute; z-index: 9; max-width: 240px; background: var(--ac-amber); color: #fff; padding: 10px 13px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); transition: all .35s var(--ac-ease); }
.demo-coach::after { content: ""; position: absolute; width: 12px; height: 12px; background: var(--ac-amber); transform: rotate(45deg); }
.demo-coach.below::after { top: -5px; left: 20px; }
.demo-coach.above::after { bottom: -5px; left: 20px; }
.demo-coach-step { font-size: 11px; opacity: .8; font-weight: 700; }
.demo-coach-next { margin-top: 8px; display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.22); border: none; color: #fff; font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; cursor: pointer; }
.demo-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.demo-dots { display: flex; gap: 6px; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: background .2s; }
.demo-dot.on { background: var(--ac-amber); }
.demo-restart { margin-left: auto; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ac-amber-ink); background: none; border: none; cursor: pointer; }
.demo-done { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 75%, transparent); backdrop-filter: blur(2px); border-radius: 14px; text-align: center; }
.demo-done .demo-done-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 28px; box-shadow: var(--shadow-lg); }
.demo-done .demo-done-emoji { font-size: 34px; }
.demo-done h4 { font-family: var(--ac-display); margin: 8px 0 4px; font-size: 19px; }
.demo-done p { margin: 0 0 14px; color: var(--text-muted); font-size: 13.5px; }
/* mini ledger effect */
.demo-ledger { position: absolute; z-index: 9; right: 14px; bottom: 14px; width: 190px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; opacity: 0; transform: translateY(8px); transition: all .4s var(--ac-ease); }
.demo-ledger.show { opacity: 1; transform: none; }
.demo-ledger-h { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 7px 10px; border-bottom: 1px solid var(--border); }
.demo-ledger-row { display: flex; justify-content: space-between; padding: 6px 10px; font-size: 11.5px; }
.demo-ledger-row .dr { color: var(--text-muted); } .demo-ledger-row .amt { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.demo-fly { position: absolute; z-index: 11; font-weight: 800; color: var(--ac-amber-ink); font-size: 14px; }

/* =====================================================================
   CONCEPTANIM (Task 5)
   ===================================================================== */
.anim { margin: 24px 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.anim-stage { background: var(--surface-2); }
.anim-stage svg { width: 100%; height: auto; display: block; }
.anim-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); }
.anim-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--ac-amber); color: #fff; font-size: 14px; cursor: pointer; display: grid; place-items: center; }
.anim-scrub { flex: 1; accent-color: var(--ac-amber); }
.anim-title { font-size: 13px; color: var(--text-muted); }
.anim-caption { padding: 0 14px 12px; font-size: 13px; color: var(--text-muted); }

/* =====================================================================
   REVEAL + RESPONSIVE + REDUCED MOTION
   ===================================================================== */
.g-reveal { opacity: 0; transform: translateY(14px); }
.g-reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ac-ease), transform .6s var(--ac-ease); }

@media (max-width: 900px) {
  .g-main { margin-left: 0; }
  .g-sidebar {
    position: fixed; z-index: 90; left: 0; top: 0; width: min(300px, 86vw);
    transform: translateX(-102%); transition: transform .3s var(--ac-ease);
  }
  body.g-nav-open .g-sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .g-menu { display: grid; }
  .g-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10,14,25,.4); }
  .g-view, .g-topbar, .g-foot { padding-left: 18px; padding-right: 18px; }
  .mk { grid-template-columns: 120px 1fr; height: 300px; }
}
@media (max-width: 560px) {
  .mk-kpis { grid-template-columns: repeat(2, 1fr); }
  .mk-pos { grid-template-columns: 1fr; }
  .g-pager { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .g-reveal { opacity: 1; transform: none; }
}
