:root {
  --bg: #07111a;
  --bg-2: #0d1823;
  --panel: rgba(9, 19, 29, 0.78);
  --panel-strong: rgba(11, 21, 31, 0.94);
  --border: rgba(144, 176, 201, 0.16);
  --text: #ebf0f3;
  --muted: #8fa8ba;
  --accent: #ff7b3d;
  --accent-soft: rgba(255, 123, 61, 0.12);
  --teal: #24d4c0;
  --lime: #97e66c;
  --danger: #ff5e63;
  --warn: #f5bf4f;
  --ok: #6de49d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 123, 61, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(36, 212, 192, 0.16), transparent 34%),
    linear-gradient(180deg, #061019 0%, #081520 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
  overflow-x: hidden;
}

body.drawer-open,
body.modal-open {
  overflow: hidden;
}

.backdrop,
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.backdrop {
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 123, 61, 0.08), transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(36, 212, 192, 0.08), transparent 28%),
    radial-gradient(circle at 40% 100%, rgba(109, 228, 157, 0.08), transparent 30%);
  filter: blur(10px);
}

.noise {
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 100%);
}

.page-shell {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.hero-panel,
.panel,
.drawer {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(9, 18, 28, 0.86), rgba(10, 24, 38, 0.74));
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -12% -50% auto;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(255, 123, 61, 0.15), transparent 70%);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
}

.hero-copy h1,
.panel h2,
.drawer h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 0.94;
  max-width: 9ch;
}

.hero-text,
.panel-caption,
.status-meta,
.metric-meta,
.feed-subline,
.detail-meta,
.chunk-meta,
.run-cell {
  color: var(--muted);
}

.hero-text {
  max-width: 54ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.75;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
  font-weight: 600;
}

.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 10px rgba(109, 228, 157, 0.08);
}

.status-pill.is-warn::before {
  background: var(--warn);
  box-shadow: 0 0 0 10px rgba(245, 191, 79, 0.08);
}

.status-pill.is-danger::before {
  background: var(--danger);
  box-shadow: 0 0 0 10px rgba(255, 94, 99, 0.08);
}

.hero-metrics,
.corpus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.corpus-card,
.compact-empty {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 120px;
}

.compact-empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -50px auto;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
}

.metric-label,
.corpus-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.metric-value,
.corpus-value {
  margin: 16px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  letter-spacing: -0.05em;
}

.metric-card.tier1 {
  background: linear-gradient(160deg, rgba(255, 94, 99, 0.12), rgba(255, 255, 255, 0.04));
}

.metric-card.tier2 {
  background: linear-gradient(160deg, rgba(245, 191, 79, 0.12), rgba(255, 255, 255, 0.04));
}

.metric-card.tier3 {
  background: linear-gradient(160deg, rgba(109, 228, 157, 0.12), rgba(255, 255, 255, 0.04));
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
}

.span-4 {
  grid-column: span 4;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header-wide {
  align-items: center;
}

.panel-caption {
  max-width: 28ch;
  margin: 0;
  line-height: 1.6;
  font-size: 0.92rem;
}

.chart-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 240px;
}

.bar-day {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.bar-stack {
  width: 100%;
  min-height: 160px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.bar-segment {
  width: 100%;
  border-radius: 999px;
  min-height: 6px;
}

.bar-segment.tier1 {
  background: linear-gradient(180deg, rgba(255, 94, 99, 0.95), rgba(255, 94, 99, 0.55));
}

.bar-segment.tier2 {
  background: linear-gradient(180deg, rgba(245, 191, 79, 0.95), rgba(245, 191, 79, 0.55));
}

.bar-segment.tier3 {
  background: linear-gradient(180deg, rgba(109, 228, 157, 0.95), rgba(109, 228, 157, 0.55));
}

.bar-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.sentiment-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sentiment-row,
.run-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sentiment-row strong,
.run-cell strong,
.filing-card h3,
.detail-hero h3 {
  font-weight: 600;
}

.sentiment-bar-track {
  width: 100%;
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sentiment-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--accent));
}

.feed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: end;
}

.tier-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  transform: translateY(-1px);
  border-color: rgba(255, 123, 61, 0.45);
  background: rgba(255, 123, 61, 0.12);
}

.result-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.filings-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.feed-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.feed-footer.hidden {
  display: none;
}

.filing-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.filing-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--ok);
}

.filing-card[data-tier="1"]::before {
  background: var(--danger);
}

.filing-card[data-tier="2"]::before {
  background: var(--warn);
}

.filing-card-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
}

.filing-card h3 {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.35;
}

