/* ==========================================================================
   Burnt Studios — Customer Service Academy
   Design system: black / white / warm neutrals, premium editorial layout
   ========================================================================== */

:root {
  --ink: #0b0b0c;
  --ink-soft: #1a1a1c;
  --graphite: #3d3d40;
  --muted: #6f6f74;
  --line: #e4e2dd;
  --line-strong: #cfccc5;
  --paper: #ffffff;
  --paper-2: #f7f6f3;
  --paper-3: #efece7;
  --accent: #0b0b0c;
  --good: #1c6b46;
  --good-bg: #e8f2ec;
  --warn: #7a5300;
  --warn-bg: #fbf1d9;
  --bad: #8c2118;
  --bad-bg: #fbe9e6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(11, 11, 12, .05);
  --shadow: 0 10px 30px rgba(11, 11, 12, .07);
  --shadow-lg: 0 24px 60px rgba(11, 11, 12, .12);
  --sidebar: 274px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Archivo", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper-2);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.18;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(1.7rem, 1.2rem + 1.5vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .7vw, 1.65rem); }
h3 { font-size: 1.1rem; letter-spacing: -.01em; }
h4 { font-size: .96rem; letter-spacing: 0; }
p { margin: 0 0 1em; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
a:hover { border-bottom-color: var(--ink); }

strong { font-weight: 650; }
small { font-size: .82rem; }

ul, ol { margin: 0 0 1em; padding-left: 1.15rem; }
li { margin-bottom: .35em; }
li::marker { color: var(--muted); }

hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

::selection { background: var(--ink); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- App shell ---------------------------------------------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--paper);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 60;
}

.sidebar__head {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup { display: block; border: 0; }
.brand-lockup img { width: 158px; height: auto; display: block; }
.brand-lockup:hover { opacity: .82; }

.brand-sub {
  margin-top: 12px;
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.sidebar__scroll { flex: 1; overflow-y: auto; padding: 14px 12px 8px; }

.nav-group { margin-bottom: 18px; }

.nav-group__label {
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--graphite);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .72; }
.nav-item span { flex: 1; }

.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--ink); color: #fff; }
.nav-item[aria-current="page"] svg { opacity: 1; }

.nav-item .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good); flex: 0 0 6px;
  opacity: 0; transition: opacity .2s;
}
.nav-item.is-done .dot { opacity: 1; }
.nav-item[aria-current="page"] .dot { background: #7ee2b0; }

.sidebar__foot {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
  background: var(--paper);
}

.mini-progress__row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; margin-bottom: 6px;
}
.mini-progress__row b { color: var(--ink); font-size: .8rem; letter-spacing: 0; text-transform: none; }

.bar { height: 5px; background: var(--paper-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; width: 0; transition: width .5s cubic-bezier(.2,.7,.2,1); }

.sidebar__foot .btn-quiet { margin-top: 10px; width: 100%; }

/* ---------- Main / topbar ------------------------------------------------ */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 243, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px clamp(16px, 3vw, 34px);
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--paper);
  cursor: pointer; color: var(--ink); flex: 0 0 auto;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
#menuToggle { display: none; }

.searchbox { position: relative; flex: 1; max-width: 520px; }
.searchbox svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.searchbox input {
  width: 100%;
  padding: 10px 74px 10px 38px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--paper);
  font: inherit; font-size: .875rem;
  color: var(--ink);
}
.searchbox input::placeholder { color: #8d8d92; }
.searchbox input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,11,12,.07); }
.searchbox kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: .65rem; letter-spacing: .04em;
  color: var(--muted); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
}

.topbar__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: .72rem; color: var(--muted); white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: 0 0 7px; }

