/* ==========================================================================
   NibbleContract AI: shared styles for the landing page and the tool.
   Warm paper (light, default) or warm charcoal (dark), one orange accent.
   ========================================================================== */

:root {
  /* Dark */
  --bg-primary: #13110f;
  --bg-secondary: #1c1a17;
  --bg-tertiary: #27241f;
  --bg-surface: #1c1a17;
  --bg-glass: #181613;
  --bg-glass-active: rgba(255, 255, 255, 0.05);

  --accent: #f97316;
  --accent-hover: #fb8a3c;
  --accent-ink: #fb923c;
  --accent-soft: rgba(249, 115, 22, 0.12);

  --text-main: #f5f1ea;
  --text-muted: #a8a29e;
  --text-dim: #78716c;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(249, 115, 22, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.25), 0 18px 40px rgba(0, 0, 0, 0.35);

  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Fraunces', Georgia, "Times New Roman", serif;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --transition-fast: 0.15s ease;

  --risk-high: #f87171;
  --risk-high-bg: rgba(239, 68, 68, 0.13);
  --risk-medium: #facc15;
  --risk-medium-bg: rgba(234, 179, 8, 0.13);
  --risk-low: #4ade80;
  --risk-low-bg: rgba(34, 197, 94, 0.12);
  --clause-highlight: rgba(249, 115, 22, 0.22);
}

[data-theme="light"] {
  --bg-primary: #faf7f2;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f2ede5;
  --bg-surface: #ffffff;
  --bg-glass: #fbf9f5;
  --bg-glass-active: rgba(28, 25, 23, 0.05);

  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-ink: #c2410c;
  --accent-soft: rgba(234, 88, 12, 0.08);

  --text-main: #1c1917;
  --text-muted: #57534e;
  --text-dim: #a8a29e;

  --border-subtle: rgba(28, 25, 23, 0.09);
  --border-strong: rgba(28, 25, 23, 0.18);
  --border-focus: rgba(234, 88, 12, 0.55);
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 1px 2px rgba(28, 25, 23, 0.04), 0 6px 18px rgba(28, 25, 23, 0.05);
  --shadow-lg: 0 2px 4px rgba(28, 25, 23, 0.04), 0 18px 40px rgba(28, 25, 23, 0.08);

  --risk-high: #b91c1c;
  --risk-high-bg: rgba(220, 38, 38, 0.08);
  --risk-medium: #a16207;
  --risk-medium-bg: rgba(234, 179, 8, 0.12);
  --risk-low: #15803d;
  --risk-low-bg: rgba(22, 163, 74, 0.09);
  --clause-highlight: rgba(250, 204, 21, 0.38);
}

/* ---- base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  min-height: 100%;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
::selection { background: var(--accent-soft); }

/* ---- layout ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo-icon {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: .95rem;
}
.brand h1 { font-family: var(--font-heading); font-size: 1.08rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.brand h1 b { color: var(--accent); font-weight: 600; }
.brand span { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.header-btn {
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--border-subtle); color: var(--text-muted);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.header-btn:hover { color: var(--text-main); border-color: var(--border-strong); }

.page { max-width: 880px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.panel {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 1.1rem; margin-bottom: 4px; }
.panel-sub { color: var(--text-muted); font-size: .86rem; margin-bottom: 14px; }

.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.field-label { font-size: .82rem; font-weight: 500; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.style-dropdown {
  background: var(--bg-secondary); border: 1px solid var(--border-strong); color: var(--text-main);
  padding: 7px 10px; border-radius: 8px; font-family: inherit; font-size: .86rem; outline: none; cursor: pointer;
}
.style-dropdown:focus { border-color: var(--border-focus); }
.style-dropdown option { background: var(--bg-secondary); color: var(--text-main); }

.doc-textarea {
  width: 100%; min-height: 220px; max-height: 440px; resize: vertical; padding: 14px 16px;
  background: var(--bg-glass); color: var(--text-main); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); font-family: inherit; font-size: .93rem; line-height: 1.55; outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.doc-textarea:focus, .drop-zone.drag-over .doc-textarea { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.doc-textarea::placeholder { color: var(--text-dim); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 9px; cursor: pointer;
  font-size: .86rem; font-weight: 600; border: 1px solid var(--border-strong);
  background: var(--bg-secondary); color: var(--text-main);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; padding: 10px 20px; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; border-color: transparent; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.hint { font-size: .76rem; color: var(--text-dim); }

.loading { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .9rem; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-subtle); border-top-color: var(--accent); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { border: 1px solid var(--risk-high); background: var(--risk-high-bg); color: var(--risk-high); border-radius: var(--radius-md); padding: 12px 14px; font-size: .9rem; }

.history-title { font-size: .76rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .86rem; }
.history-item:hover { background: var(--bg-glass-active); }
.history-item .sub { color: var(--text-dim); font-size: .74rem; }
.history-del { background: transparent; border: none; color: var(--text-dim); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.history-del:hover { color: var(--risk-high); }
.history-main { display: flex; flex-direction: column; min-width: 0; }
.history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text-main); color: var(--bg-primary); padding: 8px 14px; border-radius: 8px; font-size: .84rem; box-shadow: var(--shadow-md); }
.msg-action-btn { background: transparent; border: none; color: var(--text-dim); font-size: .78rem; padding: 4px 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.msg-action-btn:hover { background: var(--bg-tertiary); color: var(--text-main); }
.report-wrap { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.report-actions { display: flex; gap: 6px; margin-top: 8px; }
@media (max-width: 600px) { .topbar { padding: 10px 14px; } .page { padding: 20px 14px 50px; } }

/* ==========================================================================
   FINE-PRINT DECODER
   ========================================================================== */

