/* ==========================================================================
   NORTHWIND PAY STUDIO DESIGN TOKENS & STYLESHEET
   Sources: Stripe DESIGN.md, Vercel Geist, Josh Comeau HSL Shadows, Emil Kowalski
   ========================================================================== */
:root {
  /* 1. Canvas & Surface Hierarchy */
  --nw-bg-canvas: #f7f6f2; /* Warm stone alabaster canvas */
  --nw-surface-primary: #ffffff; /* Crisp white primary task card */
  --nw-surface-subtle: #f8fafc; /* Cool alabaster for inner callouts/previews */
  --nw-surface-console: #eef2f6; /* Recessed diagnostic slate for Chaos Console */
  --nw-surface-console-group: #f8fafc; /* Inner fieldset card surface inside Chaos Console */
  --nw-surface-track: #e2e8f0; /* Recessed track for segmented radio controls */

  /* 2. Chromatic Navy & Slate Typography Ink (Stripe Palette — WCAG AAA) */
  --nw-text-primary: #061b31; /* Deep navy-slate ink (17.2:1 on white) */
  --nw-text-secondary: #273951; /* Rich slate for labels & receipt keys (11.4:1) */
  --nw-text-muted: #475569; /* Accessible muted slate for hints (7.5:1) */
  --nw-text-inverse: #ffffff; /* Crisp white on primary buttons */

  /* 3. Borders & Hairlines (WCAG 2.2 SC 1.4.11 >= 3:1 Non-Text Contrast) */
  --nw-border-hairline: #e2e8f0; /* 1px internal receipt & activity row divider */
  --nw-border-card: rgba(15, 23, 42, 0.08); /* Sub-pixel card ring */
  --nw-border-subtle: #cbd5e1; /* Card divider / hairline */
  --nw-border-console: #cbd5e1; /* Outer perimeter of Chaos Console */
  --nw-border-control: #64748b; /* Input, select, and secondary button border (4.5:1) */
  --nw-border-control-hover: #334155; /* Hovered input/button border (10.1:1) */
  --nw-border-control-console: #64748b; /* Console switch border */

  /* 4. Primary Brand & Interactive Accent (Northwind Slate Blue) */
  --nw-action-primary: #0f4c81; /* Primary CTA fill (8.86:1 contrast with white) */
  --nw-action-primary-hover: #0b3961; /* Hover fill (11.85:1) */
  --nw-action-primary-active: #082845; /* Pressed fill */
  --nw-action-gradient: linear-gradient(180deg, #125691 0%, #0f4c81 100%);
  --nw-action-gradient-hover: linear-gradient(180deg, #0f4c81 0%, #0b3961 100%);
  --nw-focus-ring: #0f4c81; /* Universal keyboard focus ring */
  --nw-focus-halo: rgba(15, 76, 129, 0.14); /* 4px soft focus-within outer glow */

  /* 5. Tri-Modal Epistemic Outcome Tokens */
  /* Outcome A: Succeeded / Confirmed (Emerald) */
  --nw-status-success-bg: #ecfdf5;
  --nw-status-success-text: #065f46; /* 7.29:1 on #ECFDF5 */
  --nw-status-success-border: #047857; /* 5.21:1 on #ECFDF5 */
  --nw-status-success-badge-bg: #d1fae5;

  /* Outcome B: Rejected / Error (Crimson) */
  --nw-status-error-bg: #fef2f2;
  --nw-status-error-text: #991b1b; /* 7.60:1 on #FEF2F2 */
  --nw-status-error-border: #b91c1c; /* 6.47:1 on #FFFFFF */
  --nw-status-error-badge-bg: #fee2e2;

  /* Outcome C: Unconfirmed / Uncertain (Parchment Amber + Dashed Geometry) */
  --nw-status-uncertain-bg: #fffbeb;
  --nw-status-uncertain-text: #78350f; /* 8.75:1 on #FFFBEB */
  --nw-status-uncertain-border: #b45309; /* 4.84:1 on #FFFBEB */
  --nw-status-uncertain-badge-bg: #fde68a;

  /* Semantic In-Flight / Informational */
  --nw-status-pending-bg: #eff6ff;
  --nw-status-pending-text: #1e3a8a;
  --nw-status-pending-border: #1d4ed8;

  /* 6. Chaos Diagnostic Active Selection (Indigo-Slate) */
  --nw-chaos-active-bg: #eef2ff;
  --nw-chaos-active-text: #312e81; /* 10.22:1 on #EEF2FF */
  --nw-chaos-active-border: #4338ca; /* 7.07:1 on #EEF2FF */

  /* 7. Vercel Geist + Josh Comeau HSL Layered Shadows */
  --nw-shadow-color: 215deg 35% 18%;
  --nw-shadow-card:
    0px 0px 0px 1px rgba(15, 23, 42, 0.07), 0px 1px 2px hsl(var(--nw-shadow-color) / 0.04),
    0px 4px 8px -2px hsl(var(--nw-shadow-color) / 0.06),
    0px 12px 20px -4px hsl(var(--nw-shadow-color) / 0.05);
  --nw-shadow-balance-strip:
    0px 0px 0px 1px rgba(15, 23, 42, 0.07), 0px 1px 3px hsl(var(--nw-shadow-color) / 0.05);
  --nw-shadow-input: 0px 1px 2px rgba(6, 27, 49, 0.04);
  --nw-shadow-pill:
    0px 1px 3px rgba(6, 27, 49, 0.1), 0px 1px 2px rgba(6, 27, 49, 0.06),
    0px 0px 0px 1px rgba(6, 27, 49, 0.04);
  --nw-shadow-btn-primary:
    0px 1px 2px rgba(6, 27, 49, 0.18), inset 0px 1px 0px rgba(255, 255, 255, 0.16);
  --nw-shadow-btn-primary-hover:
    0px 4px 10px -2px rgba(15, 76, 129, 0.35), inset 0px 1px 0px rgba(255, 255, 255, 0.22);

  /* 8. Typography & Spacing Scale */
  --nw-font-sans:
    Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
    sans-serif;
  --nw-font-mono:
    ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

  --nw-space-1: 4px;
  --nw-space-2: 8px;
  --nw-space-3: 12px;
  --nw-space-4: 16px;
  --nw-space-5: 20px;
  --nw-space-6: 24px;
  --nw-space-8: 32px;
  --nw-space-10: 40px;

  --nw-radius-sm: 5px;
  --nw-radius-md: 8px;
  --nw-radius-lg: 12px;
  --nw-radius-pill: 9999px;

  /* 9. Emil Kowalski & Josh Comeau Motion Tokens */
  --nw-duration-instant: 0ms;
  --nw-duration-fast: 120ms;
  --nw-duration-base: 180ms;
  --nw-duration-leave: 300ms;
  --nw-duration-spinner: 750ms;

  --nw-spring-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --nw-spring-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --nw-spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nw-ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  --nw-ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* Legacy Backward-Compatibility Aliases */
  --color-bg: var(--nw-bg-canvas);
  --color-surface: var(--nw-surface-primary);
  --color-text: var(--nw-text-primary);
  --color-text-muted: var(--nw-text-muted);
  --color-border: var(--nw-border-subtle);
  --color-primary: var(--nw-action-primary);
  --color-error: var(--nw-status-error-border);
  --color-focus: var(--nw-focus-ring);
  --radius: var(--nw-radius-lg);
  --space-1: var(--nw-space-1);
  --space-2: var(--nw-space-2);
  --space-3: var(--nw-space-4);
  --space-4: var(--nw-space-6);
  --space-5: var(--nw-space-8);
  --font-base: var(--nw-font-sans);
}

/* Global Tabular Numerals Enforcement (Rauno Freiberg Invisible Details Rule) */
.nw-tabular,
.nw-amount-input,
.nw-money-display,
.nw-rate-display,
.nw-balance-display,
.nw-history-amount,
.nw-balance-amount,
.nw-quote-preview,
.nw-conversion-preview,
.nw-activity-amount,
.smu-preview,
input[type='text'],
input[inputmode='decimal'],
select,
dd {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings:
    'tnum' 1,
    'lnum' 1;
}

/* Universal WCAG 2.2 SC 2.4.13 Focus Ring (0ms instant application) */
:focus-visible {
  outline: 2px solid var(--nw-focus-ring) !important;
  outline-offset: 2px !important;
  box-shadow:
    0 0 0 2px var(--nw-surface-primary),
    0 0 0 4px var(--nw-focus-ring) !important;
  transition: none !important;
}

/* Strict Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  :root {
    --nw-duration-fast: 0.01ms;
    --nw-duration-base: 0.01ms;
    --nw-duration-leave: 0.01ms;
    --nw-duration-spinner: 0.01ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--nw-bg-canvas);
  color: var(--nw-text-primary);
  font-family: var(--nw-font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Button & Interactive Resets */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  box-sizing: border-box;
}

button {
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
}

/* ==========================================================================
   PHASE 2: LAYOUT SHELL & TWO-COLUMN WORKSPACE
   ========================================================================== */
.nw-app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.nw-header {
  background-color: var(--nw-surface-primary);
  border-bottom: 1px solid var(--nw-border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nw-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nw-brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* NP Brand Emblem in Northwind Slate Blue */
.nw-brand-mark {
  background: linear-gradient(135deg, #125691 0%, #0f4c81 100%) !important;
  color: #ffffff !important;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(6, 27, 49, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nw-brand-logo {
  color: var(--nw-action-primary);
  flex-shrink: 0;
}

.nw-brand-copy {
  display: flex;
  flex-direction: column;
}

.nw-brand-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--nw-text-primary);
  line-height: 1.2;
}

.nw-brand-divider {
  color: var(--nw-border-subtle);
}

.nw-brand-subtitle {
  font-size: 12.5px;
  color: var(--nw-text-muted);
  line-height: 1.2;
}

.nw-simulation-badge-group,
.nw-sim-aside {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Vercel Geist Technical Pill */
.nw-sim-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1e293b;
  background-color: #e2e8f0;
  border: 1px solid #94a3b8;
  border-radius: var(--nw-radius-pill);
  flex-shrink: 0;
}

.nw-sim-text {
  font-size: 12px;
  color: var(--nw-text-muted);
}

/* Mobile Chaos Quick Banner (< 1024px) */
.nw-mobile-chaos-banner {
  display: none;
  background-color: var(--nw-surface-console);
  border-bottom: 1px solid var(--nw-border-console);
  padding: 8px 16px;
  font-size: 13px;
  justify-content: space-between;
  align-items: center;
}

.nw-mobile-chaos-jump {
  color: var(--nw-action-primary);
  text-decoration: underline;
  font-weight: 600;
}

/* Main Workspace Grid (7fr : 5fr, Max 1200px) */
.nw-workspace-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 20px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(380px, 5fr);
  gap: 24px;
  align-items: start;
}

.nw-col-primary {
  min-width: 0;
}

.nw-col-console {
  min-width: 0;
}

/* Card Foundation with Vercel Geist + Josh Comeau HSL Layered Shadows */
.nw-card {
  background-color: var(--nw-surface-primary);
  border-radius: var(--nw-radius-lg);
  box-shadow: var(--nw-shadow-card);
  border: none; /* Replaced by shadow-as-border */
  padding: 24px 28px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

/* Step Progress Indicator (Breadcrumbs) */
.nw-step-indicator {
  border-bottom: 1px solid var(--nw-border-hairline);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.nw-step-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 12px;
}

.nw-step-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: var(--nw-radius-pill);
  padding: 3px 11px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--nw-duration-fast) var(--nw-ease-out);
}

