/* ============================================================
   kirei-core.css  —  Kirei Analytics Suite shared design system
   Source of truth: insurance-claims-dashboard.html v2.0
   All tools link this file. Tool-specific styles stay in-file.
   ============================================================ */

/* ── Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* ── Design tokens ── */
:root {
  /* ── Direction 2: ink + sky-blue, matching the kireidata.com homepage.
     Color is otherwise reserved for status. Variable names are kept as
     -teal/-teal2/-gold etc. for backwards compatibility with every tool's
     existing class names (btn-teal, kpi-card.gold, td-good, …) — only the
     values changed, so no HTML/JS had to be touched to re-theme the suite. ── */

  /* Ink scale (brand ink) */
  --ink:  #101828;
  --ink2: #182636;
  --ink3: #2a4f6b;

  /* Surface scale (sky-blue tinted paper, matching the homepage) */
  --cream:  #f7fbff;
  --cream2: #eaf6ff;

  /* "Teal" — the one decorative / brand accent, now the homepage's blue */
  --teal:     #2f8fe0;
  --teal2:    #1f7dcc;
  --teal-dim: rgba(47,143,224,0.09);

  /* Gold — amber "watch" STATUS tier only (AA on white ≈ 4.9:1).
     Never used decoratively; blue is the brand accent. */
  --gold:     #8a6a00;
  --gold2:    #a07d00;
  --gold-dim: rgba(138,106,0,0.12);

  /* Status semantics — always paired with a symbol + word, never color alone */
  --good: #0a6b50;
  --warn: #8a6a00;
  --bad:  #b3261e;

  /* Legacy alias */
  --rust: #b3261e;

  /* Text — AA contrast on white/cream */
  --text:   #101828;
  --muted:  #5b6472;
  --muted2: #344054;

  /* Borders */
  --border:  #dbe4ee;
  --border2: #eaf2fa;

  /* Typography — serif headings kept, mono body → plainer sans */
  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Source Sans 3', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono:  'DM Mono', ui-monospace, monospace;

  /* Focus ring (accessibility) */
  --focus: var(--teal);

  /* Elevation */
  --shadow:    0 1px 8px  rgba(16,24,40,0.08);
  --shadow-lg: 0 4px 24px rgba(16,24,40,0.12);
}

/* ── Base ── */
html, body {
  height: 100%;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Links — teal, underlined on hover for non-color affordance */
a { color: var(--teal); }
a:hover { color: var(--teal2); }

/* Visible focus ring for keyboard users (WCAG 2.4.7) */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--focus);
  border-radius: 5px;
}
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--focus);
}

/* ── App shell ── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header — light, airy, matching the homepage nav ── */
header {
  background: #fff;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-wrap { display: flex; align-items: center; gap: 16px; }

.logo-emblem {
  width: 44px; height: 44px;
  background: var(--teal-dim);
  border: 2px solid var(--teal);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal); font-size: 20px;
  position: relative;
  flex-shrink: 0;
}
.logo-emblem::after {
  content: '';
  position: absolute;
  width: 36px; height: 36px;
  border: 1px solid rgba(47,143,224,0.3);
  border-radius: 50%;
}

.logo-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.logo-title em { font-style: italic; color: var(--teal2); }

.logo-sub {
  font-size: 10px;
  color: var(--teal2);
  letter-spacing: 0.18em;
  margin-top: 2px;
  text-transform: uppercase;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.header-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--teal-dim);
  border: 1px solid rgba(47,143,224,0.25);
  border-radius: 4px;
  font-size: 11px;
  color: var(--teal2);
  letter-spacing: 0.1em;
}
.header-badge span { color: var(--ink); font-weight: 700; }

/* Status dot (used in badges that show file-loaded state) */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
  flex-shrink: 0;
}
.status-dot.active { background: var(--teal2); box-shadow: 0 0 8px rgba(31,125,204,0.5); }
.status-dot.warn   { background: var(--gold);  box-shadow: 0 0 8px rgba(181,137,30,0.5); }
.status-dot.error  { background: var(--rust); }

