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

:root {
  color-scheme: dark;
  --canvas: #070b12;
  --canvas-2: #090f18;
  --surface: #0d1622;
  --surface-2: #111d2b;
  --surface-3: #162435;
  --border: #243247;
  --border-strong: #31445d;
  --text: #e8eef7;
  --muted: #8a9bb0;
  --quiet: #5f728a;
  --teal: #55d8c5;
  --teal-strong: #22b8a3;
  --teal-soft: #102d2b;
  --amber: #f0bd62;
  --amber-soft: #302716;
  --red: #f07888;
  --red-soft: #321c25;
  --blue: #6a9df8;
  --blue-soft: #172744;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --header-h: 64px;
  --rail-w: 236px;
  --radius: 7px;
  --font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

html[data-theme='light'] {
  color-scheme: light;
  --canvas: #edf1f5;
  --canvas-2: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf2f6;
  --border: #ccd6e1;
  --border-strong: #aebdcd;
  --text: #152334;
  --muted: #5f7185;
  --quiet: #7e8ea0;
  --teal: #087e72;
  --teal-strong: #06675f;
  --teal-soft: #dcf1ed;
  --amber: #a86510;
  --amber-soft: #fff0d4;
  --red: #bd4056;
  --red-soft: #fbe4e8;
  --blue: #2765c7;
  --blue-soft: #e3ecfc;
  --shadow: 0 18px 50px rgba(28, 45, 65, .12);
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 14px/1.5 var(--font-body);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

.skip-link {
  position: fixed;
  z-index: 100;
  left: 12px;
  top: -60px;
  padding: 8px 12px;
  color: #061310;
  background: var(--teal);
  border-radius: 4px;
}
.skip-link:focus { top: 12px; }

.mono, .metric-value, .eyebrow, .status, code, pre, .table-head, .brand-mark {
  font-family: var(--font-mono);
}

.icon-btn, .btn, .locale-btn, .nav-item, .public-link, .segmented button {
  border: 0;
  color: inherit;
  background: transparent;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  position: relative;
}

.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-primary { background: var(--teal-strong); border-color: var(--teal-strong); color: #041311; }
html[data-theme='light'] .btn-primary { color: #fff; }
.btn-primary:hover { background: var(--teal); border-color: var(--teal); }
.btn-quiet { color: var(--muted); }

.locale-btn {
  min-width: 38px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: 500 11px var(--font-mono);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--teal-strong);
  border-radius: 7px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 500;
}

.brand-name { font-size: 16px; font-weight: 800; }
.brand-plane { color: var(--quiet); font: 500 9px var(--font-mono); text-transform: uppercase; }

.sample-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-2);
  font: 500 9px var(--font-mono);
  text-transform: uppercase;
  white-space: nowrap;
}

.sample-flag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

/* Product shells */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: var(--header-h) minmax(0, 1fr);
}

.app-shell #site-header {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas-2) 94%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-shell #site-nav {
  grid-column: 1;
  grid-row: 1 / 3;
  min-width: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: var(--canvas-2);
}

.app-shell #app-root { grid-column: 2; grid-row: 2; min-width: 0; }

.nav-brand { padding: 0 8px 16px; border-bottom: 1px solid var(--border); }
.nav-section { margin: 17px 8px 7px; color: var(--quiet); font: 500 9px var(--font-mono); text-transform: uppercase; }
.nav-list { display: grid; gap: 3px; }

.nav-item {
  min-width: 0;
  min-height: 39px;
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--teal); background: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 35%, var(--border)); }
.nav-glyph { font: 500 9px var(--font-mono); color: var(--quiet); }
.nav-item.active .nav-glyph { color: var(--teal); }
.nav-badge { padding: 1px 5px; border-radius: 8px; background: var(--red-soft); color: var(--red); font: 500 9px var(--font-mono); }
.nav-footer { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--border); }
.region-line { margin-top: 5px; display: flex; justify-content: space-between; color: var(--muted); font: 500 9px var(--font-mono); }
.region-line strong { color: var(--teal); font-weight: 500; }