.nw-step-item.is-complete {
  background-color: #eff6ff;
  color: #0f4c81;
  border: 1px solid #bfdbfe;
  font-weight: 600;
}

.nw-step-item.is-active {
  background-color: #0f4c81;
  color: #ffffff;
  border-color: #0f4c81;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 76, 129, 0.25);
}

.nw-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* Responsive Collapse (< 1024px) */
@media (max-width: 1023px) {
  .nw-header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .nw-mobile-chaos-banner {
    display: flex;
  }

  .nw-workspace-container {
    grid-template-columns: 1fr;
    padding: 16px 16px 32px;
    gap: 20px;
  }
}

/* ==========================================================================
   PHASE 3: MULTI-CURRENCY BALANCE STRIP & RECENT ACTIVITY
   ========================================================================== */
/* Outer 3-Currency Wallet Balance Container */
.nw-balance-bar,
.nw-account-balances,
.account-summary {
  background-color: var(--nw-surface-primary);
  border-radius: var(--nw-radius-lg);
  box-shadow: var(--nw-shadow-balance-strip);
  border: none;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: center;
  box-sizing: border-box;
}

/* Each Currency Item Pill (USD, EUR, GBP) */
.nw-balance-item,
.account-summary > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background-color: var(--nw-surface-subtle);
  border: 1px solid var(--nw-border-hairline);
  border-radius: var(--nw-radius-md);
  font-size: 15px;
  font-weight: 700;
  color: var(--nw-text-primary);
  font-variant-numeric: tabular-nums lining-nums;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
  box-sizing: border-box;
  text-align: center;
}

