.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.ws { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.ws-name { font-weight: 700; }
.ws-dom { font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 500; text-decoration: none !important; }
nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
nav .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.side-foot { margin-top: auto; font-size: 13px; padding: 10px 12px; border-top: 1px solid var(--border); }
main { min-width: 0; padding: 0 28px 48px; }
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 0 12px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.top h1 { font-size: 22px; margin: 0; }
.menu { display: none; }
.filters { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 7px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.demo-note { font-size: 13px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 16px 18px; }
.card h3 { font-size: 15px; margin-bottom: 2px; }
.card .sub { font-size: 12.5px; color: var(--faint); margin-bottom: 12px; }
.kpi .lbl { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.kpi .val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; }
.kpi .delta { font-size: 13px; font-weight: 600; }
.up { color: var(--good); } .down { color: var(--bad); }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 210px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
tr.me td { background: var(--brand-soft); }
.tbl-wrap { overflow-x: auto; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.bar.me > span { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.cell { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.cell.yes { background: var(--good-soft); color: var(--good); }
.cell.cite { background: var(--warn-soft); color: var(--warn); }
.cell.no { background: var(--surface-2); color: var(--faint); }
.eng { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 240px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.rec { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.rec:last-child { border-bottom: 0; }
.rec .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.rec h4 { font-size: 14.5px; margin: 0 0 3px; }
.rec p { margin: 0; font-size: 13.5px; color: var(--muted); }
.rec .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; font: inherit; padding: 9px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; }
.tabs button.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.answer { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; margin: 8px 0 12px; max-height: 320px; overflow: auto; }
.answer mark { background: var(--warn-soft); color: inherit; padding: 0 2px; border-radius: 3px; font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer { position: fixed; inset: 0; z-index: 50; display: none; }
.drawer.open { display: block; }
.drawer-bg { position: absolute; inset: 0; background: rgba(10, 14, 22, .45); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(680px, 100%); border-radius: 0; overflow-y: auto; padding: 24px; }
.drawer-x { position: absolute; right: 16px; top: 16px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.int { display: flex; gap: 12px; align-items: flex-start; }
.int .lg { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.int p { font-size: 13.5px; color: var(--muted); margin: 4px 0 10px; }
.doc { font-size: 14px; }
.doc h2 { font-size: 19px; }
.doc h3 { font-size: 15px; margin-top: 1.1em; }
.doc .box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: var(--surface-2); }
.doc ul { padding-left: 1.2em; margin: .3em 0 1em; }
.lesson { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.lesson .thumb { width: 96px; height: 56px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-size: 20px; flex: none; }
select { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: 100%; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .halves, .three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu { display: inline-flex; }
  main { padding: 0 16px 40px; }
  .filters { margin-left: 0; width: 100%; }
  .kpi .val { font-size: 24px; }
  .rec { grid-template-columns: auto 1fr; }
  .rec > :last-child { grid-column: 2; }
}
.insight { background: linear-gradient(135deg, var(--brand-soft), transparent); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px; }
.status { font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
