body { font-family: Arial, sans-serif; margin: 0; background: #f7f8fb; color: #1f2937; }
a { color: #1d4ed8; }
code { background: #eef2ff; padding: 2px 6px; border-radius: 6px; }
.web-shell-root { max-width: 1120px; margin: 0 auto; padding: 24px; }
.shell-hero { margin-bottom: 20px; }
.shell-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.shell-nav-link { display: inline-block; padding: 8px 12px; border-radius: 999px; background: #eef2ff; text-decoration: none; font-weight: 600; }
.shell-nav-link-active { background: #dbeafe; }
.shell-card { background: white; border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.hero-card { padding: 20px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.action-grid .mini-card { min-height: 128px; }
.mini-card h3 { margin-top: 0; margin-bottom: 10px; }
.mini-card p { margin-top: 0; margin-bottom: 12px; }
.muted-line { margin-top: 10px; color: #4b5563; font-size: 14px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eef2ff; font-size: 12px; }
.shell-banner { border-left: 4px solid #f59e0b; }
.gate-banner { border-left: 4px solid #2563eb; }
.state-banner { border-left: 4px solid #f59e0b; }
.state-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #e5e7eb; font-size: 12px; text-transform: uppercase; }
.state-ready { background: #dcfce7; }
.state-partial, .state-fallback, .state-loading { background: #fef3c7; }
.state-stale, .state-blocked, .state-denied, .state-session-expired, .state-bridge-failed { background: #fee2e2; }
.freshness-badge { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 999px; background: #eff6ff; }
.shell-table { width: 100%; border-collapse: collapse; }
.shell-table th, .shell-table td { text-align: left; padding: 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.consumer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.evidence-grid { display: grid; grid-template-columns: 180px 1fr; gap: 8px 12px; }
.evidence-grid dt { font-weight: 700; }
.evidence-grid dd { margin: 0; }
.compact-details summary { cursor: pointer; }
@media (max-width: 720px) {
  .web-shell-root { padding: 16px; }
  .evidence-grid { grid-template-columns: 1fr; }
}


.compact-strip .control-stack { display: grid; gap: 10px; margin-top: 12px; }
.backtrace-control-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; }
.backtrace-control-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.backtrace-control-form select { min-width: 160px; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 8px; background: white; }
.backtrace-control-form button { padding: 8px 12px; border: 0; border-radius: 8px; background: #1d4ed8; color: white; cursor: pointer; font-weight: 600; }
.muted-inline { color: #4b5563; font-size: 14px; }

.backtrace-header-strip { border-top: 4px solid #2563eb; }
.bt-note-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.kpi-grid .kpi-card { min-height: 104px; }
.kpi-value { font-size: 24px; font-weight: 700; margin: 0; }
.shell-table-wide th:nth-child(1), .shell-table-wide td:nth-child(1) { white-space: nowrap; }
.shell-table-wide th:nth-child(2), .shell-table-wide td:nth-child(2) { white-space: nowrap; }

.backtrace-n1-shell { border-top: 4px solid #2563eb; }
.backtrace-n1-tabs { display: flex; flex-wrap: wrap; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; gap: 4px; }
.backtrace-n1-tab { padding: 10px 20px; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.3s; text-decoration: none; color: #1f2937; }
.backtrace-n1-tab.is-active { border-color: #2563eb; color: #2563eb; font-weight: bold; }
.backtrace-n1-panel { margin-top: 12px; }
.backtrace-n1-filter-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.backtrace-n1-filter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; background: #f1f5f9; padding: 15px; border-radius: 6px; }
.backtrace-n1-filter-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.backtrace-n1-filter-form input, .backtrace-n1-filter-form select { min-width: 160px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.backtrace-n1-filter-form button { padding: 10px 14px; border: 0; border-radius: 8px; background: #1d4ed8; color: white; cursor: pointer; font-weight: 600; }
.backtrace-n1-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.backtrace-n1-table th, .backtrace-n1-table td { border: 1px solid #e2e8f0; padding: 12px; text-align: center; }
.backtrace-n1-table th { background: #f8fafc; }
.backtrace-n1-help { color: #4b5563; }
.backtrace-n1-tag { font-size: 0.8em; padding: 2px 6px; border-radius: 4px; }
.backtrace-n1-stat-card { background: #f0f9ff; border: 1px solid #bae6fd; padding: 15px; border-radius: 8px; margin-top: 20px; margin-bottom: 16px; }
.backtrace-n1-grid-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.backtrace-n1-stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; }
.backtrace-n1-stat-label { font-size: 13px; color: #4b5563; }
.backtrace-n1-stat-value { font-size: 20px; font-weight: 700; margin-top: 4px; }
@media (max-width: 720px) { .backtrace-n1-grid-stats { grid-template-columns: 1fr; } }