.nw-balance-item.is-active,
.account-summary > div.is-active {
  background-color: #eff6ff;
  border-color: #93c5fd;
  color: #0f4c81;
}

@media (max-width: 640px) {
  .nw-balance-bar,
  .nw-account-balances,
  .account-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Recent Activity Card */
.nw-history-card {
  background-color: var(--nw-surface-primary);
  border-radius: var(--nw-radius-lg);
  box-shadow: var(--nw-shadow-card);
  border: none;
  padding: 20px 24px;
}

.nw-section-heading {
  margin: 0 0 14px 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--nw-text-primary);
}

.nw-empty-text {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--nw-radius-md);
  padding: 16px;
  text-align: center;
  color: #475569;
  font-size: 13.5px;
  margin: 0;
}

.nw-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nw-activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--nw-border-hairline);
  font-size: 14px;
  color: var(--nw-text-primary);
}

.nw-activity-item:last-child {
  border-bottom: none;
}

.nw-activity-text {
  font-weight: 500;
}

/* Activity Status Badges */
.nw-activity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
}

.nw-activity-completed {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #047857;
}

.nw-activity-unconfirmed {
  background-color: #fffbeb;
  color: #78350f;
  border: 1px dashed #b45309;
}

/* ==========================================================================
   PHASE 4: FORM CONTROLS & HERO MONEY INPUT (SendForm.tsx)
   ========================================================================== */