.feed-subline {
  font-size: 0.88rem;
  line-height: 1.6;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-family: "IBM Plex Mono", monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge.tier-1 {
  background: rgba(255, 94, 99, 0.12);
  color: #ffd4d6;
}

.badge.tier-2 {
  background: rgba(245, 191, 79, 0.14);
  color: #ffe5ab;
}

.badge.tier-3 {
  background: rgba(109, 228, 157, 0.14);
  color: #d0ffe0;
}

.badge.impact-positive {
  color: #d4ffe8;
  background: rgba(36, 212, 192, 0.14);
}

.badge.impact-negative {
  color: #ffd7d9;
  background: rgba(255, 94, 99, 0.14);
}

.badge.impact-neutral {
  color: #edf3f7;
  background: rgba(255, 255, 255, 0.08);
}

.filing-summary {
  color: #d7e5ee;
  line-height: 1.7;
  font-size: 0.95rem;
}

.dossier-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.ops-status-chip--ok {
  background: rgba(109, 228, 157, 0.12);
  color: #d6ffe4;
}

.ops-status-chip--danger {
  background: rgba(255, 94, 99, 0.12);
  color: #ffd9db;
}

.ops-status-chip--elevated {
  background: rgba(245, 191, 79, 0.13);
  color: #ffe3a5;
}

.ops-status-chip--neutral {
  background: rgba(255, 255, 255, 0.06);
  color: #edf3f7;
}

.takeaway-list {
  display: grid;
  gap: 10px;
}

.takeaway-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
  line-height: 1.6;
}

.filing-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.detail-trigger,
.external-link,
.drawer-close {
  border: 0;
  background: linear-gradient(135deg, var(--accent), #ff9966);
  color: #130c08;
  font-weight: 700;
  font-family: "IBM Plex Sans", sans-serif;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease;
}

.detail-trigger:hover,
.external-link:hover,
.drawer-close:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.runs-table {
  display: grid;
  gap: 12px;
}

.run-row {
  grid-template-columns: minmax(240px, 1.8fr) repeat(5, auto);
  align-items: start;
}

.run-cell-primary {
  display: grid;
  gap: 6px;
}

.run-error {
  color: #ffd7d9;
  font-size: 0.84rem;
  line-height: 1.55;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 94, 99, 0.1);
  border: 1px solid rgba(255, 94, 99, 0.16);
  max-width: 52ch;
}

.run-row.is-failed {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 94, 99, 0.04);
  border: 1px solid rgba(255, 94, 99, 0.08);
}

.run-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.run-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
}

.run-status.failed::before {
  background: var(--danger);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 13, 0.72);
  backdrop-filter: blur(4px);
}

.drawer {
  position: fixed;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: min(760px, calc(100vw - 40px));
  padding: 18px;
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.96), rgba(7, 16, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.drawer-scroll {
  height: 100%;
  overflow: auto;
  padding-top: 48px;
  scrollbar-width: thin;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.detail-hero,
.detail-section,
.chunk-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-hero {
  display: grid;
  gap: 14px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.detail-section h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.detail-section p,
.detail-section li,
.chunk-card,
.raw-text {
  line-height: 1.7;
  font-size: 0.95rem;
}

.raw-text {
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(4, 11, 18, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: "IBM Plex Sans", sans-serif;
}

.chunk-grid {
  display: grid;
  gap: 12px;
}

.chunk-card {
  background: rgba(255, 255, 255, 0.025);
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.hero-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 26px;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 123, 61, 0.38);
  background: rgba(255, 123, 61, 0.1);
}

.ghost-button.compact {
  padding: 8px 12px;
}

.shortcut-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", monospace;
}

.ops-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ops-card,
.brief-card,
.brief-block,
.pref-card,
.signal-row,
.cluster-card,
.command-result {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
}

.ops-card {
  padding: 16px;
}

.ops-value {
  margin: 10px 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  letter-spacing: -0.05em;
}

.brief-shell,
.signal-list,
.cluster-list,
.control-stack {
  display: grid;
  gap: 14px;
}

.brief-card,
.brief-block,
.pref-card {
  padding: 18px;
}

.brief-headline {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #d9e6ef;
}

.brief-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", monospace;
}

.brief-grid,
.brief-highlight-list {
  display: grid;
  gap: 12px;
}

.brief-block-title,
.pref-title-row h3,
.cluster-card h3 {
  margin: 0 0 8px;
}

.brief-block-text,
.cluster-summary {
  color: #d9e6ef;
  line-height: 1.7;
  font-size: 0.94rem;
}

.brief-highlight {
  width: 100%;
  padding: 14px;
  display: grid;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  color: var(--text);
}

.signal-row,
.cluster-card,
.focus-chip,
.command-result {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.signal-row,
.focus-chip,
.command-result {
  cursor: pointer;
}

.signal-row {
  padding: 16px;
  display: grid;
  gap: 12px;
  text-align: left;
  color: var(--text);
}

.signal-main,
.cluster-topline,
.cluster-score-row,
.pref-title-row,
.filing-actions,
.command-header,
.command-result {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.signal-title {
  font-size: 1rem;
  font-weight: 600;
}

.signal-tags,
.cluster-tags,
.theme-pill-row,
.focus-chips,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-score {
  min-width: 82px;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}

.signal-score strong {
  display: block;
  font-size: 1.2rem;
  font-family: "Space Grotesk", sans-serif;
}

.signal-score.critical,
.score-critical {
  background: rgba(255, 94, 99, 0.12);
  color: #ffd7d9;
}

.signal-score.high,
.score-high {
  background: rgba(245, 191, 79, 0.14);
  color: #ffe5ab;
}

.signal-score.elevated,
.score-elevated {
  background: rgba(36, 212, 192, 0.12);
  color: #d8fff8;
}

.signal-score.monitoring,
.score-monitoring {
  background: rgba(255, 255, 255, 0.08);
  color: #edf3f7;
}

.signal-meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.signal-meter.compact-meter {
  height: 8px;
}

.signal-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--accent));
}