.header-path { min-width: 0; color: var(--muted); font: 500 10px var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-path strong { color: var(--text); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.balance-chip { color: var(--amber); font: 500 11px var(--font-mono); white-space: nowrap; }
.user-chip { padding-left: 10px; border-left: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.mobile-menu { display: none; }
.notify-dot { position: absolute; right: 7px; top: 6px; width: 6px; height: 6px; background: var(--red); border-radius: 50%; }

.workspace { max-width: 1540px; margin: 0 auto; padding: 28px 28px 52px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.page-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; font-weight: 750; }
.page-heading p { max-width: 620px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 8px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 9px; }
.metric {
  min-width: 0;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.metric-accent::before { content: ''; position: absolute; inset: -1px 14px auto; height: 2px; background: var(--amber); }
.metric-label { color: var(--muted); font-size: 11px; }
.metric-value { margin-top: 7px; font-size: clamp(20px, 2.2vw, 29px); line-height: 1.2; white-space: nowrap; }
.metric-foot { margin-top: 12px; color: var(--quiet); font: 500 9px var(--font-mono); text-transform: uppercase; }
.metric-foot.good { color: var(--teal); }
.metric-foot.warn { color: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 9px; margin-top: 9px; }
.dashboard-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel-head { min-height: 47px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 12px; font-weight: 750; }
.panel-meta { color: var(--quiet); font: 500 9px var(--font-mono); text-transform: uppercase; }
.panel-body { padding: 15px; }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 9px; text-transform: uppercase; white-space: nowrap; }
.status.good { color: var(--teal); background: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 34%, var(--border)); }
.status.warn { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); }
.status.bad { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 34%, var(--border)); }
.status.info { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 34%, var(--border)); }

.route-fabric { padding: 18px; }
.route-row { display: grid; grid-template-columns: minmax(120px, .75fr) minmax(0, 2fr) minmax(110px, .65fr); align-items: center; gap: 16px; }
.route-key small, .route-result small { display: block; color: var(--quiet); font: 500 9px var(--font-mono); text-transform: uppercase; }
.route-key strong, .route-result strong { display: block; margin-top: 4px; font-size: 12px; }
.route-result { padding-left: 15px; border-left: 1px solid var(--border); }
.route-result strong { color: var(--teal); font-family: var(--font-mono); }
.route-chain { min-width: 0; display: grid; grid-template-columns: minmax(90px, 1fr) 34px minmax(90px, 1fr) 34px minmax(74px, .75fr); align-items: center; }
.route-node { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.route-node.active { border-color: color-mix(in srgb, var(--teal) 45%, var(--border)); background: var(--teal-soft); }
.route-node small { display: block; color: var(--quiet); font: 500 8px var(--font-mono); }
.route-node strong { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.route-node em { display: block; margin-top: 4px; color: var(--amber); font: normal 500 10px var(--font-mono); }
.route-line { height: 1px; background: var(--border-strong); position: relative; }
.route-line.active { background: var(--teal); }
.route-line::after { content: ''; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); color: var(--border-strong); }
.route-line.active::after { color: var(--teal); }

.chart { min-height: 180px; position: relative; display: flex; align-items: flex-end; padding: 16px 8px 24px; gap: min(4vw, 38px); border-bottom: 1px solid var(--border); }
.chart::before { content: ''; position: absolute; inset: 18px 0 24px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 39px, var(--border) 40px); opacity: .65; }
.bar { flex: 1 1 0; max-width: 48px; min-width: 14px; height: var(--h); z-index: 1; border: 1px solid color-mix(in srgb, var(--teal) 65%, var(--border)); border-bottom: 0; background: color-mix(in srgb, var(--teal) 24%, transparent); position: relative; }
.bar::after { content: attr(data-label); position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); color: var(--quiet); font: 500 8px var(--font-mono); }

.event-list { display: grid; }
.event { padding: 12px 14px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; border-bottom: 1px solid var(--border); align-items: start; }
.event:last-child { border-bottom: 0; }
.event-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--teal); }
.event-dot.warn { background: var(--amber); }
.event-dot.bad { background: var(--red); }
.event strong { display: block; font-size: 11px; }
.event small { display: block; margin-top: 3px; color: var(--quiet); font: 500 9px var(--font-mono); }
.event-time { color: var(--quiet); font: 500 9px var(--font-mono); white-space: nowrap; }

