/* ==========================================================================
   ChinaTariffCalculator.com — Swiss Financial Precision Design System (2026)
   Compliant with Modern Web Guidance:
   - Responsive Tables (@container queries, sticky row/column headers, ::before labels)
   - Accessible Forms (visible labels, Gestalt proximity, :invalid:user-invalid, 48px tap targets)
   - Tabular numerals (font-variant-numeric: tabular-nums) for financial accuracy
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-navy: #0f172a;
  --bg-navy-light: #1e293b;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --brand-primary: #0284c7;
  --brand-primary-dark: #0369a1;
  --brand-accent: #0f172a;
  --status-go-bg: #ecfdf5;
  --status-go-text: #065f46;
  --status-go-border: #10b981;
  --status-warn-bg: #fffbeb;
  --status-warn-text: #92400e;
  --status-warn-border: #f59e0b;
  --status-danger-bg: #fef2f2;
  --status-danger-text: #991b1b;
  --status-danger-border: #ef4444;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 5rem;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* Tabular Numbers for all financial & tariff figures */
.tabular-nums,
table td,
table th,
.receipt-value,
.rate-badge,
.metric-number {
  font-variant-numeric: tabular-nums;
}

/* Visually hidden utility (Modern Web Guidance canonical recipe) */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* Top Compliance Alert Banner */
.top-policy-bar {
  background: var(--bg-navy);
  color: #f8fafc;
  font-size: 0.85rem;
  padding-block: 0.5rem;
  padding-inline: 1rem;
  border-block-end: 1px solid #334155;
}

.top-policy-inner {
  max-inline-size: 1280px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.policy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-surface);
  border-block-end: 1px solid var(--border-subtle);
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-inline-size: 1280px;
  margin-inline: auto;
  padding-block: 0.85rem;
  padding-inline: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-navy);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s, color 0.15s;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--bg-subtle);
  color: var(--brand-primary-dark);
}

/* Container Layout */
.container {
  max-inline-size: 1280px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Hero Section */
.hero-section {
  padding-block: 1.75rem 1.25rem;
}

.breadcrumb-nav {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-block-end: 0.65rem;
}

.breadcrumb-nav a {
  color: var(--brand-primary-dark);
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.hero-header h1 {
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  line-height: 1.2;
  margin-block: 0 0.65rem;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-inline-size: 86ch;
  margin-block: 0 1.25rem;
}

/* Quick Demo Preset Chips */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.preset-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-inline-end: 0.25rem;
}

.preset-chip {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  min-block-size: 38px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  border-color: var(--brand-primary);
  background: #e0f2fe;
  color: var(--brand-primary-dark);
}

.preset-chip.active {
  background: var(--bg-navy);
  color: #ffffff;
  border-color: var(--bg-navy);
}

/* Dual-Column Calculator Workbench */
.workbench-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-block-end: 2.5rem;
}

@media (min-width: 1024px) {
  .workbench-grid {
    grid-template-columns: 7fr 5fr;
  }
}

.calc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}

/* Mode Switcher Radio Group (Modern Web Guidance: <6 options exposed as visible radios) */
.mode-fieldset {
  border: 0;
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.mode-fieldset legend {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-block-end: 0.5rem;
}

.mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
}

.mode-option {
  position: relative;
}

.mode-option input[type="radio"] {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
}

.mode-option label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.7rem 0.9rem;
  min-block-size: 52px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.mode-option label span.mode-sub {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
}

.mode-option input[type="radio"]:checked + label {
  background: var(--bg-surface);
  color: var(--bg-navy);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.mode-option input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Form Groups & Inputs (Modern Web Guidance compliant) */
.form-section-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-block: 0 1.25rem;
  background: #fcfdff;
}

.form-section-fieldset legend {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bg-navy);
  padding-inline: 0.45rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.form-group {
  margin-block-end: 1rem;
}

.form-group:last-child {
  margin-block-end: 0;
}

/* Gestalt Proximity Rule: vertical margin between label and input (0.3rem) < margin between groups (1rem) */
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-block-end: 0.3rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-block-start: 0.25rem;
}