.nw-transfer-card {
  background-color: var(--nw-surface-primary);
  border-radius: var(--nw-radius-lg);
  box-shadow: var(--nw-shadow-card);
  border: none;
  padding: 24px 28px;
  margin-bottom: 20px;
}

.nw-form-group,
.smu-field {
  margin-bottom: 20px;
}

.nw-label,
.smu-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--nw-text-primary);
  margin-bottom: 6px;
}

/* Custom SVG-Caret <select> Dropdowns */
select,
.nw-select,
.smu-field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 9px 40px 9px 14px;
  font-family: var(--nw-font-sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--nw-text-primary);
  background-color: var(--nw-surface-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2716%27 height=%2716%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23334155%27 stroke-width=%272.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpolyline points=%276 9 12 15 18 9%27%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  border: 1px solid var(--nw-border-control);
  border-radius: var(--nw-radius-md);
  box-shadow: var(--nw-shadow-input);
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color var(--nw-duration-fast) var(--nw-ease-out),
    box-shadow var(--nw-duration-fast) var(--nw-spring-snappy);
}

select:hover:not(:disabled),
.nw-select:hover:not(:disabled),
.smu-field select:hover:not(:disabled) {
  border-color: var(--nw-border-control-hover);
}

select:focus-visible,
.nw-select:focus-visible,
.smu-field select:focus-visible {
  border-color: var(--nw-focus-ring);
  box-shadow: 0 0 0 4px var(--nw-focus-halo) !important;
}

/* 1. Hero Money Input (#amount) */
input#amount,
.nw-amount-input,
.smu-input {
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--nw-text-primary);
  background-color: var(--nw-surface-primary);
  border: 1px solid var(--nw-border-control);
  border-radius: var(--nw-radius-md);
  box-shadow: var(--nw-shadow-input);
  font-variant-numeric: tabular-nums lining-nums;
  box-sizing: border-box;
  transition:
    border-color var(--nw-duration-fast) var(--nw-ease-out),
    box-shadow var(--nw-duration-fast) var(--nw-spring-snappy);
}

input#amount:hover:not(:disabled),
.nw-amount-input:hover:not(:disabled),
.smu-input:hover:not(:disabled) {
  border-color: var(--nw-border-control-hover);
}

input#amount:focus-visible,
.nw-amount-input:focus-visible,
.smu-input:focus-visible {
  border-color: var(--nw-focus-ring);
  box-shadow: 0 0 0 4px var(--nw-focus-halo) !important;
}

input#amount[aria-invalid='true'],
.nw-amount-input[aria-invalid='true'],
.smu-input[aria-invalid='true'] {
  border: 2px solid var(--nw-status-error-border);
  background-color: #fffbfb;
}

