/* ITW Universe — Premium Brutalist Mid-Fi
   Philosophy: editorial restraint × brutalist scale. Black ink on cream.
   Serif display, neo-grotesque UI, mono for metadata. */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Paper & Ink */
  --paper: #F1F1F1;         /* warm cream */
  --paper-2: #E7E7E7;       /* deeper cream for surfaces */
  --paper-3: #DBDBDB;       /* dividers / placeholders */
  --ink: #0E0E0E;           /* near black */
  --ink-2: #282828;         /* slightly softer */
  --ink-muted: #676767;     /* warm grey */
  --ink-subtle: #959595;    /* captions */
  --line: #0E0E0E;          /* hairlines same as ink for brutalism */
  --line-soft: #C3C3C3;

  /* Accent — single electric coral (oklch) */
  --accent: oklch(68% 0 0);        /* electric coral */
  --accent-ink: oklch(44% 0 0);    /* deeper for text */

  /* Tier system — subdued earth palette, not candy */
  --tier-standard-bg: #E2E2E2;
  --tier-standard-ink: #363636;
  --tier-premium-bg: #D6D6D6;     /* soft plum-gray */
  --tier-premium-ink: #2B2B2B;
  --tier-exclusive-bg: #161616;
  --tier-exclusive-ink: #F1F1F1;

  /* AI / console — dark, terminal-like */
  --console-bg: #0E0E0E;
  --console-ink: #F1F1F1;
  --console-accent: oklch(78% 0 0);  /* warm amber */
  --console-dim: #676767;

  /* Type */
  --f-display: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --f-sans: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'Inter', ui-monospace, Menlo, monospace;

  /* Scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ============ ACCESSIBILITY — Focus Visible ============ */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Skip link — visible only on focus */
.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 999;
  background: var(--ink); color: var(--paper); padding: 10px 20px;
  font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.04em;
  text-decoration: none; border: 2px solid var(--accent);
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }
html, body { background: var(--paper); color: var(--ink); }
body {
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01','cv11';
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ============ TYPE ============ */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.display em { font-style: italic; color: var(--accent-ink); }
.d-xxl { font-size: clamp(48px, 7vw, 120px); }
.d-xl  { font-size: clamp(40px, 5vw, 88px); }
.d-lg  { font-size: clamp(32px, 3.5vw, 64px); }
.d-md  { font-size: clamp(32px, 3.2vw, 56px); }
.d-sm  { font-size: clamp(24px, 2.4vw, 36px); }

.sans-xl { font-size: 22px; line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; }
.sans-lg { font-size: 18px; line-height: 1.45; font-weight: 500; }
.sans-md { font-size: 15px; line-height: 1.55; }
.sans-sm { font-size: 13px; line-height: 1.5; }
.sans-xs { font-size: 12px; line-height: 1.45; }

.mono { font-family: var(--f-mono); }
.mono-label {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.mono-lbl-ink { color: var(--ink); }
.mono-num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

.muted { color: var(--ink-muted); }
.subtle { color: var(--ink-subtle); }
.italic { font-style: italic; }

/* ============ LAYOUT ============ */
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--sp-6); }
.container-narrow { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-6); }
.section { padding: var(--sp-9) 0; position: relative; }
.section-sm { padding: var(--sp-7) 0; }
.section + .section { border-top: 1px solid var(--line); }

.stack-1 > * + * { margin-top: var(--sp-1); }
.stack-2 > * + * { margin-top: var(--sp-2); }
.stack-3 > * + * { margin-top: var(--sp-3); }
.stack-4 > * + * { margin-top: var(--sp-4); }
.stack-5 > * + * { margin-top: var(--sp-5); }
.stack-6 > * + * { margin-top: var(--sp-6); }