/* ---------- Search results dropdown ------------------------------------- */

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 62vh; overflow-y: auto; padding: 6px; display: none;
}
.search-results.is-open { display: block; }
.search-results__empty { padding: 14px 12px; font-size: .85rem; color: var(--muted); }
.result-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink);
}
.result-item:hover, .result-item:focus-visible { background: var(--paper-2); }
.result-item b { display: block; font-size: .86rem; font-weight: 600; }
.result-item span { display: block; font-size: .76rem; color: var(--muted); line-height: 1.4; }
.result-item em { font-style: normal; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Views -------------------------------------------------------- */

.content { padding: clamp(20px, 3vw, 40px) clamp(16px, 3vw, 34px) 80px; max-width: 1180px; width: 100%; }

.view { display: none; animation: rise .32s ease; }
.view.is-active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.view-head { margin-bottom: 26px; }
.view-head .eyebrow {
  font-size: .66rem; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 650; color: var(--muted); margin-bottom: 8px;
}
.view-head p { color: var(--graphite); max-width: 68ch; font-size: .95rem; }

.section { margin-bottom: 34px; scroll-margin-top: 90px; }
.section > h2 { margin-bottom: 14px; }

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 99px;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: transform .12s, background .15s, color .15s;
}
.btn:hover { background: #26262a; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--paper); border-color: var(--ink); }
.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--light:hover { background: #e9e7e2; }
.btn--sm { padding: 6px 13px; font-size: .78rem; }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }

.btn-quiet {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 99px; font: inherit; font-size: .74rem; padding: 5px 10px; cursor: pointer;
}
.btn-quiet:hover { color: var(--ink); border-color: var(--line-strong); }

.link-more {
  background: none; border: 0; padding: 0; font: inherit; font-size: .82rem;
  font-weight: 600; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--ink);
}

/* ---------- Cards / grids ----------------------------------------------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card--flush { padding: 0; overflow: hidden; }
.card--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.card--ink .muted, .card--ink .eyebrow { color: rgba(255,255,255,.62); }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.muted { color: var(--muted); }
.tiny { font-size: .78rem; line-height: 1.5; }
.mono { font-family: var(--mono); font-size: .8rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 22px; }
.mb-2 { margin-bottom: 14px; }

/* ---------- Dashboard hero ---------------------------------------------- */

.hero {
  background: var(--ink);
  color: #fff;
  border-radius: 18px;
  padding: clamp(22px, 3vw, 38px);
  display: grid;
  grid-template-columns: 1.55fr .85fr;
  gap: 26px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(600px 260px at 88% 8%, rgba(255,255,255,.13), transparent 70%);
  pointer-events: none;
}
.hero__eyebrow {
  font-size: .64rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.62); font-weight: 650; margin-bottom: 12px;
}
.hero h1 { color: #fff; margin-bottom: .35em; max-width: 22ch; }
.hero p { color: rgba(255,255,255,.76); font-size: .94rem; max-width: 52ch; margin-bottom: 18px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; z-index: 1; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring__track { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 9; }
.ring__fill { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2,.7,.2,1); }
.ring__label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1;
}
.ring__label b { font-family: var(--display); font-size: 2.1rem; letter-spacing: -.03em; }
.ring__label span { font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-top: 7px; }
.ring-wrap .tiny { color: rgba(255,255,255,.6); text-align: center; }

/* ---------- Stat cards --------------------------------------------------- */