/* 2. Live Quote / Conversion Preview Strip (SOLID BORDER — NEVER DASHED!) */
.smu-preview,
.nw-quote-preview,
.nw-conversion-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1 !important; /* MUST BE SOLID, NEVER DASHED */
  border-left: 3px solid var(--nw-action-primary) !important;
  border-radius: var(--nw-radius-md);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--nw-text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

.smu-hint {
  font-size: 13px;
  color: var(--nw-text-muted);
  margin-top: 4px;
}

.smu-error-message,
.nw-field-error {
  color: var(--nw-status-error-text);
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

/* Primary CTA Button ("Review transfer", "Confirm", "Try again") */
.nw-btn-primary,
button[type='submit'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--nw-text-inverse);
  background: var(--nw-action-gradient);
  border: 1px solid #0b3961;
  border-radius: var(--nw-radius-md);
  box-shadow: var(--nw-shadow-btn-primary);
  cursor: pointer;
  box-sizing: border-box;
  /* Josh Comeau Asymmetric Leave Transition (300ms) */
  transition:
    background 300ms ease-out,
    box-shadow 300ms ease-out,
    transform 120ms var(--nw-spring-snappy);
}

.nw-btn-primary:hover:not(:disabled),
button[type='submit']:hover:not(:disabled) {
  background: var(--nw-action-gradient-hover);
  box-shadow: var(--nw-shadow-btn-primary-hover);
  /* Josh Comeau Asymmetric Enter Transition (120ms) */
  transition:
    background 120ms ease-out,
    box-shadow 120ms ease-out,
    transform 120ms var(--nw-spring-snappy);
}

.nw-btn-primary:active:not(:disabled),
button[type='submit']:active:not(:disabled) {
  transform: scale(0.985) translateY(0.5px);
}

.nw-btn-block {
  width: 100%;
}

.nw-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Secondary Button ("Edit details", "Leave transfer unconfirmed") */
.nw-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--nw-text-primary);
  background-color: var(--nw-surface-primary);
  border: 1px solid var(--nw-border-control);
  border-radius: var(--nw-radius-md);
  box-shadow: var(--nw-shadow-input);
  cursor: pointer;
  box-sizing: border-box;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 100ms var(--nw-spring-snappy);
}

.nw-btn-secondary:hover:not(:disabled) {
  background-color: #f8fafc;
  border-color: var(--nw-text-primary);
}

.nw-btn-secondary:active:not(:disabled) {
  transform: scale(0.985) translateY(0.5px);
}

/* ErrorSummary Focusable Box */
.nw-error-summary,
.smu-error-summary {
  background-color: var(--nw-status-error-bg);
  border: 1px solid #fecaca;
  border-left: 4px solid var(--nw-status-error-border);
  border-radius: var(--nw-radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.nw-error-summary-title,
.smu-error-summary-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--nw-status-error-text);
}

.nw-error-summary-list,
.smu-error-summary-list {
  margin: 0;
  padding-left: 20px;
  color: var(--nw-status-error-text);
  font-size: 14px;
}

.nw-error-summary-list li,
.smu-error-summary-list li,
.smu-error-summary-item {
  margin-bottom: 6px;
}

.nw-error-summary-list a,
.smu-error-summary-list a,
.smu-error-summary-link {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
  color: var(--nw-status-error-text);
  font-weight: 600;
  text-decoration: underline;
}

/* ==========================================================================
   PHASE 5: REVIEW RECEIPT & SPINNER (Review.tsx & Banner.tsx)
   ========================================================================== */
.nw-review-container {
  display: flex;
  flex-direction: column;
}

.nw-screen-title,
.step-heading {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--nw-text-primary);
}

.nw-screen-subtitle {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: var(--nw-text-muted);
}

.nw-receipt-list,
.review-snapshot {
  margin: 0 0 20px 0;
  padding: 0;
  border-top: 1px solid var(--nw-border-hairline);
}

.nw-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--nw-border-hairline);
  font-size: 14px;
}

.nw-receipt-row dt {
  color: var(--nw-text-secondary);
  font-weight: 500;
}

.nw-receipt-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--nw-text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

.nw-receipt-row-total {
  font-size: 16px;
  border-top: 2px solid var(--nw-text-primary);
  border-bottom: 2px solid var(--nw-text-primary);
  padding: 14px 0;
}

