/* ==========================================================================
   Pogo Precision Design System ("Ledger") — Corporate Admin UI Stylesheet
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  letter-spacing: -0.006em;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--ink-black);
  font-weight: 650;
  letter-spacing: -0.018em;
  line-height: 1.25;
}

p {
  margin: 0 0 var(--space-3);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--teal-dark);
  text-decoration: none;
  transition: color 0.12s ease;
}

a:hover {
  color: var(--ink-black);
  text-decoration: underline;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

code {
  font-size: 0.85em;
  background: var(--surface-02);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  padding: 0.1rem 0.35rem;
  color: var(--space-indigo);
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

hr,
.divider {
  border: 0;
  border-top: 1px solid var(--border-hairline);
  margin: var(--space-5) 0;
}

/* ==========================================================================
   Accessibility & Focus Management
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--atomic-tangerine);
  color: var(--ink-black);
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--pacific-teal);
  outline-offset: 2px;
}

.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;
}

/* ==========================================================================
   App Shell & Command Rail Sidebar
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  background-color: var(--ink-black);
  color: var(--pure-white);
  display: flex;
  flex-direction: column;
  padding: 1.125rem 0.875rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.9rem;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--pure-white);
  text-decoration: none;
}

.brand-wordmark:hover {
  color: var(--pure-white);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--atomic-tangerine) 0%, #FF8A4C 100%);
  color: var(--ink-black);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.brand-wordmark span.brand-dot {
  color: var(--atomic-tangerine);
}

.brand-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-inverse-muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.18rem 0.45rem;
  border-radius: var(--radius-xs);
}

.client-switcher {
  margin-bottom: 1rem;
  padding: 0.65rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
}

.client-switcher label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-inverse-muted);
  margin-bottom: 0.4rem;
}

.client-switcher select {
  width: 100%;
  appearance: none;
  background-color: var(--space-indigo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C4C5D0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  color: var(--pure-white);
  border: 1px solid rgba(196, 197, 208, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1.85rem 0.45rem 0.6rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.client-switcher select:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8E95AB;
  padding: 1rem 0.6rem 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.65rem;
  border-radius: var(--radius-sm);
  color: #D5D8E2;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.065);
  color: var(--pure-white);
  text-decoration: none;
}

.nav-link.is-active {
  background-color: var(--space-indigo);
  color: var(--pure-white);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--pacific-teal);
}

.nav-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.78;
}

.nav-link.is-active .nav-icon,
.nav-link:hover .nav-icon {
  opacity: 1;
  color: var(--pacific-teal);
}

.nav-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #D5D8E2;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.nav-link.is-active .nav-step-num {
  background: var(--pacific-teal);
  border-color: var(--pacific-teal);
  color: var(--pure-white);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.2rem 0.25rem;
}

.sidebar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  background: var(--space-indigo);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--pure-white);
  font-size: var(--text-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-user strong {
  display: block;
  color: var(--pure-white);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-inverse-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Main Canvas, Synthetic Watermark Banner & Topbar
   ========================================================================== */

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-canvas);
}

.synthetic-banner {
  background: #FFF7ED;
  border-bottom: 1px solid #FDBA74;
  color: #9A3412;
  padding: 0.45rem 1.75rem;
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar {
  background: var(--pure-white);
  border-bottom: 1px solid var(--border-subtle);
  min-height: var(--topbar-height);
  padding: 0.55rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumbs a:hover {
  color: var(--ink-black);
  text-decoration: none;
}

.breadcrumbs > span:last-child {
  color: var(--ink-black);
  font-weight: 600;
}

.breadcrumbs span[aria-hidden="true"],
.breadcrumbs .crumb-sep {
  color: var(--pale-slate);
  font-size: var(--text-xs);
  user-select: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.topbar-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  background: var(--surface-02);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.active-run-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--teal-tint);
  border: 1px solid var(--teal-border);
  color: var(--teal-dark);
  font-size: var(--text-xs);
  font-weight: 650;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.active-run-pill:hover {
  background: #D5F0F4;
  text-decoration: none;
}

.active-run-pill.is-ready {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success-fg);
}

.active-run-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--pacific-teal);
  animation: pogo-pulse 1.6s infinite ease-in-out;
  flex-shrink: 0;
}

