*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  line-height: var(--line-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  transition: background var(--motion-base), color var(--motion-base);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--line-tight);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--color-text-primary);
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
input, select, textarea, button { font-family: inherit; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--color-text-muted); }
.mono { font-family: var(--font-mono); }
.pos { color: var(--color-success); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: var(--size-button-height);
  padding-inline: var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--motion-fast), background var(--motion-fast),
    border-color var(--motion-fast), color var(--motion-fast);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-accent-strong);
  color: var(--color-accent-text);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--color-accent-primary); transform: translateY(-1px); }

.btn-ghost { background: var(--color-bg-elevated); color: var(--color-text-primary); border-color: var(--color-border-default); }
.btn-ghost:hover { border-color: var(--color-border-strong); }

.btn-quiet { background: transparent; color: var(--color-text-secondary); }
.btn-quiet:hover { background: var(--color-bg-soft); color: var(--color-text-primary); }

.btn-success { background: var(--color-success); color: var(--color-on-accent); }
.btn-success:hover { filter: brightness(1.05); }

.btn-sm { height: 2.2rem; padding-inline: var(--space-sm); font-size: var(--font-size-xs); }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--motion-fast), border-color var(--motion-fast), background var(--motion-fast);
}
.icon-btn:hover { color: var(--color-text-primary); border-color: var(--color-border-strong); background: var(--color-bg-soft); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--font-size-md);
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.brand-mark {
  position: relative;
  width: 2.1rem; height: 2.1rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-strong));
  flex-shrink: 0;
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 0.55rem 0.62rem;
  border-left: 2px solid var(--color-on-accent);
  border-bottom: 2px solid var(--color-on-accent);
  border-radius: 0 0 0 2px;
  transform: rotate(-45deg) translate(1px, -1px);
}
.brand small {
  display: block;
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.avatar {
  width: 2.4rem; height: 2.4rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--font-size-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent-primary);
  flex-shrink: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--color-bg-soft);
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-default);
  cursor: default;
}
.chip.click { background: var(--color-bg-soft); cursor: pointer; }
.chip.active { background: var(--color-accent-soft); border-color: var(--color-accent-strong); color: var(--color-accent-primary); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-semibold);
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.badge.is-success { background: var(--color-success-soft); color: var(--color-success); }
.badge.is-warn { background: var(--color-warn-soft); color: var(--color-warn); }
.badge.is-risk { background: var(--color-risk-soft); color: var(--color-risk); }
.badge.is-info { background: var(--color-info-soft); color: var(--color-info); }
.badge.is-accent { background: var(--color-accent-soft); color: var(--color-accent-primary); }
.badge.is-muted { background: var(--color-bg-soft); color: var(--color-text-muted); }

.tl {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-semibold);
}
.tl::before {
  content: "";
  width: 0.7rem; height: 0.7rem;
  border-radius: var(--radius-full);
  background: var(--color-text-muted);
}
.tl.g { color: var(--color-success); }
.tl.g::before { background: var(--color-success); box-shadow: 0 0 0 0.18rem var(--color-success-soft); }
.tl.a { color: var(--color-warn); }
.tl.a::before { background: var(--color-warn); box-shadow: 0 0 0 0.18rem var(--color-warn-soft); }
.tl.r { color: var(--color-risk); }
.tl.r::before { background: var(--color-risk); box-shadow: 0 0 0 0.18rem var(--color-risk-soft); }

.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--color-accent-soft);
  color: var(--color-accent-primary);
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-semibold);
}

.app { display: grid; grid-template-columns: 16.5rem 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-lg) var(--space-md);
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border-default);
  z-index: var(--z-nav);
  overflow-y: auto;
}
.sidebar .brand { padding: var(--space-xs) var(--space-sm) var(--space-md); }

.side-label {
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: var(--space-md) var(--space-sm) var(--space-2xs);
}

.side-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: transparent;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.side-link:hover { background: var(--color-bg-soft); color: var(--color-text-primary); }
.side-link.active { background: var(--color-accent-soft); color: var(--color-accent-primary); }
.side-link svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.side-link .count {
  margin-left: auto;
  font-size: var(--font-size-2xs);
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-full);
}
.side-link.active .count { background: var(--color-bg-elevated); }