.nw-receipt-row-total dd {
  font-size: 18px;
  font-weight: 700;
}

/* Recipient Receives Callout Box */
.nw-receive-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  margin: 16px 0 24px;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--nw-action-primary);
  border-radius: var(--nw-radius-md);
  box-sizing: border-box;
}

.nw-receive-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--nw-text-secondary);
}

.nw-receive-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--nw-text-primary);
  font-variant-numeric: tabular-nums lining-nums;
}

.nw-review-actions {
  display: flex;
  gap: 12px;
}

.nw-review-actions .nw-btn-secondary {
  flex: 1;
}

.nw-review-actions .nw-btn-primary {
  flex: 2;
}

/* Dual-Arc Compositor SVG Spinner (750ms) */
.nw-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-right-color: #ffffff;
  animation: nw-spin var(--nw-duration-spinner) cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  flex-shrink: 0;
  margin-right: 8px;
}

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

/* Warning & Informational Banners (Banner.tsx) */
.nw-banner,
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--nw-radius-md);
  margin-bottom: 20px;
  box-sizing: border-box;
}

.nw-banner-warning,
.banner-warning {
  background-color: var(--nw-status-uncertain-bg);
  border: 1px solid var(--nw-status-uncertain-border);
  border-left: 4px solid var(--nw-status-uncertain-border);
  color: var(--nw-status-uncertain-text);
}

.banner-info {
  background-color: var(--nw-surface-console);
  border: 1px solid var(--nw-border-subtle);
  border-left: 4px solid var(--nw-action-primary);
  color: var(--nw-text-primary);
}

.banner-error {
  background-color: var(--nw-status-error-bg);
  border: 1px solid var(--nw-status-error-border);
  border-left: 4px solid var(--nw-status-error-border);
  color: var(--nw-status-error-text);
}

/* ==========================================================================
   PHASE 6: EPISTEMIC TRI-MODAL RESULT CARDS (Result.tsx)
   ========================================================================== */
.nw-result-card,
.result-card {
  border-radius: var(--nw-radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.nw-result-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.nw-result-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.nw-result-title {
  margin: 4px 0 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Succeeded / Confirmed */
.nw-result-success,
.result-success {
  background-color: var(--nw-status-success-bg);
  border: 1px solid #a7f3d0;
  border-left: 4px solid var(--nw-status-success-border);
}

.nw-result-success .nw-result-icon {
  background-color: var(--nw-status-success-border);
  color: var(--nw-text-inverse);
  animation: nw-scale-pop 240ms var(--nw-spring-bounce) both;
}

.nw-result-success .nw-result-title {
  color: var(--nw-status-success-text);
}

/* Rejected / Error */
.nw-result-rejected,
.result-rejected {
  background-color: var(--nw-status-error-bg);
  border: 1px solid #fecaca;
  border-left: 4px solid var(--nw-status-error-border);
  animation: none !important;
  transition: none !important;
}

.nw-result-rejected .nw-result-icon {
  background-color: var(--nw-status-error-border);
  color: var(--nw-text-inverse);
  border-radius: var(--nw-radius-sm); /* Octagonal / squared appearance */
}

.nw-result-rejected .nw-result-title {
  color: var(--nw-status-error-text);
}

/* Unconfirmed / Uncertain (CRITICAL: 2px Dashed Perimeter Border) */
.nw-result-unconfirmed,
.result-unconfirmed {
  background-color: var(--nw-status-uncertain-bg);
  border: 2px dashed var(--nw-status-uncertain-border);
  border-left: 4px solid var(--nw-status-uncertain-border);
  animation: none !important;
  transition: none !important;
}

.nw-result-unconfirmed .nw-result-icon {
  background-color: var(--nw-status-uncertain-border);
  color: var(--nw-text-inverse);
  border-radius: var(--nw-radius-sm);
}

.nw-result-unconfirmed .nw-result-title {
  color: var(--nw-status-uncertain-text);
}

.nw-uncertain-explanation {
  font-size: 14.5px;
  color: var(--nw-status-uncertain-text);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Status Tags (Sentence-Case, Low-Contrast Fill per GOV.UK) */
.nw-status-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.nw-tag-success {
  background-color: var(--nw-status-success-badge-bg);
  color: var(--nw-status-success-text);
  border: 1px solid var(--nw-status-success-border);
}

.nw-tag-error {
  background-color: var(--nw-status-error-badge-bg);
  color: var(--nw-status-error-text);
  border: 1px solid var(--nw-status-error-border);
}

.nw-tag-uncertain {
  background-color: var(--nw-status-uncertain-badge-bg);
  color: var(--nw-status-uncertain-text);
  border: 1px dashed var(--nw-status-uncertain-border);
}

.nw-ref-badge {
  background-color: var(--nw-surface-subtle);
  border: 1px solid var(--nw-border-subtle);
  padding: 2px 6px;
  border-radius: var(--nw-radius-sm);
  font-family: var(--nw-font-mono);
  font-size: 12px;
}

.nw-result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ==========================================================================
   PHASE 7: CHAOS SIMULATION CONSOLE (ChaosPanel.tsx)
   ========================================================================== */
.nw-chaos-console,
.chaos-panel-container {
  background-color: var(--nw-surface-console);
  border: 1px solid var(--nw-border-console);
  border-radius: var(--nw-radius-lg);
  box-shadow: none; /* Recessed diagnostic instrument */
  padding: 20px 22px;
  box-sizing: border-box;
}

.nw-chaos-top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* Sleek Console Drawer Toggle Pill */
.chaos-toggle-button,
.nw-btn-drawer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border: 1px solid #94a3b8;
  border-radius: var(--nw-radius-pill);
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  min-height: 32px;
  min-width: auto;
  transition: all var(--nw-duration-fast) var(--nw-ease-out);
}

.chaos-toggle-button:hover,
.nw-btn-drawer-pill:hover {
  background: #cbd5e1;
  color: var(--nw-text-primary);
}

#chaos-panel {
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.nw-chaos-header {
  margin-bottom: 16px;
}

.nw-chaos-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.nw-chaos-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--nw-text-primary);
}

.nw-chaos-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--nw-radius-sm);
}