.active-run-pill.is-ready .active-run-dot {
  background: var(--status-success-dot);
  animation: none;
}

@keyframes pogo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}

.page-content {
  padding: 1.5rem 1.75rem 3rem;
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Page Header Anatomy
   ========================================================================== */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-hairline);
}

.page-header-main {
  min-width: 0;
  flex: 1;
}

.page-eyebrow {
  display: block;
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.065em;
  color: var(--teal-dark);
  margin-bottom: 0.25rem;
}

.page-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--ink-black);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.5;
  max-width: 72ch;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Productive Card System (Header / Body / Flush Table / Footer)
   ========================================================================== */

.card {
  background: var(--surface-01);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.15rem;
}

.card-subtle {
  background: var(--surface-02);
  box-shadow: none;
}

.card-compact {
  padding: 0.95rem 1.15rem;
}

.card-flush {
  padding: 0;
  overflow: hidden;
}

.card-flush > .card-header {
  padding: 1rem 1.35rem;
  margin-bottom: 0;
}

.card-flush > .card-body {
  padding: 1.25rem 1.35rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-hairline);
}

.card-header-main {
  min-width: 0;
}

.card-title,
.section-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink-black);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* Standalone .section-title used directly inside .card without .card-header */
.card > .section-title {
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-hairline);
}

.card-subtitle {
  margin: 0.2rem 0 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.45;
}

.card-footer {
  margin: 1.25rem -1.35rem -1.25rem;
  padding: 0.85rem 1.35rem;
  background: var(--surface-02);
  border-top: 1px solid var(--border-hairline);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-flush > .card-footer {
  margin: 0;
}

/* Edge-to-edge bleed for tables inside cards (Carbon / Polaris IndexTable style) */
.card > .table-wrap {
  margin-left: -1.35rem;
  margin-right: -1.35rem;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
}

.card > .table-wrap:last-child {
  margin-bottom: -1.25rem;
  border-bottom: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.card > .card-header + .table-wrap {
  margin-top: -1rem;
  border-top: 0;
}

.card-flush > .table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}

/* ==========================================================================
   KPI & Metric Scorecard Tiles
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--surface-01);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--space-indigo);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card--estimate {
  border-top-color: var(--pacific-teal);
}

.kpi-card--accent {
  border-top-color: var(--atomic-tangerine);
}

.kpi-card--muted {
  border-top-color: var(--pale-slate);
}

.kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.kpi-label {
  display: block;
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-muted);
  line-height: 1.35;
}

.kpi-value {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--ink-black);
  margin-top: 0.25rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi-value-sm {
  font-size: var(--text-xl);
}

.kpi-meta {
  display: block;
  margin-top: 0.4rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Button System (Strict Contrast Compliance — AGENTS.md Visual Contract)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Primary CTA: Atomic Tangerine with DARK Ink-Black text (never white!) */
.btn-primary {
  background-color: var(--atomic-tangerine);
  color: var(--ink-black);
  border-color: #E55B13;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(8, 14, 26, 0.08);
}

.btn-primary:hover {
  background-color: var(--tangerine-hover);
  color: var(--ink-black);
}

.btn-primary:active {
  background-color: var(--tangerine-active);
}

/* Secondary Outline Action */
.btn-secondary {
  background-color: var(--pure-white);
  color: var(--ink-black);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--surface-02);
  border-color: #9EA4B8;
  color: var(--ink-black);
}

/* Light-surface Ghost Action (High-contrast muted text -> crisp hover surface) */
.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--surface-03);
  color: var(--ink-black);
  border-color: var(--border-subtle);
}

/* Dark-surface Ghost Action (Sidebar Sign Out & Dark Hero Cards) */
.btn-sidebar-ghost {
  background-color: rgba(255, 255, 255, 0.04);
  color: #D5D8E2;
  border-color: rgba(196, 197, 208, 0.25);
  width: 100%;
  justify-content: center;
}