.field-error {
  display: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--status-danger-text);
  margin-block-start: 0.3rem;
}

.form-group.has-error .field-error {
  display: block;
}

input[type="text"],
input[type="search"],
select,
textarea {
  inline-size: 100%;
  font-size: 1rem; /* >=16px prevents iOS auto-zoom */
  font-family: var(--font-sans);
  padding: 0.65rem 0.8rem;
  min-block-size: 48px; /* >=48px tap target */
  border: 1px solid #94a3b8; /* High contrast border */
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

@media (pointer: coarse) {
  input[type="text"],
  input[type="search"],
  select {
    min-block-size: 52px;
  }
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}

input:invalid:user-invalid {
  border-color: var(--status-danger-border);
  background-color: var(--status-danger-bg);
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  position: absolute;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
  pointer-events: none;
}

.input-prefix {
  inset-inline-start: 0.75rem;
}

.input-suffix {
  inset-inline-end: 0.75rem;
}

.input-with-prefix input {
  padding-inline-start: 1.85rem;
}

.input-with-suffix input {
  padding-inline-end: 2.2rem;
}

/* Live USITC HTS Lookup Drawer & Results */
.hts-lookup-bar {
  display: flex;
  gap: 0.5rem;
  margin-block-top: 0.5rem;
}

.btn-secondary {
  appearance: none;
  background: var(--bg-navy);
  color: #ffffff;
  border: 1px solid var(--bg-navy);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  min-block-size: 48px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--bg-navy-light);
}

.hts-results-panel {
  margin-block-start: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  max-block-size: 230px;
  overflow-y: auto;
  display: none;
}

.hts-results-panel.open {
  display: block;
}

.hts-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-block-end: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 0.85rem;
}

.hts-result-item:hover {
  background: #f0f9ff;
}

.hts-code-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--brand-primary-dark);
  background: #e0f2fe;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* Collapsible Helper Drawers (CBM / Volumetric & DDP Truth Checker) */
.helper-details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  margin-block-end: 1rem;
  padding: 0.65rem 1rem;
}

.helper-details summary {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand-primary-dark);
  cursor: pointer;
  padding-block: 0.25rem;
}

.helper-body {
  padding-block-start: 0.85rem;
  border-block-start: 1px solid var(--border-color);
  margin-block-start: 0.6rem;
}

/* Right Column: Sticky Live CBP Form 7501 Audit Receipt */
.receipt-card {
  background: var(--bg-navy);
  color: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  inset-block-start: 5rem;
  border: 1px solid #334155;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-block-end: 1px dashed #475569;
  padding-block-end: 1rem;
  margin-block-end: 1.15rem;
}

.receipt-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
}

.receipt-hts-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: #1e293b;
  color: #38bdf8;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid #334155;
}

.receipt-hero-metrics {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin-block-end: 1.25rem;
}

.metric-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.metric-label {
  font-size: 0.78rem;
  color: #cbd5e1;
  display: block;
  margin-block-end: 0.2rem;
}

.metric-number {
  font-family: var(--font-mono);
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}

.metric-sub {
  font-size: 0.78rem;
  color: #38bdf8;
  margin-block-start: 0.25rem;
  display: block;
  font-family: var(--font-mono);
}

/* Stacked Cost Breakdown Bar */
.cost-bar-wrap {
  margin-block-end: 1.25rem;
}

.cost-bar-track {
  display: flex;
  block-size: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #1e293b;
  margin-block-end: 0.55rem;
}