.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.between { justify-content: space-between; }
.center { align-items: center; }
.middle { justify-content: center; }
.wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-4); }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-4); }
.grid-8 { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--sp-3); }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sp-5); }

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-4) var(--sp-6);
  max-width: 1440px; margin: 0 auto;
}
.nav-logo {
  font-family: var(--f-display);
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.nav-logo em { font-style: italic; color: var(--accent-ink); }

.nav-links { display: flex; gap: var(--sp-6); justify-content: center; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  position: relative; padding: 4px 0;
  color: var(--ink-2);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--ink);
}
.nav-badge {
  font-family: var(--f-mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.1em; padding: 1px 5px;
  background: var(--ink); color: var(--paper);
  margin-left: 4px; vertical-align: 2px;
}
.nav-right { display: flex; gap: var(--sp-3); align-items: center; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 12px 20px;
  font-family: var(--f-sans);
  font-size: 14px; font-weight: 500;
  line-height: 1;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: transparent; color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ghost { border-color: transparent; padding: 12px 0; }
.btn-ghost:hover { background: transparent; color: var(--accent-ink); }
.btn-sm { padding: 10px 16px; font-size: 13px; min-height: 44px; }
.btn-lg { padding: 16px 28px; font-size: 15px; }
.btn .arrow { font-family: var(--f-mono); font-weight: 500; }

/* ============ PLACEHOLDERS (mid-fi image slots) ============ */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(-45deg,
      transparent 0, transparent 11px,
      rgba(14,14,14,0.06) 11px, rgba(14,14,14,0.06) 12px),
    var(--paper-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  font-family: var(--f-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  text-align: center;
  overflow: hidden;
}
.ph-dim {
  background:
    repeating-linear-gradient(-45deg,
      transparent 0, transparent 11px,
      rgba(14,14,14,0.08) 11px, rgba(14,14,14,0.08) 12px),
    #181818;
  color: var(--paper-3);
  border-color: #181818;
}
.ph-accent {
  background:
    repeating-linear-gradient(-45deg,
      transparent 0, transparent 11px,
      rgba(14,14,14,0.12) 11px, rgba(14,14,14,0.12) 12px),
    var(--accent);
  color: var(--ink);
  border-color: var(--ink);
}
.ph-tag {
  position: absolute; top: var(--sp-3); left: var(--sp-3);
  background: var(--ink); color: var(--paper);
  padding: 3px 8px; font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}
.ph-corner {
  position: absolute; bottom: var(--sp-3); right: var(--sp-3);
  font-family: var(--f-mono); font-size: 10px;
  color: var(--ink-muted); letter-spacing: 0.08em;
}

.ph-16-9 { aspect-ratio: 16/9; }
.ph-4-3 { aspect-ratio: 4/3; }
.ph-1-1 { aspect-ratio: 1/1; }
.ph-3-4 { aspect-ratio: 3/4; }
.ph-2-1 { aspect-ratio: 2/1; }

/* ============ CARDS ============ */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
a.card:hover, .card[onclick]:hover, .card-link:hover .card {
  box-shadow: 0 4px 16px rgba(14,14,14,0.08);
  transform: translateY(-2px);
}
a.card:focus-visible, .card[onclick]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }

.tier-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px;
  background: var(--tier-standard-bg); color: var(--tier-standard-ink);
}
.tier-pill.premium { background: var(--tier-premium-bg); color: var(--tier-premium-ink); }
.tier-pill.exclusive { background: var(--tier-exclusive-bg); color: var(--tier-exclusive-ink); }
.tier-pill::before { content: '●'; font-size: 8px; }

/* ============ CONSOLE (AI panel) ============ */
.console {
  background: var(--console-bg); color: var(--console-ink);
  border: 1px solid var(--ink);
  padding: var(--sp-6);
  font-family: var(--f-sans);
  position: relative;
}
.console-head {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(241,241,241,0.2);
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-4);
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper-3);
}
.console-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--console-accent); margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.console input[type="text"] {
  width: 100%; background: transparent;
  border: none; border-bottom: 1px solid rgba(241,241,241,0.3);
  padding: var(--sp-3) 0;
  font-family: var(--f-display);
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.1;
  color: var(--console-ink); outline: none;
}
.console input[type="text"]::placeholder { color: var(--console-dim); font-style: italic; }
.console-suggest {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid rgba(241,241,241,0.08);
  cursor: pointer; transition: color 0.15s;
}
.console-suggest:hover { color: var(--console-accent); }
.console-suggest:last-child { border-bottom: none; }
.console-suggest .k {
  font-family: var(--f-mono); font-size: 10px;
  color: var(--console-accent); letter-spacing: 0.08em;
  min-width: 40px;
}
.console-suggest .t { font-size: 14px; flex: 1; }