.nw-chaos-status-pill.is-default {
  background-color: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.nw-chaos-status-pill.is-preset {
  background-color: var(--nw-chaos-active-bg);
  color: var(--nw-chaos-active-text);
  border: 1px solid var(--nw-chaos-active-border);
}

.nw-chaos-status-pill.is-custom {
  background-color: var(--nw-chaos-active-bg);
  color: var(--nw-chaos-active-text);
  border: 1px dashed var(--nw-chaos-active-border);
}

.nw-chaos-intro {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: var(--nw-text-secondary);
}

/* 2x2 Preset Card Grid with Zero Double-Border */
.nw-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

/* Outer Preset Card */
.nw-preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  padding: 12px 14px;
  background-color: var(--nw-surface-primary);
  border: 1px solid #94a3b8;
  border-radius: var(--nw-radius-md);
  box-shadow: 0 1px 2px rgba(6, 27, 49, 0.04);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition:
    background-color 140ms var(--nw-ease-out),
    border-color 140ms var(--nw-ease-out),
    box-shadow 140ms var(--nw-ease-out),
    transform 100ms var(--nw-spring-snappy);
}

.nw-preset-card:hover {
  background-color: #f8fafc;
  border-color: #334155;
  box-shadow: 0 3px 6px -1px rgba(6, 27, 49, 0.08);
}

.nw-preset-card:active {
  transform: scale(0.985);
}

/* CRITICAL FIX: Strip all default browser button chrome inside preset cards */
.nw-preset-card button,
.nw-preset-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--nw-text-primary);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: auto;
  min-width: auto;
}

/* Stretch inner button hit target across the entire preset card */
.nw-preset-card button::after,
.nw-preset-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* Active / Selected Preset State */
.nw-preset-card.is-active,
.nw-preset-card[aria-pressed='true'],
.nw-preset-card[aria-checked='true'],
.nw-preset-card:has(button[aria-pressed='true']) {
  background-color: var(--nw-chaos-active-bg);
  border: 2px solid var(--nw-chaos-active-border);
  padding: 11px 13px; /* Compensates for 2px border with zero layout shift */
  box-shadow: 0 2px 5px rgba(67, 56, 202, 0.12);
}

.nw-preset-card.is-active button,
.nw-preset-card.is-active .nw-preset-btn,
.nw-preset-card:has(button[aria-pressed='true']) button {
  color: var(--nw-chaos-active-text);
}

