/* ============================================================
   QuoteCalc — Minimalist Dark UI
   Version: 3.1.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-base: #0a0d14;
  --bg-surface: #0f1320;
  --bg-elevated: #141928;
  --bg-panel: #181e2e;
  --bg-input: #1a2035;
  --bg-hover: #1f2740;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Brand / Accent */
  --accent: #6366f1;
  --accent-hover: #5558e8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-light: rgba(99, 102, 241, 0.12);

  /* Text */
  --text-primary: #f0f2f8;
  --text-secondary: #8b93a8;
  --text-muted: #4d5570;
  --text-accent: #818cf8;

  /* Status */
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 150ms;
  --dur-med: 220ms;
  --dur-slow: 350ms;

  /* Z-index */
  --z-dropdown: 20;
  --z-history: 30;
  --z-modal: 50;
}

/* ── Light Theme Tokens ───────────────────────────────── */
[data-theme="light"] {
  /* Background layers */
  --bg-base: #f8f9fc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-panel: #ffffff;
  --bg-input: #f1f5f9;
  --bg-hover: #e2e8f0;

  /* Borders */
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-default: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.15);

  /* Brand / Accent */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.2);
  --accent-light: rgba(79, 70, 229, 0.08);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #4f46e5;

  /* Status */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

/* ── Reset / Base ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Radial gradient mesh background */
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
}

/* ── Layout ────────────────────────────────────────────── */
.app-wrap {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ── App Header ─────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) 0 var(--sp-8);
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.version-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-accent);
  background: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 100px;
  padding: 3px 10px;
  letter-spacing: 0.02em;
}

/* Theme Toggle Button */
.btn-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-theme:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-theme svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: absolute;
  transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-fast) ease;
}

.icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

.icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="light"] .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="light"] .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

[data-theme="light"] .version-badge {
  border-color: rgba(79, 70, 229, 0.15);
}

[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(79, 70, 229, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
}

/* ── Main Content Grid ─────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-6);
  padding: var(--sp-8) 0 var(--sp-10);
  align-items: start;
}

/* ── Calculator Panel ──────────────────────────────────── */
.calc-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* ── Card / Panel base ─────────────────────────────────── */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  transition: border-color var(--dur-fast) ease;
}

.card:hover {
  border-color: var(--border-default);
}

.card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

/* ── Form Card ─────────────────────────────────────────── */
.form-card {
  gap: var(--sp-4);
  display: flex;
  flex-direction: column;
}

/* Amount input */
.amount-wrap {
  position: relative;
}

.amount-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.amount-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 14px var(--sp-4);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  caret-color: var(--accent);
  outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background var(--dur-fast) ease;
  letter-spacing: -0.01em;
}

.amount-input::placeholder {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.amount-input:focus {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Inline suggestion chips ────────────────────────── */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  min-height: 0;
}

.suggestion-chips:empty {
  display: none;
}

.sug-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 5px 10px 5px 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.sug-chip:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.sug-chip-amount {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.sug-chip-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sug-chip-apply {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-accent);
  background: var(--accent-light);
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
  white-space: nowrap;
}

.sug-chip:hover .sug-chip-apply {
  background: rgba(99, 102, 241, 0.22);
}

/* ── VAT Controls Row (+ button) ───────────────────── */
.controls-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding-top: 10px;
}

/* VAT segmented control */
.vat-segment {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 3px;
}

.vat-option {
  position: relative;
}

.vat-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.vat-option span {
  display: block;
  padding: 3px 20px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
  user-select: none;
}

.vat-option input:checked+span {
  background: var(--accent);
  color: #fff;
}

.vat-option input:focus-visible+span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.vat-option span:hover {
  color: var(--text-primary);
}

