:root {
  --ink: #17222c;
  --navy: #102a35;
  --navy-2: #183b47;
  --teal: #1f8f87;
  --teal-dark: #13726d;
  --teal-soft: #dff2ef;
  --coral: #ef785f;
  --amber: #b87918;
  --amber-soft: #fff1d6;
  --red: #b74b4b;
  --red-soft: #fde8e6;
  --green: #28775c;
  --green-soft: #e3f2ea;
  --paper: #f5f5f0;
  --white: #fff;
  --line: #dfe4e1;
  --line-dark: #cbd3cf;
  --muted: #66747c;
  --muted-2: #8b969b;
  --shadow: 0 10px 35px rgba(16, 42, 53, .08);
  --radius: 16px;
  --sidebar: 250px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 14px/1.5 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(31,143,135,.2);
  outline-offset: 2px;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4, .brand { font-family: 'Manrope', system-ui, sans-serif; }
h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -.035em; }
h2 { font-size: 26px; line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 17px; letter-spacing: -.015em; }
h4 { font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { position: relative; display: inline-block; width: 30px; height: 30px; border-radius: 9px; background: var(--teal); transform: rotate(45deg); }
.brand-mark i { position: absolute; inset: 7px 13px; background: white; border-radius: 2px; }
.brand-mark i:last-child { transform: rotate(90deg); }
.brand-light .brand-mark { background: var(--coral); }
.mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 28px; font-family: 'Manrope'; font-size: 20px; font-weight: 800; }