.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat__label { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.stat__value { font-family: var(--display); font-size: 1.85rem; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 2px; }
.stat__value small { font-family: var(--font); font-size: .8rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat__foot { font-size: .76rem; color: var(--muted); }
.stat__foot.is-good { color: var(--good); }
.stat__foot.is-warn { color: var(--warn); }

/* ---------- Badges / flags ---------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .65rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; border: 1px solid transparent;
  white-space: nowrap;
}
.badge--confirmed { background: var(--good-bg); color: var(--good); border-color: #cfe3d8; }
.badge--verify { background: var(--warn-bg); color: var(--warn); border-color: #eddfb8; }
.badge--conflict { background: var(--bad-bg); color: var(--bad); border-color: #f0cdc7; }
.badge--neutral { background: var(--paper-3); color: var(--graphite); }
.badge--ink { background: var(--ink); color: #fff; }

.flag {
  border-left: 3px solid var(--line-strong);
  padding: 12px 16px;
  background: var(--paper-2);
  border-radius: 0 8px 8px 0;
  font-size: .87rem;
}
.flag--verify { border-left-color: #d8a72a; background: var(--warn-bg); }
.flag--conflict { border-left-color: #c26456; background: var(--bad-bg); }
.flag--info { border-left-color: var(--ink); background: var(--paper-2); }
.flag b { display: block; margin-bottom: 3px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
.flag--verify b { color: var(--warn); }
.flag--conflict b { color: var(--bad); }
.flag :last-child { margin-bottom: 0; }

.callout {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: .88rem;
}
.callout h4 { margin-bottom: 6px; }

/* ---------- Accordions / lists ------------------------------------------ */

.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.acc + .acc { margin-top: 10px; }
.acc__btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 18px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .93rem; font-weight: 600; text-align: left; color: var(--ink);
}
.acc__btn:hover { background: var(--paper-2); }
.acc__btn .acc__chev { margin-left: auto; width: 15px; height: 15px; transition: transform .22s; flex: 0 0 15px; color: var(--muted); }
.acc__btn[aria-expanded="true"] { background: var(--paper-2); }
.acc__btn[aria-expanded="true"] .acc__chev { transform: rotate(180deg); }
.acc__btn small { font-weight: 500; color: var(--muted); }
.acc__body { display: none; padding: 4px 18px 18px; font-size: .9rem; color: var(--graphite); border-top: 1px solid var(--line); }
.acc__body.is-open { display: block; animation: rise .2s ease; }
.acc__body h4 { margin: 16px 0 4px; color: var(--ink); }
.acc__body h4:first-child { margin-top: 14px; }
.acc__body ul { margin-bottom: .7em; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; font-size: .89rem; }
.list-plain li:last-child { border-bottom: 0; }

.ticklist { list-style: none; padding: 0; }
.ticklist li { position: relative; padding-left: 24px; margin-bottom: .5em; font-size: .89rem; }
.ticklist li::before {
  content: ""; position: absolute; left: 3px; top: .52em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
}
.ticklist--x li::before { background: var(--bad); }

/* ---------- Tables ------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 640px; }
thead th {
  text-align: left; padding: 11px 14px; background: var(--paper-2);
  font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfaf8; }
td b { font-weight: 650; }

/* ---------- Tabs --------------------------------------------------------- */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--paper); font: inherit; font-size: .8rem; font-weight: 550;
  color: var(--graphite); cursor: pointer;
}
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.tabpanels > [role="tabpanel"] { display: none; }
.tabpanels > [role="tabpanel"].is-active { display: block; animation: rise .22s ease; }

/* ---------- Product library --------------------------------------------- */

.product-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.product-card__img { height: 150px; background: var(--paper-3); position: relative; overflow: hidden; }
.product-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card__body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.product-card__body h3 { margin-bottom: 4px; }
.product-card__body .tiny { color: var(--muted); }
.product-card__body .btn-quiet { align-self: flex-start; margin-top: 12px; }

/* ---------- Wizard / decision tree -------------------------------------- */

.wizard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wizard__head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--paper-2); }
.wizard__head h3 { margin: 0; font-size: .98rem; }
.wizard__head .tiny { margin-left: auto; color: var(--muted); }
.wizard__body { padding: 20px; min-height: 190px; }
.wizard__step { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.wizard__q { font-family: var(--display); font-size: 1.08rem; font-weight: 700; letter-spacing: -.015em; margin-bottom: 14px; }

.choices { display: grid; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper); font: inherit; font-size: .88rem; text-align: left; cursor: pointer; color: var(--ink);
}
.choice:hover { border-color: var(--ink); background: var(--paper-2); }
.choice svg { width: 14px; height: 14px; color: var(--muted); flex: 0 0 14px; }
.choice:hover svg { color: var(--ink); }

.wizard__result { border-left: 3px solid var(--ink); background: var(--paper-2); padding: 16px 18px; border-radius: 0 10px 10px 0; }
.wizard__result h4 { margin-bottom: 8px; }
.wizard__result .badge { margin-bottom: 10px; }
.wizard__foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: var(--paper-2); }
.wizard__foot .tiny { margin-left: auto; }
.wizard__progress { display: flex; gap: 4px; }
.wizard__progress i { width: 18px; height: 3px; border-radius: 2px; background: var(--line-strong); display: block; }
.wizard__progress i.is-done { background: var(--ink); }

/* ---------- Quiz / checks / assessment ---------------------------------- */