.btn-sidebar-ghost:hover {
  background-color: rgba(255, 255, 255, 0.11);
  color: var(--pure-white);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Secondary button on dark hero surfaces */
.btn-inverse-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--pure-white);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-inverse-secondary:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: var(--pure-white);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Destructive Outline Action */
.btn-danger-outline {
  background-color: var(--pure-white);
  color: var(--status-danger-fg);
  border-color: var(--status-danger-border);
}

.btn-danger-outline:hover {
  background-color: var(--status-danger-bg);
  border-color: #F87171;
  color: var(--status-danger-fg);
}

.btn-sm {
  padding: 0.34rem 0.68rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 0.65rem 1.25rem;
  font-size: var(--text-base);
}

.btn-block {
  width: 100%;
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Forms, Inputs & Interactive Choice Tiles
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-grid > .form-group,
.form-grid-3 > .form-group {
  margin-bottom: 0;
}

.form-label,
.form-group > label:not(.choice-card):not(.checkbox-inline) {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--ink-black);
  margin-bottom: 0.35rem;
  letter-spacing: 0.005em;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--ink-black);
  background-color: var(--pure-white);
  line-height: 1.4;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-control:hover {
  border-color: #9CA3B8;
}

.form-control:focus {
  outline: none;
  border-color: var(--pacific-teal);
  box-shadow: 0 0 0 3px rgba(20, 155, 176, 0.16);
}

.form-control[readonly],
.form-control:disabled {
  background-color: var(--surface-02);
  color: var(--text-muted);
}

.form-hint {
  margin-top: 0.3rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.field-error,
.form-error {
  margin-top: 0.3rem;
  font-size: var(--text-xs);
  color: var(--status-danger-fg);
  font-weight: 600;
}

/* Interactive Checkbox / Radio Choice Tile */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.68rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--pure-white);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.choice-card:hover {
  border-color: var(--pacific-teal);
  background: var(--surface-hover);
}

.choice-card:has(input:checked) {
  border-color: var(--pacific-teal);
  background: var(--surface-selected);
  box-shadow: inset 0 0 0 1px var(--pacific-teal);
}

.choice-card input[type="checkbox"],
.choice-card input[type="radio"] {
  margin-top: 0.18rem;
  accent-color: var(--pacific-teal);
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.choice-card-body {
  min-width: 0;
  flex: 1;
}

.choice-card-title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--ink-black);
  line-height: 1.3;
}

.choice-card-meta {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-black);
  cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
  accent-color: var(--pacific-teal);
  width: 0.95rem;
  height: 0.95rem;
}

/* ==========================================================================
   Semantic Status Badges (Pill + Leading Status Dot — Shape + Color)
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.35;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-dotless::before {
  display: none;
}

.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
  border-color: var(--status-success-border);
}

.badge-success::before {
  background: var(--status-success-dot);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
  border-color: var(--status-warning-border);
}

.badge-warning::before {
  background: var(--status-warning-dot);
}

.badge-blocked,
.badge-neutral {
  background: var(--status-blocked-bg);
  color: var(--status-blocked-fg);
  border-color: var(--status-blocked-border);
}

.badge-blocked::before,
.badge-neutral::before {
  background: var(--status-blocked-dot);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
  border-color: var(--status-danger-border);
}

.badge-danger::before {
  background: var(--status-danger-dot);
}

.badge-progress {
  background: var(--status-info-bg);
  color: var(--status-info-fg);
  border-color: var(--status-info-border);
}

.badge-progress::before {
  background: var(--status-info-dot);
}

.badge-synthetic {
  background: var(--status-synthetic-bg);
  color: var(--status-synthetic-fg);
  border-color: var(--status-synthetic-border);
}

.badge-synthetic::before {
  background: var(--status-synthetic-dot);
}

/* ==========================================================================
   Epistemic Provenance Tags (Fact vs. Estimate vs. Recommendation vs. Withheld)
   ========================================================================== */

