/* ════════════════════════════════════════════════════════════════════════
   AWS Knowledge — Core (tokens, nav, shell, sidebar, home)
   Pure AWS palette · Lato · calm reading base + bold module color
   ════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Brand ── */
  --navy:          #141430;
  --navy-soft:     #21213f;
  --amber:         #FF9900;
  --amber-dark:    #e08600;
  --amber-light:   #fff6e6;
  --amber-line:    #ffe0a8;

  /* ── Surfaces ── */
  --bg:            #eef0f4;
  --bg-2:          #e8eaf0;
  --surface:       #ffffff;
  --surface-2:     #fafbfc;
  --surface-3:     #f4f5f8;
  --border:        #e3e5ec;
  --border-muted:  #edeef3;
  --border-strong: #d3d6e0;

  /* ── Text ── */
  --text-primary:  #181830;
  --text-body:     #36384a;
  --text-secondary:#646b7d;
  --text-muted:    #9aa1b2;
  --text-faint:    #c2c7d4;

  /* ── Shape ── */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  /* ── Shadow ── */
  --sh-xs: 0 1px 2px rgba(20,20,48,0.06);
  --sh-sm: 0 2px 6px rgba(20,20,48,0.07), 0 1px 2px rgba(20,20,48,0.05);
  --sh-md: 0 8px 24px -8px rgba(20,20,48,0.18), 0 2px 6px rgba(20,20,48,0.06);
  --sh-lg: 0 24px 60px -16px rgba(20,20,48,0.28), 0 8px 24px -12px rgba(20,20,48,0.16);
  --sh-amber: 0 8px 22px -8px rgba(255,153,0,0.45);

  /* ── Type ── */
  --font: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Fira Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;

  /* ── Tunable ── */
  --read-width: 720px;
  --read-scale: 1;
  --accent: var(--amber);
  --accent-dark: var(--amber-dark);
  --accent-light: var(--amber-light);

  --t: 0.18s cubic-bezier(.4,0,.2,1);

  --mod: #4381E5;
  --mod-tint: rgba(67,129,229,0.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100vh;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255,153,0,0.28); }

body[data-density="compact"] { --gap-pad: 0.82; }
body { --gap-pad: 1; }

/* ════════════════════════════════════════════════════════════════════════
   TOP NAV
   ════════════════════════════════════════════════════════════════════════ */
.topnav {
  height: 52px;
  background: var(--navy);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  position: relative;
  z-index: 40;
  flex-shrink: 0;
  overflow: hidden;
}
.topnav::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(67,129,229,.28), transparent 65%);
  pointer-events: none;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 800; color: #fff;
  letter-spacing: -0.4px; white-space: nowrap; position: relative; z-index: 1;
  cursor: pointer;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--amber), #ffb347);
  color: var(--navy); font-weight: 900; font-size: 12px;
  box-shadow: 0 2px 10px rgba(255,153,0,0.4);
}
.brand span { color: var(--amber); }

.nav-search {
  flex: 1; max-width: 400px;
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--r-sm);
  padding: 7px 13px; font-size: 13px;
  color: rgba(255,255,255,0.45);
  cursor: text; transition: border-color var(--t), background var(--t);
  position: relative; z-index: 1; user-select: none;
}
.nav-search:hover { border-color: rgba(255,255,255,0.26); background: rgba(255,255,255,0.1); }
.nav-search svg { opacity: 0.45; flex-shrink: 0; }
.nav-search .kbd {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px; padding: 2px 7px; color: rgba(255,255,255,0.7);
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }

.nav-progress { display: flex; align-items: center; gap: 10px; }
.nav-progress-bar {
  width: 84px; height: 5px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.16); overflow: hidden;
}
.nav-progress-fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--amber), #ffc14d);
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.nav-progress-label { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.75); white-space: nowrap; }