.bar-seg-fob { background: #38bdf8; }
.bar-seg-duty { background: #f43f5e; }
.bar-seg-fees { background: #f59e0b; }
.bar-seg-freight { background: #10b981; }

.cost-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-inline-end: 0.3rem;
}

/* Line Item Receipt Breakdown */
.receipt-lines {
  border-block-start: 1px solid #334155;
  padding-block-start: 0.85rem;
  margin-block-end: 1.15rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 0.4rem;
  font-size: 0.88rem;
  border-block-end: 1px solid rgba(255, 255, 255, 0.06);
}

.receipt-row.total-row {
  border-block-start: 1px dashed #64748b;
  border-block-end: 0;
  padding-block-start: 0.75rem;
  margin-block-start: 0.35rem;
  font-weight: 800;
  font-size: 1rem;
  color: #38bdf8;
}

.receipt-label {
  color: #cbd5e1;
}

.receipt-rate-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-inline-start: 0.35rem;
}

.receipt-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
}

/* Traffic Light Profit Verdict & DDP Truth Radar */
.verdict-banner {
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-block-end: 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.verdict-go {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
}

.verdict-tight {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.verdict-nogo {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

/* Action Toolbar */
.receipt-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-block-end: 1rem;
}

.btn-action {
  appearance: none;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.5rem;
  min-block-size: 44px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-action:hover {
  background: #334155;
}

/* FX Wire Savings Card */
.fx-savings-box {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid #38bdf8;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.fx-savings-box strong {
  color: #38bdf8;
}

/* Responsive Data Tables (Strictly following Modern Web Guidance `responsive-table`) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 80vh);
  container-type: inline-size;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-block: 1.25rem 2rem;
}

.table-wrapper table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.table-wrapper caption {
  text-align: start;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--bg-navy);
  background: var(--bg-subtle);
  border-block-end: 1px solid var(--border-color);
}

/* Sticky column headers (desktop) */
.table-wrapper thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.table-wrapper thead th {
  background: var(--bg-navy);
  color: #ffffff;
  font-weight: 700;
  text-align: start;
  padding: 0.75rem 1rem;
  border-block-end: 1px solid #334155;
}

/* Sticky row headers (desktop) */
.table-wrapper tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--bg-surface);
  color: var(--bg-navy);
  font-weight: 700;
  text-align: start;
  padding: 0.75rem 1rem;
  border-block-end: 1px solid var(--border-subtle);
  border-inline-end: 1px solid var(--border-subtle);
}

.table-wrapper tbody td {
  padding: 0.75rem 1rem;
  border-block-end: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.table-wrapper tbody tr:hover td,
.table-wrapper tbody tr:hover th {
  background: #f0f9ff;
}

/* Modern Web Guidance: Responsive Stacked Layout inside @container (width < 600px) */
@container (width < 600px) {
  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
  }

  .table-wrapper thead {
    /* MANDATORY: Hide column header from layout and screen readers */
    display: none;
  }

  .table-wrapper tr {
    margin-block-end: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
  }

  .table-wrapper tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--bg-subtle);
  }

  .table-wrapper td:nth-child(2)::before {
    content: var(--label-2, "HTS Code") ": ";
    font-weight: 700;
    color: var(--text-primary);
  }
  .table-wrapper td:nth-child(3)::before {
    content: var(--label-3, "Base MFN") ": ";
    font-weight: 700;
    color: var(--text-primary);
  }
  .table-wrapper td:nth-child(4)::before {
    content: var(--label-4, "Section 301") ": ";
    font-weight: 700;
    color: var(--text-primary);
  }
  .table-wrapper td:nth-child(5)::before {
    content: var(--label-5, "2026 Stacked Total") ": ";
    font-weight: 700;
    color: var(--text-primary);
  }
  .table-wrapper td:nth-child(6)::before {
    content: var(--label-6, "Action") ": ";
    font-weight: 700;
    color: var(--text-primary);
  }
}

/* Editorial Content Sections, How-To Steps, and FAQs */
.content-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-block-end: 2rem;
  box-shadow: var(--shadow-sm);
}

.content-section h2 {
  font-size: 1.5rem;
  color: var(--bg-navy);
  margin-block: 0 1rem;
  letter-spacing: -0.02em;
}

.content-section h3 {
  font-size: 1.15rem;
  color: var(--bg-navy);
  margin-block: 1.5rem 0.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-block: 1.25rem;
}

.step-card {
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bg-navy);
  color: #38bdf8;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-block-end: 0.65rem;
}

/* Internal Hub Links Grid */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
  margin-block: 1.25rem;
}

.hub-card {
  display: block;
  text-decoration: none;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  color: var(--text-primary);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.hub-card strong {
  display: block;
  font-size: 1rem;
  color: var(--brand-primary-dark);
  margin-block-end: 0.3rem;
}

.hub-card span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* FAQ Accordion */
.faq-list details {
  border-block-end: 1px solid var(--border-subtle);
  padding-block: 1rem;
}

.faq-list summary {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--bg-navy);
  cursor: pointer;
}