.side-foot {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-default);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.side-foot strong { display: block; font-size: var(--font-size-xs); font-family: var(--font-display); }
.side-foot span { font-size: var(--font-size-2xs); color: var(--color-text-muted); }

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

.topbar {
  position: sticky; top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 4rem;
  padding-inline: var(--space-xl);
  background: color-mix(in srgb, var(--color-bg-primary) 84%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--color-border-default);
}
.topbar .hamburger { display: none; }

.crumbs { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--font-size-sm); color: var(--color-text-muted); }
.crumbs strong { color: var(--color-text-primary); font-family: var(--font-display); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-sm); }

.search-mini {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  height: 2.5rem;
  padding-inline: var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  min-width: 15rem;
}
.search-mini input { border: none; background: transparent; color: var(--color-text-primary); font-size: var(--font-size-sm); width: 100%; }
.search-mini input:focus { outline: none; }

.app-scroll { flex: 1; padding: var(--space-xl); max-width: var(--size-content); width: 100%; margin-inline: auto; }

.screen { display: none; }
.screen.active { display: block; animation: screen-in var(--motion-base) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.page-head h1 { font-size: var(--font-size-2xl); }
.page-head p { color: var(--color-text-muted); margin-top: var(--space-2xs); font-size: var(--font-size-sm); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-primary);
  margin-bottom: var(--space-xs);
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); margin-bottom: var(--space-lg); }
.stat { background: var(--color-bg-elevated); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); padding: var(--space-lg); }
.stat .l { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--font-size-xs); color: var(--color-text-muted); margin-bottom: var(--space-xs); }
.stat .n { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--font-size-xl); letter-spacing: -0.02em; }
.stat .d { font-size: var(--font-size-2xs); font-weight: var(--weight-semibold); color: var(--color-success); margin-top: var(--space-2xs); }
.stat .d.warn { color: var(--color-warn); }

.panel { background: var(--color-bg-elevated); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: var(--space-lg); border-bottom: 1px solid var(--color-border-default); }
.panel-head h2 { font-size: var(--font-size-md); display: flex; align-items: center; gap: var(--space-xs); }
.panel-body { padding: var(--space-lg); }

.toolbar { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-md); }
.toolbar .spacer { margin-left: auto; }
.filters { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }

.table-wrap { background: var(--color-bg-elevated); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--font-size-2xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: var(--weight-semibold);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-secondary);
  white-space: nowrap;
}
.table td { padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--color-border-default); color: var(--color-text-secondary); vertical-align: middle; }
.table tbody tr { cursor: pointer; background: transparent; transition: background var(--motion-fast); }
.table tbody tr:hover { background: var(--color-bg-soft); }
.table td.num { font-family: var(--font-mono); text-align: right; }
.table th.num { text-align: right; }

.cell-name { display: flex; align-items: center; gap: var(--space-sm); }
.cell-name .glyph {
  width: 2rem; height: 2rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--font-size-2xs);
  background: var(--color-accent-soft);
  color: var(--color-accent-primary);
  flex-shrink: 0;
}
.cell-name strong { display: block; font-family: var(--font-display); color: var(--color-text-primary); font-size: var(--font-size-sm); }
.cell-name span { font-size: var(--font-size-2xs); color: var(--color-text-muted); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-accent-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  margin-bottom: var(--space-md);
  padding: 0;
}