.nav-streak {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(255,153,0,0.16); border: 1px solid rgba(255,153,0,0.3);
  padding: 5px 11px; border-radius: var(--r-pill); white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════════
   SHELL + SIDEBAR
   ════════════════════════════════════════════════════════════════════════ */
.shell { display: flex; height: calc(100vh - 52px); overflow: hidden; }

.sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 0 40px;
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: #dfe2ea; border-radius: 8px; border: 2px solid var(--surface); }
.sidebar:hover::-webkit-scrollbar-thumb { background: #cbcfdb; }

.side-block { padding: 0 12px; }

.side-home {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  transition: background var(--t);
}
.side-home svg { color: var(--text-secondary); }
.side-home:hover { background: var(--surface-3); }
.side-home.active { background: var(--amber-light); color: var(--amber-dark); }
.side-home.active svg { color: var(--amber-dark); }

.side-divider { height: 1px; background: var(--border-muted); margin: 12px 14px; }

.side-label {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); padding: 6px 14px 6px;
}

.side-bm-empty { font-size: 12px; color: var(--text-faint); padding: 2px 14px 8px; font-style: italic; }

/* module group */
.mod-group { margin: 1px 0; }
.mod-group-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 7px 12px; border-radius: var(--r-sm);
  transition: background var(--t);
}
.mod-group-head:hover { background: var(--surface-3); }
.mod-group-head .chev {
  color: var(--text-faint); flex-shrink: 0; transition: transform var(--t);
}
.mod-group[data-open="true"] .mod-group-head .chev { transform: rotate(90deg); }
.mod-num-dot {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #fff;
  background: var(--mg);
}
.mod-group-title {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mod-mini-prog {
  width: 28px; height: 3px; border-radius: var(--r-pill);
  background: var(--border); overflow: hidden; flex-shrink: 0;
}
.mod-mini-fill { height: 100%; background: var(--mg); border-radius: var(--r-pill); transition: width 0.4s; }
.mod-check { color: #16a34a; flex-shrink: 0; }

.mod-items {
  overflow: hidden;
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows 0.26s cubic-bezier(.4,0,.2,1);
}
.mod-group[data-open="false"] .mod-items { grid-template-rows: 0fr; }
.mod-items-inner { overflow: hidden; padding-left: 14px; }

.side-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 5px 10px 5px 12px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  line-height: 1.3; position: relative;
  border-left: 2px solid transparent; margin-left: 4px;
  transition: background var(--t), color var(--t);
}
.side-item:hover { background: var(--surface-3); color: var(--text-primary); }
.side-item.active {
  background: var(--mod-tint); color: var(--mod); font-weight: 700;
  border-left-color: var(--mod);
}
.side-item .dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; background: var(--idot); }
.side-item .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item .rd { color: #16a34a; flex-shrink: 0; opacity: 0; transition: opacity var(--t); }
.side-item.read .rd { opacity: 1; }
.side-item.read .nm { color: var(--text-muted); }
.side-item .star { color: var(--amber); flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════════
   MAIN / SCROLL AREA
   ════════════════════════════════════════════════════════════════════════ */
.main { flex: 1; overflow-y: auto; min-width: 0; position: relative; scroll-behavior: smooth; }
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: #d6d9e2; border-radius: 10px; border: 3px solid var(--bg); }
.main:hover::-webkit-scrollbar-thumb { background: #c3c7d4; }

.view { display: none; }
.view.show { display: block; }

/* ════════════════════════════════════════════════════════════════════════
   HOME
   ════════════════════════════════════════════════════════════════════════ */
.home-wrap { max-width: 1060px; margin: 0 auto; padding: 28px 36px 64px; }

.dash {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 28px;
}
.dash-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--sh-sm);
}
.dash-hello { font-size: 12px; font-weight: 700; color: var(--amber-dark); letter-spacing: 0.3px; margin-bottom: 4px; }
.dash-title { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; margin-bottom: 16px; line-height: 1.15; }
.dash-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dash-bar { flex: 1; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; box-shadow: inset 0 1px 2px rgba(20,20,48,0.07); }
.dash-bar-fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--amber-dark), var(--amber) 60%, #ffc14d);
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
}
.dash-pct { font-size: 18px; font-weight: 800; color: var(--text-primary); white-space: nowrap; }
.dash-stats { display: flex; gap: 20px; }
.dash-stat { display: flex; flex-direction: column; gap: 1px; }
.dash-stat b { font-size: 17px; font-weight: 800; color: var(--text-primary); }
.dash-stat span { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.dash-stat.sep { padding-left: 20px; border-left: 1px solid var(--border-muted); }

.resume-card {
  display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(150deg, var(--navy), #232348);
  border: 1px solid var(--navy); box-shadow: var(--sh-md); color: #fff;
  position: relative;
}
.resume-card::after {
  content:""; position:absolute; right:-40px; top:-40px; width:180px; height:180px; border-radius:50%;
  background: radial-gradient(circle at 40% 40%, rgba(255,153,0,0.22), transparent 65%); pointer-events:none;
}
.resume-pad { padding: 20px 22px; position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; }
.resume-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.resume-title { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 4px; line-height: 1.25; flex: 1; }
.resume-sub { font-size: 12px; color: rgba(255,255,255,0.55); margin-bottom: 16px; }
.resume-btn {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--amber); color: var(--navy); font-weight: 800; font-size: 13px;
  padding: 9px 16px; border-radius: var(--r-sm); transition: transform 0.12s, box-shadow var(--t);
  box-shadow: var(--sh-amber);
}
.resume-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -8px rgba(255,153,0,0.6); }
.resume-btn:active { transform: translateY(0); }