/* ============ CHIPS / FILTERS ============ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { background: var(--ink); color: var(--paper); }
.chip.active { background: var(--ink); color: var(--paper); }
.chip .count { font-family: var(--f-mono); font-size: 11px; color: var(--ink-muted); margin-left: 4px; }
.chip.active .count { color: var(--paper-3); }

/* ============ TABLES ============ */
.t-row {
  display: grid;
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.t-row:last-child { border-bottom: none; }
.t-row.head {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}

/* ============ FORMS ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
}
.input, select.input {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--f-sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.input::placeholder { color: var(--ink-muted); opacity: 1; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(156,156,156,0.15); }
textarea.input { min-height: 120px; resize: vertical; }

/* ============ BADGES / META ============ */
.index-num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}
.tag {
  display: inline-block;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted);
}
.eyebrow::before {
  content: ''; width: 28px; height: 1px; background: var(--ink-muted);
}

/* ============ SECTION HEADERS ============ */
.section-head {
  display: grid; grid-template-columns: 1fr auto;
  align-items: end; gap: var(--sp-5);
  margin-bottom: var(--sp-7);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

/* ============ FOOTER ============ */
.foot {
  background: var(--ink); color: var(--paper);
  padding: var(--sp-9) var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--ink);
}
.foot-grid {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--sp-6);
}
.foot h5 {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper-3); margin-bottom: var(--sp-4);
  font-weight: 500;
}
.foot a { display: block; padding: 4px 0; color: var(--paper-3); font-size: 14px; }
.foot a:hover { color: var(--paper); }
.foot-brand .logo { font-family: var(--f-display); font-size: 40px; letter-spacing: -0.02em; line-height: 1; }
.foot-brand p { margin-top: var(--sp-3); font-size: 14px; color: rgba(241,241,241,0.6); max-width: 36ch; }
.foot-bottom {
  max-width: 1440px; margin: var(--sp-7) auto 0;
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(241,241,241,0.15);
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 11px;
  color: rgba(241,241,241,0.5);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============ HAIRLINE DIVIDER WITH LABEL ============ */
.rule {
  display: grid; grid-template-columns: auto 1fr;
  align-items: center; gap: var(--sp-4);
  margin: var(--sp-6) 0;
}
.rule::after { content: ''; height: 1px; background: var(--line); }
.rule .lbl { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }

/* ============ MARQUEE (continuous scroll) ============ */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--sp-4) 0;
  background: var(--paper);
}
.marquee-track {
  display: inline-flex; gap: var(--sp-7);
  animation: scroll 40s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: var(--f-display);
  font-size: 32px; letter-spacing: -0.01em;
  color: var(--ink);
}
.marquee-track em { font-style: italic; color: var(--accent-ink); }
.marquee-track .sep { color: var(--ink-subtle); font-family: var(--f-mono); font-size: 20px; font-style: normal; }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ FLOW STEPS ============ */
.flow {
  display: grid;
  grid-auto-flow: column; grid-auto-columns: 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.flow-item {
  padding: var(--sp-4) var(--sp-5);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px;
  color: var(--ink-muted);
}
.flow-item:last-child { border-right: none; }
.flow-item.done { color: var(--ink); }
.flow-item.active {
  background: var(--ink); color: var(--paper);
}
.flow-item.active .step-k { color: var(--accent); }
.flow-item .step-k { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; }
.flow-item .step-t { font-size: 15px; font-weight: 500; }

/* ============ UTILS ============ */
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none; }
.u-line { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ============ MOBILE NAV ============ */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px; line-height: 1;
}
.nav-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(14,14,14,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.nav-drawer {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 300px; max-width: 85vw;
  background: var(--paper);
  z-index: 100;
  flex-direction: column;
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.nav-drawer-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper);
  font-size: 18px; cursor: pointer;
}
.nav-drawer-links {
  display: flex; flex-direction: column;
  padding: var(--sp-4) 0;
}
.nav-drawer-links a {
  padding: var(--sp-3) var(--sp-5);
  font-size: 16px; font-weight: 500;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
}
.nav-drawer-links a:hover,
.nav-drawer-links a.active { color: var(--ink); background: var(--paper-2); }
.nav-drawer-actions {
  padding: var(--sp-4) var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.nav-drawer-actions .btn { justify-content: center; }

/* ============ RESPONSIVE — 1200px (large tablet / small desktop) ============ */
@media (max-width: 1200px) {
  :root {
    --sp-8: 48px;
    --sp-9: 72px;
    --sp-10: 96px;
  }
  .container { padding: 0 var(--sp-5); }
  .nav-inner { gap: var(--sp-4); padding: var(--sp-3) var(--sp-5); }
  .nav-links { gap: var(--sp-4); }
  .foot-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; margin-bottom: var(--sp-4); }

  /* Inside sidebar layouts, reduce asset grid from 3→2 columns earlier */
  [style*="grid-template-columns: 260px 1fr"] .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============ RESPONSIVE — 1000px (tablet) ============ */
@media (max-width: 1000px) {
  /* Type scale — tablet */
  .d-xxl { font-size: clamp(40px, 8vw, 80px); }
  .d-xl  { font-size: clamp(32px, 6vw, 64px); }
  .d-lg  { font-size: clamp(28px, 4.5vw, 48px); }
  .d-md  { font-size: clamp(24px, 3.5vw, 36px); }

  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5, .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-8 { grid-template-columns: repeat(4, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }

  /* 12-col grid → single column */
  .grid-12 {
    grid-template-columns: 1fr !important;
  }
  .grid-12 > * {
    grid-column: 1 / -1 !important;
  }

  /* Section head stacks */
  .section-head {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }
  .section-head > :last-child { text-align: left; }

  /* Flow steps wrap */
  .flow {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(3, 1fr);
  }

  /* Checkout step bars */
  [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Large inline font scaling */
  [style*="font-size: 88px"],
  [style*="font-size: 96px"],
  [style*="font-size: 108px"],
  [style*="font-size: 78px"] {
    font-size: clamp(40px, 7vw, 72px) !important;
  }
  [style*="font-size: 72px"] {
    font-size: clamp(36px, 6vw, 60px) !important;
  }
  [style*="font-size: 64px"] {
    font-size: clamp(32px, 5.5vw, 52px) !important;
  }

  /* Multi-column inline grids → responsive */
  [style*="grid-template-columns: 260px 1fr 160px 140px 60px"] {
    grid-template-columns: 1fr 1fr !important;
  }
  [style*="grid-template-columns: 80px 2fr 3fr 1fr 60px"] {
    grid-template-columns: 60px 1fr 1fr !important;
  }
  [style*="grid-template-columns: 140px 1fr 120px 140px 140px 120px 60px"] {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  [style*="grid-template-columns: 1fr 180px 160px 140px 32px"] {
    grid-template-columns: 1fr 120px 100px !important;
  }
  [style*="grid-template-columns: 120px 1fr 120px 120px 60px"] {
    grid-template-columns: 1fr 1fr !important;
  }
  [style*="grid-template-columns: 48px 1fr 140px 120px 100px"] {
    grid-template-columns: 40px 1fr 100px !important;
  }

  /* Sidebar + content layouts */
  [style*="grid-template-columns: 260px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 240px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 1.6fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 1.8fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Admin sidebar with fixed px in grid */
  [style*="grid-template-columns: 160px repeat(12, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 200px repeat(4, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  [style*="grid-template-columns: repeat(9, 1fr)"] {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* Sticky sidebars — unstick on tablet */
  aside [style*="position: sticky"],
  aside [style*="position:sticky"] {
    position: static !important;
  }
}

/* ============ RESPONSIVE — 768px (small tablet / large phone) ============ */
@media (max-width: 768px) {
  /* Nav → mobile */
  .nav-links { display: none !important; }
  .nav-toggle { display: flex; }
  .nav-drawer { display: flex; }
  .nav-overlay.active { display: block; }
  .nav-inner { grid-template-columns: auto 1fr auto; }
  .nav-right { gap: var(--sp-2); }
  .nav-right .btn { padding: 8px 10px; font-size: 12px; }

  /* Spacing reduction */
  :root {
    --sp-7: 36px;
    --sp-8: 40px;
    --sp-9: 56px;
  }
  .container { padding: 0 var(--sp-4); }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-5, .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-8 { grid-template-columns: repeat(2, 1fr); }

  /* Full-height split layouts (login/signup) → stack */
  [style*="grid-template-columns: 1fr 1fr"][style*="min-height: 100vh"] {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  /* Flow steps → 2 col */
  .flow {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Checkout step bars → 2+3 or scrollable */
  [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }

  /* 5-column stat grids */
  [style*="grid-template-columns: repeat(5,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns: repeat(3,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Inline font sizes scale down further */
  [style*="font-size: 88px"],
  [style*="font-size: 96px"],
  [style*="font-size: 108px"],
  [style*="font-size: 78px"] {
    font-size: clamp(32px, 8vw, 56px) !important;
  }
  [style*="font-size: 72px"] {
    font-size: clamp(28px, 7vw, 48px) !important;
  }
  [style*="font-size: 64px"] {
    font-size: clamp(26px, 6vw, 44px) !important;
  }
  [style*="font-size: 48px"] {
    font-size: clamp(24px, 5vw, 36px) !important;
  }
  [style*="font-size: 40px"] {
    font-size: clamp(24px, 5vw, 36px) !important;
  }
  [style*="font-size: 36px"] {
    font-size: clamp(22px, 4.5vw, 32px) !important;
  }

  /* Two-column layouts → stack */
  [style*="grid-template-columns: 1fr 1fr"][style*="gap"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 1.8fr 1fr"],
  [style*="grid-template-columns: 1.6fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Data table rows → stack */
  [style*="grid-template-columns: 260px 1fr 160px 140px 60px"],
  [style*="grid-template-columns: 80px 2fr 3fr 1fr 60px"],
  [style*="grid-template-columns: 140px 1fr 120px 140px 140px 120px 60px"] {
    grid-template-columns: 1fr !important;
    gap: var(--sp-2) !important;
  }
  [style*="grid-template-columns: 1fr 180px 160px 140px 32px"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Console panel tighter */
  .console { padding: var(--sp-4); }
  .console input[type="text"] {
    font-size: clamp(18px, 4vw, 28px);
  }

  /* Footer */
  .foot-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .foot { padding: var(--sp-7) var(--sp-5) var(--sp-4); }
  .foot-bottom { flex-direction: column; gap: var(--sp-3); text-align: center; }
  .foot-brand .logo { font-size: 32px; }

  /* Hero layout helper: when a row is used for hero alignment */
  .row.between { flex-wrap: wrap; }

  /* Marquee text smaller */
  .marquee-track span { font-size: 24px; }

  /* Button sizes */
  .btn-lg { padding: 14px 22px; font-size: 14px; }
}

/* ============ RESPONSIVE — 480px (phone) ============ */
@media (max-width: 480px) {
  :root {
    --sp-6: 24px;
    --sp-7: 28px;
    --sp-8: 36px;
    --sp-9: 48px;
  }
  .container { padding: 0 var(--sp-3); }
  .nav-inner { padding: var(--sp-3) var(--sp-3); gap: var(--sp-3); }
  .nav-logo { font-size: 22px; }
  .nav-right .btn { padding: 6px 8px; font-size: 11px; }

  /* Type scale clamp */
  .d-xxl { font-size: clamp(36px, 10vw, 60px); }
  .d-xl  { font-size: clamp(28px, 8vw, 48px); }
  .d-lg  { font-size: clamp(24px, 6vw, 36px); }
  .d-md  { font-size: clamp(20px, 5vw, 28px); }
  .d-sm  { font-size: clamp(18px, 4vw, 24px); }
  .sans-xl { font-size: 18px; }
  .sans-lg { font-size: 16px; }

  /* All inline large fonts → clamped */
  [style*="font-size: 88px"],
  [style*="font-size: 96px"],
  [style*="font-size: 108px"],
  [style*="font-size: 78px"],
  [style*="font-size: 72px"] {
    font-size: clamp(28px, 9vw, 48px) !important;
    line-height: 1 !important;
  }
  [style*="font-size: 64px"],
  [style*="font-size: 48px"] {
    font-size: clamp(24px, 7vw, 36px) !important;
    line-height: 1 !important;
  }
  [style*="font-size: 40px"],
  [style*="font-size: 36px"] {
    font-size: clamp(20px, 6vw, 30px) !important;
    line-height: 1.05 !important;
  }
  [style*="font-size: 28px"] {
    font-size: clamp(18px, 5vw, 24px) !important;
  }

  /* Flow → single column */
  .flow {
    grid-template-columns: 1fr;
  }

  /* Checkout step bar → scroll horizontal */
  [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(5, minmax(80px, 1fr)) !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* All multi-col inline grids → single */
  [style*="grid-template-columns: repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns: repeat(5,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Two col stat grids → single */
  [style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* 44px step list items → stack */
  [style*="grid-template-columns: 44px 1fr 140px"] {
    grid-template-columns: 1fr !important;
    gap: var(--sp-2) !important;
  }

  /* Bank detail grids → stack */
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer → single column */
  .foot-grid { grid-template-columns: 1fr; }

  /* Marquee even smaller */
  .marquee-track span { font-size: 18px; }
  .marquee-track { gap: var(--sp-4); }

  /* Buttons full width on smallest screens */
  .row.gap-3 { flex-wrap: wrap; }
  .row.gap-3 > .btn { flex: 1 1 auto; justify-content: center; min-width: 0; }

  /* Card body tighter */
  .card-body { padding: var(--sp-4); }

  /* Chips wrap nicely */
  .chip { padding: 6px 10px; font-size: 12px; }
}

/* ============ BACK TO TOP BUTTON ============ */
.back-to-top {
  position: fixed; bottom: 96px; right: 24px; z-index: 850;
  width: 44px; height: 44px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  text-decoration: none;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--accent); color: var(--ink); }

/* ============ DROP CAP — disable on mobile ============ */
@media (max-width: 768px) {
  .drop-cap::first-letter,
  p.drop-cap::first-letter {
    float: none !important;
    font-size: inherit !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* ============ READING PROGRESS BAR ============ */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  width: 0%; height: 3px;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ============ OVERFLOW SAFETY ============ */
body { overflow-x: hidden; }
.container, .container-narrow { overflow-wrap: break-word; }
img, video, svg { max-width: 100%; height: auto; }
pre, code { overflow-x: auto; max-width: 100%; }
table { max-width: 100%; overflow-x: auto; display: block; }

/* Ensure inline grid children don't overflow */
[style*="display: grid"],
[style*="display:grid"] {
  min-width: 0;
}
[style*="display: grid"] > *,
[style*="display:grid"] > * {
  min-width: 0;
  overflow-wrap: break-word;
}

/* ============ WISH BUTTON / SAVE FEATURE ============ */
.wish-btn {
  display: inline-block;
}
.wish-btn.saved {
  color: var(--accent) !important;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 8px;
  font-family: var(--f-sans);
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(14,14,14,0.28);
  z-index: 950;
  max-width: 400px;
  text-align: center;
  animation: slideUp 0.3s ease-out, slideOut 0.3s ease-out 2.7s forwards;
}
.toast a {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.toast a:hover {
  color: #838383;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* ============ OMNIPRESENT AI BAR ============ */
.ai-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  width: 92%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--ink);
  border-radius: 48px;
  box-shadow: 0 8px 32px rgba(14,14,14,0.28), 0 2px 8px rgba(14,14,14,0.12);
  padding: 6px 6px 6px 20px;
  transition: box-shadow 0.2s, width 0.3s;
}
.ai-bar:hover,
.ai-bar:focus-within {
  box-shadow: 0 12px 48px rgba(14,14,14,0.35), 0 2px 12px rgba(14,14,14,0.18);
}
.ai-bar-icon {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  margin-right: 10px;
  line-height: 1;
}
.ai-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--paper);
  font-family: var(--f-display);
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 10px 0;
  min-width: 0;
}
.ai-bar input::placeholder {
  color: rgba(241,241,241,0.4);
  font-style: italic;
}
.ai-bar-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: var(--ink);
  border: none;
  border-radius: 40px;
  padding: 10px 20px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ai-bar-btn:hover { background: #838383; }
.ai-bar-hint {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: rgba(241,241,241,0.35);
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* Ensure footer padding doesn't get hidden behind AI bar */
.foot { padding-bottom: calc(var(--sp-7) + 80px); }

@media (max-width: 640px) {
  .ai-bar {
    width: 94%;
    max-width: none;
    bottom: 16px;
    padding: 5px 5px 5px 16px;
    border-radius: 40px;
  }
  .ai-bar input { font-size: 14px; }
  .ai-bar-btn { padding: 9px 14px; font-size: 11px; }
  .ai-bar-hint { display: none; }
}
