:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --teal: #0d9488;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --fail: #b91c1c;
  --fail-soft: #fef2f2;
  --log-bg: #1e293b;
  --log-text: #e2e8f0;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --sidebar-w: 272px;
  --header-h: auto;
}

* {
  box-sizing: border-box;
}

.github-pages-demo-banner {
  background: #eff6ff;
  border-bottom: 1px solid #93c5fd;
  color: #1e3a5f;
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0.55rem 1rem;
  text-align: center;
}

.github-pages-demo-banner code {
  font-size: 0.85em;
}

.demo-error-card .error {
  color: var(--fail);
  font-weight: 500;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-muted);
  padding: 0.08em 0.32em;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem 0.65rem;
  box-shadow: var(--shadow-sm);
}

.app-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-brand h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mode-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.32em 0.6em;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
}

.header-meta {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.info-pill {
  margin: 0;
  font-size: 0.78rem;
  color: #1e3a5f;
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.28em 0.75em;
}

.scope-note {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1;
  min-height: 0;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.run-filter-label input {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.run-filter-label input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.sidebar-status {
  font-size: 0.78rem;
  color: var(--muted);
}

.sidebar-empty {
  text-align: center;
  padding: 1rem 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar-empty p {
  margin: 0 0 0.65rem;
}

.run-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.run-item {
  margin-bottom: 0.35rem;
}

.run-item button {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.run-item button:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.run-item button.active {
  border-color: #93c5fd;
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
}

.run-item .run-asset {
  font-weight: 650;
  font-size: 0.92rem;
}

.run-item .run-id {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  word-break: break-all;
}

.run-status-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.status-pill.tone-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-pill.tone-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-pill.tone-fail {
  background: var(--fail-soft);
  color: var(--fail);
}

.status-pill.tone-neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.run-item .run-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Main console */
.console {
  padding: 1rem 1.35rem 1.5rem;
  overflow-y: auto;
}

.empty-state[hidden],
.run-detail[hidden],
.sidebar-empty[hidden],
.run-progress-panel[hidden],
.run-execution-panel[hidden] {
  display: none !important;
}

.empty-state {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
}

.empty-state-card {
  max-width: 28rem;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.empty-state-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.empty-advanced {
  margin-top: 1rem;
  text-align: left;
}

.cli-preview-inline {
  margin: 0.5rem 0;
  font-size: 0.7rem;
}

.empty-state h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}

.arch-strip {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-top: 1.5rem;
}

/* Run header */
.run-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-md);
}

.run-header-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.run-header-title h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.run-header-title .status-pill {
  font-size: 0.72rem;
  padding: 0.2em 0.55em;
}

.run-header-sub {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.run-header-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.run-header-highlight {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Metric cards row */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
}

.metric-card-label {
  font-size: 0.65rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.metric-card-value {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.metric-card.tone-ok .metric-card-value {
  color: var(--ok);
}

.metric-card.tone-fail .metric-card-value {
  color: var(--fail);
}

.metric-card.tone-warn .metric-card-value {
  color: var(--warn);
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.85rem;
  overflow-x: auto;
}

.tab {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.55rem 0.95rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.panel-compact h3 {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.panel-sub {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.summary-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  border-left: 3px solid var(--border-strong);
}

.summary-card.tone-ok {
  border-left-color: var(--ok);
}

.summary-card.tone-fail {
  border-left-color: var(--fail);
}

.summary-card.tone-warn {
  border-left-color: var(--warn);
}

.summary-card-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.summary-card-value {
  font-size: 0.9rem;
}

/* Terminal */
.terminal-log {
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
  background: var(--log-bg);
  color: var(--log-text);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  max-height: 360px;
  overflow-y: auto;
}

.terminal-compact {
  max-height: 140px;
  font-size: 0.72rem;
}

.terminal-log .log-line {
  display: block;
  margin-bottom: 0.15rem;
}

.terminal-log .log-ts {
  color: #94a3b8;
}

.terminal-log .log-level {
  font-weight: 600;
}

.terminal-log .log-level-info {
  color: #7dd3fc;
}

.terminal-log .log-level-warn {
  color: #fcd34d;
}

.terminal-log .log-level-error {
  color: #fca5a5;
}

.terminal-log .hl-pass {
  color: #86efac;
  font-weight: 600;
}

.terminal-log .hl-warn {
  color: #fcd34d;
  font-weight: 600;
}

.terminal-log .hl-fail {
  color: #fca5a5;
  font-weight: 600;
}

.terminal-log .log-chain {
  color: #7dd3fc;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.local-run-banner {
  margin-top: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 0.85rem;
}

/* Claims */
.claims-compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.claim-category-block h4 {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  color: var(--muted);
}

.claims-compact-block.supported {
  background: var(--ok-soft);
  border-radius: 6px;
  padding: 0.55rem;
  font-size: 0.85rem;
}

.claims-compact-block.unsupported-groups {
  font-size: 0.85rem;
}

.claims-compact-block ul {
  margin: 0;
  padding-left: 1rem;
}

.claims-tab-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.claims-tab-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.claims-tab-panel.supported {
  border-color: #86efac;
  background: var(--ok-soft);
}

.claims-tab-panel.unsupported {
  border-color: #fecaca;
  background: var(--fail-soft);
}

.claims-tab-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.claims-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.65rem;
}

.claims-column h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.claim-card {
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  background: var(--surface);
  border-left: 3px solid var(--border-strong);
}

.claim-card .claim-id {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
}

/* Artifacts */
.artifact-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.filter-chip {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.28em 0.65em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--muted);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-muted);
}

td.path-cell {
  font-family: var(--mono);
  font-size: 0.76rem;
  word-break: break-all;
}

.checksum-cell {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

a.download-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.84rem;
}

a.download-link:hover {
  text-decoration: underline;
}

.package-info dl,
.bundle-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  font-size: 0.88rem;
  margin: 0;
}

.package-info dt,
.bundle-info dt {
  color: var(--muted);
  font-weight: 500;
}

/* Overview Evidence Bundle card */
.evidence-bundle-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted, #f8f9fb) 100%);
}

.evidence-bundle-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.evidence-bundle-desc {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #4a5568);
  line-height: 1.45;
  max-width: 52rem;
}

.evidence-bundle-note {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.evidence-bundle-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  font-size: 0.84rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.evidence-bundle-meta dt {
  color: var(--muted);
  font-weight: 500;
}

.evidence-bundle-meta dd {
  margin: 0;
  font-weight: 500;
}

.evidence-bundle-meta .status-built {
  color: var(--ok, #2e7d32);
}

.evidence-bundle-meta .status-not-built {
  color: var(--muted);
}

.evidence-bundle-actions {
  margin-top: 0;
}

.evidence-bundle-actions .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.evidence-bundle-actions .btn-ghost:hover:not(:disabled) {
  background: var(--surface-muted);
}

/* Bundle tab */
.bundle-tab-header {
  margin-bottom: 1rem;
}

.bundle-tab-title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.bundle-tab-lead {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #4a5568);
  line-height: 1.5;
  max-width: 44rem;
}

.bundle-tab-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.bundle-tab-actions {
  margin-top: 0.75rem;
}

.bundle-action-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.bundle-info {
  margin-bottom: 0.5rem;
}

.bundle-status-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.88rem;
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.bundle-status-card dt {
  color: var(--muted);
  font-weight: 500;
}

.bundle-status-card dd {
  margin: 0;
  font-weight: 500;
}

.status-pass {
  color: var(--ok, #2e7d32);
}

.status-fail {
  color: var(--danger, #c62828);
}

.status-neutral {
  color: var(--muted);
}

.bundle-verify-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #f0c4c4;
  background: #fff8f8;
  font-size: 0.84rem;
}

.bundle-verify-alert-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.4rem;
}

.bundle-verify-alert-hint {
  margin: 0;
  color: var(--text-secondary, #4a5568);
  line-height: 1.45;
}

.bundle-json-advanced {
  margin-top: 1rem;
}

.artifacts-panel-lead {
  max-width: 44rem;
}

.artifacts-evidence-table .artifact-evidence-name {
  font-weight: 600;
  font-size: 0.86rem;
}

.artifact-desc-cell {
  font-size: 0.84rem;
  color: var(--text-secondary, #4a5568);
  line-height: 1.4;
  max-width: 22rem;
}

.artifact-action-cell {
  white-space: nowrap;
}

.artifact-action-cell .download-link {
  margin-right: 0.5rem;
}

.btn-link {
  font: inherit;
  font-size: 0.8rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--accent-hover);
}

.artifact-details-row td {
  background: var(--surface-muted);
  padding: 0.65rem 0.75rem 0.85rem;
}

.artifact-details-panel {
  font-size: 0.82rem;
}

.artifact-details-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.85rem;
  margin: 0 0 0.65rem;
}

.artifact-details-dl dt {
  color: var(--muted);
  font-weight: 500;
}

.artifact-details-dl dd {
  margin: 0;
}

.artifact-path-code,
.artifact-checksum-full {
  font-family: var(--mono);
  font-size: 0.74rem;
  word-break: break-all;
}

.artifact-manifest-json {
  margin-top: 0.35rem;
}

.json-preview-sm {
  max-height: 12rem;
  font-size: 0.72rem;
}

.checksum-short {
  font-family: var(--mono);
  font-size: 0.72rem;
}

.evidence-bundle-meta-compact {
  margin-bottom: 0.65rem;
}

.evidence-bundle-card h3 .status-pass,
.evidence-bundle-card h3 .status-fail,
.evidence-bundle-card h3 .status-not-built,
.evidence-bundle-card h3 .status-built {
  font-weight: 600;
}

/* Buttons */
.btn {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn:hover:not(:disabled) {
  background: var(--surface-muted);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.collapsible > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0.35rem 0;
}

.json-preview,
.cli-preview {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.panel-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.panel-status.error {
  color: var(--fail);
}

.request-builder-error {
  color: var(--fail);
}

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

.app-footer {
  padding: 0.5rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 1.15rem 1.25rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-close {
  font-size: 1.5rem;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 0 0.25rem;
}

.local-audit-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.request-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.request-builder-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.request-builder-grid label.span-2 {
  grid-column: span 2;
}

.request-builder-grid input,
.request-builder-grid select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.request-builder-grid select {
  cursor: pointer;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.35rem 0 0.65rem;
  min-height: 1.25rem;
}

.form-hint.error {
  color: var(--fail);
}

.run-progress-panel {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.run-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
}

.run-progress-status {
  font-weight: 650;
  text-transform: capitalize;
  color: var(--accent);
}

.run-progress-current-stage {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #5c6370);
}

.run-progress-current-stage.is-error {
  color: var(--danger, #c62828);
}

.run-progress-elapsed {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.progress-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-bar-fill.indeterminate {
  width: 40%;
  animation: progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

.run-progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}

.run-progress-steps li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0;
  color: var(--muted);
}

.run-progress-steps li.active {
  color: var(--text);
  font-weight: 600;
}

.run-progress-steps li.done {
  color: var(--ok);
}

.run-progress-steps li.failed {
  color: var(--fail);
}

.run-progress-steps .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.run-progress-steps li.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.run-progress-steps li.done .step-dot {
  background: var(--ok);
}

.run-progress-steps li.failed .step-dot {
  background: var(--fail);
}

.execution-panel-title {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.modal-panel-wide {
  width: min(560px, 100%);
}

.modal-advanced {
  margin-top: 0.5rem;
}

.btn-lg {
  padding: 0.55rem 1.15rem;
  font-weight: 600;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-soft);
}

.btn-primary .btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 0.45rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-primary.is-running .btn-label {
  opacity: 0.9;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.run-execution-panel {
  margin: 0.65rem 0;
}

.execution-log-view {
  max-height: 120px;
  font-size: 0.7rem;
}

@media (max-width: 1000px) {
  .overview-grid,
  .claims-compact-grid,
  .claims-tab-panels,
  .claims-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }
}

/* Landing */
.view-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%);
}

.landing-header {
  padding: 2rem 1.5rem 0.5rem;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.landing-brand {
  margin-bottom: 0.75rem;
}

.mode-badge-landing {
  background: #0f172a;
}

.landing-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.landing-subtitle {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 36rem;
}

.landing-body {
  flex: 1;
  padding: 1rem 1.5rem 2rem;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.landing-lead {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.landing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  box-shadow: var(--shadow-sm);
}

.landing-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.landing-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.landing-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.landing-scope {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.landing-scope strong {
  color: var(--text);
}

.landing-footer {
  padding: 0.75rem 1.5rem 1.25rem;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  font-size: 0.8rem;
  color: var(--muted);
}

.view-console[hidden],
.view-landing[hidden] {
  display: none !important;
}

.btn-home {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.8rem;
  padding: 0;
}

.clean-modal-text {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 800px) {
  .landing-cards {
    grid-template-columns: 1fr;
  }
}