/* section header */
.home-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.home-head h2 { font-size: 15px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.2px; }
.home-head .count { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.seg {
  margin-left: auto; display: flex; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px;
}
.seg button {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  padding: 5px 12px; border-radius: 6px; transition: all var(--t);
}
.seg button.on { background: var(--surface); color: var(--text-primary); box-shadow: var(--sh-xs); }
.seg button:not(.on):hover { color: var(--text-primary); }

/* module grid */
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.mcard {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer; text-align: left;
  display: flex; flex-direction: column;
  transition: transform 0.14s cubic-bezier(.4,0,.2,1), box-shadow var(--t), border-color var(--t);
}
/* accent bar at top */
.mcard::before {
  content:""; position:absolute; left:0; top:0; right:0; height:4px; background: var(--mc);
}
.mcard:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--mc); }
.mcard-top { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 20px 0; }
.mcard-num {
  font-size: 42px; font-weight: 900; line-height: 0.85; letter-spacing: -3px;
  color: var(--mc); opacity: 0.14; user-select: none;
}
/* progress ring */
.ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring-track { stroke: var(--surface-3); }
.ring-fill { stroke: var(--mc); stroke-linecap: round; transition: stroke-dashoffset 0.7s cubic-bezier(.4,0,.2,1); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: var(--text-secondary); }
.ring.done .ring-num { color: #16a34a; }

.mcard-body { padding: 10px 20px 0; flex: 1; }
.mcard-title { font-size: 15px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; line-height: 1.2; margin-bottom: 6px; }
.mcard-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 16px; margin-top: 12px;
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
}
.mcard-foot .topics { color: var(--text-secondary); }
.mcard-foot .readct { color: var(--mc); font-weight: 700; }
.mcard.placeholder {
  opacity: 0.52; cursor: default;
  background: var(--surface-2);
  border-style: dashed;
}
.mcard.placeholder:hover { transform: none; box-shadow: none; border-color: var(--border); }
.mcard-lock { color: var(--text-faint); }
.mcard-pending {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--text-faint); text-transform: uppercase;
}

.mcard-done {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase;
  color: #15803d; background: #e9f9ee; border: 1px solid #bbf0c9;
  padding: 3px 9px; border-radius: var(--r-pill);
}