.fact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.14rem 0.46rem;
  border-radius: var(--radius-xs);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  border: 1px solid transparent;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.3;
}

.fact-badge-fact {
  background: var(--indigo-tint);
  color: var(--space-indigo);
  border-color: var(--indigo-border);
}

.fact-badge-estimate {
  background: var(--teal-tint);
  color: var(--teal-dark);
  border-color: var(--teal-border);
}

.fact-badge-simulation {
  background: var(--tangerine-tint);
  color: #9A3412;
  border-color: var(--tangerine-border);
}

.fact-badge-withheld {
  background: var(--status-blocked-bg);
  color: var(--status-blocked-fg);
  border-color: var(--status-blocked-border);
}

/* ==========================================================================
   Contextual Alerts & Inline Notices
   ========================================================================== */

.alert {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.15rem;
  border: 1px solid transparent;
  border-left-width: 4px;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.alert strong {
  font-weight: 700;
}

.alert-success {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
  border-color: var(--status-success-border);
  border-left-color: var(--status-success-dot);
}

.alert-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
  border-color: var(--status-warning-border);
  border-left-color: var(--status-warning-dot);
}

.alert-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
  border-color: var(--status-danger-border);
  border-left-color: var(--status-danger-dot);
}

.alert-info {
  background: var(--status-info-bg);
  color: var(--status-info-fg);
  border-color: var(--status-info-border);
  border-left-color: var(--pacific-teal);
}

/* ==========================================================================
   Enterprise Data Tables & Pagination
   ========================================================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface-01);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  text-align: left;
  padding: 0.65rem 1rem;
  background: var(--surface-02);
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 0.72rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
  color: var(--text-main);
  line-height: 1.4;
}

.data-table tbody tr {
  transition: background-color 0.08s ease;
}

.data-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cell-primary {
  display: block;
  font-weight: 600;
  color: var(--ink-black);
}

.cell-secondary {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 0.12rem;
}

.cell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Enterprise Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0 0.15rem;
}

.card > .table-wrap + .pagination-bar,
.card-flush > .pagination-bar {
  padding: 0.75rem 1.35rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--surface-02);
}

.pagination-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--pure-white);
  color: var(--ink-black);
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.pagination-btn:hover {
  background: var(--surface-02);
  border-color: var(--border-strong);
  text-decoration: none;
}

.pagination-btn.is-active {
  background: var(--space-indigo);
  border-color: var(--space-indigo);
  color: var(--pure-white);
}

.pagination-btn.is-disabled {
  background: var(--surface-02);
  color: var(--pale-slate);
  border-color: var(--border-hairline);
  cursor: default;
}

/* Safety guard if default Laravel SVG pagination renders anywhere */
nav[role="navigation"] svg {
  width: 1rem;
  height: 1rem;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-02);
  border: 1px solid var(--border-subtle);
  color: var(--pacific-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state h3,
.empty-state-title {
  margin: 0 0 0.35rem;
  color: var(--ink-black);
  font-size: var(--text-base);
  font-weight: 650;
}

.empty-state p {
  max-width: 48ch;
  margin: 0 auto 1rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ==========================================================================
   Guest / Authentication Shell
   ========================================================================== */

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--ink-black);
  background-image:
    radial-gradient(circle at 18% 18%, rgba(20, 155, 176, 0.16), transparent 42%),
    radial-gradient(circle at 82% 82%, rgba(252, 109, 38, 0.12), transparent 42%);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--pure-white);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
}

.auth-header {
  margin-bottom: 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-hairline);
}

.auth-footer-note {
  margin-top: 1.25rem;
  font-size: var(--text-xs);
  color: var(--text-inverse-muted);
  text-align: center;
}

/* ==========================================================================
   Wizard Progress Stepper
   ========================================================================== */

.wizard-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.35rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--pure-white);
  border: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.wizard-step.is-active,
.wizard-step.is-current {
  border-color: var(--pacific-teal);
  background: var(--teal-tint);
  color: var(--ink-black);
  box-shadow: inset 0 0 0 1px var(--pacific-teal);
}