/* Tax-included toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  user-select: none;
}

.toggle-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--bg-hover);
  border: 1.5px solid var(--border-strong);
  border-radius: 100px;
  position: relative;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
  flex-shrink: 0;
}

.toggle-wrap input:checked~.toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 1px;
  left: 1px;
  transition: transform var(--dur-fast) var(--ease-out);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.toggle-wrap input:checked~.toggle-track::after {
  transform: translateX(16px);
}

.toggle-wrap input:focus-visible~.toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Submit Button (inline in controls-row) ──────────── */
.btn-calc {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-calc::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
  pointer-events: none;
}

.btn-calc:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-calc:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-calc:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Error message ─────────────────────────────────────── */
.error-msg {
  display: none;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--r-md);
  padding: 10px var(--sp-4);
  font-size: 0.875rem;
  color: var(--error);
  line-height: 1.5;
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--r-xl);
}

.empty-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-2);
}

.empty-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.empty-state h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ── Result Area ───────────────────────────────────────── */
#result-area {
  display: none;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Metrics strip */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-3);
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: border-color var(--dur-fast) ease;
}

.metric-card:hover {
  border-color: var(--border-default);
}

.metric-card--primary {
  border-color: rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.07) 0%, var(--bg-panel) 100%);
}

.metric-card--primary:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-card--primary .metric-label {
  color: var(--text-accent);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
  word-break: break-all;
}

.metric-card--primary .metric-value {
  color: #a5b4fc;
}

/* Inline copy button */
.btn-copy {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn-copy.copied {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.btn-copy svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ── Controls spacer ────────────────────────────────────── */
.controls-spacer {
  flex: 1;
  min-width: var(--sp-2);
}

/* ── Suggestion inline (cùng dòng controls-row) ───────── */
.suggest-inline {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--r-md);
  padding: 6px 8px 6px 12px;
  flex-shrink: 0;
  max-width: 260px;
  overflow: hidden;
}

.suggest-inline.visible {
  display: flex;
}

.suggest-inline-amount {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.suggest-inline-diff {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.btn-apply-inline {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warning);
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--r-sm);
  padding: 4px 9px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) ease;
  white-space: nowrap;
}

.btn-apply-inline:hover {
  background: rgba(251, 191, 36, 0.28);
  border-color: rgba(251, 191, 36, 0.5);
}


/* ── Text Output Panel ─────────────────────────────────── */
.output-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
}

.output-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.output-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.output-row:first-child {
  padding-top: 0;
}

.output-tag {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 3px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.output-text {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.55;
  word-break: break-word;
  min-width: 0;
}

/* ── History Sidebar ───────────────────────────────────── */
.history-sidebar {
  position: sticky;
  top: var(--sp-8);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
  max-height: calc(100dvh - 160px);
  display: flex;
  flex-direction: column;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.history-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-clear {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
  display: none;
}

.btn-clear:hover {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.06);
}

.history-body {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

.history-body::-webkit-scrollbar {
  width: 4px;
}

.history-body::-webkit-scrollbar-track {
  background: transparent;
}

.history-body::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

.history-empty {
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 12px var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

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

.history-item:hover {
  background: var(--bg-hover);
}

.history-amount {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.history-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.history-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.history-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .history-sidebar {
    position: static;
    max-height: 320px;
    order: 2;
  }

  .metrics-row {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .app-wrap {
    padding: 0 var(--sp-4);
  }

  .app-header {
    padding: var(--sp-5) 0 var(--sp-6);
    flex-wrap: wrap;
    gap: var(--sp-3);
  }

  .app-grid {
    padding: var(--sp-6) 0 var(--sp-8);
    gap: var(--sp-4);
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .metric-card:last-child {
    grid-column: unset;
  }

  .amount-input {
    font-size: 1.25rem;
  }

  /* Suggestion wraps below on mobile */
  .controls-spacer {
    display: none;
  }

  .suggest-inline {
    max-width: 100%;
    width: 100%;
    order: 10;
    flex-basis: 100%;
  }
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.metric-card,
.output-card {
  animation: fadeIn var(--dur-med) var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}