/* Input dock additions */
.chat-textarea.decoder-input {
  max-height: 260px;
}

.decoder-file-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 0 4px 6px;
}

.decoder-file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 3px 6px 3px 12px;
  font-size: 0.76rem;
  color: var(--text-main);
  max-width: 100%;
}

.decoder-file-chip > i {
  color: var(--accent-ink);
}

.decoder-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decoder-file-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.decoder-file-remove:hover {
  background: var(--bg-glass-active);
  color: var(--text-main);
}

.decoder-disclaimer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--risk-medium);
}

.input-container-box.drag-over {
  border-color: var(--accent-ink);
  border-style: dashed;
}

/* Report layout */

.decoder-report {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.decoder-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.decoder-report-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.98rem;
}

.decoder-report-title i {
  color: var(--accent-ink);
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid currentColor;
}

.risk-badge.risk-high { color: var(--risk-high); background: var(--risk-high-bg); }
.risk-badge.risk-medium { color: var(--risk-medium); background: var(--risk-medium-bg); }
.risk-badge.risk-low { color: var(--risk-low); background: var(--risk-low-bg); }

.decoder-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.decoder-card h4,
.report-wrap .decoder-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-main);
}

.decoder-card h4 i {
  color: var(--accent-ink);
  font-size: 0.8rem;
}

.decoder-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.decoder-card-head h4 {
  margin-bottom: 8px;
}