.wizard-step.is-done {
  border-color: var(--status-success-border);
  background: var(--status-success-bg);
  color: var(--status-success-fg);
}

/* ==========================================================================
   Study Sub-Navigation Tabs (Segmented Control Strip)
   ========================================================================== */

.study-subnav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  padding: 0.28rem;
  background: var(--surface-03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.study-subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.study-subnav-link:hover:not(.is-disabled) {
  color: var(--ink-black);
  background: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}

.study-subnav-link.is-active {
  background: var(--pure-white);
  color: var(--ink-black);
  font-weight: 650;
  box-shadow: var(--shadow-xs);
}

.study-subnav-link.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.study-subnav-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--surface-02);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* ==========================================================================
   Executive Hero Takeaway Card (Story-First Results Centerpiece)
   ========================================================================== */

.hero-takeaway {
  background: linear-gradient(135deg, var(--ink-black) 0%, var(--space-indigo) 100%);
  color: var(--pure-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.35rem;
  border-left: 5px solid var(--pacific-teal);
  box-shadow: var(--shadow-elevated);
}

.hero-takeaway.is-limited {
  border-left-color: var(--atomic-tangerine);
}

.hero-takeaway.is-blocked {
  border-left-color: #94A3B8;
}

.hero-takeaway-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.hero-takeaway-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ADAE5;
}

.hero-takeaway-title,
.hero-takeaway-headline {
  margin: 0 0 0.75rem;
  font-size: var(--text-xl);
  font-weight: 750;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--pure-white);
}

.hero-takeaway-sub {
  margin: 0 0 1rem;
  font-size: var(--text-md);
  line-height: 1.55;
  color: #E2E8F0;
  max-width: 78ch;
}

.hero-takeaway-bullets {
  margin: 0 0 1.15rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: #E2E8F0;
  font-size: var(--text-base);
  line-height: 1.55;
  max-width: 82ch;
}

.hero-takeaway-bullets li::marker {
  color: var(--pacific-teal);
}

.hero-takeaway-footer,
.hero-takeaway-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Ensure secondary buttons placed inside the dark hero card stay high-contrast */
.hero-takeaway .btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--pure-white);
  border-color: rgba(255, 255, 255, 0.28);
}

.hero-takeaway .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: var(--pure-white);
  border-color: rgba(255, 255, 255, 0.48);
}

/* ==========================================================================
   Plain-English Coaching Cards (Credibility & Data Readiness)
   ========================================================================== */

.coaching-card {
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--pacific-teal);
  border-radius: var(--radius-md);
  background: var(--pure-white);
  padding: 0.95rem 1.15rem;
  margin-bottom: 0.75rem;
}

.coaching-card:last-child {
  margin-bottom: 0;
}

.coaching-card-danger {
  border-left-color: var(--status-danger-dot);
  background: #FFFDFD;
}

.coaching-card-warning {
  border-left-color: var(--atomic-tangerine);
  background: #FFFDF9;
}

.coaching-card-info,
.coaching-card-progress {
  border-left-color: var(--pacific-teal);
}

.coaching-card-success {
  border-left-color: var(--status-success-dot);
}

.coaching-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.coaching-card-title {
  margin: 0.35rem 0 0;
  font-size: var(--text-base);
  font-weight: 650;
  color: var(--ink-black);
}

.coaching-card-code {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  background: var(--surface-02);
  padding: 0.15rem 0.42rem;
  border-radius: var(--radius-xs);
}

.coaching-card-why {
  margin: 0.3rem 0 0.6rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.coaching-card-action {
  font-size: var(--text-xs);
  color: var(--ink-black);
  background: var(--surface-02);
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
}

/* ==========================================================================
   Progressive Disclosure Audit Drawer & Terminal Stage Log
   ========================================================================== */

.audit-drawer {
  background: var(--pure-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 1.25rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-xs);
}

.audit-drawer-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 650;
  font-size: var(--text-sm);
  color: var(--ink-black);
  user-select: none;
  transition: background-color 0.12s ease;
}

.audit-drawer-summary:hover {
  background: var(--surface-02);
}