.data-table { min-width: 620px; }

.workspace-empty-inline,
.public-empty {
  padding: 28px 22px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}

.data-status {
  margin: 14px 22px 0;
  padding: 10px 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel);
  font: 500 11px var(--font-mono);
}

.data-status.error {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 38%, var(--border));
}
.table-wrap { overflow-x: auto; }
.table-row { display: grid; grid-template-columns: var(--cols, 1.1fr 1fr .8fr .7fr); align-items: center; min-height: 48px; padding: 0 14px; border-bottom: 1px solid var(--border); gap: 14px; font-size: 11px; }
.table-row:last-child { border-bottom: 0; }
.table-head { min-height: 36px; color: var(--quiet); background: var(--surface-2); font-size: 9px; text-transform: uppercase; }
.table-primary { min-width: 0; }
.table-primary strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-primary small { color: var(--quiet); font: 500 9px var(--font-mono); }

.progress-track { height: 4px; margin-top: 7px; overflow: hidden; background: var(--surface-3); }
.progress-track span { display: block; width: var(--w); height: 100%; background: var(--teal); }
.progress-track.warn span { background: var(--amber); }

.filter-row { display: flex; gap: 8px; margin-bottom: 9px; }
.search-field { min-width: 160px; flex: 1; height: 38px; border: 1px solid var(--border); border-radius: 6px; padding: 0 11px; color: var(--text); background: var(--surface); }
.filter-select { height: 38px; border: 1px solid var(--border); border-radius: 6px; padding: 0 30px 0 10px; color: var(--muted); background: var(--surface); }

.workspace-empty { min-height: 410px; display: grid; place-items: center; padding: 24px; }
.workspace-empty-inner { width: min(620px, 100%); }
.workspace-empty h2 { margin: 0 0 6px; font-size: 18px; }
.workspace-empty p { margin: 0; color: var(--muted); }
.foundation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.foundation-item { padding: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.foundation-item span { display: block; color: var(--quiet); font: 500 9px var(--font-mono); text-transform: uppercase; }
.foundation-item strong { display: block; margin-top: 6px; font-size: 11px; }

.notice-drawer {
  position: fixed;
  z-index: 60;
  inset: var(--header-h) 0 0 auto;
  width: min(390px, 100vw);
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--canvas-2);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 180ms ease;
}
.notice-drawer.open { transform: translateX(0); }
.drawer-head { height: 58px; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }

/* Public surface */
.public-shell { min-height: 100vh; background: var(--canvas); }
.public-shell #site-nav { display: none; }
.public-shell #site-header { height: 72px; padding: 0 max(24px, calc((100vw - 1320px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--canvas) 92%, transparent); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(16px); }
.public-links { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.public-link { min-height: 34px; padding: 6px 10px; color: var(--muted); border-radius: 5px; font-size: 12px; }
.public-link:hover, .public-link.active { color: var(--text); background: var(--surface); }
.public-actions { display: flex; align-items: center; gap: 8px; }
.public-account-loading { width: 98px; height: 38px; display: inline-block; border: 1px solid var(--border); border-radius: 999px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 220% 100%; animation: account-shimmer 1.2s ease-in-out infinite; }
@keyframes account-shimmer { to { background-position: -220% 0; } }
.public-account { position: relative; }
.account-trigger { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); }
.account-trigger:hover, .public-account.open .account-trigger { border-color: var(--teal); background: var(--teal-soft); }
.account-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-strong); color: #041311; font: 700 11px var(--font-mono); }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.account-chevron { color: var(--muted); font-size: 16px; line-height: 1; }
.public-account::after { content: ''; position: absolute; z-index: 49; top: 100%; right: 0; width: 210px; height: 9px; }
.account-menu { position: absolute; z-index: 50; top: calc(100% + 9px); right: 0; width: 190px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-4px); transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease; }
.public-account.open .account-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.account-menu a, .account-menu button { width: 100%; min-height: 36px; display: flex; align-items: center; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); text-align: left; font-size: 12px; }
.account-menu a:hover, .account-menu button:hover { background: var(--teal-soft); color: var(--text); }
.public-account-error { position: absolute; z-index: 51; top: calc(100% + 52px); right: 0; width: 220px; padding: 8px 10px; border: 1px solid var(--red); border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 11px; }
.account-menu-divider { height: 1px; margin: 5px 3px; background: var(--border); }
.public-main { max-width: 1320px; margin: 0 auto; }