.decoder-count {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.decoder-empty {
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* Red flags */
.red-flag {
  border-left: 3px solid var(--border-subtle);
  padding: 8px 0 8px 12px;
  font-size: 0.88rem;
}

.red-flag + .red-flag {
  border-top: 1px solid var(--border-subtle);
}

.red-flag.sev-high { border-left-color: var(--risk-high); }
.red-flag.sev-medium { border-left-color: var(--risk-medium); }
.red-flag.sev-low { border-left-color: var(--risk-low); }

.red-flag p {
  margin: 4px 0 0;
}

.red-flag-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.sev-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 8px;
  border-radius: 10px;
}

.sev-pill.sev-high { color: var(--risk-high); background: var(--risk-high-bg); }
.sev-pill.sev-medium { color: var(--risk-medium); background: var(--risk-medium-bg); }
.sev-pill.sev-low { color: var(--risk-low); background: var(--risk-low-bg); }

.quote-unverified {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

blockquote.clause-quote {
  font-style: normal;
  margin: 4px 0 6px;
  border-left-color: var(--risk-medium);
  color: var(--text-main);
}

.clause-quote mark {
  background: var(--clause-highlight);
  color: inherit;
  padding: 1px 2px;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Deadlines & money */
ul.money-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.money-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 6px 0;
  font-size: 0.86rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.money-list li:last-child {
  border-bottom: none;
}

.money-list li span {
  color: var(--text-muted);
}

/* Questions */
ol.question-list {
  margin: 0;
  padding-left: 20px;
}

.question-list li {
  font-size: 0.86rem;
  padding: 3px 0;
}

.question-list li > span {
  margin-right: 6px;
}

.question-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.74rem;
  vertical-align: middle;
  transition: all var(--transition-fast);
}

.question-copy-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.decoder-report-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.decoder-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ==========================================================================
   INTERNSHIP AUTHENTICITY
   ========================================================================== */

.auth-fields { padding: 10px 12px; border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-glass); }
.auth-input {
  flex: 1 1 180px; min-width: 0; background: var(--bg-tertiary); border: 1px solid var(--border-subtle);
  color: var(--text-main); padding: 7px 10px; border-radius: 8px; font-size: .84rem; font-family: inherit; outline: none;
}
.auth-input:focus { border-color: var(--border-focus); }
.auth-input::placeholder { color: var(--text-dim); }

.auth-card { border-width: 1px; }
.auth-card.verdict-low { border-color: var(--risk-low); }
.auth-card.verdict-medium { border-color: var(--risk-medium); }
.auth-card.verdict-high { border-color: var(--risk-high); }

.auth-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.auth-top-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; flex: 1 1 220px; }
.auth-top-text h4 { margin: 0 !important; }
.auth-meta { font-size: .78rem; color: var(--text-muted); }