/* scan list */
.scan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-sm); }
.scan-filter {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border-muted);
}
.scan-filter svg { color: var(--text-muted); flex-shrink: 0; }
.scan-filter input { flex: 1; border: none; outline: none; font-family: inherit; font-size: 14px; color: var(--text-primary); background: none; }
.scan-filter input::placeholder { color: var(--text-faint); }
.scan-cat-label {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
  padding: 12px 20px 7px; background: var(--surface-2); border-bottom: 1px solid var(--border-muted);
}
.scan-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 20px; border-bottom: 1px solid var(--border-muted); transition: background var(--t);
}
.scan-row:last-child { border-bottom: none; }
.scan-row:hover { background: var(--mod-tint); }
.scan-row .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--idot); }
.scan-row .nm { font-size: 13.5px; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; }
.scan-row.read .nm { color: var(--text-muted); }
.scan-row .modtag { font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.scan-row .cat { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.scan-row .star { color: var(--text-faint); }
.scan-row .star.on { color: var(--amber); }
.scan-row .rd { color: #16a34a; opacity: 0; }
.scan-row.read .rd { opacity: 1; }
.scan-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 14px; }
.tier-cat-label { display: flex; align-items: center; gap: 8px; }
.tier-cat-label .tier-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tier-cat-label .tier-count { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--text-faint); padding-right: 4px; }

/* ════════════════════════════════════════════════════════════════════════
   EXAM DOMAIN VIEW
   ════════════════════════════════════════════════════════════════════════ */
.domain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.dcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); text-align: left; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  --dc: #4381E5;
}
.dcard::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--dc);
}
.dcard:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--dc); }
.dcard-inner { padding: 22px 22px 18px; flex: 1; display: flex; flex-direction: column; gap: 0; }

.dcard-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.dcard-id {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--dc);
  background: color-mix(in srgb, var(--dc) 10%, transparent);
  border-radius: var(--r-sm); padding: 3px 7px; letter-spacing: 0.3px;
}
.dcard-weight { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--dc); line-height: 1; }
.dcard-weight span { font-size: 13px; font-weight: 600; }

.dcard-title { font-size: 15px; font-weight: 900; color: var(--text-primary); letter-spacing: -0.3px; margin-bottom: 5px; }
.dcard-desc {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.dcard-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.dcard-bar { flex: 1; height: 4px; background: var(--bg); border-radius: var(--r-pill); overflow: hidden; }
.dcard-bar-fill { height: 100%; background: var(--dc); border-radius: var(--r-pill); transition: width 0.4s; }
.dcard-bar-pct { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--dc); white-space: nowrap; }

.dcard-foot { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.dcard-stat { font-size: 12px; color: var(--text-muted); }
.dcard-stat b { color: var(--text-primary); font-weight: 700; }
.dcard-gap-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: #b45309;
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: var(--r-pill); padding: 2px 8px;
  margin-left: auto;
}

/* domain detail */
.domain-detail-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.domain-back {
  display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  padding: 6px 10px; border-radius: var(--r-sm); transition: all var(--t); flex-shrink: 0;
}
.domain-back:hover { background: var(--bg); color: var(--text-primary); }
.domain-detail-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.domain-detail-title { font-size: 17px; font-weight: 900; color: var(--text-primary); letter-spacing: -0.3px; }
.domain-weight-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--dc, #4381E5); background: color-mix(in srgb, var(--dc, #4381E5) 10%, transparent);
  border-radius: var(--r-pill); padding: 3px 10px;
}
.domain-divider { width: 1px; height: 18px; background: var(--border); }