.public-hero { min-height: min(730px, calc(100vh - 72px)); padding: clamp(50px, 8vh, 92px) 24px 72px; display: grid; grid-template-columns: minmax(0, .92fr) minmax(460px, 1.08fr); align-items: center; gap: clamp(44px, 7vw, 100px); border-bottom: 1px solid var(--border); }
.hero-copy { align-self: center; }
.eyebrow { margin-bottom: 16px; color: var(--teal); font-size: 10px; text-transform: uppercase; }
.hero-copy h1 { margin: 0; max-width: 720px; font-size: clamp(43px, 6vw, 76px); line-height: .98; font-weight: 760; }
.hero-copy h1 span { color: var(--teal); }
.hero-copy p { max-width: 610px; margin: 24px 0 0; color: var(--muted); font-size: clamp(15px, 1.5vw, 18px); line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 34px; color: var(--quiet); font: 500 10px var(--font-mono); }
.hero-proof span::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--teal); }

.fabric-visual { min-width: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.fabric-toolbar { min-height: 45px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.fabric-toolbar span { color: var(--quiet); font: 500 9px var(--font-mono); text-transform: uppercase; }
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--quiet); opacity: .55; }
.fabric-code { margin: 0; padding: 18px; overflow-x: auto; color: var(--muted); background: var(--canvas-2); font: 400 10px/1.75 var(--font-mono); }
.fabric-code .code-key { color: var(--blue); }
.fabric-code .code-value { color: var(--teal); }
.fabric-code .code-number { color: var(--amber); }
.fabric-flow { padding: 20px 16px; display: grid; grid-template-columns: 1fr 30px 1fr 30px .85fr; align-items: center; }
.fabric-node { min-width: 0; padding: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.fabric-node.active { border-color: var(--teal-strong); background: var(--teal-soft); }
.fabric-node small { display: block; color: var(--quiet); font: 500 8px var(--font-mono); }
.fabric-node strong { display: block; margin-top: 4px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fabric-link { height: 1px; background: var(--teal); }
.fabric-result { margin: 0 16px 16px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid color-mix(in srgb, var(--teal) 40%, var(--border)); background: var(--teal-soft); color: var(--teal); font: 500 9px var(--font-mono); }

.public-section { padding: 80px 24px; border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 34px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 4vw, 48px); line-height: 1.05; }
.section-head p { margin: 13px 0 0; color: var(--muted); font-size: 15px; }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-right: 0; }
.model-item { min-width: 0; padding: 22px; border-right: 1px solid var(--border); background: var(--surface); }
.model-item-top { display: flex; justify-content: space-between; gap: 12px; }
.model-item h3 { margin: 0; font: 500 13px var(--font-mono); }
.model-item p { min-height: 44px; margin: 12px 0 22px; color: var(--muted); font-size: 12px; }
.rate-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.rate-pair div { padding: 11px; background: var(--surface-2); }
.rate-pair span { display: block; color: var(--quiet); font: 500 8px var(--font-mono); text-transform: uppercase; }
.rate-pair strong { display: block; margin-top: 5px; color: var(--amber); font: 500 11px var(--font-mono); }
.public-footer { padding: 32px 24px; display: flex; justify-content: space-between; color: var(--quiet); font: 500 9px var(--font-mono); }
.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-right: 0; }
.capability-grid article { min-width: 0; min-height: 190px; padding: 24px; border-right: 1px solid var(--border); background: var(--surface); }
.capability-grid strong { font-size: 15px; }
.capability-grid p { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.faq-list { border-top: 1px solid var(--border); }
.faq-list details { border-bottom: 1px solid var(--border); background: var(--surface); }
.faq-list summary { padding: 19px 6px; cursor: pointer; font-weight: 700; }
.faq-list p { max-width: 780px; margin: 0; padding: 0 6px 20px; color: var(--muted); line-height: 1.75; }

/* Customer authentication */
.auth-shell { min-height: 100vh; background: var(--canvas); }
.auth-shell #site-header { height: 72px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.auth-shell #site-nav { display: none; }
.auth-page { width: min(1180px, 100%); min-height: calc(100vh - 72px); margin: 0 auto; padding: 64px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, 430px); align-items: center; gap: clamp(48px, 9vw, 130px); }
.auth-context h1 { max-width: 660px; margin: 0; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; }
.auth-context > p { max-width: 610px; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.auth-context > small { display: block; max-width: 590px; color: var(--quiet); line-height: 1.6; }
.auth-route { margin: 38px 0 24px; display: grid; grid-template-columns: max-content minmax(24px, 80px) max-content minmax(24px, 80px) max-content; align-items: center; }
.auth-route span { padding: 9px 11px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--teal); font: 500 9px var(--font-mono); }
.auth-route i { height: 1px; background: var(--teal); }
.auth-panel { border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.auth-panel-head { min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border); color: var(--quiet); font: 500 9px var(--font-mono); }
.auth-panel-head strong { color: var(--teal); font-weight: 500; }
.auth-form { padding: 24px; display: grid; gap: 18px; }
.auth-form label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.auth-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--canvas-2); color: var(--text); outline: none; }
.auth-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.auth-form label small { color: var(--quiet); font: 500 9px var(--font-mono); }
.auth-error { min-height: 18px; color: var(--red); font-size: 11px; line-height: 1.5; }
.auth-submit { width: 100%; min-height: 44px; }
.auth-switch { width: 100%; min-height: 48px; padding: 10px 16px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 11px; }
.auth-switch:hover { color: var(--teal); background: var(--teal-soft); }
.auth-status { grid-column: 1 / -1; justify-self: center; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.auth-loader { width: 16px; height: 16px; border: 1px solid var(--border-strong); border-top-color: var(--teal); border-radius: 50%; animation: auth-spin .8s linear infinite; }
.auth-page-centered { grid-template-columns: minmax(320px, 480px); justify-content: center; }
.auth-message-panel { width: 100%; }
.auth-message { padding: 32px 28px 26px; display: grid; gap: 16px; text-align: center; }
.auth-message h1 { margin: 0; font-size: 28px; }
.auth-message p { margin: 0; color: var(--muted); line-height: 1.7; }
.auth-message > strong { color: var(--teal); overflow-wrap: anywhere; }
.auth-message .auth-switch { border-top: 0; }
.auth-message-mark { width: 48px; height: 48px; margin: 0 auto 3px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-2); color: var(--teal); font: 500 20px var(--font-mono); }
.auth-message-mark.good { background: var(--teal-soft); border-color: var(--teal); }
.auth-message-mark.danger { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.auth-actions .btn { min-height: 44px; }
.auth-notice { min-height: 20px; color: var(--muted); font-size: 12px; }
.auth-notice.danger { color: var(--red); }
.resend-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.resend-button:disabled { cursor: not-allowed; opacity: .7; }
.resend-timer { min-width: 44px; padding-left: 10px; border-left: 1px solid currentColor; font: 500 11px var(--font-mono); }
.resend-timer:empty { display: none; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  :root { --rail-w: 76px; }
  .nav-brand .brand-copy, .nav-item span:nth-child(2), .nav-section, .nav-footer { display: none; }
  .nav-brand { padding: 0 8px 16px; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding-inline: 5px; }
  .nav-glyph { font-size: 10px; }
  .nav-badge { position: absolute; margin: -25px 0 0 25px; }
  .public-hero { grid-template-columns: 1fr; }
  .fabric-visual { max-width: 760px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-row { grid-template-columns: 1fr; }
  .route-result { padding: 12px 0 0; border: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 480px) {
  .auth-actions { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --rail-w: 0px; --header-h: 58px; }
  .app-shell { display: block; padding-top: var(--header-h); }
  .app-shell #site-header { position: fixed; inset: 0 0 auto 0; height: var(--header-h); padding: 0 13px; }
  .app-shell #site-nav { position: fixed; inset: var(--header-h) auto 0 0; width: min(310px, 86vw); height: auto; overflow-y: auto; overscroll-behavior: contain; transform: translateX(-102%); transition: transform 180ms ease; box-shadow: var(--shadow); }
  body.nav-open .app-shell #site-nav { transform: translateX(0); }
  .nav-brand .brand-copy, .nav-item span:nth-child(2), .nav-section, .nav-footer { display: block; }
  .nav-item { grid-template-columns: 24px minmax(0, 1fr) auto; justify-items: stretch; padding-inline: 9px; }
  .nav-badge { position: static; margin: 0; }
  .mobile-menu { display: inline-grid; }
  .header-path { display: none; }
  .user-chip, .balance-chip { display: none; }
  .workspace { padding: 20px 14px 42px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 12px; }
  .heading-actions .btn-quiet { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 105px; padding: 13px; }
  .metric-value { font-size: 20px; }
  .dashboard-grid, .dashboard-grid.equal { grid-template-columns: 1fr; }
  .route-chain { grid-template-columns: 1fr; gap: 6px; }
  .route-line { width: 1px; height: 18px; justify-self: center; }
  .route-line::after { right: -3px; top: auto; bottom: 0; transform: rotate(135deg); }
  .foundation-grid { grid-template-columns: 1fr; }
  .filter-row { flex-wrap: wrap; }
  .filter-select { flex: 1; }

  .public-shell #site-header { height: 62px; padding: 0 14px; }
  .public-links { display: none; }
  .public-main { width: 100%; }
  .public-hero { min-height: auto; padding: 55px 17px 48px; gap: 42px; }
  .hero-copy h1 { font-size: 44px; }
  .hero-copy p { font-size: 15px; }
  .fabric-flow { grid-template-columns: 1fr; gap: 6px; }
  .fabric-link { width: 1px; height: 16px; justify-self: center; }
  .public-section { padding: 56px 17px; }
  .model-grid { grid-template-columns: 1fr; border-bottom: 0; }
  .model-item { border-bottom: 1px solid var(--border); }
  .capability-grid { grid-template-columns: 1fr; border-bottom: 0; }
  .capability-grid article { min-height: 0; border-bottom: 1px solid var(--border); }
  .public-footer { display: grid; gap: 8px; }
  .auth-shell #site-header { height: 62px; padding: 0 14px; }
  .auth-page { min-height: calc(100vh - 62px); padding: 42px 17px; grid-template-columns: 1fr; gap: 38px; }
  .auth-context h1 { font-size: clamp(36px, 11vw, 54px); }
  .auth-route { grid-template-columns: 1fr; gap: 6px; }
  .auth-route i { width: 1px; height: 14px; justify-self: center; }
  .auth-route span { text-align: center; }
  .signout-button { display: none; }
}

@media (max-width: 460px) {
  .metric-grid { grid-template-columns: 1fr; }
  .page-heading { display: grid; }
  .heading-actions { width: 100%; }
  .heading-actions .btn-primary { flex: 1; }
  .public-shell #site-header { gap: 8px; }
  .public-shell .public-actions { gap: 4px; flex-wrap: nowrap; }
  .public-shell .public-actions .btn { min-height: 34px; padding: 7px 8px; font-size: 10px; white-space: nowrap; }
  .public-shell .public-actions .icon-btn, .public-shell .public-actions .locale-btn { width: 32px; min-width: 32px; height: 34px; }
  .account-name { max-width: 105px; }
  .hero-actions .btn { width: 100%; }
  .hero-proof { display: grid; gap: 8px; }
  .hero-copy h1 { font-size: 40px; }
}

@media (max-width: 380px) {
  .public-shell .brand-plane { display: none; }
  .public-shell .public-actions .btn { padding-inline: 6px; font-size: 9px; }
}

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