.audit-drawer-summary::-webkit-details-marker {
  display: none;
}

.audit-drawer-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.audit-drawer-icon {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}

.audit-drawer-right {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.audit-drawer-subtitle {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.audit-drawer-chevron {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  transition: transform 0.16s ease;
  flex-shrink: 0;
}

.audit-drawer[open] .audit-drawer-chevron {
  transform: rotate(180deg);
}

.audit-drawer[open] .audit-drawer-summary {
  border-bottom: 1px solid var(--border-hairline);
  background: var(--surface-02);
}

.audit-drawer-body {
  padding: 1.2rem 1.25rem;
}

.terminal-log {
  background: var(--ink-black);
  color: #E2E8F0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--space-indigo);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 24rem;
  font-size: var(--text-xs);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   Accessible Inline Help Tooltip (?)
   ========================================================================== */

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.help-tip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--surface-03);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  line-height: 1;
}

.help-tip:hover .help-tip-trigger,
.help-tip:focus .help-tip-trigger {
  background: var(--pacific-teal);
  border-color: var(--pacific-teal);
  color: var(--pure-white);
}

.help-tip-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  padding: 0.6rem 0.75rem;
  background: var(--ink-black);
  color: var(--pure-white);
  font-size: var(--text-xs);
  font-weight: 450;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popover);
  z-index: 60;
  pointer-events: none;
}

.help-tip:hover .help-tip-popover,
.help-tip:focus .help-tip-popover,
.help-tip:focus-within .help-tip-popover {
  display: block;
}

/* ==========================================================================
   Onboarding Checklist & Data Coverage Timeline
   ========================================================================== */

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-02);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.onboarding-step.is-current {
  background: var(--pure-white);
  border-color: var(--pacific-teal);
  box-shadow: 0 2px 8px rgba(20, 155, 176, 0.08);
}

.onboarding-step.is-done {
  background: #F8FCFA;
  border-color: var(--status-success-border);
}

.onboarding-step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-xs);
  background: var(--pure-white);
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.onboarding-step.is-current .onboarding-step-num {
  background: var(--pacific-teal);
  border-color: var(--pacific-teal);
  color: var(--pure-white);
}

.onboarding-step.is-done .onboarding-step-num {
  background: var(--status-success-fg);
  border-color: var(--status-success-fg);
  color: var(--pure-white);
}

.onboarding-step-content {
  flex: 1;
  min-width: 0;
}

.onboarding-step-content strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 650;
  color: var(--ink-black);
}

.onboarding-step-content p {
  margin: 0.12rem 0 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.coverage-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.coverage-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

.coverage-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.coverage-row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  align-items: center;
  gap: 1rem;
}

.coverage-source-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: var(--text-sm);
}

.coverage-dates {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 0.12rem;
  font-variant-numeric: tabular-nums;
}

.coverage-track {
  position: relative;
  height: 0.65rem;
  background: var(--surface-03);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
}

.coverage-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: var(--radius-pill);
  background: var(--pacific-teal);
}

.coverage-bar-indigo {
  background: var(--space-indigo);
}

.coverage-bar-tangerine {
  background: var(--atomic-tangerine);
}

/* ==========================================================================
   Smart File Dropzone & AI Mapping Rows
   ========================================================================== */

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.25rem 1.5rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-02);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--pacific-teal);
  background: var(--teal-tint);
}

.upload-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.upload-dropzone-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--pure-white);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  color: var(--pacific-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.upload-dropzone-title {
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--ink-black);
}

.upload-dropzone-sub {
  margin-top: 0.25rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.upload-file-pill {
  margin-top: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--pure-white);
  border: 1px solid var(--pacific-teal);
  color: var(--ink-black);
  font-size: var(--text-xs);
  font-weight: 650;
}

.mapping-list,
.mapping-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mapping-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) minmax(220px, 1.2fr) minmax(200px, 1.3fr);
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--pure-white);
}

.mapping-row.is-required {
  border-left: 3px solid var(--pacific-teal);
}