.domain-tasks { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.domain-task-chip {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 4px 12px;
}

.domain-section-label {
  font-size: 10px; font-weight: 800; color: var(--text-muted);
  letter-spacing: 0.9px; text-transform: uppercase; margin: 20px 0 8px;
}

.gaps-list {
  background: #fffbf0; border: 1px solid #fde68a;
  border-radius: var(--r-md); overflow: hidden;
}
.gap-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-bottom: 1px solid #fde68a; font-size: 13px; color: #78350f; font-weight: 500;
}
.gap-row:last-child { border-bottom: none; }
.gap-row svg { color: #f59e0b; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════════
   HIDE-GAMIFY LAYER
   ════════════════════════════════════════════════════════════════════════ */
body.hide-gamify .ring,
body.hide-gamify .mcard-foot .readct,
body.hide-gamify .mcard-done,
body.hide-gamify .dash,
body.hide-gamify .nav-progress,
body.hide-gamify .nav-streak,
body.hide-gamify .mod-mini-prog,
body.hide-gamify .mod-check,
body.hide-gamify .side-item .rd,
body.hide-gamify .read-progress { display: none !important; }

body.hide-toc .article { grid-template-columns: minmax(0,1fr) !important; max-width: var(--read-width) !important; }
body.hide-toc .toc { display: none !important; }

/* ════════════════════════════════════════════════════════════════════════
   SEARCH OVERLAY
   ════════════════════════════════════════════════════════════════════════ */
.ov { position: fixed; inset: 0; z-index: 100; display: none; }
.ov.show { display: block; }
.ov-scrim { position: absolute; inset: 0; background: rgba(20,20,48,0.5); backdrop-filter: blur(3px); animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } }
.ov-panel {
  position: relative; max-width: 600px; margin: 12vh auto 0;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  overflow: hidden; animation: pop 0.16s cubic-bezier(.4,0,.2,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(0.99); } }
.ov-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-muted); }
.ov-input-row svg { color: var(--text-muted); flex-shrink: 0; }
.ov-input { flex: 1; border: none; outline: none; font-family: inherit; font-size: 16px; font-weight: 600; color: var(--text-primary); background: none; }
.ov-input::placeholder { color: var(--text-faint); font-weight: 500; }
.ov-esc { font-family: var(--mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 5px; padding: 3px 8px; }
.ov-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.ov-cat { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); padding: 10px 14px 6px; }
.ov-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 9px 14px; border-radius: var(--r-sm); transition: background var(--t);
}
.ov-item.sel, .ov-item:hover { background: var(--mod-tint); }
.ov-item .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--idot); }
.ov-item .nm { font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-item .nm mark { background: var(--amber-light); color: var(--amber-dark); border-radius: 3px; padding: 0 1px; }
.ov-item .meta { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.ov-item .rd { color: #16a34a; opacity: 0; }
.ov-item.read .rd { opacity: 1; }
.ov-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 14px; }
.ov-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border-muted); background: var(--surface-2); font-size: 11px; color: var(--text-muted); }
.ov-foot kbd { font-family: var(--mono); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 10px; margin-right: 3px; }

/* ════════════════════════════════════════════════════════════════════════
   TWEAKS PANEL
   ════════════════════════════════════════════════════════════════════════ */
.gear {
  position: fixed; right: 18px; bottom: 18px; z-index: 89;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff; display: grid; place-items: center;
  box-shadow: var(--sh-md); transition: transform 0.15s, background var(--t);
}
.gear:hover { transform: rotate(40deg); background: var(--navy-soft); }

.tweaks {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 260px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg); overflow: hidden;
  display: none;
}
.tweaks.show { display: block; }
.tweaks-head { display: flex; align-items: center; gap: 9px; padding: 13px 15px; border-bottom: 1px solid var(--border-muted); }
.tweaks-head .ti { width: 24px; height: 24px; border-radius: 6px; background: var(--amber-light); display: grid; place-items: center; color: var(--amber-dark); }
.tweaks-head h3 { font-size: 13.5px; font-weight: 800; color: var(--text-primary); flex: 1; }
.tweaks-head .x { color: var(--text-muted); padding: 4px; border-radius: 6px; transition: all var(--t); }
.tweaks-head .x:hover { background: var(--surface-3); color: var(--text-primary); }
.tweaks-body { padding: 6px 15px 15px; }
.tw-row { padding: 12px 0; border-bottom: 1px solid var(--border-muted); }
.tw-row:last-child { border-bottom: none; }
.tw-row > label { display: block; font-size: 11px; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.tw-seg { display: flex; gap: 5px; }
.tw-seg button {
  flex: 1; font-size: 12px; font-weight: 700; color: var(--text-secondary);
  padding: 7px 4px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-3);
  transition: all var(--t);
}
.tw-seg button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tw-toggle { display: flex; align-items: center; justify-content: space-between; }
.tw-toggle span { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.tw-sw { width: 40px; height: 22px; border-radius: var(--r-pill); background: var(--border-strong); position: relative; transition: background var(--t); flex-shrink: 0; cursor: pointer; }
.tw-sw::after { content:""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-xs); transition: transform var(--t); }
.tw-sw.on { background: var(--amber); }
.tw-sw.on::after { transform: translateX(18px); }

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .mod-grid { grid-template-columns: repeat(2, 1fr); }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .home-wrap { padding: 20px 18px 56px; }
  .nav-progress, .nav-search .kbd { display: none; }
  .mod-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════
   MOCK EXAM — launch button, exam view, results
   ════════════════════════════════════════════════════════════════════════ */