.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--space-lg); align-items: start; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--color-border-default); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); overflow: hidden; }
.kv div { background: var(--color-bg-elevated); padding: var(--space-sm) var(--space-md); }
.kv .k { font-size: var(--font-size-2xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.kv .v { font-size: var(--font-size-sm); font-weight: var(--weight-medium); margin-top: 0.1rem; color: var(--color-text-primary); }

.steps { display: flex; flex-direction: column; gap: var(--space-xs); }
.step-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  font-size: var(--font-size-sm);
}
.step-row .dot { width: 1.4rem; height: 1.4rem; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-row.done .dot { background: var(--color-success); color: var(--color-on-accent); }
.step-row.pending .dot { background: var(--color-warn-soft); color: var(--color-warn); }
.step-row.blocked .dot { background: var(--color-risk-soft); color: var(--color-risk); }
.step-row .meta { margin-left: auto; font-size: var(--font-size-2xs); color: var(--color-text-muted); }

.timeline { position: relative; display: flex; flex-direction: column; gap: var(--space-md); padding-left: var(--space-lg); }
.timeline::before { content: ""; position: absolute; left: 0.5rem; top: 0.4rem; bottom: 0.4rem; width: 2px; background: var(--color-border-default); }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: calc(-1 * var(--space-lg) + 0.15rem); top: 0.25rem; width: 0.75rem; height: 0.75rem; border-radius: var(--radius-full); background: var(--color-accent-primary); border: 2px solid var(--color-bg-elevated); }
.tl-item strong { font-family: var(--font-display); font-size: var(--font-size-sm); }
.tl-item span { display: block; font-size: var(--font-size-2xs); color: var(--color-text-muted); }
.tl-item p { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: 0.15rem; }

.review-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: start; }

.doc-preview {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xs);
  font-size: var(--font-size-xs);
}
.doc-preview .doc-h { display: flex; align-items: center; justify-content: space-between; padding-bottom: var(--space-sm); border-bottom: 2px solid var(--color-border-default); margin-bottom: var(--space-md); }
.doc-preview .doc-h strong { font-family: var(--font-display); font-size: var(--font-size-sm); }
.doc-line { display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px dashed var(--color-border-default); }
.doc-line b { font-weight: var(--weight-semibold); color: var(--color-text-primary); }
.doc-hl { background: color-mix(in srgb, var(--color-accent-primary) 16%, transparent); border-radius: 0.2rem; padding: 0 0.15rem; }
.doc-meeting p { line-height: var(--line-relaxed); color: var(--color-text-secondary); margin-bottom: var(--space-sm); }

.extract-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.ef-row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-sm); align-items: center; }
.ef-field { display: flex; flex-direction: column; gap: 0.2rem; }
.ef-field label { font-size: var(--font-size-2xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.ef-field .val { font-size: var(--font-size-sm); font-weight: var(--weight-semibold); }
.conf { font-size: var(--font-size-2xs); font-weight: var(--weight-semibold); padding: 0.15rem 0.45rem; border-radius: var(--radius-full); }
.conf.high { background: var(--color-success-soft); color: var(--color-success); }
.conf.med { background: var(--color-warn-soft); color: var(--color-warn); }
.conf.low { background: var(--color-risk-soft); color: var(--color-risk); }

.draft-editor {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  font-size: var(--font-size-sm);
  line-height: var(--line-relaxed);
  color: var(--color-text-secondary);
  min-height: 14rem;
  white-space: pre-wrap;
}
.draft-editor h4 { font-size: var(--font-size-sm); margin-bottom: var(--space-2xs); color: var(--color-text-primary); }
.draft-editor .para { margin-bottom: var(--space-md); }

.review-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-default);
  flex-wrap: wrap;
}
.review-actions .spacer { margin-left: auto; }

.confirm-note {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  margin-top: var(--space-md);
}

.chase-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border-default);
}
.chase-row:first-child { border-top: none; }
.doc-chips { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-2xs);
  font-weight: var(--weight-medium);
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-primary);
  color: var(--color-text-muted);
}
.doc-chip.got { background: var(--color-success-soft); color: var(--color-success); border-color: transparent; }
.doc-chip.wait { background: var(--color-warn-soft); color: var(--color-warn); border-color: transparent; }
.doc-chip.over { background: var(--color-risk-soft); color: var(--color-risk); border-color: transparent; }

.meter { height: 0.5rem; border-radius: var(--radius-full); background: var(--color-bg-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--color-accent-strong); }