.mapping-row.is-required-missing {
  border-color: var(--tangerine-border);
  background: #FFFDFB;
}

.mapping-label-col strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--ink-black);
}

.mapping-label-col span {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 0.12rem;
}

.mapping-samples,
.sample-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.2rem;
}

.sample-pill {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 0.16rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--surface-02);
  border: 1px solid var(--border-subtle);
  color: var(--ink-black);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--teal-tint) 0%, #F4FAFC 100%);
  border: 1px solid var(--teal-border);
  margin-bottom: 1.15rem;
}

.ai-banner-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--pure-white);
  border: 1px solid var(--teal-border);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   1-Click Scenario Preset Cards & Run Progress Checklist
   ========================================================================== */

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.preset-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--pure-white);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.preset-card:hover {
  border-color: var(--pacific-teal);
  box-shadow: var(--shadow-elevated);
}

.preset-card-tag {
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--teal-dark);
}

.preset-card-title {
  margin: 0.3rem 0 0.35rem;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink-black);
}

.preset-card-desc {
  margin: 0 0 0.95rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.45;
}

.run-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.run-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.78rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--pure-white);
}

.run-step.is-active {
  border-color: var(--pacific-teal);
  background: var(--teal-tint);
}

.run-step.is-done {
  border-color: var(--status-success-border);
  background: #F8FCFA;
}

.run-step.is-error {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.run-step-indicator {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  background: var(--surface-02);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.run-step.is-done .run-step-indicator {
  background: var(--status-success-fg);
  border-color: var(--status-success-fg);
  color: var(--pure-white);
}

.run-step.is-active .run-step-indicator {
  background: var(--pacific-teal);
  border-color: var(--pacific-teal);
  color: var(--pure-white);
}

.run-step.is-error .run-step-indicator {
  background: var(--status-danger-fg);
  border-color: var(--status-danger-fg);
  color: var(--pure-white);
}

/* ==========================================================================
   Charts, Response Curve Grid & Composable Layout Utilities
   ========================================================================== */

.chart-frame {
  padding: 0.75rem 0.5rem 0.25rem;
  background: var(--pure-white);
  border-radius: var(--radius-sm);
}

.response-curve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1rem;
}

.response-curve-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  background: var(--surface-02);
}

.response-curve-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.scenario-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.25rem;
  margin-bottom: 1.15rem;
  background: var(--surface-02);
}

.scenario-card:last-child {
  margin-bottom: 0;
}

.report-preview-canvas {
  background: #DCE2EC;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 2px 6px rgba(8, 14, 26, 0.06);
}

.stack-xs { display: flex; flex-direction: column; gap: var(--space-1); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-md { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-6); }

.cluster { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.cluster-sm { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.cluster-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.15rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.grid-2 > .form-group,
.grid-3 > .form-group {
  margin-bottom: 1rem;
}

.form-card-narrow {
  max-width: 760px;
}

/* Inline Collapsible Action Panel (.expandable) */
details.expandable {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-02);
  padding: 0.7rem 0.95rem;
  margin-bottom: 1rem;
}

details.expandable > summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--teal-dark);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

details.expandable > summary::-webkit-details-marker {
  display: none;
}

details.expandable > summary::after {
  content: "+";
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

details.expandable[open] {
  background: var(--pure-white);
  border-color: var(--pacific-teal);
}

details.expandable[open] > summary {
  padding-bottom: 0.65rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--ink-black);
}

details.expandable[open] > summary::after {
  content: "−";
}

.text-muted { color: var(--text-muted); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.font-semibold { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Responsive Breakpoints, Print & Reduced Motion
   ========================================================================== */

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

  .app-sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .page-content {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .mapping-row,
  .coverage-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .app-sidebar,
  .topbar,
  .study-subnav,
  .btn {
    display: none !important;
  }

  body,
  .app-main {
    background: var(--pure-white);
  }

  .app-shell {
    display: block;
  }

  .page-content {
    padding: 0;
    max-width: none;
  }

  .card {
    box-shadow: none;
    break-inside: avoid;
  }
}