.login-shell { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(400px, .94fr); min-height: 100vh; background: var(--white); }
.login-story {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px clamp(42px, 6vw, 90px);
  color: white;
  background:
    radial-gradient(circle at 78% 16%, rgba(58,171,160,.28), transparent 22%),
    radial-gradient(circle at 18% 88%, rgba(239,120,95,.18), transparent 25%),
    linear-gradient(145deg, #0d2732 0%, #143d49 100%);
}
.login-story::before, .login-story::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 50%;
}
.login-story::before { right: -210px; top: 18%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.015); }
.login-story::after { left: -260px; bottom: -250px; }
.login-story > * { position: relative; z-index: 1; }
.story-copy { max-width: 660px; }
.story-copy .eyebrow { color: #78d0c7; margin-bottom: 20px; }
.story-copy h1 { margin-bottom: 22px; font-size: clamp(40px, 5.2vw, 64px); overflow-wrap: anywhere; font-weight: 700; }
.story-copy p { max-width: 600px; color: #c7d8dc; font-size: 17px; }
.story-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.13); }
.story-proof div { display: flex; flex-direction: column; gap: 2px; }
.story-proof strong { font: 700 20px 'Manrope'; }
.story-proof span { color: #a9c0c5; font-size: 11px; }

.login-panel { min-width: 0; display: grid; place-items: center; padding: 40px; background: #fbfbf8; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 8px 0 8px; font-size: 34px; }
.login-card > .muted { margin-bottom: 30px; }
label { display: grid; gap: 7px; margin-bottom: 17px; color: #394851; font-size: 12px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, textarea:hover, select:hover { border-color: #9eaba7; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,143,135,.11); outline: none; }
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.form-error { min-height: 20px; margin-top: 9px; color: var(--red); font-size: 12px; }
.demo-accounts { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.demo-accounts span { width: 100%; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.demo-accounts button { border: 0; border-radius: 999px; padding: 5px 9px; background: var(--teal-soft); color: var(--teal-dark); cursor: pointer; font-size: 11px; font-weight: 700; }
.demo-accounts small { color: var(--muted-2); }
.privacy-note { margin: 20px 0 0; color: var(--muted-2); text-align: center; font-size: 11px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: white;
  padding: 9px 15px;
  color: #34434a;
  cursor: pointer;
  font-weight: 700;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(16,42,53,.09); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
.button.primary { border-color: var(--teal); background: var(--teal); color: white; }
.button.primary:hover { background: var(--teal-dark); }
.button.danger { border-color: #e3b8b3; color: var(--red); }
.button.ghost { border-color: transparent; background: transparent; }
.button.compact { min-height: 35px; padding: 7px 12px; font-size: 12px; }
.button.full { width: 100%; }
.button.loading::before { content: ''; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 27px 18px 18px;
  color: #d5e1e3;
  background: var(--navy);
}
.sidebar .brand { padding: 0 10px 30px; color: white; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 12px;
  color: #abc0c5;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: white; }
.nav-item.active { background: rgba(73,179,168,.16); color: #7bdbd1; }
.nav-icon { display: grid; width: 20px; place-items: center; color: inherit; font-size: 17px; }
.sidebar-callout { margin-top: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.045); padding: 15px; }
.callout-icon { display: grid; width: 28px; height: 28px; margin-bottom: 9px; place-items: center; border-radius: 50%; background: rgba(239,120,95,.18); color: #f39b88; }
.sidebar-callout strong { display: block; color: white; font-size: 12px; }
.sidebar-callout p { margin: 5px 0 0; color: #9fb5ba; font-size: 10px; line-height: 1.45; }
.user-block { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; margin-top: 15px; padding: 13px 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #2f5e68; color: white; font-weight: 800; }
.user-block strong, .user-block span { display: block; }
.user-block strong { color: white; font-size: 11px; }
.user-block span { color: #91a9ae; font-size: 9px; text-transform: capitalize; }
.user-block button { border: 0; background: transparent; color: #8ba4a9; cursor: pointer; }

.main { grid-column: 2; min-width: 0; }
.topbar { position: sticky; z-index: 8; top: 0; display: flex; align-items: center; justify-content: space-between; height: 67px; border-bottom: 1px solid var(--line); background: rgba(251,251,248,.94); padding: 0 34px; backdrop-filter: blur(12px); }
#breadcrumbs { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 12px; }
#breadcrumbs b { color: #c7ceca; }
#breadcrumbs strong { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { position: relative; display: grid; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; place-items: center; background: white; cursor: pointer; }
.icon-button .dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }
.menu-button { display: none; }
.api-state { display: flex; align-items: center; gap: 7px; margin-right: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.api-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.api-state.live i { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.page { width: min(1480px, 100%); margin: 0 auto; padding: 34px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin: 4px 0 6px; font-size: 31px; }
.page-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; gap: 9px; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  border: 1px solid #e8d39d;
  border-radius: 12px;
  background: var(--amber-soft);
  padding: 13px 15px;
  color: #775419;
  font-size: 12px;
}
.notice strong { display: block; margin-bottom: 2px; }
.notice.danger { border-color: #e9bcb8; background: var(--red-soft); color: #7c3737; }
.notice.info { border-color: #badfd9; background: var(--teal-soft); color: #245e5b; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 25px; }
.metric-card { position: relative; overflow: hidden; min-height: 135px; border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 19px; box-shadow: 0 3px 15px rgba(16,42,53,.025); }
.metric-card::after { content: ''; position: absolute; right: -25px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--teal-soft); opacity: .55; }
.metric-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-icon { display: grid; width: 30px; height: 30px; border-radius: 9px; place-items: center; background: #eef5f3; color: var(--teal-dark); }
.metric-value { margin-top: 10px; font: 800 30px 'Manrope'; letter-spacing: -.04em; }
.metric-foot { color: var(--muted-2); font-size: 10px; }
.metric-foot.up { color: var(--green); }
.metric-card.alert .metric-icon { background: var(--red-soft); color: var(--red); }
.metric-card.warn .metric-icon { background: var(--amber-soft); color: var(--amber); }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 4px 20px rgba(16,42,53,.035); }
.panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 63px; border-bottom: 1px solid var(--line); padding: 14px 19px; }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 20px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(270px,.65fr); gap: 18px; }
.side-stack { display: grid; align-content: start; gap: 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.filter-row input, .filter-row select { width: auto; min-width: 140px; padding: 8px 10px; font-size: 11px; }
.filter-row input { flex: 1; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { border-bottom: 1px solid var(--line); padding: 9px 10px; color: var(--muted-2); text-align: left; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.data-table td { border-bottom: 1px solid #eef1ef; padding: 12px 10px; font-size: 11px; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fafbf9; }
.data-table tr:last-child td { border-bottom: 0; }
.student-cell { display: flex; align-items: center; gap: 9px; }
.student-avatar { display: grid; width: 30px; height: 30px; border-radius: 8px; place-items: center; background: #edf3f2; color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.student-cell strong, .student-cell span { display: block; }
.student-cell span { color: var(--muted-2); font-size: 9px; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; background: #edf1ef; color: #61716f; font-size: 9px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.pass, .badge.finalized, .badge.reviewed { background: var(--green-soft); color: var(--green); }
.badge.fail, .badge.confirmed, .badge.failed { background: var(--red-soft); color: var(--red); }
.badge.pending, .badge.pending-review, .badge.unreviewed, .badge.transcribing { background: var(--amber-soft); color: var(--amber); }
.badge.draft, .badge.uploaded { background: #edf1ef; color: #6d7977; }
.badge.ready, .badge.transcribed { background: var(--teal-soft); color: var(--teal-dark); }

.queue-list { display: grid; gap: 13px; }
.queue-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.queue-icon { display: grid; width: 34px; height: 34px; border-radius: 9px; place-items: center; background: var(--amber-soft); color: var(--amber); }
.queue-item strong, .queue-item span { display: block; }
.queue-item strong { font-size: 11px; }
.queue-item span { color: var(--muted-2); font-size: 9px; }
.queue-item b { color: var(--amber); font-size: 11px; }
.source-meter { display: grid; gap: 12px; }
.source-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; color: var(--muted); font-size: 10px; }
.source-row .bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: #edf1ef; overflow: hidden; }
.source-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }

.form-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.55fr); gap: 18px; align-items: start; }
.form-section { border-bottom: 1px solid var(--line); padding: 20px; }
.form-section:last-child { border-bottom: 0; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-title h3 { margin-bottom: 3px; }
.section-title p { margin: 0; color: var(--muted); font-size: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 15px; }
.field-grid .wide { grid-column: 1 / -1; }
.helper { margin-top: -11px; margin-bottom: 16px; color: var(--muted-2); font-size: 10px; }
.required { color: var(--coral); }
.mode-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { position: relative; display: block; cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card span { display: block; min-height: 80px; border: 1px solid var(--line-dark); border-radius: 11px; padding: 13px; }
.mode-card strong, .mode-card small { display: block; }
.mode-card small { margin-top: 4px; color: var(--muted); font-weight: 400; }
.mode-card input:checked + span { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 1px var(--teal); }
.upload-zone { display: grid; min-height: 150px; border: 1.5px dashed #aebcb8; border-radius: 13px; place-items: center; padding: 24px; text-align: center; background: #fbfcfa; cursor: pointer; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--teal); background: var(--teal-soft); }
.upload-zone input { display: none; }
.upload-zone strong { display: block; margin: 8px 0 3px; }
.upload-zone span { color: var(--muted); font-size: 10px; }
.upload-icon { display: grid; width: 42px; height: 42px; border-radius: 12px; place-items: center; background: var(--teal-soft); color: var(--teal-dark); font-size: 18px; }
.summary-card { position: sticky; top: 86px; }
.summary-list { display: grid; gap: 13px; }
.summary-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 12px; border-bottom: 1px solid #eef1ef; }
.summary-row:last-child { border: 0; padding-bottom: 0; }
.summary-row span { color: var(--muted); font-size: 10px; }
.summary-row strong { text-align: right; font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 17px; }

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; margin-bottom: 22px; }
.detail-title { display: flex; gap: 14px; }
.detail-title .student-avatar { width: 46px; height: 46px; border-radius: 13px; font-size: 14px; }
.detail-title h1 { margin: 0 0 3px; font-size: 27px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; color: var(--muted); font-size: 11px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.stepper { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 22px; border: 1px solid var(--line); border-radius: 13px; background: white; overflow: hidden; }
.step { position: relative; display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 12px 16px; color: var(--muted-2); font-size: 10px; font-weight: 700; }
.step:not(:last-child) { border-right: 1px solid var(--line); }
.step b { display: grid; width: 23px; height: 23px; border-radius: 50%; place-items: center; background: #edf1ef; font-size: 9px; }
.step.done { color: var(--green); }
.step.done b { background: var(--green-soft); }
.step.active { color: var(--teal-dark); background: #f1f8f6; }
.step.active b { background: var(--teal); color: white; }

.tabs { display: flex; gap: 3px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 13px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.tab.active { border-bottom-color: var(--teal); color: var(--teal-dark); }
.detail-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(270px,.55fr); gap: 18px; align-items: start; }
.audio-card { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf8; padding: 13px; }
.audio-play { display: grid; width: 38px; height: 38px; border: 0; border-radius: 50%; place-items: center; background: var(--teal); color: white; cursor: pointer; }
.audio-info { min-width: 0; flex: 1; }
.audio-info strong, .audio-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-info strong { font-size: 11px; }
.audio-info span { color: var(--muted); font-size: 9px; }
.audio-wave { display: flex; align-items: center; gap: 2px; width: 100px; height: 28px; }
.audio-wave i { display: block; width: 2px; border-radius: 2px; background: #8dc9c2; }

.report-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; border-radius: 15px; padding: 23px; color: white; background: linear-gradient(120deg,var(--navy),var(--navy-2)); }
.report-hero h2 { margin: 4px 0 6px; font-size: 24px; }
.report-hero p { margin: 0; color: #bad0d4; font-size: 11px; }
.score-orb { display: grid; width: 88px; height: 88px; border: 5px solid rgba(255,255,255,.15); border-top-color: #67c9bf; border-radius: 50%; place-items: center; }
.score-orb strong { display: block; font: 800 27px 'Manrope'; line-height: 1; text-align: center; }
.score-orb span { display: block; color: #a9c2c6; font-size: 9px; text-align: center; }
.score-table { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.score-row { display: grid; grid-template-columns: 190px 55px 1fr; gap: 12px; align-items: start; background: white; padding: 14px; }
.score-row > strong { font-size: 11px; text-transform: capitalize; }
.score-value { font: 800 17px 'Manrope'; color: var(--teal-dark); }
.score-row p { margin: 0; color: var(--muted); font-size: 10px; }
.evidence-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.evidence-chip { border-radius: 999px; background: var(--green-soft); padding: 3px 7px; color: var(--green); font-size: 8px; font-weight: 700; }
.critical-list { display: grid; gap: 9px; }
.critical-item { border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.critical-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.critical-head strong { font-size: 10px; text-transform: capitalize; }
.critical-item p { margin: 0; color: var(--muted); font-size: 9px; }
.dpi-grid { display: grid; gap: 10px; }
.dpi-row { display: grid; grid-template-columns: 1fr 30px; gap: 6px; align-items: center; font-size: 9px; }
.dpi-row .bar { height: 5px; border-radius: 99px; background: #edf1ef; overflow: hidden; }
.dpi-row .bar i { display: block; height: 100%; background: var(--coral); }
.dpi-row b { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--coral); text-align: right; }
.list-clean { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.list-clean li { position: relative; padding-left: 17px; color: var(--muted); font-size: 10px; }
.list-clean li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.list-clean.negative li::before { content: '—'; color: var(--amber); }

.knowledge-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.knowledge-card { border: 1px solid var(--line); border-radius: 14px; background: white; padding: 17px; }
.file-icon { display: grid; width: 36px; height: 40px; margin-bottom: 12px; border-radius: 7px; place-items: center; background: var(--teal-soft); color: var(--teal-dark); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.knowledge-card h3 { min-height: 42px; margin-bottom: 6px; font-size: 13px; }
.knowledge-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 9px; }

.empty { display: grid; min-height: 240px; place-items: center; padding: 40px; text-align: center; }
.empty-icon { display: grid; width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 14px; place-items: center; background: var(--teal-soft); color: var(--teal-dark); font-size: 20px; }
.empty h3 { margin-bottom: 5px; }
.empty p { max-width: 390px; color: var(--muted); font-size: 11px; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 9px; width: min(350px,calc(100vw - 44px)); }
.toast { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 13px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast strong { display: block; font-size: 11px; }
.toast span { color: var(--muted); font-size: 9px; }
.toast button { border: 0; background: transparent; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; background: rgba(6,24,31,.54); padding: 22px; backdrop-filter: blur(4px); }
.modal { width: min(590px,100%); max-height: calc(100vh - 44px); overflow: auto; border-radius: 17px; background: white; box-shadow: 0 25px 80px rgba(5,24,31,.3); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 19px 21px; }
.modal-header h2 { margin: 0 0 3px; font-size: 20px; }
.modal-header p { margin: 0; color: var(--muted); font-size: 10px; }
.modal-close { border: 0; background: transparent; cursor: pointer; font-size: 19px; }
.modal-body { padding: 21px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding: 15px 21px; }
.override-grid { display: grid; grid-template-columns: 1fr 100px; gap: 8px 13px; align-items: center; margin-bottom: 18px; }
.override-grid label { margin: 0; }
.override-grid input, .override-grid select { padding: 8px 10px; }

@media (max-width: 1450px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid, .form-layout, .detail-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .knowledge-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 780px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 26px; }
  .mobile-brand { display: flex; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .main { grid-column: 1; }
  .topbar { padding: 0 16px; }
  .menu-button { display: grid; }
  #breadcrumbs, .api-state { display: none; }
  .page { padding: 22px 16px; }
  .page-heading, .detail-header { align-items: flex-start; flex-direction: column; }
  .heading-actions, .detail-actions { width: 100%; justify-content: flex-start; }
  .stepper { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .score-row { grid-template-columns: 1fr 45px; }
  .score-row p, .score-row .evidence-chips { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .metric-grid, .knowledge-grid { grid-template-columns: 1fr; }
  .new-eval-button { font-size: 0; }
  .new-eval-button::after { content: '＋'; font-size: 17px; }
  .mode-selector { grid-template-columns: 1fr; }
  .report-hero { grid-template-columns: 1fr; }
  .score-orb { width: 76px; height: 76px; }
}

.metric-card, .notice > div, .panel, .dashboard-grid > *, .topbar > * { min-width: 0; }
.notice { overflow: hidden; }
.notice > div { overflow-wrap: anywhere; }