.trust-ring {
  --ring: var(--risk-medium);
  width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--bg-tertiary) 0);
}
.verdict-low .trust-ring { --ring: var(--risk-low); }
.verdict-medium .trust-ring { --ring: var(--risk-medium); }
.verdict-high .trust-ring { --ring: var(--risk-high); }
.trust-ring-inner {
  width: 74px; height: 74px; border-radius: 50%; background: var(--bg-secondary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.trust-ring-inner strong { font-size: 1.6rem; font-weight: 800; }
.trust-ring-inner span { font-size: .68rem; color: var(--text-dim); margin-top: 2px; }

.auth-group { margin-top: 12px; }
.auth-group-title { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.auth-signal { padding: 8px 0 8px 12px; border-left: 3px solid var(--border-subtle); font-size: .88rem; }
.auth-signal + .auth-signal { border-top: 1px solid var(--border-subtle); }
.auth-signal.negative { border-left-color: var(--risk-high); }
.auth-signal.positive { border-left-color: var(--risk-low); }
.auth-signal.not-scored { opacity: .75; border-left-style: dashed; }
.auth-signal p { margin: 4px 0 0; color: var(--text-muted); }
.auth-signal-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.auth-signal.negative .auth-signal-head > i { color: var(--risk-high); }
.auth-signal.positive .auth-signal-head > i { color: var(--risk-low); }
.auth-signal blockquote.clause-quote { margin-top: 6px; }
.auth-limits { margin-top: 12px; font-size: .76rem; color: var(--text-dim); }
.auth-card ol.question-list { margin-top: 6px; }

.auth-checks { list-style: none; margin: 4px 0 0; padding: 0; }
.auth-checks li { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: .84rem; color: var(--text-muted); }
.auth-checks li strong { color: var(--text-main); font-weight: 600; }
.auth-checks li i { margin-top: 3px; }
.auth-checks .check-ok i { color: var(--risk-low); }
.auth-checks .check-warn i { color: var(--risk-high); }
.auth-checks .check-unavailable i, .auth-checks .check-skipped i { color: var(--text-dim); }

.auth-sources { list-style: none; margin: 6px 0 0; padding: 0; }
.auth-sources li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: .8rem; padding: 2px 0; }
.auth-sources i { font-size: .65rem; color: var(--text-dim); }
.auth-sources a { color: var(--accent-ink); text-decoration: none; overflow-wrap: anywhere; }
.auth-sources a:hover { text-decoration: underline; }
.auth-source-host { color: var(--text-dim); font-size: .72rem; }

/* ==========================================================================
   APP PAGE
   ========================================================================== */

.app-page a { text-decoration: none; color: inherit; }
a.brand { color: var(--text-main); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.top-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 8px; font-size: .86rem; font-weight: 600;
  color: var(--text-muted); border: 1px solid var(--border-subtle); transition: color var(--transition-fast), border-color var(--transition-fast);
}
.top-link:hover { color: var(--text-main); border-color: var(--border-strong); }
.app-intro { padding: 8px 0 4px; }
.app-intro h2 { font-family: var(--font-heading); font-size: clamp(1.7rem, 3.2vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.app-intro p { color: var(--text-muted); max-width: 620px; margin-top: 8px; font-size: .98rem; }

#inputPanel { border-radius: var(--radius-xl); padding: 22px; }
.example-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.example-label { font-size: .82rem; color: var(--text-muted); margin-right: 4px; }
.example-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 7px; cursor: pointer; font: inherit;
  font-size: .8rem; font-weight: 600; color: var(--text-main); background: var(--bg-secondary); border: 1px solid var(--border-strong);
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.example-chip i { color: var(--text-dim); }
.example-chip:hover { border-color: var(--accent); }
.example-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.example-chip.active i { color: var(--accent); }

.loading strong { font-size: .95rem; color: var(--text-main); }
.loading .hint { margin-top: 2px; }
.report-wrap { border-radius: var(--radius-xl); padding: 20px; animation: reportIn .4s ease both; }
@keyframes reportIn { from { opacity: 0; transform: translateY(8px); } }
.trust-ring { transition: background .6s ease; }

@media (max-width: 600px) {
  .top-link span { display: none; }
  .brand span { display: none; }
  #inputPanel { padding: 16px; }
  .example-label { width: 100%; }
}

/* ---- tool tabs ---- */
.tool-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: var(--bg-tertiary); border-radius: var(--radius-lg); }
.tool-tab {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: none; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text-muted); font: inherit; text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.tool-tab > i { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .85rem; }
.tool-tab strong { display: block; font-size: .92rem; color: inherit; }
.tool-tab small { display: block; font-size: .76rem; color: var(--text-dim); }
.tool-tab:hover { color: var(--text-main); }
.tool-tab.active { background: var(--bg-secondary); color: var(--text-main); box-shadow: var(--shadow-sm); }
.tool-tab.active > i { background: var(--accent-soft); color: var(--accent-ink); }
.tool-panel { border-radius: var(--radius-xl); padding: 22px; }
.tool-panel[hidden] { display: none; }
.link-row { margin: 12px 0 0; }
.link-row .auth-input { flex: 1 1 320px; }

/* ---- internship type ---- */
.type-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 4px; }
.type-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font-size: .82rem; font-weight: 600; background: var(--bg-tertiary); color: var(--text-main); }
.type-chip.type-paid_internship { background: var(--risk-low-bg); color: var(--risk-low); }
.type-chip.type-training_or_paid_course { background: var(--risk-high-bg); color: var(--risk-high); }
.type-chip.type-unpaid_internship, .type-chip.type-agency_or_recruiter_post { background: var(--risk-medium-bg); color: var(--risk-medium); }
.type-block blockquote.clause-quote { margin: 6px 0 0; }

/* ---- agent research panel ---- */
.agent-panel { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.agent-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.agent-panel-head .auth-group-title i { color: var(--accent); }
.agent-total { font-size: .76rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.agent-list { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-glass); }
.agent-row + .agent-row { border-top: 1px solid var(--border-subtle); }
.agent-row > summary, .agent-summary {
  display: grid; grid-template-columns: 22px minmax(150px, 1.1fr) minmax(90px, 1fr) auto 14px; align-items: center; gap: 12px;
  padding: 10px 12px; list-style: none;
}
.agent-row > summary { cursor: pointer; }
.agent-row > summary::-webkit-details-marker { display: none; }
.agent-row > summary:hover { background: var(--bg-glass-active); }
.agent-status { font-size: .95rem; }
.agent-status.status-done { color: var(--risk-low); }
.agent-status.status-skipped { color: var(--text-dim); }
.agent-status.status-unavailable { color: var(--risk-medium); }
.agent-name { min-width: 0; }
.agent-name strong { display: block; font-size: .86rem; }
.agent-name small { display: block; font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-track { position: relative; height: 8px; border-radius: 4px; background: var(--bg-tertiary); overflow: hidden; }
.agent-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.agent-bar.status-unavailable { background: var(--risk-medium); opacity: .7; }
.agent-meta { font-size: .74rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.agent-chevron { font-size: .7rem; color: var(--text-dim); transition: transform var(--transition-fast); }
.agent-row[open] .agent-chevron { transform: rotate(180deg); }
.agent-detail { padding: 2px 12px 12px 46px; }
.agent-note { font-size: .8rem; color: var(--text-muted); margin-bottom: 6px; }
.agent-findings { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.agent-findings li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: .8rem; }
.agent-claim { color: var(--text-main); }
.agent-link { color: var(--accent-ink); font-size: .74rem; text-decoration: none; }
.agent-link:hover { text-decoration: underline; }
.stance-pill { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 5px; background: var(--bg-tertiary); color: var(--text-muted); white-space: nowrap; }
.stance-pill.tone-high { background: var(--risk-high-bg); color: var(--risk-high); }
.stance-pill.tone-medium { background: var(--risk-medium-bg); color: var(--risk-medium); }
.stance-pill.tone-low { background: var(--risk-low-bg); color: var(--risk-low); }
.agent-sources-title { font-size: .72rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.agent-panel > .hint { margin-top: 8px; }

@media (max-width: 600px) {
  /* Stack on phones: name, then timing, then the bar. */
  .agent-row > summary, .agent-summary { grid-template-columns: 20px 1fr 12px; gap: 4px 8px; }
  .agent-status { grid-column: 1; grid-row: 1; }
  .agent-name { grid-column: 2; grid-row: 1; }
  .agent-chevron { grid-column: 3; grid-row: 1; }
  .agent-meta { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
  .agent-track { grid-column: 2 / -1; grid-row: 3; }
  .agent-detail { padding-left: 12px; }
  .tool-panel { padding: 16px; }
  .tool-tab { padding: 10px; gap: 8px; }
  .tool-tab > i { display: none; }
}

/* ---- login ---- */
.auth-pending .page { visibility: hidden; }   /* the tool shows only after the login check */
.user-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-email { font-size: .8rem; color: var(--text-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.top-link { background: transparent; font-family: inherit; cursor: pointer; }

.auth-shell { max-width: 440px; margin: 0 auto; padding: 56px 20px 64px; }
.auth-card { padding: 28px; border-radius: var(--radius-xl); }
.auth-card h2 { font-family: var(--font-heading); font-weight: 600; font-size: 1.7rem; letter-spacing: -0.02em; margin: 0; }
.auth-sub { color: var(--text-muted); font-size: .92rem; margin: 6px 0 18px; }
.auth-sub a { color: var(--accent-ink); font-weight: 600; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-tertiary); border-radius: 10px; margin-bottom: 18px; }
.auth-tabs[hidden] { display: none; }
.auth-tab { border: none; background: transparent; color: var(--text-muted); font: inherit; font-size: .88rem; font-weight: 600; padding: 8px; border-radius: 7px; cursor: pointer; }
.auth-tab.active { background: var(--bg-secondary); color: var(--text-main); box-shadow: var(--shadow-sm); }
.auth-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin: 12px 0 6px; }
.auth-label[hidden], .auth-field[hidden] { display: none; }
.auth-field {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--bg-secondary);
  color: var(--text-main); font: inherit; font-size: .95rem; outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.auth-field:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-message { margin-top: 14px; padding: 10px 12px; border-radius: 9px; font-size: .86rem; background: var(--bg-tertiary); color: var(--text-main); }
.auth-message.error { background: var(--risk-high-bg); color: var(--risk-high); }
.auth-message.ok { background: var(--risk-low-bg); color: var(--risk-low); }
.auth-submit { width: 100%; justify-content: center; margin-top: 18px; padding: 11px 20px; }
.auth-links { display: flex; justify-content: center; margin-top: 14px; }
.auth-link { border: none; background: none; color: var(--accent-ink); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.auth-link[hidden] { display: none; }
.auth-link:hover { text-decoration: underline; }
.auth-note { text-align: center; margin-top: 14px; }

@media (max-width: 600px) {
  .user-email { display: none; }
  .auth-shell { padding-top: 28px; }
  .auth-card { padding: 20px; }
}

/* Motion off (follows the OS "reduce motion" setting) */
html[data-motion="off"] .report-wrap { animation: none; }