.quiz { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.quiz__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.quiz__head h3 { margin: 0; }
.quiz__head .badge { margin-left: auto; }

.q { padding: 16px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q__num { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 5px; }
.q__text { font-weight: 600; font-size: .94rem; margin-bottom: 10px; }
.q__text .badge { margin-left: 6px; vertical-align: 1px; }

.opts { display: grid; gap: 6px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 9px 12px; cursor: pointer; font-size: .875rem;
  transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--ink); }
.opt input { margin: 4px 0 0; accent-color: var(--ink); flex: 0 0 auto; }
.opt span { flex: 1; }
.opt.is-correct { border-color: #8ec4a6; background: var(--good-bg); }
.opt.is-wrong { border-color: #dda79e; background: var(--bad-bg); }
.opt.is-key { border-color: #8ec4a6; background: #f2f8f4; }

.feedback {
  margin-top: 10px; font-size: .84rem; padding: 10px 12px;
  border-radius: 8px; border-left: 3px solid var(--line-strong); background: var(--paper-2);
}
.feedback.is-good { border-left-color: var(--good); background: var(--good-bg); color: #14482f; }
.feedback.is-bad { border-left-color: var(--bad); background: var(--bad-bg); color: #6b1a13; }
.feedback b { display: block; margin-bottom: 2px; }

textarea {
  width: 100%; min-height: 110px; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  font: inherit; font-size: .88rem; resize: vertical; background: var(--paper); color: var(--ink);
}
textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,11,12,.06); }
input[type="text"], select {
  padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  font: inherit; font-size: .88rem; background: var(--paper); color: var(--ink);
}
input[type="text"]:focus, select:focus { outline: none; border-color: var(--ink); }

.quiz__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.quiz__score { font-size: .85rem; font-weight: 600; }

.selfmark { display: grid; gap: 6px; margin-top: 10px; }
.selfmark label { display: flex; gap: 8px; align-items: flex-start; font-size: .82rem; color: var(--graphite); }
.selfmark input { margin-top: 3px; accent-color: var(--ink); }

/* Assessment progress */
.assess-bar { position: sticky; top: 62px; z-index: 30; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.assess-bar .bar { flex: 1; }
.assess-bar .tiny { white-space: nowrap; }

.result-hero { background: var(--ink); color: #fff; border-radius: 18px; padding: 30px; display: grid; grid-template-columns: 190px 1fr; gap: 26px; align-items: center; }
.result-hero h2 { color: #fff; }
.result-hero .ring__track { stroke: rgba(255,255,255,.18); }
.result-hero .ring__fill { stroke: #fff; }
.result-hero__meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.result-hero__meta div { font-size: .78rem; color: rgba(255,255,255,.62); }
.result-hero__meta b { display: block; font-family: var(--display); font-size: 1.25rem; color: #fff; letter-spacing: -.02em; }
.pass-chip { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; background: #fff; color: var(--ink); }
.pass-chip.is-fail { background: var(--bad); color: #fff; }

.gap-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.gap-row:last-child { border-bottom: 0; }
.gap-row .bar { width: 110px; flex: 0 0 110px; }
.gap-row b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- Knowledge base ---------------------------------------------- */

.kb-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.kb-tools input[type="text"] { flex: 1; min-width: 220px; padding: 11px 15px; border-radius: 99px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--paper); font: inherit; font-size: .75rem; cursor: pointer; color: var(--graphite);
}
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.kb-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 10px; }
.kb-item h3 { font-size: .98rem; margin-bottom: 6px; }
.kb-item p { font-size: .89rem; color: var(--graphite); }
.kb-item__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: .72rem; color: var(--muted); }
.kb-item__meta a { font-size: .72rem; }
.kb-item__meta svg { width: 12px; height: 12px; }
.kb-count { font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
mark { background: #ffe9a8; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- Templates ---------------------------------------------------- */

.tpl { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 10px; overflow: hidden; }
.tpl__head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; }
.tpl__title { font-weight: 600; font-size: .9rem; flex: 1; }
.tpl__body { display: none; padding: 0 18px 18px; }
.tpl__body.is-open { display: block; }
.tpl__text {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 14px 16px; font-size: .875rem; line-height: 1.62; color: var(--ink); white-space: pre-wrap;
  font-family: var(--font);
}
.tpl__actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.copy-ok { font-size: .72rem; color: var(--good); font-weight: 600; }

.say-no { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.say-no > div { padding: 14px 16px; border-radius: 10px; font-size: .855rem; }
.say-no .bad { background: var(--bad-bg); border: 1px solid #f0cdc7; }
.say-no .good { background: var(--good-bg); border: 1px solid #cfe3d8; }
.say-no h4 { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.say-no .bad h4 { color: var(--bad); }
.say-no .good h4 { color: var(--good); }

/* ---------- Timeline ----------------------------------------------------- */

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.timeline__item { position: relative; padding-bottom: 18px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -25px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
}
.timeline__time { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.timeline__item h4 { margin: 2px 0 3px; font-size: .92rem; }
.timeline__item p { font-size: .86rem; color: var(--graphite); margin: 0; }

/* ---------- KPI cards ---------------------------------------------------- */

.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; }
.kpi__head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; }
.kpi__head h3 { margin: 0; font-size: .95rem; }
.kpi__head span { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-left: auto; }
.kpi__body { padding: 14px 18px 16px; display: grid; gap: 10px; }
.kpi__row { font-size: .84rem; color: var(--graphite); }
.kpi__row b { display: block; font-size: .63rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }

/* ---------- Simulator ---------------------------------------------------- */

.sim { display: grid; grid-template-columns: 1fr; gap: 16px; }
.sim__screen { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 20px; }
.sim__screen .tiny { color: rgba(255,255,255,.6); }
.sim__msg { display: flex; gap: 12px; margin-top: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex: 0 0 34px; }
.bubble { background: rgba(255,255,255,.1); border-radius: 12px; border-top-left-radius: 3px; padding: 12px 15px; font-size: .9rem; line-height: 1.55; }
.sim__choices { display: grid; gap: 8px; }
.sim-choice {
  text-align: left; padding: 13px 15px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--paper); font: inherit; font-size: .88rem;
  cursor: pointer; color: var(--ink); display: flex; gap: 10px; align-items: flex-start;
}
.sim-choice:hover:not(:disabled) { border-color: var(--ink); background: var(--paper-2); }
.sim-choice .tag { font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: var(--paper-3); color: var(--graphite); flex: 0 0 auto; margin-top: 2px; }
.sim-choice.is-best { border-color: #7fb99a; background: var(--good-bg); }
.sim-choice.is-partial { border-color: #d8b45c; background: var(--warn-bg); }
.sim-choice.is-poor { border-color: #d99b90; background: var(--bad-bg); }
.sim-choice .res { display: block; font-size: .82rem; margin-top: 6px; color: var(--graphite); }
.sim__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim__score { margin-left: auto; font-size: .8rem; color: var(--muted); }

/* ---------- Misc --------------------------------------------------------- */

.breadcrumb { font-size: .72rem; color: var(--muted); margin-bottom: 10px; letter-spacing: .04em; }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 99px;
  font-size: .84rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 200;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.footer-note { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.footer-note span { display: inline-flex; gap: 6px; align-items: center; }

.scrim { display: none; position: fixed; inset: 0; background: rgba(11,11,12,.42); z-index: 55; }
.scrim.is-on { display: block; }

/* ---------- Responsive --------------------------------------------------- */

@media (max-width: 1080px) {
  :root { --sidebar: 0px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 288px; flex-basis: 288px;
    transform: translateX(-100%); transition: transform .26s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  #menuToggle { display: inline-flex; }
  .hero { grid-template-columns: 1fr; }
  .ring-wrap { flex-direction: row; gap: 18px; justify-content: flex-start; }
  .ring { width: 128px; height: 128px; }
  .ring__label b { font-size: 1.6rem; }
  .result-hero { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar__meta { display: none; }
  .say-no { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .content { padding-bottom: 60px; }
  .card { padding: 17px; }
  .hero { padding: 22px; border-radius: 14px; }
  .hero h1 { font-size: 1.5rem; }
  .hero__actions .btn { flex: 1 1 auto; }
  .searchbox kbd { display: none; }
  .searchbox input { padding-right: 14px; font-size: .82rem; }
  .acc__btn { font-size: .87rem; padding: 13px 14px; }
  .acc__body { padding: 0 14px 14px; }
  .wizard__body { padding: 16px; }
  .quiz { padding: 16px; }
  .assess-bar { top: 56px; padding: 7px 12px; gap: 9px; border-radius: 12px; }
  .assess-bar .tiny { font-size: .68rem; }
  .ring-wrap { flex-direction: column; align-items: flex-start; }
  .timeline { padding-left: 22px; }
  .stat__value { font-size: 1.55rem; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .footer-note { flex-direction: column; gap: 6px; }
}

@media print {
  .sidebar, .topbar, .scrim, .toast, .hero__actions { display: none !important; }
  .content { max-width: none; padding: 0; }
  .view { display: block !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