/* ── Main content area ── */
main {
  flex: 1;
  padding: 36px 40px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* ── Sidebar layout (tools with persistent sidebar) ── */
.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 76px);
}
.input-sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 28px 72px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--cream);
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  overflow-y: auto;
  align-self: start;
}
.content-area { padding: 28px 36px; overflow: auto; min-width: 0; }
.sidebar-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.sidebar-section { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 860px) {
  .main-layout { grid-template-columns: 1fr; }
  .input-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
}
@media print {
  .input-sidebar { display: none !important; }
  .main-layout   { display: block !important; }
  .content-area  { padding: 0 !important; }

  /* ── PDF / print readability ── */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .suite-nav, .no-print, .no-print-btn { display: none !important; }

  /* High-contrast headings & values */
  .kpi-value, .sr-kpi-value, .breakdown-title, .kpi-label, .sr-kpi-label { color: #000 !important; }
  .kpi-meta, .data-bar-value { color: #111 !important; }

  /* Tables: black rules, larger cells, no light-gray text */
  .data-table { font-size: 11pt; }
  .data-table th {
    background: #e6e6e6 !important; color: #000 !important;
    border-bottom: 2px solid #000 !important; font-weight: 700;
  }
  .data-table td { color: #000 !important; border-bottom: 1px solid #888 !important; padding: 8px 14px; }
  .data-table tr:hover td { background: transparent !important; }

  /* Status keeps meaning in print via symbol + label; deepen the ink for contrast */
  .td-good, .status-pill.great { color: #05503b !important; }
  .td-warn, .status-pill.good  { color: #6b5200 !important; }
  .td-bad,  .status-pill.watch { color: #8f1a14 !important; }
  .status-pill { border: 1px solid currentColor; background: transparent !important; }

  /* Cards: crisp borders instead of soft shadows */
  .kpi-card, .breakdown-card, .sr-kpi { box-shadow: none !important; border-color: #888 !important; }
}

/* ── Section labels ── */
.section-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Drop zone ── */
.drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.drop-zone::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--teal-dim), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
.drop-zone.drag-over,
.drop-zone.active {
  border-color: var(--teal);
  border-style: solid;
  box-shadow: 0 0 0 4px var(--teal-dim);
}
.drop-zone.drag-over::before,
.drop-zone.active::before { opacity: 1; }

.drop-zone input[type=file] { display: none; }

.drop-zone.loaded {
  border-color: rgba(47,143,224,0.45);
  border-style: solid;
  background: var(--teal-dim);
}

/* Drop zone inner elements */
.drop-icon-wrap {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  transition: all 0.2s;
}
.drop-zone.active .drop-icon-wrap,
.drop-zone.drag-over .drop-icon-wrap { border-color: var(--teal); background: var(--teal-dim); }

.drop-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.drop-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}
.drop-sub em { color: var(--teal); font-style: normal; font-weight: 500; }

/* Compact drop zone (sidebar variant) */
.drop-zone.compact {
  padding: 20px 14px;
  border-radius: 8px;
}
.drop-zone.compact .drop-title { font-size: 13px; margin-bottom: 4px; }
.drop-zone.compact .drop-sub   { font-size: 11px; margin-bottom: 12px; }
.drop-zone.compact .drop-icon-wrap { width: 40px; height: 40px; font-size: 18px; margin-bottom: 10px; }

/* Small muted caption below a drop zone or field (file requirements, tips) */
.sidebar-note { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.sidebar-note strong { color: var(--ink3); }
.sidebar-note em { color: var(--teal); font-style: normal; font-weight: 500; }

/* File queue rows */
.file-queue { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: border-color 0.15s;
}
.file-row.parsed { border-color: rgba(47,143,224,0.35); }
.file-row.error  { border-color: rgba(185,28,28,0.35); }

.file-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-pending { background: var(--border); }
.dot-parsing { background: var(--gold); animation: blink 0.8s ease infinite; }
.dot-parsed  { background: var(--teal); }
.dot-error   { background: var(--rust); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.file-name { flex: 1; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.file-err  { font-size: 11px; color: var(--rust); flex-shrink: 0; }
.file-rm {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 15px; padding: 2px 5px;
  border-radius: 3px; transition: all 0.1s;
}
.file-rm:hover { color: var(--rust); background: rgba(185,28,28,0.07); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: 6px; border: none;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--border) !important; color: var(--muted) !important; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-gold    { background: var(--teal);  color: #fff; font-weight: 600; }
.btn-gold:hover:not(:disabled)    { background: var(--teal2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(47,143,224,0.3); }

.btn-teal    { background: var(--teal);  color: #fff; font-weight: 600; }
.btn-teal:hover:not(:disabled)    { background: var(--teal2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(47,143,224,0.3); }

.btn-ink     { background: var(--ink);   color: #fff; font-weight: 600; }
.btn-ink:hover:not(:disabled)     { background: var(--ink2);  transform: translateY(-1px); }

.btn-rust    { background: var(--rust);  color: #fff; font-weight: 600; }
.btn-rust:hover:not(:disabled)    { background: #9b1616; transform: translateY(-1px); }

.btn-outline { background: #fff; color: var(--ink3); border: 1.5px solid var(--border); box-shadow: var(--shadow); }
.btn-outline:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }

.btn-full { width: 100%; justify-content: center; }
.btn-group { display: flex; flex-direction: column; gap: 6px; }
.btn-row   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Action row (below drop zone) ── */
.action-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; gap: 12px; flex-wrap: wrap;
}

/* ── KPI cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--border);
}
.kpi-card.gold::before   { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.kpi-card.teal::before   { background: linear-gradient(90deg, var(--teal), var(--teal2)); }
.kpi-card.rust::before   { background: var(--rust); }
.kpi-card.ink::before    { background: linear-gradient(90deg, var(--ink), var(--ink3)); }
.kpi-card.purple::before { background: linear-gradient(90deg, var(--purple,#7c5cbf), #a07dd6); }
/* accent-* aliases: same tiles, used by tools that adopted this naming convention */
.kpi-card.accent-teal::before  { background: linear-gradient(90deg, var(--teal), var(--teal2)); }
.kpi-card.accent-rust::before  { background: var(--rust); }
.kpi-card.accent-amber::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.kpi-card.accent-gold::before  { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.kpi-card.accent-ink::before   { background: linear-gradient(90deg, var(--ink), var(--ink3)); }
.kpi-card.accent-purple::before{ background: linear-gradient(90deg, #7a5a8a, #9c7bae); }

.kpi-label {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--serif);
  font-size: 28px; font-weight: 900; line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.kpi-value.lg { font-size: 40px; }
.kpi-meta { font-size: 11px; color: var(--muted); }

/* ── Breakdown / data tables ── */
.breakdown-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.breakdown-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.breakdown-title { font-family: var(--serif); font-size: 14px; font-weight: 700; }
.breakdown-sub   { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 8px 14px;
  background: var(--cream);
  text-align: left;
  font-size: 10px; letter-spacing: 0.1em; color: var(--muted);
  border-bottom: 1px solid var(--border2);
  font-weight: 500;
  white-space: nowrap;
}
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border2);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--cream2); }
.td-num   { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.td-good  { color: var(--teal); font-weight: 600; }
.td-warn  { color: #8a6a00; font-weight: 600; }
.td-bad   { color: var(--rust); font-weight: 600; }
.td-muted { color: var(--muted); }

/* Mini bar (inline in table cells) */
.mini-bar-track { height: 5px; border-radius: 3px; background: var(--cream2); }
.mini-bar-fill  { height: 100%; border-radius: 3px; background: var(--teal); }
.mini-bar-fill.teal { background: var(--teal); }

/* ── Status / badge pills ── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 500;
  padding: 3px 10px; border-radius: 20px;
}
.status-pill.great { background: rgba(47,143,224,0.10); color: var(--teal); }
.status-pill.good  { background: rgba(181,137,30,0.15); color: #8a6a00; }
.status-pill.watch { background: rgba(185,28,28,0.10);  color: var(--rust); }

/* ── Data info bar — light card, matching the homepage's note-box ── */
.data-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--cream2); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-bottom: 24px;
  font-family: var(--sans);
}
.data-bar-segment {
  display: flex; flex-direction: column;
  padding: 12px 20px; gap: 3px; flex: 1; min-width: 0;
}
.data-bar-segment + .data-bar-segment { border-left: 1px solid var(--border); }
.data-bar-label  { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal2); }
.data-bar-value  { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-bar-segment.accent .data-bar-value { color: var(--teal); }
.data-bar-segment.wide { flex: 2; }

/* ── Provider filter pills (shared look-ahead) ── */
.prov-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.prov-pill {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.03em;
  padding: 4px 11px; border-radius: 14px;
  border: 1px solid var(--border); background: #fff; color: var(--muted2);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.prov-pill:hover { border-color: var(--teal); color: var(--teal); }
.prov-pill.active, .prov-pill.all-pill.active, .prov-pill.all.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ── Progress / spinner ── */
.progress-bar  { height: 2px; background: var(--cream2); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal2), var(--teal)); border-radius: 2px; transition: width 0.4s; width: 0%; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--teal);
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.fade-up { animation: fadeUp 0.35s ease forwards; }

/* ── Log box ── */
.log-box {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px; max-height: 120px; overflow-y: auto;
  font-size: 10px; line-height: 1.7; color: var(--muted);
}
.log-entry  { display: flex; gap: 8px; }
.log-step   { color: var(--teal); min-width: 70px; flex-shrink: 0; }
.log-warn .log-step { color: var(--gold); }
.log-err  .log-step { color: var(--rust); }

/* ── Export / action footer strip — light card, matching the homepage ── */
.export-footer {
  background: var(--cream2); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 32px;
}
.export-text { color: var(--muted); font-size: 12px; flex: 1; min-width: 180px; }
.export-text strong { color: var(--ink); font-family: var(--serif); font-size: 14px; display: block; margin-bottom: 3px; }
.export-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Suite nav bar — light, matching the homepage nav ── */
.suite-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 2px solid var(--teal);
  display: flex; align-items: center;
  padding: 0 24px; height: 48px; gap: 0;
  font-family: var(--sans);
  box-shadow: 0 -2px 16px rgba(16,24,40,0.08);
}
.suite-nav-tools { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; }
.suite-nav-link {
  color: var(--muted);
  font-size: 9px; letter-spacing: 0.1em; text-decoration: none;
  padding: 6px 10px; border-radius: 4px;
  transition: all 0.15s;
  text-transform: uppercase; white-space: nowrap;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.suite-nav-link:hover { color: var(--ink); background: var(--cream2); border-color: var(--border); }
.suite-nav-link.active { color: var(--teal2); border-color: rgba(47,143,224,0.35); background: rgba(47,143,224,0.10); }
.suite-nav-divider { width: 1px; height: 20px; background: var(--border); margin: 0 6px; flex-shrink: 0; }
.suite-nav-period {
  display: flex; align-items: center; gap: 8px;
  font-size: 9px; letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  margin-left: 8px;
}
.suite-nav-period-label { text-transform: uppercase; color: var(--teal2); }
#navDateValue { color: var(--ink); transition: color 0.3s; }
#navDateValue.empty { color: var(--muted); font-style: italic; }

/* Ensure nav doesn't overlap page content */
body { padding-bottom: 56px !important; }

/* ── Shared utility: kpi-sub ── */
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* ── Shared utility: layout helpers ── */
.one-col { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.two-col  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ── Shared utility: multi-file queue ── */
.fq-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 7px;
  margin-top: 6px;
}
.fq-name { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fq-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.fq-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fq-status {
  font-size: 10px; font-weight: 500; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.fq-pending { background: var(--cream2); color: var(--muted); }
.fq-ok      { background: rgba(47,143,224,0.1); color: var(--teal); }
.fq-err     { background: rgba(185,28,28,0.1);  color: var(--rust); }
.fq-remove, .remove-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 2px 5px; border-radius: 3px; transition: all 0.1s;
}
.fq-remove:hover, .remove-btn:hover { color: var(--rust); background: rgba(185,28,28,0.07); }

/* ── Shared PDF section picker modal ── */
.kirei-pdf-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(17,24,39,0.55);
  display: none; align-items: center; justify-content: center;
}
.kirei-pdf-overlay.open { display: flex; }
.kirei-pdf-modal {
  background: #fff; border-radius: 14px;
  box-shadow: 0 24px 64px rgba(17,24,39,0.22);
  width: 560px; max-width: 95vw; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.kirei-pdf-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.kirei-pdf-title { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--ink); }
.kirei-pdf-title em { font-style: italic; color: var(--teal2); }
.kirei-pdf-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.05em; margin-top: 3px; }
.kirei-pdf-close {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 20px; padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.kirei-pdf-close:hover { background: var(--cream2); color: var(--ink); }
.kirei-pdf-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.kirei-pdf-selall { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.kirei-pdf-selall button {
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 4px; border: 1px solid var(--border);
  background: transparent; color: var(--muted2); cursor: pointer; transition: all 0.1s;
}
.kirei-pdf-selall button:hover { border-color: var(--teal); color: var(--teal); }
.kirei-pdf-selall-count { font-size: 11px; color: var(--muted); margin-left: 4px; }
.kirei-pdf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kirei-pdf-card {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 12px 14px; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; user-select: none;
}
.kirei-pdf-card:hover  { border-color: var(--teal); background: var(--teal-dim); }
.kirei-pdf-card.selected { border-color: var(--teal); background: var(--teal-dim); }
.kirei-pdf-check {
  width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; background: #fff; transition: all 0.15s;
}
.kirei-pdf-card.selected .kirei-pdf-check { background: var(--teal); border-color: var(--teal); }
.kirei-pdf-card-name { font-size: 12px; font-weight: 600; color: var(--ink); letter-spacing: 0.03em; }
.kirei-pdf-card-desc { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.kirei-pdf-orient-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 11px; color: var(--muted);
}
.kirei-pdf-orient-btn {
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.06em;
  padding: 5px 14px; border-radius: 5px; border: 1.5px solid var(--border);
  background: #fff; color: var(--muted2); cursor: pointer; transition: all 0.15s;
}
.kirei-pdf-orient-btn.active { border-color: var(--ink3); background: var(--ink3); color: #fff; }
.kirei-pdf-progress {
  display: none; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 10px;
}
.kirei-pdf-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--teal);
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
.kirei-pdf-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #f8f9fb;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  header { padding: 16px 20px; }
  main   { padding: 24px 20px; }
  .content-area { padding: 20px 16px; }
}

/* ── Letter-mark tile (replaces emoji tool/section icons) ── */
.tool-mark {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--teal-dim);
  border: 1px solid var(--teal);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 17px;
  letter-spacing: 0.01em;
}
.tool-mark.on-ink { background: var(--teal); border-color: var(--teal); color: #fff; }
.tool-mark.sm { width: 40px; height: 40px; font-size: 15px; border-radius: 8px; }
.tool-mark.lg { width: 52px; height: 52px; font-size: 19px; }

/* Status text that always pairs a symbol + word with color (colorblind-safe) */
.stat-good, .stat-warn, .stat-bad {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.stat-good { color: var(--good); }
.stat-warn { color: var(--warn); }
.stat-bad  { color: var(--bad); }

/* Reduced-motion: honor user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