.field { display: flex; flex-direction: column; gap: var(--space-2xs); margin-bottom: var(--space-md); }
.field label { font-size: var(--font-size-xs); font-weight: var(--weight-semibold); color: var(--color-text-secondary); }
.input, .select, .textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}
.input, .select { height: var(--size-button-height); }
.textarea { min-height: 6rem; resize: vertical; line-height: var(--line-relaxed); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--color-accent-primary); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  margin-bottom: var(--space-sm);
}
.toggle-row .t-copy strong { display: block; font-family: var(--font-display); font-size: var(--font-size-sm); }
.toggle-row .t-copy span { font-size: var(--font-size-2xs); color: var(--color-text-muted); }
.switch { position: relative; width: 2.75rem; height: 1.6rem; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; background: transparent; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: var(--radius-full); background: var(--color-border-strong); transition: background var(--motion-fast); }
.switch .track::after { content: ""; position: absolute; top: 0.18rem; left: 0.18rem; width: 1.24rem; height: 1.24rem; border-radius: var(--radius-full); background: var(--color-on-accent); transition: transform var(--motion-fast); }
.switch input:checked + .track { background: var(--color-accent-strong); }
.switch input:checked + .track::after { transform: translateX(1.15rem); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: start; }
.stack { display: flex; flex-direction: column; gap: var(--space-lg); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-sm); padding: var(--space-2xl); color: var(--color-text-muted); }
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg-strong);
  color: var(--color-on-strong);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--motion-base), opacity var(--motion-base);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .ic { color: var(--color-success); display: inline-flex; }

.drawer-backdrop { display: none; position: fixed; inset: 0; background: var(--surface-veil); z-index: var(--z-panel); }
.drawer-backdrop.open { display: block; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid, .review-split, .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 16.5rem; transform: translateX(-100%); transition: transform var(--motion-base); z-index: var(--z-modal); }
  .sidebar.open { transform: none; }
  .topbar .hamburger { display: inline-flex; }
}

@media (max-width: 640px) {
  .app-scroll { padding: var(--space-md); }
  .topbar { padding-inline: var(--space-md); }
  .search-mini { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chase-row { grid-template-columns: 1fr; }
  .table th:nth-child(n + 4), .table td:nth-child(n + 4) { display: none; }
}

.src {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--font-size-2xs);
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}
.src svg { width: 0.85rem; height: 0.85rem; flex-shrink: 0; color: var(--color-accent-primary); }
.src b { color: var(--color-text-secondary); font-weight: var(--weight-semibold); }

.conn-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.conn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  background: var(--color-bg-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--weight-medium);
}
.conn .live-dot { width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); background: var(--color-success); flex-shrink: 0; }

.auto-card {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}
.auto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border-default);
}
.auto-head strong { font-family: var(--font-display); font-size: var(--font-size-md); display: block; }
.auto-head .sub { font-size: var(--font-size-2xs); color: var(--color-text-muted); }

.flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: var(--space-lg); }
.flow-node {
  flex: 1;
  min-width: 7.5rem;
  text-align: center;
  padding: var(--space-sm);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
}
.flow-node .ic {
  width: 2.1rem; height: 2.1rem;
  margin: 0 auto var(--space-xs);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent-soft); color: var(--color-accent-primary);
}
.flow-node.ai .ic { background: var(--color-accent-strong); color: var(--color-on-accent); }
.flow-node.review .ic { background: var(--color-warn-soft); color: var(--color-warn); }
.flow-node strong { display: block; font-size: var(--font-size-xs); font-family: var(--font-display); }
.flow-node span { font-size: var(--font-size-2xs); color: var(--color-text-muted); }
.flow-arrow { display: flex; align-items: center; color: var(--color-border-strong); padding-inline: var(--space-2xs); flex-shrink: 0; }

.cap-feed { display: flex; flex-direction: column; }
.cap { display: flex; align-items: flex-start; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--color-border-default); }
.cap:first-child { border-top: none; }
.cap .ic { width: 2rem; height: 2rem; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: var(--color-bg-soft); color: var(--color-text-secondary); flex-shrink: 0; }
.cap-body { flex: 1; min-width: 0; }
.cap-body strong { font-family: var(--font-display); font-size: var(--font-size-sm); }
.cap-body p { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: 0.1rem; }
.cap-arrow { font-size: var(--font-size-2xs); color: var(--color-accent-primary); font-weight: var(--weight-semibold); white-space: nowrap; align-self: center; }
