/* DESSAR Knowledge Hub */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #16202e;
  --muted: #5d6b7e;
  --line: #e2e7ef;
  --brand: #0b4f9c;
  --brand-2: #0a3f7d;
  --brand-soft: #e7f0fb;
  --accent: #f28c28;
  --ok: #1d7a46;
  --ok-soft: #e4f5eb;
  --warn: #9a5b00;
  --warn-soft: #fff3dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --side: #0c2340;
  --side-text: #c9d6e8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 56, .06), 0 2px 8px rgba(16, 32, 56, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141c; --panel: #151d28; --panel-2: #1a2330; --text: #e6ebf2; --muted: #93a1b5; --line: #263243;
    --brand: #5b9ee8; --brand-2: #7cb2ee; --brand-soft: #16304f; --ok: #56c28a; --ok-soft: #133526;
    --warn: #f0b55a; --warn-soft: #3a2a10; --bad: #f07a6e; --bad-soft: #3d1a17; --side: #0a1017; --side-text: #a9b8cc;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2rem 0 .4rem; }
h2 { font-size: 1.05rem; margin: 0 0 .7rem; }
h3 { font-size: .98rem; margin: 1rem 0 .4rem; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.c { text-align: center; }
.ok-text { color: var(--ok); font-weight: 600; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: .7rem; align-items: center; padding: 1rem 1rem .9rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-text strong { display: block; font-size: .98rem; line-height: 1.2; }
.brand-text small { color: var(--side-text); font-size: .75rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, #1a6fd0, #0b4f9c); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.brand-mark.lg { width: 64px; height: 64px; font-size: 2rem; border-radius: 14px; }
.logo-plate { background: #fff; border-radius: 8px; padding: 4px 6px; display: inline-flex; align-items: center; flex: none; }
.logo-plate img { height: 30px; width: auto; display: block; }
.logo-plate.lg img { height: 56px; }
.sidebar nav { padding: .2rem .6rem 1rem; display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a { color: var(--side-text); padding: .48rem .7rem; border-radius: 7px; display: flex; gap: .6rem; align-items: center; font-size: .93rem; }
.sidebar nav a i { font-style: normal; width: 1.3rem; text-align: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.sidebar nav a.on { background: rgba(91,158,232,.22); color: #fff; font-weight: 600; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: .9rem .7rem .3rem; }
.sidebar-foot { margin-top: auto; padding: .9rem 1rem; font-size: .7rem; opacity: .65; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; gap: .8rem; align-items: center; padding: .55rem 1.2rem; }
.search { flex: 1; max-width: 640px; }
.search input { width: 100%; }
.content { padding: 1.4rem 1.6rem 3rem; max-width: 1320px; width: 100%; }
.menu-btn { display: none; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .6rem; font-size: 1.1rem; color: var(--text); cursor: pointer; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; gap: .5rem; align-items: center; cursor: pointer; padding: .2rem .4rem; border-radius: 8px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15); min-width: 250px; padding: .4rem; display: flex; flex-direction: column; }
.usermenu .menu a, .usermenu .menu button { padding: .5rem .7rem; border-radius: 6px; color: var(--text); text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--panel-2); text-decoration: none; }
.menu-head { padding: .5rem .7rem; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: .3rem; }

/* forms & buttons */
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .65rem; min-width: 0; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.form label, .login-card label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; margin-bottom: .8rem; }
.form label input, .form label select, .form label textarea { font-weight: 400; }
.form .row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.form .row > label { flex: 1 1 160px; }
.form .row > label.grow { flex: 3 1 220px; }
label.check { flex-direction: row !important; align-items: center; gap: .45rem !important; font-weight: 500 !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .95rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn.block { width: 100%; margin-bottom: .5rem; }
.btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.linkish { background: none; border: 0; color: var(--brand); padding: 0; font: inherit; cursor: pointer; }
.linkish.danger { color: var(--bad); }
form.inline { display: inline; }
.inline-form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.inline-form input[type=password] { width: 170px; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 0 0 1rem; }
.toolbar input[type=search] { flex: 1 1 240px; }
.md-help { font-size: .8rem; color: var(--muted); margin: -.3rem 0 .8rem; }
.md-help code { background: var(--panel-2); padding: 0 .25rem; border-radius: 4px; }
.narrow { max-width: 560px; }

/* layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.2rem; align-items: start; }
.grid-3 > .col-2 { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.card-head a { font-size: .85rem; }
.sticky { position: sticky; top: 74px; }
.scroll-x { overflow-x: auto; }
.crumbs { font-size: .85rem; margin-bottom: .6rem; color: var(--muted); }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; background: var(--brand-soft); border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.callout { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; background: var(--brand-soft); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.callout.warn { background: var(--warn-soft); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty.big { padding: 5rem 1rem; }
.empty-icon { font-size: 3rem; }

/* badges, chips, bars */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.new { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.k-lesson_learned { background: #fdf0e3; color: #a4520b; border-color: transparent; }
.badge.k-policy { background: #efe9fb; color: #5b3aa6; border-color: transparent; }
.badge.k-howto { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.lvl-foundation { background: var(--ok-soft); color: var(--ok); }
.badge.lvl-intermediate { background: var(--brand-soft); color: var(--brand); }
.badge.lvl-advanced { background: #efe9fb; color: #5b3aa6; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .8rem; }
.chip { display: inline-block; padding: .15rem .6rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: .8rem; color: var(--text); }
.chip.sm { font-size: .72rem; padding: 0 .45rem; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip small { color: var(--muted); }
.bar { height: 7px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin: .4rem 0 .25rem; }
.bar.lg { height: 11px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #3aa0ff); border-radius: 99px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 1rem; background: var(--panel); }
.seg.wrap { flex-wrap: wrap; }
.seg a { padding: .4rem .85rem; color: var(--text); font-size: .88rem; border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--brand); color: #fff; }
.seg a:hover { text-decoration: none; }

/* avatars */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar.xl { width: 104px; height: 104px; font-size: 2rem; }

/* home */
.hero { display: flex; justify-content: space-between; gap: 1.2rem; align-items: stretch; background: linear-gradient(120deg, #0b4f9c, #1a6fd0 70%, #2e8ae6);
  color: #fff; border-radius: 14px; padding: 1.5rem 1.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.hero h1 { color: #fff; }
.hero p { margin: 0 0 1rem; opacity: .9; }
.hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.hero .btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.hero .btn.primary { background: #fff; color: var(--brand); border-color: #fff; }
.level-card { background: rgba(255,255,255,.12); border-radius: 12px; padding: 1rem 1.2rem; min-width: 230px; }
.level-card .bar { background: rgba(255,255,255,.2); border: 0; }
.level-card .bar span { background: #ffd27a; }
.level-card .muted { color: rgba(255,255,255,.8); }
.level-card.flat { background: var(--brand-soft); color: var(--text); margin: .8rem 0; min-width: 0; }
.level-name { font-size: 1.25rem; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.stat span, .stat a { display: block; font-size: 1.45rem; font-weight: 700; }
.stat a { font-size: 1rem; padding-top: .35rem; }
.stat small { color: var(--muted); }
.list { display: flex; flex-direction: column; }
.card.list { padding: .3rem .4rem; }
.list-item { display: flex; gap: .8rem; align-items: center; padding: .65rem .7rem; border-radius: 8px; color: var(--text); border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--panel-2); text-decoration: none; }
.li-icon { font-size: 1.3rem; width: 1.8rem; text-align: center; flex: none; }
.li-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li-body small { color: var(--muted); }
.li-body .summary { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tick { color: var(--ok); font-weight: 700; }
.mini-link { display: flex; flex-direction: column; padding: .45rem 0; border-bottom: 1px solid var(--line); color: var(--text); }
.mini-link:last-child { border-bottom: 0; }
.mini-link small { color: var(--muted); font-size: .78rem; }
a.mini-link:hover { color: var(--brand); text-decoration: none; }
.announce { border-left: 3px solid var(--line); padding: .2rem 0 .2rem .9rem; margin-bottom: .9rem; }
.announce.pinned { border-left-color: var(--accent); }
.card.announce { border-left: 4px solid var(--line); padding-left: 1.2rem; }
.card.announce.pinned { border-left-color: var(--accent); }
.announce.expired { opacity: .55; }
.announce h3 { margin: 0 0 .2rem; }
.meta { color: var(--muted); font-size: .82rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.tile { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem .4rem; border: 1px solid var(--line); border-radius: 9px; text-align: center; font-size: .82rem; color: var(--text); }
.tile span { font-size: 1.4rem; }
.tile:hover { border-color: var(--brand); text-decoration: none; }
.term-card h3 { margin-top: 0; color: var(--brand); }
.path-row { display: block; padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--text); }
.path-row:last-child { border-bottom: 0; }
.path-row small { color: var(--muted); }
.path-row:hover { text-decoration: none; }
.person-row { display: flex; gap: .6rem; align-items: center; padding: .45rem .3rem; border-radius: 8px; color: var(--text); }
.person-row:hover { background: var(--panel-2); text-decoration: none; }
.person-row.me { background: var(--brand-soft); }
.person-row .rank { width: 1.8rem; text-align: center; font-weight: 700; color: var(--muted); }
.person-row .pts { font-weight: 700; color: var(--brand); }

/* knowledge base */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin-bottom: 1.2rem; }
.cat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; color: var(--text); box-shadow: var(--shadow); }
.cat-card:hover { border-color: var(--brand); text-decoration: none; }
.cat-icon { font-size: 1.6rem; }
.cat-card small { color: var(--muted); }
.doc { padding: 1.4rem 1.8rem; }
.doc-head { border-bottom: 1px solid var(--line); padding-bottom: .8rem; margin-bottom: .8rem; }
.doc-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.prose { overflow-wrap: anywhere; }
.prose h2 { font-size: 1.25rem; margin: 1.6rem 0 .6rem; padding-top: .2rem; }
.prose h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.prose p, .prose ul, .prose ol { margin: .5rem 0 .8rem; }
.prose li { margin: .2rem 0; }
.prose li.task { list-style: none; margin-left: -1.2rem; }
.prose li.task .box { color: var(--brand); }
.prose table { border-collapse: collapse; width: 100%; margin: .8rem 0; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--panel-2); }
.prose code { background: var(--panel-2); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }
.prose pre { background: var(--panel-2); padding: .8rem; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: .8rem 0; padding: .3rem 1rem; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.prose img { max-width: 100%; }
.prose.sm { font-size: .92rem; }
.prose.sm p { margin: .2rem 0; }
.toc a { display: block; padding: .2rem 0; font-size: .88rem; color: var(--muted); }
.toc a.l3 { padding-left: .9rem; font-size: .83rem; }
.toc a:hover { color: var(--brand); }
.toc-card h2 { margin-top: 1rem; }
.toc-card h2:first-child { margin-top: 0; }
.feedback { border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: .6rem; }
.fb-form { display: flex; gap: .5rem; margin-bottom: .6rem; }
.comment { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: .2rem; margin-bottom: -.1rem; }
.tab { background: none; border: 1px solid transparent; border-bottom: 0; padding: .35rem .8rem; border-radius: 8px 8px 0 0; font: inherit; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--panel-2); border-color: var(--line); color: var(--text); font-weight: 600; }
.preview { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; min-height: 300px; margin-bottom: .8rem; }
.diff { background: var(--panel-2); padding: .8rem; border-radius: 8px; overflow-x: auto; font-size: .82rem; line-height: 1.45; white-space: pre-wrap; }
.diff span { display: block; }
.diff .add { background: var(--ok-soft); color: var(--ok); }
.diff .del { background: var(--bad-soft); color: var(--bad); }
.diff .hunk { color: var(--brand); }
details.card > summary { cursor: pointer; font-weight: 600; }
mark { background: #ffe58a; color: inherit; padding: 0 .1rem; border-radius: 3px; }
.tight { padding-left: 1.1rem; margin: 0; }
.tight li { margin: .25rem 0; }

/* learning */
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.path-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.path-card:hover { border-color: var(--brand); text-decoration: none; }
.path-card h2 { font-size: 1.15rem; margin: .5rem 0 .3rem; }
.path-card p { color: var(--muted); font-size: .9rem; flex: 1; margin: 0 0 .6rem; }
.path-card small { color: var(--muted); }
.path-top { display: flex; gap: .3rem; flex-wrap: wrap; }
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li a { display: flex; gap: .7rem; align-items: center; padding: .55rem .4rem; border-radius: 8px; color: var(--text); }
.lesson-list li a:hover { background: var(--panel-2); text-decoration: none; }
.lesson-list li a span:nth-child(2) { flex: 1; }
.lesson-list small { color: var(--muted); }
.lesson-list .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; color: var(--muted); }
.lesson-list li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.lesson-list li.current a { background: var(--brand-soft); font-weight: 600; }
.lesson-list.compact li a { padding: .35rem .3rem; font-size: .88rem; }
.lesson-list.compact .dot { width: 22px; height: 22px; font-size: .7rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.quiz fieldset { border: 1px solid var(--line); }
.quiz legend { font-weight: 600; padding: 0 .3rem; float: left; width: 100%; margin-bottom: .6rem; }
.qnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; margin-right: .3rem; }
.option { display: flex; gap: .6rem; align-items: center; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .4rem; cursor: pointer; clear: both; }
.option:hover { background: var(--panel-2); }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.result { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.result .score { font-size: 2.6rem; font-weight: 800; width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; background: var(--bad-soft); color: var(--bad); }
.result.pass .score { background: var(--ok-soft); color: var(--ok); }
.review-q.ok { border-left: 4px solid var(--ok); }
.review-q.bad { border-left: 4px solid var(--bad); }
ul.plain { list-style: none; padding: 0; }
ul.plain li { padding: .2rem 0; }
ul.plain li.right { color: var(--ok); font-weight: 600; }
ul.plain li.chosen:not(.right) { color: var(--bad); text-decoration: line-through; }
.edit-item { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; margin-bottom: .5rem; }
.edit-item summary { cursor: pointer; font-weight: 600; }
.edit-item[open] summary { margin-bottom: .7rem; }
.edit-item.new summary { color: var(--brand); }
.opt-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.opt-row input[name=option] { flex: 1; }
.certificate { background: #fff; color: #16202e; border: 10px solid #0b4f9c; outline: 2px solid #f28c28; outline-offset: -18px; padding: 3rem 2rem; text-align: center; max-width: 900px; margin: 0 auto; }
.cert-kicker { font-size: 1.9rem; letter-spacing: .08em; text-transform: uppercase; color: #0b4f9c; font-weight: 700; margin: 1rem 0; }
.cert-name { font-size: 2.2rem; font-family: Georgia, "Times New Roman", serif; border-bottom: 1px solid #ccd; display: inline-block; padding: 0 2rem .3rem; margin: .4rem 0 1rem; }
.cert-title { font-size: 1.5rem; font-weight: 700; margin: .4rem 0 1rem; }
.cert-foot { display: flex; justify-content: space-around; margin: 3rem 0 1.5rem; gap: 1rem; flex-wrap: wrap; }
.cert-foot .line { display: block; width: 220px; border-top: 1px solid #16202e; margin: 0 auto .4rem; }

/* Q&A */
.q-row .q-stats { display: flex; gap: .4rem; flex: none; }
.q-stats > span { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: .25rem; border-radius: 7px; font-size: .75rem; color: var(--muted); }
.q-stats b { font-size: 1rem; color: var(--text); }
.q-stats .solved { background: var(--ok); color: #fff; }
.q-stats .solved b { color: #fff; }
.q-stats .zero { border: 1px solid var(--warn); }
.answer { display: flex; gap: 1rem; }
.answer.accepted { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.vote { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.vbtn { background: none; border: 1px solid var(--line); border-radius: 6px; width: 32px; height: 28px; cursor: pointer; color: var(--muted); }
.vbtn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.answer-body { flex: 1; min-width: 0; }
.answer-foot { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .5rem; }
.who { display: flex; gap: .45rem; align-items: center; color: var(--text); }
.who small { color: var(--muted); }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }

/* glossary */
.letters { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; }
.letters a { padding: .2rem .55rem; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: .85rem; }
.letters a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.glossary { margin: 0; }
.g-item { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.g-item:target { background: var(--warn-soft); }
.g-item dt { font-weight: 700; }
.g-item dd { margin: .15rem 0 0; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); padding: .5rem; }
.table td { border-bottom: 1px solid var(--line); padding: .55rem .5rem; vertical-align: middle; }
.table.compact td { padding: .35rem .5rem; }
.table tr.inactive td { opacity: .55; }
.edit-grid { display: grid; gap: .5rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.edit-grid.head { font-size: .75rem; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.edit-grid input { width: 100%; }
.edit-grid .contents, form.contents { display: contents; }
.cols-cat { grid-template-columns: 64px 1.2fr 2fr 80px 70px 70px 40px; }
.cols-link { grid-template-columns: 64px 1fr 2fr 80px 70px 40px; }
.cols-skill { grid-template-columns: 1fr 2fr 90px 70px 40px; }
.new-row { background: var(--panel-2); padding: .5rem; border-radius: 8px; border: 0; margin-top: .4rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; text-align: left; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* people */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.person-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .2rem; box-shadow: var(--shadow); }
.person-card strong { color: var(--text); }
.person-card small { color: var(--muted); }
.contact { display: flex; gap: .6rem; margin-top: .4rem; font-size: 1.1rem; }
.contact a:hover { text-decoration: none; }
.profile-card { text-align: center; }
.profile-card .kv { margin-top: .8rem; }
.skill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .3rem 1.2rem; }
.skill { display: grid; grid-template-columns: 1fr auto 70px; gap: .5rem; align-items: center; padding: .3rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.skill small { color: var(--muted); }
.pips { display: flex; gap: 3px; }
.pips i { width: 12px; height: 12px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); }
.pips i.on { background: var(--brand); border-color: var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; }
.skills-form td, .skills-form th { text-align: left; }
.skills-form .c { text-align: center; }
.skills-form input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); }
.matrix { font-size: .82rem; }
.table.matrix { width: auto; }
.matrix th.rot { vertical-align: bottom; padding: .3rem 0; width: 34px; text-transform: none; letter-spacing: 0; }
.matrix th.rot a { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 150px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 600; display: inline-block; }
.matrix th.c { padding: .3rem .8rem; }
.matrix td.cell { text-align: center; width: 34px; min-width: 34px; font-weight: 700; border: 1px solid var(--bg); padding: .3rem 0; }
.matrix .l0 { background: var(--panel); color: var(--muted); }
.matrix .l1 { background: #dbe9f9; color: #0b4f9c; }
.matrix .l2 { background: #a9cbf0; color: #08386f; }
.matrix .l3 { background: #4f94e0; color: #fff; }
.matrix .l4 { background: #0b4f9c; color: #fff; }
.matrix .area-row td { background: var(--panel-2); font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; color: var(--muted); }
.matrix td.risk { color: var(--bad); font-weight: 700; }
.sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 210px; }
.logo-preview { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }

/* login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem;
  background: radial-gradient(circle at 20% 10%, #1a6fd0 0, transparent 45%), linear-gradient(160deg, #0c2340, #0b4f9c); }
.login-card { background: var(--panel); border-radius: 16px; padding: 2rem 2rem 1.4rem; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card input { width: 100%; }
.login-brand { text-align: center; margin-bottom: 1.2rem; }
.login-brand h1 { margin: .7rem 0 .1rem; font-size: 1.4rem; }
.login-brand p { margin: 0; color: var(--muted); }
.login-foot { color: rgba(255,255,255,.75); font-size: .78rem; margin-top: 1rem; }

/* responsive */
@media (max-width: 1000px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-block; }
  .content { padding: 1rem 16px 3rem; }
  .topbar { padding: .5rem 16px; }
  .hide-sm { display: none !important; }
  .doc { padding: 1rem; }
  .hero { padding: 1.1rem; }
  .level-card { min-width: 0; width: 100%; }
  .answer { flex-direction: column; }
  .vote { flex-direction: row; }
  .cols-cat, .cols-link, .cols-skill { grid-template-columns: 1fr 1fr; }
  .edit-grid.head { display: none; }
  .q-row { flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar, .no-print, .doc-actions, .feedback, #comments, aside, .flash, .crumbs { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .grid-3 { display: block; }
  .card { border: 0; box-shadow: none; }
}

/* training assignment */
.badge.st-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.st-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.st-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.st-info { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.st-muted { color: var(--muted); }
.bad-text { color: var(--bad); font-weight: 600; }
.todo-card { border-left: 4px solid var(--brand); }
.todo-row { display: flex; gap: .8rem; align-items: center; padding: .55rem .6rem; border-radius: 8px; color: var(--text); border-bottom: 1px solid var(--line); }
.todo-row:last-child { border-bottom: 0; }
.todo-row:hover { background: var(--panel-2); text-decoration: none; }
.todo-row .bar { display: block; max-width: 320px; }
.st-row-bad { box-shadow: inset 3px 0 0 var(--bad); }
.st-row-warn { box-shadow: inset 3px 0 0 var(--warn); }
tr.st-row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.st-row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.st-row-bad, tr.st-row-warn { box-shadow: none; }
.stat.bad span { color: var(--bad); }
.stat.warn span { color: var(--warn); }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-between { flex-direction: row; justify-content: space-between; align-items: center; gap: .5rem; }
input.xs, .xs { width: 5.5rem; }
.due-row { align-items: center !important; margin-bottom: .8rem; }
.due-row > label.check { flex: none !important; margin: 0 !important; }
.due-row input[type=date] { width: auto; }
.assign-form select, .assign-form input:not([type=radio]):not([type=checkbox]) { width: 100%; }
.assign-form .due-row input:not([type=radio]):not([type=checkbox]) { width: auto; flex: none; }
.assign-form .due-row input[type=number] { width: 5.5rem; }
.assign-form .due-row { flex-wrap: wrap; gap: .5rem .7rem; }
.form .row.due-row > * { flex: none; }
.narrow-card { max-width: 640px; }
ul.rules { padding-left: 0; list-style: none; }
ul.rules li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.timer { position: sticky; top: 64px; z-index: 10; display: inline-block; background: var(--brand); color: #fff; padding: .4rem .9rem;
  border-radius: 99px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: .8rem; box-shadow: var(--shadow); }
.timer.low { background: var(--bad); }
.verify { display: flex; gap: 1.2rem; align-items: flex-start; }
.verify-mark { font-size: 2.2rem; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ok-soft); color: var(--ok); }
.verify.expired .verify-mark, .verify.revoked .verify-mark { background: var(--bad-soft); color: var(--bad); }
.certificate.void { position: relative; }
.certificate.void::after { content: "NOT VALID"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 5rem; font-weight: 800; color: rgba(180, 35, 24, .18); transform: rotate(-18deg); pointer-events: none; }
