:root {
  --ink: #2b2b2b;
  --muted: #5a6269;
  --line: #dde1e4;
  --paper: #f6f7f7;
  --white: #fff;
  --navy: #0d1b2a;
  --navy2: #1b2a3c;
  --gold: #d4a843;
  --gold-soft: #f7eedb;
  --hero: #172536;
  --accent-ink: #8a6a24;
  --blue: #e8eef3;
  --sage: #e4ebe4;
  --success: #2f7d5a;
  --warning: #b7791f;
  --red: #b42318;
  --radius: 16px;
  --shadow: 0 16px 50px #0d1b2a1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 194px; flex: none;
  background: var(--navy); color: #fff; display: flex; flex-direction: column; z-index: 30;
}
.logo { margin: 18px 13px 16px; background: #fff; border: 0; border-radius: 12px; padding: 10px 14px; display: grid; place-items: center; }
.logo img { width: 100%; max-width: 130px; display: block; }
.nav { flex: 1; overflow-y: auto; padding: 0 10px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: #e9edf2;
  padding: 10px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; text-align: left;
}
.nav-item .ico { width: 18px; text-align: center; opacity: .85; font-size: 12px; }
.nav-item:hover { background: #ffffff14; }
.nav-item.active { background: var(--gold); color: var(--navy); }
.nav-item .pill { margin-left: auto; font-size: 10px; background: #ffffff1f; padding: 2px 6px; border-radius: 99px; font-weight: 600; }
.blueprint-link { margin: 4px 10px 0; width: auto; border-top: 1px solid #ffffff1a; border-radius: 0; padding-top: 14px; }
.blueprint-link.active { border-radius: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 14px 18px 18px; font-size: 12px; }
.user-chip strong { display: block; font-size: 12.5px; }
.user-chip small { color: #c8ced6; }
.user-chip .dots { margin-left: auto; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 30px; gap: 12px; position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 14.5px; font-weight: 700; }
.page-title span { font-size: 11px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bell { position: relative; border: 0; background: none; font-size: 14px; color: var(--muted); }
.bell .badge { position: absolute; top: -9px; right: -7px; background: var(--red); color: #fff; font-size: 9px; border-radius: 99px; padding: 1px 4px; font-weight: 700; }
.view-as { font-size: 9.5px; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: 8px; font-weight: 700; }
.view-as[hidden] { display: none; }
.view-as select { font-size: 11.5px; font-weight: 700; color: var(--ink); padding: 6px 8px; min-width: 132px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.menu-btn { display: none; border: 0; background: none; font-size: 20px; }
main { padding: 34px 25px 40px; flex: 1; max-width: 1180px; width: 100%; outline: none; }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 25px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.footer a { text-decoration: none; }

/* ---------- Typography & primitives ---------- */
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; }
.h1 { font-size: 31px; font-weight: 400; letter-spacing: -.02em; margin-bottom: 10px; }
.h2 { font-size: 21px; font-weight: 400; letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px; }
.card + .card { margin-top: 0; }
.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 16px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 14px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: #b9c0c6; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 6px 18px #0d1b2a33; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.danger { color: var(--red); }
.btn.link { border: 0; background: none; padding: 0; text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.big-btn { padding: 12px 14px; font-size: 14px; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--blue); color: var(--navy); letter-spacing: .02em; }
.tag.gold { background: var(--gold-soft); color: var(--accent-ink); }
.tag.green { background: #e3f1ea; color: var(--success); }
.tag.red { background: #fbe7e5; color: var(--red); }
.tag.amber { background: #fbf0dc; color: var(--warning); }
.tag.grey { background: #eef0f2; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 13px; font-size: 11.5px; font-weight: 600; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .count { margin-left: 6px; opacity: .65; }
.bar { height: 6px; border-radius: 99px; background: #e7e9eb; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.banner { display: flex; gap: 12px; align-items: flex-start; background: var(--gold-soft); border: 1px solid #ecd9ad; border-radius: 12px; padding: 14px 16px; font-size: 13px; margin-bottom: 20px; }
.banner.blue { background: var(--blue); border-color: #d3dde6; }
.banner strong { display: block; margin-bottom: 2px; }
.icon-box { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; flex: none; font-size: 14px; }
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; }
.field input, .field select, .field textarea { font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; }
.field textarea { min-height: 84px; resize: vertical; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.person strong { display: block; }
.person small { color: var(--muted); font-size: 11px; }
.mini-bar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.mini-bar .bar { flex: 1; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 30px 30px 26px; color: #fff;
  background: radial-gradient(circle at 80% 20%, #2a3b52, transparent 50%), linear-gradient(135deg, var(--hero), var(--navy));
  margin-bottom: 14px; min-height: 255px;
}
.hero .due { background: var(--gold-soft); color: var(--navy); font-size: 10.5px; font-weight: 700; padding: 5px 10px; border-radius: 99px; display: inline-block; margin-bottom: 18px; }
.hero h2 { font-size: 22px; font-weight: 400; max-width: 340px; line-height: 1.45; margin-bottom: 14px; }
.hero p { max-width: 330px; font-size: 13.5px; color: #e3e7ec; }
.hero .progress { max-width: 330px; margin-top: 30px; }
.hero .bar { background: #ffffff38; }
.hero .meta { display: flex; gap: 22px; font-size: 10.5px; font-weight: 700; margin-top: 10px; }
.shield {
  position: absolute; right: 30px; top: 34px; width: 150px; height: 175px; border: 1px solid #d4a84399;
  border-radius: 46% 46% 50% 50% / 38% 38% 62% 62%; transform: rotate(-10deg);
  background: radial-gradient(circle at 40% 18%, #6d6a4f99, transparent 55%), #ffffff0d;
  display: grid; place-content: center; text-align: center;
}
.shield b { font-size: 46px; letter-spacing: -.03em; }
.shield small { font-size: 10px; letter-spacing: .18em; font-weight: 700; transform: rotate(6deg); }
.stat { display: flex; gap: 12px; padding: 16px 18px; }
.stat .s-ico { font-size: 11px; padding-top: 4px; }
.stat b { font-size: 19px; display: block; }
.stat small { font-size: 10.5px; color: var(--muted); }
.path { list-style: none; padding: 0; margin: 0; }
.path li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.path li:last-child { border-bottom: 0; }
.step { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #eef0f2; color: var(--muted); flex: none; }
.step.done { background: var(--success); color: #fff; }
.step.now { background: var(--gold); color: var(--navy); }
.path .state { margin-left: auto; font-size: 11px; color: var(--muted); }
.announce { padding: 12px 0; border-bottom: 1px solid var(--line); }
.announce:last-of-type { border-bottom: 0; }
.announce h4 { font-size: 13.5px; margin: 6px 0 4px; }
.announce p { font-size: 12.5px; color: var(--muted); }
.announce small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ---------- Onboarding ---------- */
.ring { --p: 38; width: 92px; height: 92px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), #e7e9eb 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 72px; height: 72px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; }
.ring b { font-size: 19px; }
.ring small { font-size: 10px; color: var(--muted); }
.module-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.module-row h3 { font-size: 15px; font-weight: 700; }
.module-row p { font-size: 12.5px; color: var(--muted); }
.module-row .btn { margin-left: auto; }

/* ---------- Learning ---------- */
.course-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: box-shadow .15s; }
.course-card:hover { box-shadow: var(--shadow); }
.course-top { display: flex; justify-content: space-between; align-items: center; }
.hills { height: 92px; border-radius: 10px; background: #e9efe9; position: relative; overflow: hidden; }
.hills::before, .hills::after { content: ""; position: absolute; border-radius: 50%; }
.hills::before { width: 120%; height: 120%; left: -40%; top: 45%; background: #a9c0a9; }
.hills::after { width: 110%; height: 110%; left: 25%; top: 55%; background: #46684e; }
.hills i { position: absolute; width: 90%; height: 90%; left: -10%; top: 72%; background: #6e8d73; border-radius: 50%; z-index: 1; }
.course-card h3 { font-size: 15px; font-weight: 400; }

/* ---------- Video series ---------- */
.v-hero { background: linear-gradient(135deg, var(--hero), var(--navy)); color: #fff; border-radius: 22px; padding: 28px; margin-bottom: 16px; }
.v-hero .eyebrow { color: var(--gold); }
.v-hero .h1 { font-size: 28px; }
.v-hero p { color: #d7dde4; max-width: 620px; font-size: 14px; }
.v-hero .actions { display: flex; gap: 10px; margin: 20px 0 22px; flex-wrap: wrap; }
.v-hero .btn:not(.gold) { background: transparent; color: #fff; border-color: #ffffff4d; }
.v-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.v-stats div { background: #ffffff10; border-radius: 12px; padding: 12px 14px; }
.v-stats b { font-size: 20px; display: block; }
.v-stats small { color: #c8ced6; font-size: 11px; }
.phase { display: flex; flex-direction: column; gap: 4px; }
.phase small { font-size: 10px; letter-spacing: .1em; font-weight: 700; color: var(--accent-ink); }
.video-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.video-card .thumb { height: 110px; border-radius: 10px; background: linear-gradient(135deg, #24364c, var(--navy)); color: #fff; position: relative; display: grid; place-items: center; font-size: 22px; }
.video-card .thumb span { position: absolute; font-size: 10.5px; font-weight: 700; background: #00000059; padding: 3px 7px; border-radius: 6px; }
.video-card .thumb .id { left: 10px; top: 10px; }
.video-card .thumb .dur { right: 10px; bottom: 10px; }
.video-card .thumb.ready { background: linear-gradient(135deg, var(--accent-ink), var(--navy)); color: var(--gold); }
.video-card h3 { font-size: 14.5px; }
.video-card p { font-size: 12.5px; color: var(--muted); flex: 1; }
.video-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.video-card .basis { font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.controls-list { columns: 2; padding-left: 18px; font-size: 13px; margin: 10px 0 0; }
.controls-list li { margin-bottom: 6px; }

/* ---------- Time off / calendar ---------- */
.balance { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.balance b { font-size: 16px; }
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head .month { font-size: 17px; min-width: 130px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal .dow { font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 8px; background: var(--paper); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 84px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11.5px; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { color: #aab0b6; background: #fafbfb; }
.cal .ev { display: block; margin-top: 4px; font-size: 10.5px; padding: 3px 5px; border-radius: 5px; background: var(--blue); line-height: 1.25; }
.cal .ev.ooo { background: var(--gold-soft); }
.cal .ev.leave { background: #e3f1ea; }

/* ---------- Assistant ---------- */
.chat { display: flex; flex-direction: column; min-height: 460px; padding: 0; overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.chat-head img { width: 64px; border-radius: 6px; }
.chat-log { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 460px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; }
.msg.bot { background: var(--paper); border: 1px solid var(--line); }
.msg.bot b { display: block; font-size: 11px; color: var(--accent-ink); margin-bottom: 4px; }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; }
.msg .cite { display: inline-block; margin-top: 8px; font-size: 11px; background: var(--gold-soft); border-radius: 6px; padding: 2px 7px; }
.chat-form { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.ai-msg { max-width: 94%; }
.ai-part { padding: 8px 0; border-top: 1px solid var(--line); }
.ai-part:first-of-type { border-top: 0; padding-top: 0; }
.ai-part strong { display: block; font-size: 12px; color: var(--navy); }
.ai-part p { margin: 3px 0 2px; white-space: pre-line; }
.ai-text p { white-space: normal; }
.ai-text ul { margin: 4px 0; padding-left: 18px; }
.ai-text strong { display: inline; font-size: inherit; color: inherit; }
.ai-hint { padding: 0 18px 10px; margin: 0; font-size: 11.5px; color: var(--muted); }
.ai-failed { border-color: var(--red); }
.ai-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); flex-direction: unset; }
.ai-main { display: flex; flex-direction: column; min-width: 0; }
.ai-side { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-right: 1px solid var(--line); min-width: 0; }
.ai-side input { border: 1px solid var(--line); border-radius: 8px; padding: 8px; width: 100%; box-sizing: border-box; }
.ai-list { display: flex; flex-direction: column; gap: 2px; flex: 1; max-height: 520px; overflow-y: auto; }
.ai-item { border-radius: 8px; padding: 2px 4px; }
.ai-item.active { background: var(--gold-soft); }
.ai-open { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 6px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: inherit; }
.ai-open small { display: block; color: var(--muted); font-size: 11px; }
@media (max-width: 760px) { .ai-layout { grid-template-columns: 1fr; } .ai-side { border-right: 0; border-bottom: 1px solid var(--line); } .ai-list { max-height: 180px; } }
.ai-conn { border-top: 1px solid var(--line); padding-top: 12px; }
.ai-conn[hidden] { display: none; }
.chat-form textarea { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical; min-height: 44px; font: inherit; }
.samples { padding: 0 18px 16px; }
.samples small { display: block; font-size: 10px; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin-bottom: 8px; }

/* ---------- Docs / policies / resources ---------- */
.doc-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.doc-card h3 { font-size: 14.5px; }
.doc-card p { font-size: 12.5px; color: var(--muted); }
.doc-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: auto; }
.doc-meta span:not(:last-child)::after { content: " ·"; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; }
.toolbar input { flex: 1; min-width: 200px; }
.res-card { display: flex; gap: 12px; padding: 16px; text-align: left; }
.res-card h3 { font-size: 14.5px; margin-bottom: 4px; }
.res-card p { font-size: 12.5px; color: var(--muted); }
.res-card small { display: block; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--accent-ink); }

/* ---------- Blueprint ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--navy); border-color: var(--gold); }
.flow { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
.flow .card { padding: 14px; }
.flow b { color: var(--gold); font-size: 12px; }
.flow h4 { font-size: 14px; margin: 4px 0; }
.flow p { font-size: 12px; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.checks li { font-size: 13px; padding: 10px 12px; background: var(--paper); border-radius: 8px; }
.seq { display: flex; gap: 8px; flex-wrap: wrap; }
.seq span { font-size: 12.5px; background: var(--paper); border-radius: 99px; padding: 6px 12px; }
.seq b { color: var(--accent-ink); margin-right: 4px; }

/* ---------- HR ---------- */
.kpi b { font-size: 26px; display: block; }
.kpi small { color: var(--muted); font-size: 11.5px; }
.kpi .tag { margin-bottom: 8px; }
.queue-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.queue-item:last-child { border-bottom: 0; }
.track-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 10px; align-items: center; font-size: 13px; padding: 8px 0; }
.audit-row { display: grid; grid-template-columns: 80px 170px 140px 1fr 20px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.audit-row code { font-size: 11px; background: var(--blue); padding: 3px 6px; border-radius: 5px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.editor-tools { display: flex; gap: 6px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 12px; background: var(--paper); }
.editor { border: 1px solid var(--line); border-radius: 0 0 8px 8px; padding: 12px; min-height: 120px; font-size: 13.5px; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: #0d1b2a80; display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 18px; padding: 26px; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 24px; color: var(--muted); }
.doc-page { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 22px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.doc-page .line { height: 8px; background: #e2e5e8; border-radius: 4px; margin: 9px 0; }
.modal-card.wide { max-width: 960px; }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-right: 24px; margin-bottom: 14px; }
.cfg-section input[type="file"] { max-width: 100%; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 8px; }
.theme-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 13px; cursor: pointer; }
.theme-card:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.theme-sample { display: flex; height: 46px; border-radius: 6px; overflow: hidden; align-items: center; gap: 8px; }
.theme-sample i { width: 28%; height: 100%; }
.theme-sample b { padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.doc-viewer { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: #3a4048; }
.dv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.dv-title { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.dv-tools, .dv-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dv-tools { gap: 8px 14px; }
.dv-tools .btn { padding: 7px 11px; min-width: 38px; min-height: 38px; }
.dv-page, .dv-zoom { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dv-page input { width: 52px; padding: 6px; text-align: center; border: 1px solid var(--line); border-radius: 6px; }
.dv-zoom { min-width: 42px; text-align: center; }
.dv-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; position: relative; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch; }
.dv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; width: max-content; min-width: 100%; box-sizing: border-box; }
.dv-sheet { background: #fff; flex: none; box-shadow: 0 1px 6px #0006; }
.dv-sheet canvas { display: block; width: 100%; height: 100%; }
.dv-status { color: #fff; text-align: center; padding: 48px 16px; margin: 0; }
body.dv-open { overflow: hidden; }
@media print { body.dv-open > * { display: none !important; } }
.pdf-frame { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.welcome-video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; display: block; }
.welcome-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; margin-bottom: 14px; padding: 16px 20px; }
.welcome-card:hover { box-shadow: var(--shadow); }
.welcome-card .play { width: 56px; height: 56px; border-radius: 50%; background: var(--navy) center 15% / cover; color: #fff; display: grid; place-items: center; flex: none; position: relative; }
.welcome-card .play i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 9px; display: grid; place-items: center; position: absolute; right: 2px; bottom: 2px; }
.ceo-card { display: flex; gap: 24px; align-items: center; }
.home-intro { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.home-intro img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.home-block { margin-bottom: 16px; }
.ceo-card img { width: 180px; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 14px; flex: none; }
.ceo-card blockquote { margin: 0 0 12px; font-size: 16px; line-height: 1.6; }
@media (max-width: 760px) { .home-intro { flex-direction: column; align-items: flex-start; } .ceo-card { flex-direction: column; align-items: flex-start; } .ceo-card img { width: 140px; } }
.msg .cite { border: 0; cursor: pointer; color: var(--navy); text-align: left; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; z-index: 110; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }
.scrim { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; width: 240px; }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: #0d1b2a66; z-index: 25; }
  .menu-btn { display: block; }
  .topbar { padding: 0 16px; }
  .view-as { font-size: 0; }
  .view-as select { min-width: 0; }
  main { padding: 24px 16px 32px; }
  .footer { padding: 18px 16px; }
  .g2, .g3, .flow, .checks { grid-template-columns: 1fr; }
  .shield { display: none; }
  .v-stats { grid-template-columns: repeat(2, 1fr); }
  .controls-list { columns: 1; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
  .cal .day { min-height: 64px; font-size: 10px; }
  .cal .ev { font-size: 9px; }
  .h1 { font-size: 26px; }
}

/* ---------- Production additions ---------- */
body.booting .shell { visibility: hidden; }
body.signed-out .sidebar, body.signed-out .topbar, body.signed-out .footer, body.signed-out .scrim { display: none; }
body.signed-out main { max-width: none; padding: 0; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate .card { max-width: 440px; width: 100%; text-align: center; padding: 32px 28px; }
.gate img { width: 120px; margin: 0 auto 18px; display: block; }
.gate .btn { display: flex; width: 100%; justify-content: center; margin-top: 18px; text-decoration: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.inline-select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.copy-box { display: flex; gap: 8px; margin-top: 10px; }
.copy-box input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; }
.notif { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; }
.notif.unread h4::before { content: '● '; color: var(--gold); }
.notif h4 { font-size: 14px; margin-bottom: 2px; }
.health { display: flex; align-items: center; gap: 8px; }
.health i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; }
.health i.ok { background: #2e8b57; }
.dots { text-decoration: none; color: inherit; }
.check-list { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.check-list label { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; }
.profile-btn { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.profile-btn strong, .profile-btn small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar { background: var(--gold-soft); border-bottom: 1px solid var(--gold); padding: 10px 25px; font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.preview-bar[hidden] { display: none; }
.nav-group > .nav-item::after { content: '▾'; margin-left: auto; font-size: 10px; }
.nav-group.open > .nav-item::after { content: '▴'; }
.nav-sub { display: none; padding-left: 18px; }
.nav-group.open .nav-sub { display: block; }
.yt-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; margin: 14px 0; }
.thumb.yt { background-size: cover; background-position: center; }
.md h2 { font-size: 20px; margin: 18px 0 8px; } .md h3 { font-size: 16px; margin: 14px 0 6px; } .md p { margin: 0 0 10px; line-height: 1.6; } .md ul { margin: 0 0 10px 20px; }
.section-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cfg-section[hidden] { display: none; }
.lesson-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lesson-row:last-child { border-bottom: 0; }
.quiz-q { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.quiz-q label { display: flex; gap: 8px; padding: 4px 0; font-size: 14px; }
.progress-line { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-line i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .2s; }
.folder-head { margin: 18px 0 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
textarea.code { font-family: Consolas, monospace; font-size: 12px; }

/* ---------- Platform Studio ---------- */
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; display: contents; }
fieldset.plain[disabled] { display: block; opacity: .7; }
.dnd-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.dnd-item { display: grid; grid-template-columns: 22px minmax(140px, 1fr) minmax(140px, 1.2fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.dnd-item.dragging { opacity: .45; border-style: dashed; }
.dnd-handle { cursor: grab; color: #8a94a3; font-weight: 700; letter-spacing: -2px; user-select: none; }
.dnd-name { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; }
.dnd-name small { font-weight: 400; color: #6b7685; font-size: 11px; }
.dnd-check { white-space: nowrap; }
.dnd-move { display: flex; gap: 2px; }
.dnd-move .btn { padding: 2px 6px; }
@media (max-width: 720px) {
  .dnd-item { grid-template-columns: 22px 1fr auto; }
  .dnd-item .inline-select { grid-column: 2 / -1; }
}
.cfg-bar { margin-top: 12px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.cfg-bar[hidden] { display: none; }
.dnd-item.dnd-short { grid-template-columns: 22px 1fr auto; }
.dnd-list[hidden] { display: none; }
/* Narrow screens: keep the top bar inside the screen when both Preview as and Organization are shown. */
@media (max-width: 700px) {
  .topbar { gap: 8px; }
  .page-title { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-right { gap: 6px; min-width: 0; }
  .view-as select { max-width: 110px; }
  #feedbackBtn { padding: 6px 4px; }
}
@media (max-width: 480px) {
  #feedbackBtn { font-size: 0; }
  #feedbackBtn::before { content: '✎'; font-size: 15px; }
  .view-as select { max-width: 92px; }
  .top-right { gap: 4px; }
}
