:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #1b2430;
  --muted: #5b6676;
  --line: #d9e0e8;
  --brand: #1f4e79;
  --brand-2: #2f6fa8;
  --accent: #e0861a;
  --ok: #1d7a46;
  --ok-bg: #e3f4ea;
  --bad: #b3261e;
  --bad-bg: #fbe7e5;
  --key-bg: #fff4d6;
  --key-line: #e0a400;
  --trap-bg: #fde8e8;
  --trap-line: #c0392b;
  --mind-bg: #e6f0fb;
  --mind-line: #2f6fa8;
  --people: #7b3fa0;
  --process: #1f6fb2;
  --biz: #1d7a46;
  --agile: #c0621a;
  --shadow: 0 1px 3px rgba(20, 30, 45, .08), 0 4px 14px rgba(20, 30, 45, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b; --surface: #171e27; --surface-2: #1f2834; --text: #e6ebf1; --muted: #9aa6b5;
    --line: #2c3746; --brand: #6fa8dc; --brand-2: #8dbbe6; --accent: #f0a04b;
    --ok: #5fd08f; --ok-bg: #143322; --bad: #ff8a80; --bad-bg: #3a1a18;
    --key-bg: #3a3016; --key-line: #d9a628; --trap-bg: #3a1c1c; --trap-line: #e57368;
    --mind-bg: #172a40; --mind-line: #6fa8dc;
    --people: #c39be0; --process: #7fb6ea; --biz: #6fd39b; --agile: #f0a066;
    --shadow: 0 1px 3px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --surface: #171e27; --surface-2: #1f2834; --text: #e6ebf1; --muted: #9aa6b5;
  --line: #2c3746; --brand: #6fa8dc; --brand-2: #8dbbe6; --accent: #f0a04b;
  --ok: #5fd08f; --ok-bg: #143322; --bad: #ff8a80; --bad-bg: #3a1a18;
  --key-bg: #3a3016; --key-line: #d9a628; --trap-bg: #3a1c1c; --trap-line: #e57368;
  --mind-bg: #172a40; --mind-line: #6fa8dc;
  --people: #c39be0; --process: #7fb6ea; --biz: #6fd39b; --agile: #f0a066;
  --shadow: 0 1px 3px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.6rem; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
button { font: inherit; cursor: pointer; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); }
.tbl { overflow-x: auto; margin: .6em 0; }
code, .f { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .9em; }

/* top bar + nav */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--text); font-weight: 700; }
.logo { background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 8px; letter-spacing: .5px; }
:root[data-theme="dark"] .logo { color: #0f141b; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.countdown { font-size: .8rem; color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 10px; width: 36px; height: 36px; }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--line); padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--muted); font-size: .68rem; padding: 4px 0; border-radius: 10px; }
.nav a span { font-size: 1.2rem; line-height: 1.2; }
.nav a b { font-weight: 600; }
.nav a.on { color: var(--brand); background: var(--surface-2); }

.app { max-width: 880px; margin: 0 auto; padding: 16px; outline: none; }
.foot { max-width: 880px; margin: 24px auto 0; padding: 0 16px 16px; font-size: .75rem; color: var(--muted); }

@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 200px; }
  .nav { top: 57px; bottom: 0; right: auto; width: 200px; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 12px 10px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: 0; flex-direction: row; gap: 10px; font-size: .95rem; padding: 9px 12px; }
  .app { padding: 24px 32px; }
}

