/* ============================================================
   AntiPlagiat Pro — Université de Kara
   Bleu marine, vert sombre, texte à fort contraste.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&family=IBM+Plex+Mono:wght@500&family=Newsreader:ital,opsz,wght@0,6..72,500;0,6..72,650;0,6..72,700;1,6..72,500&display=swap');

:root {
  --ink: #0A1F3D;
  --ink-soft: #163056;
  --paper: #E7EEF4;
  --paper-raised: #FFFFFF;
  --line: #C5D3E0;
  --line-strong: #9BB0C4;
  --muted: #2F4A66;
  --accent: #0E4A36;
  --accent-deep: #083628;
  --accent-soft: #D3E8DF;
  --gold: #0E4A36;
  --gold-soft: #D3E8DF;
  --accent-risk: #B42318;
  --accent-risk-bg: #F8E4E1;
  --accent-safe: #0E4A36;
  --accent-safe-bg: #D3E8DF;
  --accent-warn: #9A6B12;
  --accent-warn-bg: #F6E9CF;

  --font-display: 'Newsreader', 'Palatino Linotype', Georgia, serif;
  --font-ui: 'Atkinson Hyperlegible', 'Segoe UI', sans-serif;
  --font-data: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  --sidebar-width: 268px;
  --content-max-width: 1180px;
  --shadow: 0 1px 0 rgba(36, 28, 24, 0.04), 0 12px 28px rgba(36, 28, 24, 0.05);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    linear-gradient(180deg, #D5E3EE 0, var(--paper) 180px);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display {
  font-family: var(--font-display); font-weight: 650; color: var(--ink);
  margin: 0 0 6px; letter-spacing: -0.02em; font-optical-sizing: auto;
}
p { margin: 0 0 12px; }
.mono { font-family: var(--font-data); font-weight: 500; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font-family: inherit; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 4px;
}
.skip-link:focus { left: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 700; cursor: pointer; letter-spacing: 0.01em;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #F4FBF8; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); background: var(--paper-raised); }
.btn-danger { background: transparent; border-color: var(--accent-risk); color: var(--accent-risk); }
.btn-danger:hover { background: var(--accent-risk-bg); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select,
.sheet input[type="text"], .sheet input[type="number"], .sheet input[type="url"],
.sheet input[type="email"], .sheet input[type="password"], .sheet select, .sheet textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-size: 15px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.field-hint { font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.45; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.checkbox-row input { width: auto; }

.sheet {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow);
}
.sheet-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}

.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; font-family: var(--font-data); }
.badge-safe { background: var(--accent-safe-bg); color: var(--accent-safe); }
.badge-warn { background: var(--accent-warn-bg); color: var(--accent-warn); }
.badge-risk { background: var(--accent-risk-bg); color: var(--accent-risk); }
.badge-muted { background: var(--line); color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent-deep); }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--muted);
  padding: 10px 12px; border-bottom: 2px solid var(--ink); letter-spacing: 0.08em; text-transform: uppercase;
}
td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
tr:hover td { background: rgba(196, 69, 45, 0.04); }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; color: #E8EEF4;
  padding: 0; display: flex; flex-direction: column;
  background: var(--ink);
  border-right: 1px solid #07152A;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.sidebar .brand {
  display: block;
  padding: 16px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar .brand img {
  width: 100%;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  display: block;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 12px 12px 8px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14.5px; color: rgba(232,238,244,0.88);
}
.sidebar nav a svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.85; }
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar nav a.active {
  background: var(--accent); color: #F4FBF8; font-weight: 700;
}
.sidebar nav a.active svg { opacity: 1; }
.sidebar nav .nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700;
  color: #9AD4BE; margin: 14px 4px 6px; padding: 0 8px;
}
.sidebar .user-box {
  margin: 8px 12px 16px; padding: 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  font-size: 13px; color: rgba(232,238,244,0.75);
}
.sidebar .user-box strong { color: #fff; display: block; font-family: var(--font-display); font-size: 16px; }
.sidebar .user-box .link { color: #9AD4BE; }

.sidebar-backdrop { display: none; }
.menu-toggle {
  display: none; border: 1px solid var(--line-strong); background: var(--paper-raised);
  border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; font-weight: 700; font-size: 13px;
}

.main-area { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px; border-bottom: 3px solid var(--ink); background: var(--paper-raised);
  position: sticky; top: 0; z-index: 20;
}
.header-crest {
  display: flex; align-items: center; flex-shrink: 0;
  background: transparent; padding: 0;
}
.header-crest img { height: 44px; width: auto; max-width: 280px; display: block; object-fit: contain; }
.header-crest .univ-name { display: none; }
.topbar h1 { font-size: 22px; margin: 0; font-weight: 650; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kicker {
  font-family: var(--font-ui); font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.topbar-meta { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line); padding: 5px 10px 5px 5px; border-radius: var(--radius-sm);
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 3px; background: var(--ink); color: #E8EEF4;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; font-family: var(--font-display);
}
.notify-dot {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 3px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
}

.page-container { max-width: var(--content-max-width); padding: var(--space-8) var(--space-10) var(--space-12); margin: 0 auto; }
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-105%); transition: transform 200ms ease; }
  body.nav-open .sidebar { transform: none; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(36, 28, 24, 0.45); z-index: 35;
    opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-flex; }
  .page-container { padding: var(--space-5) var(--space-4) var(--space-8); }
  .topbar { padding: 10px 16px; border-bottom-width: 2px; }
  .topbar h1 { font-size: 18px; }
  .header-crest img { height: 36px; max-width: 180px; }
}

.section { margin-top: var(--space-8); }
.section:first-child { margin-top: 0; }
.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: var(--space-3);
}

.muted { color: var(--muted); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grid { display: grid; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
@media (max-width: 800px) { .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--paper-raised); border: 1px solid var(--line); border-left: 4px solid var(--ink);
  border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow);
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 36px; font-weight: 700; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.hero-banner {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  background: var(--ink); color: #E8EEF4;
  border-radius: var(--radius-lg); padding: 32px 34px; margin-bottom: 28px;
  border-bottom: 6px solid var(--accent);
}
.hero-banner h2 { color: #F4F7FA; font-size: 32px; margin-bottom: 8px; }
.hero-banner p { margin: 0; color: rgba(232, 238, 244, 0.82); max-width: 560px; }
.hero-banner .btn-primary { background: var(--accent); color: #fff; }

.gauge-bar { height: 8px; border-radius: 0; background: var(--line); overflow: hidden; }
.gauge-bar > span { display: block; height: 100%; }
.gauge-bar .safe { background: var(--accent-safe); }
.gauge-bar .warn { background: var(--accent-warn); }
.gauge-bar .risk { background: var(--accent-risk); }

.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--space-5); }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.flash-success { background: var(--accent-safe-bg); color: var(--accent-safe); border-color: var(--accent-safe); }
.flash-error { background: var(--accent-risk-bg); color: var(--accent-risk); border-color: var(--accent-risk); }
.flash-info { background: var(--accent-soft); color: var(--ink-soft); border-color: var(--accent); }

.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr;
  background: var(--paper);
}
.auth-visual {
  background: var(--ink);
  color: #E8EEF4; padding: 52px; display: flex; flex-direction: column; justify-content: space-between;
  border-right: 8px solid var(--accent);
}
.auth-visual h1 { color: #F4F7FA; font-size: 44px; line-height: 1.08; max-width: 11ch; }
.auth-visual p { color: rgba(232, 238, 244, 0.82); max-width: 36ch; font-size: 17px; }
.auth-visual .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #F4F7FA; }
.auth-visual .brand img {
  width: auto; height: 56px; max-width: 320px; object-fit: contain;
  background: #fff; border-radius: 8px; padding: 8px 12px;
}
.auth-card-wrap { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .brand { display: none; }
@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-card .brand {
    display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px;
    font-family: var(--font-display); font-size: 22px; font-weight: 700;
  }
  .auth-card .brand img {
    height: 48px; width: auto; max-width: 280px; object-fit: contain;
    background: transparent; padding: 0;
  }
}

.empty-state { text-align: center; padding: var(--space-10) var(--space-6); color: var(--muted); }

.match-item { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; background: var(--paper-raised); }
.match-item .excerpt { background: var(--paper); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 8px; font-family: var(--font-data); }
.match-item .source-excerpt { border-left: 3px solid var(--accent-warn); }
.citation-line { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.annotated-document {
  max-height: 620px; overflow: auto; white-space: pre-wrap;
  background: #FFF8EF; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px; font-size: 15px; line-height: 1.85; font-family: var(--font-display);
}
.annotated-hit { background: var(--accent-soft); color: var(--ink); padding: 2px 1px; border-bottom: 2px solid var(--accent); }
.annotated-hit sup { color: var(--accent-deep); font-size: 10px; font-weight: 700; margin-left: 2px; }

.pager { display: flex; gap: 6px; margin-top: var(--space-4); }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.pill-nav a { padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); font-size: 13px; }
.pill-nav a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.intake {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.intake:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.intake.is-dragging { border-color: var(--accent); border-style: dashed; }
.intake-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}
.intake-empty-guide {
  padding: 16px 18px 18px;
  color: var(--ink);
  background: #E8F0F8;
  border-top: 2px solid var(--line-strong);
}
.intake-empty-guide-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.intake-empty-guide-list {
  margin: 0;
  padding-left: 1.35rem;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.intake-empty-guide-list li { margin-bottom: 6px; }
.intake-empty-guide-list strong { color: var(--accent-deep); font-weight: 700; }
.intake-text {
  flex: 1 1 auto;
  width: 100%; min-height: 420px; resize: vertical;
  border: 0; background: #fff; color: var(--ink);
  padding: 16px 18px; font-size: 16px; line-height: 1.65;
  font-family: var(--font-ui); font-weight: 400;
}
.intake-text::placeholder {
  color: #163056;
  opacity: 1;
}
.intake-text:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-soft); }
.intake-text:disabled {
  color: var(--ink);
  background: #F3F6F9;
}
.intake-text:disabled::placeholder {
  color: #163056;
  opacity: 1;
}
@media (max-width: 600px) {
  .intake-main { min-height: 280px; }
  .intake-text { min-height: 180px; }
}
.intake-drop {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(232, 244, 239, 0.97);
  font-family: var(--font-display); font-size: 22px; pointer-events: none; color: var(--ink);
  border: 3px dashed var(--accent);
}
.intake-drop[hidden] { display: none !important; }
.intake-drop strong { font-weight: 700; color: var(--ink); }
.intake-drop-formats {
  font-family: var(--font-ui); font-size: 16px; font-weight: 700; color: var(--ink);
}
.intake-file-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 10px 14px 0; padding: 12px 14px;
  background: #fff; border: 2px solid var(--line-strong); border-radius: var(--radius-sm);
}
.intake-file-chip[hidden] { display: none !important; }
.intake-file-name { font-family: var(--font-data); font-size: 14px; font-weight: 700; color: var(--ink); word-break: break-all; }
.intake-bar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-top: 2px solid var(--line-strong); background: #F0F4F8;
}
.intake-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-intake-primary {
  background: var(--accent); color: #fff;
  border: 2px solid var(--accent-deep);
  font-weight: 700; font-size: 14px;
}
.btn-intake-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-intake-secondary {
  background: #fff; color: var(--ink);
  border: 2px solid var(--ink);
  font-weight: 700; font-size: 14px;
}
.btn-intake-secondary:hover { background: var(--paper); color: var(--ink); }
.intake-count { font-size: 15px; color: var(--ink); font-weight: 700; }
.intake-count.is-short { color: var(--accent-warn); }

.source-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.source-card {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px; cursor: pointer; font-size: 14px; background: #fff;
}
.source-card:hover { border-color: var(--accent); }
.source-card:has(input:checked) { border-color: var(--ink); background: #F3F8F6; }
.source-card input { margin-top: 3px; }
.source-card input:disabled { cursor: not-allowed; }
.source-card input:disabled ~ div { opacity: 0.55; }
.source-card strong { display: block; margin-bottom: 3px; font-family: var(--font-display); color: var(--ink); }
.source-card .field-hint { display: block; margin-top: 4px; }

.progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.progress-state { font-family: var(--font-display); font-size: 22px; font-weight: 650; margin-bottom: 2px; color: var(--ink); }
.progress-figure { display: flex; flex-direction: column; align-items: flex-end; }
.progress-figure span:first-child { font-size: 24px; font-weight: 700; font-family: var(--font-display); }
.progress-figure span:last-child { font-size: 12px; }
.progress-fill { background: var(--accent); transition: width 350ms ease; min-width: 4px; }
.analyze-gauge { height: 14px; border: 1px solid var(--line-strong); background: #fff; }
.analyze-status-line {
  margin: -8px 0 18px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
}

.phase-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.phase {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); background: #fff;
}
.phase.is-pending { color: var(--ink-soft); }
.phase-dot { width: 8px; height: 8px; border-radius: 1px; flex: 0 0 auto; background: var(--line-strong); }
.phase-note { font-size: 12px; }
.phase.is-running { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.phase.is-running .phase-dot { background: var(--accent); animation: phase-pulse 1s ease-in-out infinite; }
.phase.is-done { color: var(--ink); }
.phase.is-done .phase-dot { background: var(--accent-safe); }
.phase.is-skipped { color: var(--muted); }
.phase.is-skipped .phase-dot { background: var(--line); }
@keyframes phase-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.analysis-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 10px; }
.analysis-run-list { display: flex; flex-direction: column; gap: 12px; }
.analysis-run-card .progress-fill { display: block; height: 100%; }
.analysis-batch-stack { display: flex; flex-direction: column; gap: 22px; }
.analysis-batch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.analysis-panel.is-complete { border-color: var(--accent-safe); }
.analysis-panel.is-failed { border-color: var(--accent-risk); }
.phase-list-compact .phase { padding: 6px 10px; font-size: 13px; }
.console-compact { max-height: 120px; }
.intake-file-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.intake-file-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.intake-file-list-name { font-size: 13px; word-break: break-word; }

.console {
  max-height: 220px; overflow-y: auto;
  background: var(--ink); color: rgba(246, 237, 227, 0.85);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-family: var(--font-data); font-size: 12px; line-height: 1.6;
}
.console:empty { display: none; }
.console-line { white-space: pre-wrap; word-break: break-word; }
.console-ok { color: #9BD6A9; }
.console-error { color: #F0A090; }
.console-skip { color: rgba(246, 237, 227, 0.45); }

.score-big { font-family: var(--font-display); font-size: 52px; font-weight: 700; line-height: 1; }
.score-big.safe { color: var(--accent-safe); }
.score-big.warn { color: var(--accent-warn); }
.score-big.risk { color: var(--accent-risk); }
.score-big.muted { color: var(--muted); }

@media (max-width: 720px) {
  .source-grid { grid-template-columns: 1fr; }
  .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

.panel-title { font-size: 22px; margin-bottom: 6px; }
.panel-lead { color: var(--ink); margin-bottom: 18px; line-height: 1.55; }

.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.filter-bar input, .filter-bar select { max-width: 100%; }
.filter-bar .grow { flex: 1; min-width: 200px; }

.empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
  background: var(--paper-raised); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.empty-state a { font-weight: 700; }

.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.folder-card {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.folder-card .folder-name { font-family: var(--font-display); font-size: 20px; font-weight: 650; }
.folder-meta { font-size: 13px; color: var(--muted); }
.folder-card .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }

.compare-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .compare-split { grid-template-columns: 1fr; } }

.alert-card {
  background: var(--paper-raised); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 12px;
}
.alert-card.is-error { border-left-color: var(--accent-warn); }

.help-stack { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.help-stack .sheet h3 { font-size: 22px; }
.help-stack ul { padding-left: 20px; line-height: 1.8; font-size: 15px; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }

details summary { cursor: pointer; font-weight: 700; color: var(--accent-deep); }
details[open] summary { margin-bottom: 8px; }

.sidebar nav a { position: relative; }
.sidebar nav a .notify-dot { margin-left: auto; }
.sidebar nav a.active .notify-dot { background: #F4FBF8; color: var(--accent); }

.report-ps-header { display: flex; flex-direction: column; gap: 16px; }
.report-ps-meta { font-size: 13px; line-height: 1.5; }
.report-ps-hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.report-ps-metric {
  border-radius: var(--radius-md); padding: 16px 18px; border: 1px solid var(--line);
  background: var(--paper-raised);
}
.report-ps-metric-plag { border-color: #E8C4BC; background: #FBF3F1; }
.report-ps-metric-unique { border-color: #C5D9CB; background: #F4FAF6; }
.report-ps-metric-ai { border-color: #C9D4E8; background: #F5F8FC; }
.report-ps-metric-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.report-ps-metric-value { font-size: 36px; font-weight: 700; font-family: var(--font-display); line-height: 1.1; }
.report-ps-filters { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.report-ps-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.report-ps-layout {
  display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 20px; align-items: start;
}
@media (max-width: 960px) {
  .report-ps-layout { grid-template-columns: 1fr; }
}
.report-source-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; }
.report-source-item {
  padding: 10px 0; border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.report-source-item.is-highlight { background: rgba(46, 110, 142, 0.08); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }
.report-source-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.report-source-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; margin-top: 3px; border: 1px solid rgba(0,0,0,0.12); }
.report-source-num { font-weight: 700; flex-shrink: 0; }
.report-source-title { font-weight: 600; word-break: break-word; }
.report-source-meta { font-size: 11px; margin: 4px 0 0 22px; }
.report-source-link { font-size: 11px; word-break: break-all; margin-left: 22px; display: inline-block; margin-top: 4px; }
.annotated-document { line-height: 1.65; text-align: justify; font-size: 14px; }
.annotated-hit { border-radius: 2px; cursor: help; }
.annotated-hit sup { font-size: 9px; font-weight: 700; margin-left: 1px; }

.compact-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.compact-form input { flex: 1; min-width: 160px; }