.nw-preset-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nw-preset-name {
  font-size: 13.5px;
  color: var(--nw-text-primary);
}

.nw-preset-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--nw-text-muted);
}

.nw-preset-card.is-active .nw-preset-indicator {
  color: var(--nw-chaos-active-border);
}

.nw-preset-desc {
  margin: 0;
  font-size: 12px;
  color: var(--nw-text-muted);
  line-height: 1.35;
}

/* Group Fieldsets */
.nw-chaos-console fieldset,
.chaos-group {
  background-color: var(--nw-surface-console-group);
  border: 1px solid var(--nw-border-console);
  border-radius: var(--nw-radius-md);
  padding: 12px 14px;
  margin: 0 0 12px 0;
  box-sizing: border-box;
}

.nw-chaos-console legend,
.chaos-group legend {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nw-text-muted);
  padding: 0 6px;
}

/* Sliding-Pill Latency Segmented Radio Group */
.chaos-radios,
.nw-latency-group,
.nw-segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background-color: var(--nw-surface-track);
  padding: 3px;
  border-radius: var(--nw-radius-md);
  border: 1px solid rgba(15, 23, 42, 0.06);
  gap: 2px;
  box-sizing: border-box;
  width: 100%;
}

.chaos-radios label,
.nw-latency-group label,
.nw-segmented-control label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--nw-text-secondary);
  border-radius: 6px;
  cursor: pointer;
  margin: 0;
  transition:
    background-color 180ms var(--nw-spring-smooth),
    color 180ms var(--nw-spring-smooth),
    box-shadow 180ms var(--nw-spring-smooth);
}

.chaos-radios label:has(input:checked),
.nw-latency-group label:has(input:checked),
.nw-segmented-control label:has(input:checked),
.nw-segment-label.is-selected {
  background-color: var(--nw-surface-primary);
  color: var(--nw-text-primary);
  font-weight: 700;
  box-shadow: var(--nw-shadow-pill);
}

/* Tactile Checkbox Rows (:has(input:checked)) */
.nw-chaos-console label:has(input[type='checkbox']),
.chaos-checkboxes label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 8px;
  margin: 2px -8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--nw-text-primary);
  cursor: pointer;
  box-sizing: border-box;
  transition:
    background-color 120ms ease,
    border-color 120ms ease;
}

.nw-chaos-console label:has(input[type='checkbox']):hover,
.chaos-checkboxes label:hover {
  background-color: rgba(15, 23, 42, 0.04);
}

.nw-chaos-console label:has(input[type='checkbox']:checked),
.chaos-checkboxes label:has(input:checked) {
  background-color: var(--nw-chaos-active-bg);
  border-color: #c7d2fe;
  color: var(--nw-chaos-active-text);
  font-weight: 600;
}

.nw-chaos-console input[type='checkbox'],
.chaos-checkboxes input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--nw-chaos-active-border);
  cursor: pointer;
  flex-shrink: 0;
}

.nw-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.nw-sublabel {
  font-size: 13px;
  font-weight: 600;
  color: var(--nw-text-secondary);
}

.nw-select-sm {
  height: 34px;
  width: auto;
  font-size: 13px;
}

/* Trigger Buttons & Footer */
.nw-trigger-buttons,
.chaos-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.nw-btn-sm {
  min-height: 36px;
  font-size: 13px;
  padding: 0 12px;
}

/* ==========================================================================
   PHASE 8: PRE-EXISTING WEB ANIMATIONS & SAFETY LOCKS
   ========================================================================== */
/* 1. Emil Kowalski fadeInUp Step Transition (180ms smooth spring) */
.nw-step-content-viewport,
.nw-review-container,
.nw-result-success {
  animation: nw-fade-in-up var(--nw-duration-base) var(--nw-spring-smooth) both;
}

@keyframes nw-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. NON-NEGOTIABLE SAFETY OVERRIDE: 0ms Instant Render for Errors, Rejections & Uncertainty */
.nw-error-summary,
.smu-error-summary,
.nw-result-rejected,
.result-rejected,
.nw-result-unconfirmed,
.result-unconfirmed,
[role='alert'] {
  animation: none !important;
  transition: none !important;
}

/* 3. Self-Drawing SVG Checkmark / Badge Pop for Confirmed Transfers */
@keyframes nw-scale-pop {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}


/*# sourceMappingURL=main.01ae8e4ae2a72db9225b.css.map*/