.signal-meter-fill.critical {
  background: linear-gradient(90deg, rgba(255, 94, 99, 0.92), rgba(255, 143, 126, 0.92));
}

.signal-meter-fill.high {
  background: linear-gradient(90deg, rgba(245, 191, 79, 0.92), rgba(255, 123, 61, 0.92));
}

.signal-meter-fill.elevated {
  background: linear-gradient(90deg, rgba(36, 212, 192, 0.92), rgba(151, 230, 108, 0.92));
}

.signal-meter-fill.monitoring {
  background: linear-gradient(90deg, rgba(143, 168, 186, 0.8), rgba(235, 240, 243, 0.45));
}

.signal-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.83rem;
  font-family: "IBM Plex Mono", monospace;
}

.cluster-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.cluster-apply {
  cursor: pointer;
}

.control-stack {
  align-content: start;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: #dce9f1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-row:last-of-type {
  border-bottom: 0;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.ops-health {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.focus-form,
.filter-grid {
  display: grid;
  gap: 10px;
}

.focus-form {
  grid-template-columns: 1fr auto;
  margin-top: 12px;
}

.focus-input,
.input-shell input,
.select-shell select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 16px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.94rem;
}

.input-shell input:focus,
.select-shell select:focus,
.focus-input:focus {
  outline: none;
  border-color: rgba(255, 123, 61, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 123, 61, 0.08);
}

.focus-chip {
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(36, 212, 192, 0.11);
  color: var(--text);
}

.focus-chip-remove {
  opacity: 0.72;
  pointer-events: none;
}

.control-bar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.filter-grid {
  grid-template-columns: minmax(240px, 1.6fr) repeat(5, minmax(140px, 1fr)) auto;
  align-items: center;
}

.search-shell {
  min-width: 0;
}

.quick-action {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.quick-action.is-active {
  border-color: rgba(255, 123, 61, 0.45);
  background: rgba(255, 123, 61, 0.12);
}

.theme-pill-row {
  margin-top: -4px;
}

.filing-card.is-focus {
  box-shadow: inset 0 0 0 1px rgba(36, 212, 192, 0.25);
}

.filings-feed.is-dense {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.filings-feed.is-dense .filing-card {
  gap: 12px;
  padding: 15px;
}

.filings-feed.is-dense .filing-summary {
  font-size: 0.9rem;
  line-height: 1.55;
}

.command-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding: 6vh 16px 24px;
  background: rgba(3, 8, 13, 0.74);
  backdrop-filter: blur(10px);
}

.command-modal {
  width: min(880px, 100%);
  max-height: min(78vh, 760px);
  padding: 18px;
  overflow: auto;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.98), rgba(7, 16, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

.command-input-shell {
  flex: 1;
}

.command-results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.command-result {
  padding: 14px 16px;
  text-align: left;
  color: var(--text);
}

.command-result.is-active {
  border-color: rgba(255, 123, 61, 0.45);
  background: rgba(255, 123, 61, 0.12);
  transform: translateY(-1px);
}

.command-footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", monospace;
}

.llm-overlay {
  z-index: 32;
  padding-top: 4vh;
}

.llm-modal {
  width: min(1120px, 100%);
  max-height: min(86vh, 980px);
  padding: 22px;
  overflow: auto;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.99), rgba(7, 16, 25, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

.llm-header,
.llm-actions,
.secret-row,
.provider-card-head,
.provider-card-meta,
.provider-card-head-actions {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.llm-header h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.llm-body,
.llm-stack,
.llm-provider-grid,
.llm-notice-stack {
  display: grid;
  gap: 14px;
}

.llm-runtime-grid,
.llm-inline-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.llm-provider-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-shell {
  display: grid;
  gap: 8px;
}

.field-shell > span,
.provider-card-label,
.secret-meta,
.llm-notice-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-meta {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.field-shell input,
.field-shell select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 16px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.94rem;
}

.field-shell input:focus,
.field-shell select:focus {
  outline: none;
  border-color: rgba(255, 123, 61, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 123, 61, 0.08);
}

.provider-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 14px;
}

.provider-card.is-active {
  border-color: rgba(255, 123, 61, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 123, 61, 0.16);
}

.provider-card h3 {
  margin: 0;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 123, 61, 0.14);
  color: #ffd9c9;
  font-size: 0.77rem;
  font-family: "IBM Plex Mono", monospace;
}

.provider-card-meta {
  align-items: center;
}

.provider-card-head-actions {
  align-items: center;
  justify-content: end;
}

.provider-card-meta .ghost-button[disabled] {
  opacity: 0.58;
  cursor: wait;
}

.usage-shell {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 123, 61, 0.06), rgba(36, 212, 192, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.usage-status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.usage-status-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.usage-status-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.usage-status-card strong {
  font-size: 1.15rem;
  line-height: 1.3;
}

.provider-card-hint,
.llm-notice-text,
.llm-result-text {
  color: #d9e6ef;
  line-height: 1.7;
  font-size: 0.94rem;
}

.provider-setup-note {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(36, 212, 192, 0.07);
  border: 1px solid rgba(36, 212, 192, 0.16);
}

.provider-setup-title {
  color: #d8fff8;
  font-size: 0.84rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.provider-setup-text,
.provider-setup-list {
  color: #d9e6ef;
  line-height: 1.7;
  font-size: 0.92rem;
}

.provider-setup-list {
  display: grid;
  gap: 6px;
}

.provider-setup-note code {
  font-family: "IBM Plex Mono", monospace;
  color: #fff2e8;
}

.secret-row {
  align-items: center;
}

.secret-row .field-shell {
  flex: 1;
}

.llm-notice,
.llm-result {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

.llm-notice.warn,
.llm-result.error {
  border-color: rgba(255, 94, 99, 0.24);
  background: rgba(255, 94, 99, 0.08);
}

.llm-notice.ok,
.llm-result.ok {
  border-color: rgba(109, 228, 157, 0.22);
  background: rgba(109, 228, 157, 0.08);
}

.llm-auth-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.llm-actions {
  flex-wrap: wrap;
}

.llm-actions .detail-trigger,
.llm-actions .ghost-button {
  appearance: none;
}

.llm-muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(11, 21, 31, 0.96);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  z-index: 10000;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.empty-state {
  padding: 22px;
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.empty-state-loading {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 120px;
}

.loading-dot-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.loading-dot-row span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(36, 212, 192, 0.8);
  animation: loadingPulse 1.1s ease-in-out infinite;
}

.loading-dot-row span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dot-row span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loadingPulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.88);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1200px) {
  .hero-panel,
  .grid-layout {
    grid-template-columns: 1fr;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: span 1;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .page-shell {
    padding: 18px 14px 28px;
  }

  .hero-panel,
  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  .hero-copy h1 {
    font-size: clamp(2.2rem, 16vw, 4rem);
  }

  .hero-metrics,
  .ops-strip,
  .corpus-grid,
  .filings-feed {
    grid-template-columns: 1fr;
  }

  .filter-grid,
  .focus-form {
    grid-template-columns: 1fr;
  }

  .signal-main,
  .signal-foot,
  .cluster-topline,
  .command-header,
  .filing-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .run-row {
    grid-template-columns: 1fr 1fr;
  }

  .drawer {
    inset: 10px;
    width: auto;
  }

  .command-overlay {
    padding-top: 20px;
  }

  .llm-runtime-grid,
  .llm-inline-grid,
  .llm-provider-grid,
  .llm-auth-row {
    grid-template-columns: 1fr;
  }

  .usage-status-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* Loading state for primary ghost buttons */
.ghost-button.is-loading {
  opacity: 0.85;
  pointer-events: none;
  position: relative;
}
.ghost-button.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  vertical-align: middle;
  border: 2px solid rgba(255,255,255,0.16);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: _oc_spin 1s linear infinite;
}
@keyframes _oc_spin { to { transform: rotate(360deg); } }

/* Accessibility helpers and toast */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.oc-toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  background: rgba(11,21,31,0.94);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  font-size: 0.95rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.oc-toast.oc-toast--visible { opacity: 1; transform: translateY(0); }
.oc-toast.oc-toast--ok {
  border-color: rgba(109, 228, 157, 0.26);
}
.oc-toast.oc-toast--error {
  border-color: rgba(255, 94, 99, 0.28);
}