/* Launch row on Exam tab */
.exam-launch-row { margin-bottom: 20px; }
.exam-launch-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 16px 22px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #1e40af 0%, #0ea5a4 100%);
  border: none; color: #fff; font-size: 15px; font-weight: 800;
  cursor: pointer; transition: opacity var(--t); letter-spacing: .01em;
}
.exam-launch-btn:hover { opacity: 0.92; }
.exam-launch-meta { font-size: 12px; font-weight: 600; opacity: 0.75; margin-left: auto; }

/* Exam view full-height layout */
#examView.show { display: flex; flex-direction: column; min-height: 100%; }

/* Top bar */
.exam-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.exam-exit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--text-secondary);
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: var(--r-sm); cursor: pointer; flex-shrink: 0;
  transition: all var(--t);
}
.exam-exit:hover { border-color: var(--border-strong); color: var(--text-primary); }
.exam-bar-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.exam-bar-title { font-size: 13.5px; font-weight: 800; color: var(--text-primary); }
.exam-bar-prog { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.exam-bar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.exam-timer {
  font-size: 17px; font-weight: 900; color: var(--text-primary);
  font-variant-numeric: tabular-nums; letter-spacing: .03em;
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: var(--r-sm);
}
.exam-timer.urgent { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.exam-submit-btn {
  padding: 7px 16px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 800;
  background: #1e40af; color: #fff; border: none; cursor: pointer; transition: opacity var(--t);
}
.exam-submit-btn:hover { opacity: 0.88; }

/* Body — question panel + navigator */
.exam-body {
  flex: 1; display: grid; grid-template-columns: 1fr 220px;
  gap: 0; align-items: start;
}

/* Question panel */
.exam-panel {
  padding: 32px 36px 32px; border-right: 1px solid var(--border-muted);
  min-height: 100%;
}
.exam-qnum {
  font-size: 11.5px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
}
.exam-multi-hint {
  display: inline-block; font-size: 11.5px; font-weight: 800; color: #7c3aed;
  background: #f3f0ff; border: 1px solid #ddd6fe;
  padding: 2px 9px; border-radius: 99px; margin-bottom: 12px;
}
.exam-qtext {
  font-size: 16px; font-weight: 600; line-height: 1.6;
  color: var(--text-primary); margin-bottom: 24px;
}
.exam-opts { display: flex; flex-direction: column; gap: 9px; margin-bottom: 28px; }
.exam-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--surface-3);
  cursor: pointer; text-align: left; font-size: 14px;
  color: var(--text-primary); transition: all var(--t); line-height: 1.45;
}
.exam-opt:hover { border-color: #818cf8; background: #eef2ff; }
.exam-opt.sel { border-color: #4f46e5; background: #eef2ff; color: #312e81; }
.exam-opt-letter {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid currentColor; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--text-muted);
}
.exam-opt.sel .exam-opt-letter { color: #4f46e5; }
.exam-opt-text { flex: 1; }

.exam-flag-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--text-muted);
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 6px 12px; cursor: pointer; transition: all var(--t);
}
.exam-flag-btn:hover { border-color: #f59e0b; color: #d97706; }
.exam-flag-btn.on { border-color: #f59e0b; color: #d97706; background: #fffbeb; }

/* Footer prev/next */
.exam-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-muted);
}
.exam-nav-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 9px 18px; border-radius: var(--r-md); border: 1.5px solid var(--border);
  background: var(--surface-3); color: var(--text-primary); cursor: pointer; transition: all var(--t);
}
.exam-nav-btn:hover:not(:disabled) { border-color: var(--border-strong); }
.exam-nav-btn:disabled { opacity: 0.38; cursor: default; }
.exam-nav-btn.primary {
  background: #1e40af; color: #fff; border-color: #1e40af;
}
.exam-nav-btn.primary:hover { background: #1d3fb0; opacity: 0.9; }

/* Navigator sidebar */
.exam-nav {
  padding: 20px 16px; position: sticky; top: 57px;
  max-height: calc(100vh - 57px); overflow-y: auto;
}
.exam-nav-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 12px;
}
.exam-nav-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 14px;
}
.exam-nav-dot {
  aspect-ratio: 1; border-radius: 5px; font-size: 10px; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface-3);
  color: var(--text-muted); cursor: pointer; transition: all var(--t);
  display: grid; place-items: center;
}
.exam-nav-dot:hover { border-color: var(--border-strong); }
.exam-nav-dot.current { background: #1e40af; color: #fff; border-color: #1e40af; }
.exam-nav-dot.answered { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.exam-nav-dot.flagged { background: #fffbeb; border-color: #fcd34d; color: #d97706; }
.exam-nav-dot.flagged-answered { background: #fef3c7; border-color: #f59e0b; color: #b45309; }

.exam-nav-legend { display: flex; flex-direction: column; gap: 5px; }
.leg {
  font-size: 10.5px; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.leg::before {
  content: ""; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface-3);
}
.leg.answered::before { background: #e0f2fe; border-color: #7dd3fc; }
.leg.flagged::before  { background: #fffbeb; border-color: #fcd34d; }

/* Results page */
.exam-results {
  max-width: 580px; margin: 48px auto; padding: 0 24px 80px;
}
.exam-results-hero {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-bottom: 40px;
}
.exam-score-ring {
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 6px solid var(--border);
}
.exam-score-ring.pass { border-color: #22c55e; background: #f0fdf4; }
.exam-score-ring.fail { border-color: #ef4444; background: #fef2f2; }
.exam-score-val { font-size: 38px; font-weight: 900; line-height: 1; }
.exam-score-ring.pass .exam-score-val { color: #15803d; }
.exam-score-ring.fail .exam-score-val { color: #b91c1c; }
.exam-score-sub { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.exam-verdict {
  font-size: 20px; font-weight: 900; letter-spacing: .08em; padding: 6px 24px;
  border-radius: 99px;
}
.exam-verdict.pass { background: #dcfce7; color: #15803d; }
.exam-verdict.fail { background: #fee2e2; color: #b91c1c; }
.exam-results-detail { font-size: 13.5px; color: var(--text-muted); font-weight: 600; }

.exam-bk-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 14px;
}
.exam-breakdown { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; }
.exam-bk-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; }
.exam-bk-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.exam-bk-bar {
  height: 8px; border-radius: 99px; background: var(--surface-3);
  border: 1px solid var(--border); overflow: hidden;
}
.exam-bk-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.exam-bk-right { font-size: 12px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.exam-bk-right b { color: var(--text-primary); }

.exam-results-actions { display: flex; gap: 10px; justify-content: center; }
.exam-results-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 800;
  border: 1.5px solid var(--border); background: var(--surface-3);
  color: var(--text-primary); cursor: pointer; transition: all var(--t);
}
.exam-results-btn:hover { border-color: var(--border-strong); }
.exam-results-btn.primary { background: #1e40af; color: #fff; border-color: #1e40af; }
.exam-results-btn.primary:hover { opacity: 0.9; }