/* cards & common */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 12px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; }
.tile:hover { border-color: var(--brand-2); }
.tile .ico { font-size: 1.5rem; }
.tile h3 { margin: .3em 0 .2em; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.tile .done { position: absolute; top: 10px; right: 12px; color: var(--ok); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-right: 4px; }
.pill.people { color: var(--people); } .pill.process { color: var(--process); } .pill.biz { color: var(--biz); } .pill.agile { color: var(--agile); }
.btn { border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 600; }
:root[data-theme="dark"] .btn { color: #0f141b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn, :root:not([data-theme="light"]) .logo { color: #0f141b; } }
.btn.ghost { background: transparent; color: var(--brand); }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.hero { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: var(--radius); padding: 20px; }
.hero h1 { margin-top: 0; }
.hero p { margin: .3em 0; opacity: .95; }
:root[data-theme="dark"] .hero { color: #0f141b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { color: #0f141b; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: rgba(255,255,255,.15); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 1.4rem; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); width: 0; transition: width .4s; }

/* domain weight bar */
.weights { display: flex; height: 34px; border-radius: 10px; overflow: hidden; font-size: .8rem; font-weight: 700; color: #fff; }
.weights div { display: flex; align-items: center; justify-content: center; }
.w-people { background: var(--people); } .w-process { background: var(--process); } .w-biz { background: var(--biz); }
:root[data-theme="dark"] .weights { color: #0f141b; }

/* roadmap */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 18px; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand-2); }
.timeline li.now::before { background: var(--accent); border-color: var(--accent); }
.timeline h3 { margin: 0; }
.timeline .when { font-size: .8rem; font-weight: 700; color: var(--accent); }

/* notes */
.note h2 { border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.note ul, .note ol { padding-left: 1.3em; }
.note li { margin: .2em 0; }
.key, .trap, .mind { border-left: 4px solid; border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.key { background: var(--key-bg); border-color: var(--key-line); }
.trap { background: var(--trap-bg); border-color: var(--trap-line); }
.mind { background: var(--mind-bg); border-color: var(--mind-line); }
.key::before { content: "⭐ KEY POINT"; }
.trap::before { content: "⚠️ EXAM TRAP"; }
.mind::before { content: "🧠 PM MINDSET"; }
.key::before, .trap::before, .mind::before { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .6px; margin-bottom: 2px; opacity: .85; }
.key p, .trap p, .mind p { margin: .2em 0; }
mark { background: var(--key-bg); color: inherit; padding: 0 3px; border-radius: 3px; box-shadow: inset 0 -2px 0 var(--key-line); }
.keyonly .sec > *:not(.key):not(.trap):not(.mind):not(h2) { display: none; }
.toolbar { position: sticky; top: 57px; z-index: 10; background: var(--bg); padding: 8px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 6px 12px; border-radius: 99px; font-size: .85rem; }
.toggle.on { background: var(--key-bg); border-color: var(--key-line); font-weight: 700; }
.toc { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.toc a { white-space: nowrap; font-size: .8rem; text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; color: var(--muted); background: var(--surface); }
details.reveal { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
details.reveal summary { cursor: pointer; font-weight: 600; }

/* quiz & mindset */
.opt { display: block; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.opt:hover:not(:disabled) { border-color: var(--brand-2); }
.opt .lt { display: inline-block; width: 1.6em; font-weight: 800; color: var(--muted); }
.opt.sel { border-color: var(--brand-2); background: var(--mind-bg); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt:disabled { cursor: default; }
.why { border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: var(--surface-2); }
.why.ok { background: var(--ok-bg); } .why.no { background: var(--bad-bg); }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.score-big { font-size: 2.6rem; font-weight: 800; }
.review-item { border-top: 1px solid var(--line); padding: 10px 0; }

/* flashcards */
.flip { perspective: 1200px; height: 260px; margin: 12px 0; cursor: pointer; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; overflow: auto; }
.face.back { transform: rotateY(180deg); background: var(--mind-bg); }
.face .term { font-size: 1.35rem; font-weight: 800; }
.face .hint { position: absolute; bottom: 10px; font-size: .75rem; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 4px 12px; border-radius: 99px; font-size: .85rem; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .chip.on { color: #0f141b; }

/* tools */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.form label { font-size: .8rem; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.form input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
.out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.out div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.out b { display: block; font-size: 1.15rem; }
.good { color: var(--ok); } .badc { color: var(--bad); }
.form textarea, .form select, .inl { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
.inl { width: auto; padding: 4px 6px; }
.chips label.chip { cursor: pointer; }

/* experience-log month map */
.mgrid { margin: 12px 0 6px; display: grid; gap: 4px; }
.mrow { display: grid; grid-template-columns: 38px repeat(12, 1fr); gap: 3px; align-items: center; }
.mrow .yr { font-size: .72rem; color: var(--muted); font-weight: 700; }
.mrow i, .lg { display: inline-block; height: 16px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.mrow i.on, .lg.on { background: var(--ok); border-color: var(--ok); }
.mrow i.ovl, .lg.ovl { background: var(--brand-2); border-color: var(--brand-2); }
.mrow i.out, .lg.out { opacity: .25; }
.lg { width: 14px; height: 12px; vertical-align: -1px; margin: 0 3px 0 8px; }

@media (max-width: 420px) { .nav a { font-size: .6rem; } .nav a span { font-size: 1.05rem; } }