.faq-list p {
  color: var(--text-secondary);
  margin-block: 0.65rem 0;
}

/* Footer */
.site-footer {
  background: var(--bg-navy);
  color: #cbd5e1;
  padding-block: 3rem 2rem;
  margin-block-start: 3rem;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-block-end: 2rem;
}

.site-footer h3 {
  color: #ffffff;
  font-size: 0.95rem;
  margin-block: 0 0.75rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-block-end: 0.45rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.disclaimer-box {
  border-block-start: 1px solid #334155;
  padding-block-start: 1.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

@media print {
  .site-header,
  .top-policy-bar,
  .preset-bar,
  .receipt-actions,
  .site-footer,
  .content-section {
    display: none !important;
  }
  .workbench-grid {
    grid-template-columns: 1fr 1fr;
  }
  .receipt-card {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
  }
}


/* ==========================================================================
   GEO TL;DR Summary Box, Worked Example Box & Table Action Buttons
   ========================================================================== */
.tldr-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  border-left: 5px solid #059669;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.tldr-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tldr-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #064e3b;
  font-size: 0.94rem;
  line-height: 1.65;
}
.tldr-list li {
  margin-bottom: 0.35rem;
}
.example-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #0f172a;
  border-radius: 0.65rem;
  padding: 1.15rem 1.35rem;
  margin: 1rem 0;
  font-size: 0.93rem;
}
.btn-table-calc {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #1e293b;
  border-radius: 0.4rem;
  padding: 0.32rem 0.68rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-table-calc:hover {
  background: #059669;
  border-color: #059669;
}

/* ==========================================================================
   v4.0 Advanced Workbench Extensions:
   1. AD/CVD Statutory Scope Radar Alert & Cash Deposit Overlay
   2. Compound & Specific Duties ($/kg, $/unit) Drawer
   3. Amazon FBA / Shopify Profit & Target Retail Price Simulator
   4. China vs. Vietnam / Mexico / India Nearshoring Landed Cost Comparator
   5. Multi-SKU CBP Form 7501 Container Manifest & Pro-Rata MPF/Freight Engine
   ========================================================================== */
.adcvd-radar-box {
  display: none;
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  background: #fef2f2;
  border: 1px solid #f87171;
  border-left: 5px solid #dc2626;
  border-radius: var(--radius-md);
  color: #7f1d1d;
  font-size: 0.85rem;
  line-height: 1.5;
}
.adcvd-radar-box.active {
  display: block;
}
.adcvd-radar-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.adcvd-case-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.76rem;
  background: #dc2626;
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.btn-adcvd-apply {
  background: #991b1b;
  color: #ffffff;
  border: 0;
  border-radius: 4px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-adcvd-apply:hover {
  background: #7f1d1d;
}

/* Advanced Interactive Suite Below Receipt / Workbench */
.v4-suite-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-block: 0 2.25rem;
}
@media (min-width: 1024px) {
  .v4-suite-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.v4-panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.v4-panel-card.full-span {
  grid-column: 1 / -1;
}
.v4-panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.v4-panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bg-navy);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.v4-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}
.v4-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}
.v4-kpi-item {
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}
.v4-kpi-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.v4-kpi-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--bg-navy);
  margin-top: 0.15rem;
}
.v4-kpi-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}
.v4-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.btn-v4 {
  appearance: none;
  background: var(--bg-navy);
  color: #ffffff;
  border: 1px solid var(--bg-navy);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-v4:hover {
  background: #0284c7;
  border-color: #0284c7;
}
.btn-v4.secondary {
  background: var(--bg-page);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-v4.secondary:hover {
  background: #e2e8f0;
}
.btn-v4.danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}
.manifest-summary-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.86rem;
  color: #0c4a6e;
}
.country-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
.country-cmp-table th,
.country-cmp-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
.country-cmp-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--bg-navy);
}
.country-win-pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}
.country-lose-pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
}
