/* ==========================================================================
   TENGRI FUNDING — ALPINE WORKSPACE DESIGN SYSTEM
   Professional prop evaluation trading platform visual system.
   Supports full Dark Mode & Light Mode with semantic tokens,
   unified navigation, responsive tables, and WCAG 2.2 AA compliance.
   ========================================================================== */

/* ------------------------------------------------------------------ Tokens */
:root {
  /* Common metrics */
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --max: 1280px;
  --header-h: 60px;
  --sidebar-w: 260px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* DARK THEME (Alpine Nocturne - Default) */
  color-scheme: dark;
  --bg-canvas: #060c0e;
  --bg-surface: #0c1619;
  --bg-elevated: #132227;
  --bg-muted: #182b31;
  --bg-overlay: rgba(6, 12, 14, 0.88);

  --text: #f0fdf9;
  --text-primary: #f0fdf9;
  --muted: #8ba8a4;
  --muted-2: #7a9995;

  --line: rgba(45, 212, 191, 0.12);
  --line-strong: rgba(45, 212, 191, 0.26);

  --accent: #2dd4bf;
  --accent-hover: #14b8a6;
  --accent-fg: #041c17;
  --accent-subtle: rgba(45, 212, 191, 0.12);

  --cyan-300: #5eead4;
  --cyan-400: #2dd4bf;
  --blue-500: #0ea5e9;
  --blue-400: #38bdf8;

  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.14);
  --ok-border: rgba(52, 211, 153, 0.35);

  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.14);
  --warn-border: rgba(251, 191, 36, 0.35);

  --bad: #f87171;
  --bad-fg: #041c17;
  --bad-bg: rgba(248, 113, 113, 0.14);
  --bad-border: rgba(248, 113, 113, 0.35);

  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.14);
  --info-border: rgba(56, 189, 248, 0.35);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 32px -8px rgba(45, 212, 191, 0.28);

  --mountain-hero: url('/images/mountain-dark-hero.jpg');
  --mountain-banner: url('/images/mountain-dark-banner.jpg');
}

/* Themed Worker pages expose only data-tf-theme. Share the same light tokens
   so catalogue titles, ghost buttons and links are not white on white. */
[data-theme="light"], html[data-tf-theme="light"] {
  /* LIGHT THEME (Alpine White) */
  color-scheme: light;
  --bg-canvas: #f4f7f6;
  --bg-surface: #ffffff;
  --bg-elevated: #edf2f1;
  --bg-muted: #e2eae8;
  --bg-overlay: rgba(244, 247, 246, 0.92);

  --text: #0f172a;
  --text-primary: #0f172a;
  --muted: #475569;
  --muted-2: #55657a;

  --line: rgba(15, 118, 110, 0.14);
  --line-strong: rgba(15, 118, 110, 0.32);

  --accent: #0d5c48;
  --accent-hover: #094737;
  --accent-fg: #ffffff;
  --accent-subtle: rgba(13, 92, 72, 0.1);

  --cyan-300: #0d5c48;
  --cyan-400: #0f766e;
  --blue-500: #0284c7;
  --blue-400: #0369a1;

  /* Status colours are darkened so 12px badge text keeps ≥4.5:1 on its tint. */
  --ok: #047857;
  --ok-bg: rgba(4, 120, 87, 0.12);
  --ok-border: rgba(4, 120, 87, 0.32);

  --warn: #9a4f00;
  --warn-bg: rgba(154, 79, 0, 0.12);
  --warn-border: rgba(154, 79, 0, 0.32);

  --bad: #b91c1c;
  --bad-fg: #ffffff;
  --bad-bg: rgba(185, 28, 28, 0.12);
  --bad-border: rgba(185, 28, 28, 0.32);

  --info: #0369a8;
  --info-bg: rgba(3, 105, 168, 0.12);
  --info-border: rgba(3, 105, 168, 0.32);

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 24px -8px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 24px -4px rgba(13, 92, 72, 0.15);

  --mountain-hero: url('/images/mountain-light-hero.jpg');
  --mountain-banner: url('/images/mountain-light-banner.jpg');
}

/* ------------------------------------------------------------------ Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

main { flex: 1; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }

/* Inline text links stay at least 24px tall so they are easy to tap. */
.back, .small a, .tiny a, .muted a, .note-muted a, .prose a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.025em;
  font-weight: 700;
}
h1 { font-size: clamp(28px, 4.5vw, 52px); letter-spacing: -0.035em; }
h2 { font-size: clamp(22px, 3vw, 36px); }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }

.lead { font-size: 16px; color: var(--muted); line-height: 1.6; }
.small { font-size: 13px; line-height: 1.5; }
.tiny { font-size: 12px; line-height: 1.4; }
.muted { color: var(--muted); }
.note-muted { color: var(--muted-2); font-size: 12px; }
.m0 { margin: 0 !important; }
.mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-14 { margin-top: 14px !important; }
.mt-18 { margin-top: 18px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-24 { margin-top: 24px !important; }
.mb-18 { margin-bottom: 18px !important; }
.mb-24 { margin-bottom: 24px !important; }
.nowrap { white-space: nowrap; }
.is-hidden { display: none !important; }
.pre-wrap { white-space: pre-wrap; }
.badge--inline { margin-left: 6px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip:focus { top: 20px; }

/* ------------------------------------------------------------------ Grid & Layout */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}
.narrow { max-width: 760px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.section { padding: clamp(48px, 6vw, 84px) 0; position: relative; }
.section--tight { padding: clamp(24px, 3.5vw, 44px) 0; }
.section-head { margin-bottom: 24px; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-title { font-size: clamp(19px, 2vw, 24px); margin: 32px 0 16px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.row-center { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------------ Header */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-head.is-scrolled {
  box-shadow: var(--shadow-sm);
}
.site-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}
.brand__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.brand__logo-img {
  display: block;
  height: 34px;
  width: auto;
}
.brand__logo-img--light { display: none; }
[data-theme="light"] .brand__logo-img--dark { display: none; }
[data-theme="light"] .brand__logo-img--light { display: block; }

.brand__mark {
  width: 32px;
  height: 32px;
  color: var(--accent);
  flex-shrink: 0;
}
.brand__text {
  font-size: 16px;
  letter-spacing: 0.06em;
  font-weight: 800;
}
.brand__funding {
  color: var(--accent);
  margin-left: 2px;
  font-weight: 400;
  font-size: 14px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.site-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 16px;
}
.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-muted);
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Language Dropdown */
.lang-dropdown {
  position: relative;
  display: inline-block;
}
.lang-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-dropdown__trigger:hover,
.lang-dropdown.is-open .lang-dropdown__trigger {
  border-color: var(--accent);
  background: var(--bg-muted);
}
.lang-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 100;
  animation: dropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-dropdown.is-open .lang-dropdown__menu { display: block; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}
.lang-dropdown__item:hover,
.lang-dropdown__item.is-selected {
  background: var(--bg-elevated);
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: all 0.2s ease;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { bottom: -6px; }

.mobile-nav {
  display: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 0 20px;
}
.mobile-nav.is-open { display: block; }
.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav__links a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.mobile-nav__links a:hover {
  background: var(--bg-elevated);
}
.registration-closed { display: inline-flex; align-items: center; padding: 0 4px; }
.mobile-nav .registration-closed { display: block; padding: 10px 14px; }
.mobile-nav__links--cabinet {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn--sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 7px; }
.btn--lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: var(--radius); }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg) !important;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--text-primary) !important;
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--bg-muted);
}

.btn--danger {
  background: var(--bad);
  color: var(--bad-fg) !important;
}
.btn--danger:hover {
  filter: brightness(0.9);
}

.btn--link {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  height: auto;
  min-height: 24px;
  font-size: 13px;
}
.btn--link:hover { color: var(--accent); }

/* Checkboxes are real controls: 24x24 keeps them usable with a mouse or touch. */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.check input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ------------------------------------------------------------------ Cards & Panels */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--line-strong);
}
.card--flush { padding: 0; overflow: hidden; }

/* Support: one primary action, clear labels, honest history states. */
.card--support h2 { font-size: clamp(22px, 3vw, 28px); }
.support-compose__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.support-compose__actions .btn--lg { min-width: 220px; }

/* ------------------------------------------------------------------ Auth Pages */
.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}
.auth-media {
  background-image: var(--mountain-hero);
  background-size: cover;
  background-position: center;
  position: relative;
  min-height: 320px;
}
.auth-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 40%, var(--bg-canvas) 100%);
}
.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px) 24px;
  background: var(--bg-canvas);
}
.auth-card { width: min(100%, 430px); }
.auth-card h1 { margin: 8px 0 10px; font-size: clamp(30px, 3.4vw, 42px); }
.auth-card .lead { margin-bottom: 20px; }
.auth-card .form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .form .btn { margin-top: 4px; }

@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-media { min-height: 190px; max-height: 220px; }
  .auth-media::after { background: linear-gradient(180deg, transparent 35%, var(--bg-canvas) 100%); }
  .auth-pane { padding: 28px 20px 48px; }
}

/* ------------------------------------------------------------------ Alpine Workspace */
.alpine-workspace {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  position: relative;
}
.alpine-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.alpine-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.alpine-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.alpine-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.alpine-nav-item.is-active,
.alpine-nav-item[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}
.alpine-nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.alpine-nav-item .badge {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 7px;
}
.alpine-nav-group + .alpine-nav-group { margin-top: 14px; }
.alpine-nav-group__title {
  display: block;
  padding: 0 14px 6px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.alpine-nav-item--catalog { margin-bottom: 12px; }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.alpine-sidebar__user {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.alpine-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.alpine-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.alpine-user-info { min-width: 0; flex: 1; }
.alpine-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alpine-user-role { font-size: 12px; color: var(--muted); }

.alpine-main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 48px;
}

/* Compact Alpine Banner */
.alpine-banner {
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  background-size: cover;
  background-position: center 38%;
  background-image: var(--mountain-banner);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.alpine-banner__overlay {
  background: linear-gradient(90deg, rgba(6, 12, 14, 0.92) 0%, rgba(6, 12, 14, 0.72) 55%, rgba(6, 12, 14, 0.25) 100%);
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
[data-theme="light"] .alpine-banner__overlay {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.78) 55%, rgba(255, 255, 255, 0.3) 100%);
}

.alpine-banner__content h1, .alpine-banner__content h2 { margin: 0 0 6px; font-size: 22px; }
.alpine-banner__content p { margin: 0; color: var(--muted); font-size: 14px; }
.alpine-banner__actions { display: flex; gap: 10px; }

/* Stat Cards */
.account-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.account-stat {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.account-stat span { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.account-stat b { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }

/* ------------------------------------------------------------------ Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  width: fit-content;
}
.badge--ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.badge--warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
.badge--bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-border); }
.badge--info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge--neutral { background: var(--bg-elevated); color: var(--muted); border: 1px solid var(--line); }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ------------------------------------------------------------------ Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  text-align: left;
}
.table th {
  background: var(--bg-elevated);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-strong);
}
.table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:hover td {
  background: var(--bg-elevated);
}
.table tbody tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------------ Forms */
.form { display: flex; flex-direction: column; gap: 16px; }

/* Google Identity Services (official button is injected by /google-auth.js) */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  color: var(--muted-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.google-auth { margin: 0; }
.google-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
}
.google-slot[data-unavailable] .google-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.google-auth .tiny { margin: 10px 0 0; text-align: center; }
.label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.15s ease;
}
.textarea { height: auto; padding: 10px 14px; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  outline: none;
}
.input::placeholder { color: var(--muted-2); }
.field-error {
  margin: 0;
  color: var(--bad);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.inline-form { display: inline-block; margin: 0; }

/* ------------------------------------------------------------------ Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert--success, .alert--ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.alert--error, .alert--bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-border); }
.alert--warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
.alert--info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }

/* ------------------------------------------------------------------ Empty States */
.empty {
  text-align: center;
  padding: 36px 24px;
  background: var(--bg-surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  color: var(--muted-2);
}
.empty h3 { margin-bottom: 8px; color: var(--text-primary); }
.empty p { color: var(--muted); max-width: 480px; margin: 0 auto 20px; font-size: 14px; }

/* ------------------------------------------------------------------ Catalogue & Cards */
.product {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-surface);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.product:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.product__top {
  padding: 20px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product__balance {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.product__title {
  padding: 0 22px;
  margin: 0 0 14px;
  font-size: 18px;
}
.specs {
  list-style: none;
  padding: 0 22px;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.specs li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--muted);
}
.specs li b { color: var(--text-primary); font-weight: 600; }
.product__foot {
  padding: 16px 22px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price { font-size: 20px; font-weight: 700; color: var(--text-primary); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* Filter bar & chips */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.seg {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg:hover { color: var(--text-primary); }
.seg.is-active,
.seg[aria-current="page"],
.seg[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-fg) !important;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.is-active,
.chip[aria-current="page"],
.chip[aria-pressed="true"] {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------------ KV Details */
.kv {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
.kv > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.kv > div:last-child { border-bottom: none; }
.kv dt { font-size: 13px; color: var(--muted); font-weight: 500; }
.kv dd { font-size: 13px; color: var(--text-primary); font-weight: 600; margin: 0; }

/* ------------------------------------------------------------------ Public Hero */
.home-hero {
  position: relative;
  padding: clamp(60px, 8vw, 110px) 0;
  background-image: var(--mountain-hero);
  background-size: cover;
  background-position: center 30%;
  border-bottom: 1px solid var(--line);
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-overlay) 0%, rgba(6, 12, 14, 0.6) 50%, var(--bg-canvas) 100%);
  pointer-events: none;
}
[data-theme="light"] .home-hero::before {
  background: linear-gradient(180deg, rgba(244, 247, 246, 0.94) 0%, rgba(244, 247, 246, 0.68) 50%, #f4f7f6 100%);
}
.home-hero .container { position: relative; z-index: 2; }
.home-hero__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}
.home-hero__content { min-width: 0; }
.home-hero__content h1 { overflow-wrap: anywhere; }
.home-hero__content h1 .soft {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 32px;
  font-size: 13px;
  color: var(--muted);
}
.meta-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.meta-row span::before {
  content: "•";
  color: var(--accent);
}

/* Glass panel */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.glass-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.overview-brand { font-size: 14px; font-weight: 800; }
.overview-brand span { color: var(--accent); font-weight: 400; }
.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Trust Bar */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ------------------------------------------------------------------ Footer */
.site-foot {
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  padding: 56px 0 28px;
  margin-top: auto;
}
.site-foot__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.foot-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.plain {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plain a {
  color: var(--muted);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.plain a:hover { color: var(--text-primary); }

.site-foot__legal {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: var(--muted-2);
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ Admin shell */
.admin {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin__side {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.admin__brand {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin__nav { display: flex; flex-direction: column; gap: 4px; }
.admin__nav a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.admin__nav a:hover { background: var(--accent-subtle); color: var(--accent); }
.admin__nav a[aria-current='page'] { background: var(--accent); color: var(--accent-fg); }
.admin__main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.admin__title { margin: 0; font-size: clamp(24px, 3vw, 34px); }
.admin .card--flush { overflow-x: auto; }
.admin .table:not(.table--stack) { min-width: 560px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1024px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .home-hero__grid { grid-template-columns: 1fr; }
  .site-foot__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .admin { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .admin__side { position: static; padding: 12px; }
  .admin__nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .admin__nav a { white-space: nowrap; flex-shrink: 0; }
  /* Cabinet links live in the mobile drawer; keeping them in the top bar
     pushed the header past the viewport on 390px screens. */
  .site-head__actions > .btn,
  .site-head__actions > .inline-form { display: none; }
  .alpine-workspace { flex-direction: column; }
  .alpine-main { min-width: 0; }
  .alpine-sidebar {
    width: 100%;
    overflow: hidden;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
  }
  .alpine-sidebar__nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
    max-width: 100%;
  }
  .alpine-nav-item { white-space: nowrap; flex-shrink: 0; padding: 8px 12px; font-size: 13px; }
  .alpine-nav-group {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
  }
  .alpine-nav-group + .alpine-nav-group {
    margin-top: 0;
    padding-left: 10px;
    border-left: 1px solid var(--line);
  }
  .alpine-nav-group__title { display: none; }
  .alpine-nav-item--catalog { margin-bottom: 0; margin-right: 4px; }
  .alpine-sidebar__user { display: none; }
  .alpine-main { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .trust-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Mobile Stacked Tables */
  .table--stack thead { display: none; }
  .table--stack tr {
    display: flex;
    flex-direction: column;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .table--stack td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .table--stack td:last-child { border-bottom: none; }
  .table--stack td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .site-foot__grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .container { padding: 0 14px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  .account-stats { grid-template-columns: repeat(2, 1fr); }
  .trust-bar { grid-template-columns: 1fr; }
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; }
  .alpine-banner__overlay { flex-direction: column; align-items: flex-start; }
  .alpine-banner__actions { flex-wrap: wrap; max-width: 100%; }

  /* Keep the header inside a 320–390px viewport: the flag alone identifies
     the current language in the compact bar, the full label stays in the menu. */
  .site-head__row { padding-inline: 14px; gap: 8px; }
  .site-head__actions { gap: 6px; }
  .brand__text { font-size: 14px; letter-spacing: 0.02em; }
  .brand__logo-img { height: 30px; }
  .lang-dropdown__trigger { padding: 7px 9px; }
  .lang-dropdown__trigger span:nth-child(2) { display: none; }
  .nav-toggle { width: 38px; height: 38px; }
}

/* ---------------------------------------------------- Release education pages */
.how-head { padding-bottom: 18px; }
.journey {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  counter-reset: journey;
}
.journey-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 100% 0%, var(--accent-subtle), transparent 58%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.journey-step__n {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}
.journey-step__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-subtle);
}
.journey-step__icon svg { width: 22px; height: 22px; }
.journey-step h2 { margin: 4px 0 0; font-size: 19px; line-height: 1.25; }
.journey-step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.journey-step .text-link { margin-top: auto; padding-top: 8px; }
.text-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.status-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
}
.status-panel__intro h2 { margin: 8px 0 10px; }
.status-panel__intro p { color: var(--muted); margin: 0; line-height: 1.65; }
.status-list { display: grid; gap: 10px; }
.status-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.status-item__icon { color: var(--accent); }
.status-item__icon svg { width: 21px; height: 21px; }
.status-item h3 { margin: 0 0 2px; font-size: 14px; }
.status-item p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.status-tag {
  padding: 5px 9px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-pill);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-tag--on { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }

.faq-tools {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}
.faq-search {
  display: grid;
  gap: 7px;
  max-width: 560px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.faq-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
}
.faq-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.faq-chip {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.faq-chip:hover { color: var(--text); border-color: var(--accent); }
.faq-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.faq-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.faq-group { display: grid; gap: 9px; }
.faq-group > h2 {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.faq-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.faq-card:hover { border-color: var(--line-strong); }
.faq-card[open] { border-color: var(--line-strong); background: var(--bg-elevated); }
.faq-card summary {
  padding: 16px 46px 16px 16px;
  position: relative;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.45;
  list-style: none;
}
.faq-card summary::-webkit-details-marker { display: none; }
.faq-card summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 13px;
  color: var(--accent);
  font-size: 21px;
  font-weight: 400;
}
.faq-card[open] summary::after { content: "−"; }
.faq-card p {
  margin: 0;
  padding: 0 46px 17px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.faq-empty {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.faq-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.faq-help h2 { margin: 0 0 6px; }
.faq-help p { margin: 0; color: var(--muted); max-width: 60ch; line-height: 1.6; }

@media (max-width: 1024px) {
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-panel { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 768px) {
  .faq-grid { grid-template-columns: 1fr; gap: 22px; }
  .faq-help { flex-direction: column; align-items: flex-start; }
  .status-item { grid-template-columns: 34px minmax(0, 1fr); }
  .status-item .status-tag { grid-column: 2; justify-self: start; }
}
@media (max-width: 480px) {
  .journey { grid-template-columns: 1fr; }
  .journey-step { padding: 22px 18px; }
  .status-panel { padding: 20px; }
  .faq-tools { gap: 12px; }
  .faq-card summary { padding-right: 42px; }
}

/* -------------------------------------------------------- Catalogue compare */
.compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.compare-toggle input {
  width: 24px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.compare-toggle:hover { color: var(--text); }
.compare-tray[hidden] { display: none; }

.compare-tray {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(560px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-overlay);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
}
.compare-tray__info { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 2px 7px; min-width: 0; color: var(--muted); font-size: 13px; }
.compare-tray__info strong { color: var(--accent); font-size: 18px; }
.compare-tray__hint { grid-column: 1 / -1; font-size: 12px; color: var(--warn); }
.compare-tray__hint[hidden] { display: none; }
.compare-tray__actions { display: flex; gap: 8px; margin-left: auto; }
.compare-dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: min(84vh, 760px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.compare-dialog::backdrop { background: rgba(2, 8, 8, 0.72); backdrop-filter: blur(4px); }
.compare-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
}
.compare-dialog__head h2 { margin: 0; font-size: 20px; }
.compare-dialog__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.compare-dialog__close:hover { border-color: var(--accent); color: var(--accent); }
.compare-dialog__body { overflow: auto; padding: 18px 20px 24px; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 13px; }
.compare-table th,
.compare-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table thead th { color: var(--text); font-size: 14px; }
.compare-table tbody th { width: 180px; color: var(--muted); font-weight: 600; }
.compare-table tbody td { color: var(--text); min-width: 150px; }
.compare-cards { display: none; }
.compare-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.compare-card h3 { margin: 0 0 10px; font-size: 16px; }
.compare-card dl { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.compare-card dt { color: var(--muted); font-weight: 600; }
.compare-card dd { margin: 0; color: var(--text); }

@media (max-width: 640px) {
  .compare-table { display: none; }
  .compare-cards { display: grid; gap: 12px; }
  .compare-dialog__body { overflow-x: hidden; }
}

@media (max-width: 480px) {
  .compare-tray { flex-wrap: wrap; gap: 10px; padding: 11px 12px; }
  .compare-tray__actions { width: 100%; }
  .compare-tray__actions .btn { flex: 1; }
  .compare-dialog { max-height: 90vh; }
  .compare-dialog__head { padding: 14px 16px; }
  .compare-dialog__body { padding: 14px 16px 20px; }
}

/* ---------------------------------------------------- Rules detail + glossary */
.specs--detail { padding: 0; margin-top: 12px; }
.specs--detail li { align-items: flex-start; gap: 14px; line-height: 1.45; }
.specs--detail li b { max-width: 58%; text-align: right; }

.glossary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.glossary__item {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.glossary__item h3 { margin: 0 0 8px; font-size: 15px; line-height: 1.4; }
.glossary__item p { margin: 8px 0 0; font-size: 13px; line-height: 1.55; }

@media (max-width: 480px) {
  .specs--detail li { flex-direction: column; gap: 2px; }
  .specs--detail li b { max-width: none; text-align: left; }
}

/* WCAG 2.2 target size (2.5.8): form controls stay at least 44x44 on touch. */
@media (hover: none) and (pointer: coarse) {
  .input, .select, .textarea { min-height: 44px; }
  .check { min-height: 44px; align-items: center; }
  .check input[type="checkbox"] { width: 28px; height: 28px; }
  .theme-toggle, .lang-dropdown__trigger, .nav-toggle,
  .btn--sm, .seg, .chip, .alpine-nav-item, .mobile-nav__links a {
    min-height: 44px;
  }
}

/* Themed pages (catalogue + account) share one header baseline. The theme
   Worker's own CSS is appended after this file, so keep selectors specific. */
html[data-tf-theme][data-tf-section] .site-head__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-h);
  min-height: var(--header-h);
}
html[data-tf-theme][data-tf-section="catalog-preview"] .section--tight {
  padding-block-start: 16px;
}

/* Mountain surfaces for the existing Cloudflare-rendered account and auth UI. */
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) {
  --navy-800: #f0f8f6;
  --navy-700: #95d9ce;
  --blue-700: #83f0dd;
  --blue-600: #5ce2cd;
  --blue-500: #40bfae;
  --blue-100: #233f3e;
  --blue-50: #183532;
  --sky-50: #14272a;
  --sky-100: #182f32;
  --white: #101e21;
  --line: #335451;
  --line-soft: #263e3f;
  --text: #e9f4f2;
  --muted: #bdd2ce;
  --muted-2: #a1bdb8;
  background: #0a1619;
  color: var(--text);
  font-family: system-ui, sans-serif;
  color-scheme: dark;
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(.site-head, .site-footer, .card, .auth-card, .empty, .account-stat, .table) {
  background: #112226;
  color: var(--text);
  border-color: var(--line);
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(.btn--primary, .btn--primary:hover) {
  background: linear-gradient(110deg,#91ffea,#43ead3);
  border-color: #7cf5e5;
  color: #061b18;
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(input:not([type="checkbox"]), select, textarea) {
  background: #0b191c;
  border-color: #3f605e;
  color: #f3f8f7;
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :focus-visible {
  outline: 2px solid #68f0dd;
  outline-offset: 3px;
}
.account-hero {
  background: radial-gradient(ellipse at 85% 0%, #20423f, #0d1d20 64%);
  border-bottom: 1px solid #335451;
}
.account-hero h1 { max-width: 22ch; letter-spacing: -.045em; }
.account-hero .eyebrow { color: #78f4e0; }
.account-layout { gap: clamp(16px, 2.6vw, 34px); }
.account-layout > * { min-width: 0; }
.account-menu.card { padding: 12px; }
.account-menu__nav { gap: 5px; }
.account-menu__link { border: 1px solid transparent; min-height: 44px; overflow-wrap: anywhere; }
.account-menu__link.is-active { border-color: #50877e; box-shadow: inset 2px 0 #68f0dd; }
.account-content :is(.card, .empty) { overflow-wrap: anywhere; }
.account-content .card--flush { overflow-x: auto; }
.account-stat { min-width: 0; }
.account-stat b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .account-menu__nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-menu__link { display: flex; align-items: center; }
  .account-menu__foot { flex-wrap: wrap; }
  .account-content .challenge-row__actions { width: 100%; }
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head)
  :is(.btn--ghost, .nav-toggle, .lang-switch a[aria-current]) {
  background: #172c2f;
  border-color: #47736e;
  color: #e3f6f2;
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) .brand__mark {
  content: url("/design-preview/assets/brand/logo-light.svg");
  width: 132px;
  height: auto;
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) .nav-toggle span {
  background-color: #e3f6f2;
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head)
  .brand:has(.brand__mark) .brand__text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Explicit surfaces are needed for older components that hard-code white. */
body:has(.account-layout, .auth, .checkout-grid, main > .page-head)
  :is(.compare__scroll, .compare table, .compare th, .compare td, .mobile-nav,
      .specs li.muted, .rule-card, .faq, .checkout-lock, .steps li, .table td, .table th) {
  background-color: #122529;
  color: #e9f4f2;
  border-color: #335451;
}
body:has(.account-layout, main > .page-head) :is(.compare thead th, .table thead th) {
  background-color: #1b383b;
  color: #aef5e8;
}
.compare__scroll:focus-visible { outline: 2px solid #68f0dd; outline-offset: 3px; }
body:has(.account-layout, .auth, .checkout-grid, main > .page-head)
  :is(.btn--ghost:hover, .account-menu__link:hover) {
  background: #254740;
  color: #f1fffb;
}
body:has(.account-layout, .auth, .checkout-grid, main > .page-head) .page-head,
.account-hero {
  background: linear-gradient(90deg,#0a171af5,#0a171aa6),
    url('/design-preview/assets/cinema/closing.webp') center 58% / cover;
}
body:has(.auth) .auth__aside {
  background: linear-gradient(135deg,#0d2329f0,#0c1d24ab),
    url('/design-preview/assets/cinema/hero-mobile.webp') center / cover;
}
.account-content :is(label, .kv dd) { overflow-wrap: anywhere; }
.account-content > :is(.card, .section-head) { margin-bottom: 16px; }
.preview-head .lead { max-width: 64ch; }
.preview-approval { display: inline-block; padding: 7px 12px; border: 1px solid #638d80; background: #152e2c; color: #d7f5ee; border-radius: 8px; }
.preview-filters { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.preview-filters fieldset { min-width: 0; margin: 0; border: 1px solid #335451; border-radius: 12px; padding: 12px; }
.preview-filters legend, .preview-count, .preview-footnote { color: #bdd2ce; }
.preview-filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-filter { border: 1px solid #47736e; background: #172c2f; color: #e3f6f2; border-radius: 8px; min-height: 44px; padding: 6px 10px; cursor: pointer; }
.preview-filter[aria-pressed="true"] { background: #68f0dd; border-color: #68f0dd; color: #061b18; font-weight: 700; }
.preview-count { margin: 14px 0; }
.preview-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.preview-plan { padding: 18px; border: 1px solid #335451; border-radius: 14px; background: #112226; }
.preview-plan__head, .preview-plan__fee, .preview-plan__terms > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.preview-plan h2 { font-size: 1.12rem; margin: 14px 0 10px; }
.preview-plan__fee strong { color: #83f0dd; font-size: 1.65rem; }
.preview-plan__terms { margin-bottom: 0; }
.preview-plan__terms > div { border-top: 1px solid #263e3f; padding: 8px 0; font-size: .83rem; }
.preview-plan__terms dt { color: #bdd2ce; }
.preview-plan__terms dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.preview-plan__size, .preview-plan .pill { color: #aef5e8; }
.preview-footnote { margin-top: 18px; }
@media (max-width: 940px) { .preview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 620px) {
  .preview-grid, .preview-filters { grid-template-columns: 1fr; }
  .account-layout .account-menu { padding: 8px; }
}
.account-hero {
  background-image: linear-gradient(90deg,#0a171af5,#0a171a88), url('/mountain-dashboard.webp');
}

/* The server selects the palette before the browser paints the document. */
html[data-tf-theme] {
  --tf-bg: #071113;
  --tf-panel: #102124;
  --tf-raised: #193035;
  --tf-text: #f5fafa;
  --tf-muted: #b1c8c4;
  --tf-accent: #65ecda;
  --tf-action: #35dfc8;
  --tf-action-ink: #071e1b;
  --tf-border: #668d86;
  --tf-focus: #82f5df;
  --tf-alert: #493719;
  --tf-alert-ink: #fff1c8;
  color-scheme: dark;
}
html[data-tf-theme="light"] {
  --tf-bg: #f4f8f7;
  --tf-panel: #fff;
  --tf-raised: #e5efed;
  --tf-text: #13252a;
  --tf-muted: #405b5f;
  --tf-accent: #005f59;
  --tf-action: #006c65;
  --tf-action-ink: #fff;
  --tf-border: #62827e;
  --tf-focus: #006c65;
  --tf-alert: #fff1cd;
  --tf-alert-ink: #664708;
  color-scheme: light;
}
html[data-tf-theme] body:where(:not(.landing)),
html[data-tf-theme] body:has(.account-layout, .auth, .checkout-grid, main > .page-head) {
  --navy-900: var(--tf-text);
  --navy-800: var(--tf-text);
  --navy-700: var(--tf-accent);
  --blue-700: var(--tf-accent);
  --blue-600: var(--tf-accent);
  --blue-500: var(--tf-action);
  --blue-100: var(--tf-raised);
  --blue-50: var(--tf-raised);
  --sky-50: var(--tf-raised);
  --sky-100: var(--tf-raised);
  --white: var(--tf-panel);
  --line: var(--tf-border);
  --line-soft: color-mix(in srgb, var(--tf-border), var(--tf-panel) 63%);
  --text: var(--tf-text);
  --muted: var(--tf-muted);
  --muted-2: var(--tf-muted);
  background: var(--tf-bg);
  color: var(--tf-text);
  color-scheme: inherit;
}
html[data-tf-theme] body :is(.site-head, .site-footer, .auth-card, .card, .empty, .account-stat, .table, .preview-plan, .compare__scroll, .compare table, .faq, .rule-card, .mobile-nav, .steps li, .checkout-lock, .specs li.muted),
html[data-tf-theme] body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(.site-head, .site-footer, .auth-card, .card, .empty, .account-stat, .table, .compare__scroll, .compare table, .compare th, .compare td, .table td, .table th, .faq, .rule-card, .mobile-nav, .steps li, .checkout-lock, .specs li.muted) {
  background: var(--tf-panel);
  color: var(--tf-text);
  border-color: var(--line-soft);
}
html[data-tf-theme] body :is(.table thead th, .compare thead th, .preview-filters fieldset) {
  background: var(--tf-raised);
  color: var(--tf-text);
}
html[data-tf-theme] body :is(.preview-plan__size, .preview-plan .pill, .preview-plan__fee strong, .eyebrow) { color: var(--tf-accent); }
html[data-tf-theme] body :is(.preview-plan__terms dt, .preview-filters legend, .preview-footnote, .preview-count) { color: var(--tf-muted); }
html[data-tf-theme] body :is(.preview-plan__terms > div) { border-color: var(--line-soft); }
html[data-tf-theme] body :is(.preview-approval, .alert, .notice) { background: var(--tf-alert); color: var(--tf-alert-ink); border-color: var(--tf-border); }
html[data-tf-theme] body :is(.tf-theme-toggle, .preview-filter, .nav-toggle, .lang-switch a[aria-current], .btn--ghost),
html[data-tf-theme] body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(.btn--ghost, .nav-toggle, .lang-switch a[aria-current]) {
  background: var(--tf-panel);
  color: var(--tf-text);
  border: 1px solid var(--tf-border);
}
html[data-tf-theme] body :is(.tf-theme-toggle, .preview-filter, .nav-toggle, .btn--ghost):hover { background: var(--tf-raised); }
html[data-tf-theme] body :is(.tf-theme-toggle, .preview-filter, .nav-toggle, .btn):active { transform: translateY(1px); }
html[data-tf-theme] body :is(.btn--primary, .preview-filter[aria-pressed="true"]),
html[data-tf-theme] body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(.btn--primary, .btn--primary:hover) {
  background: var(--tf-action);
  color: var(--tf-action-ink);
  border-color: var(--tf-action);
}
html[data-tf-theme] body :is(.btn--primary, .preview-filter[aria-pressed="true"]):hover { box-shadow: inset 0 0 0 2px currentColor; }
html[data-tf-theme] body :is(button, .btn):is(:disabled, [aria-disabled="true"]) {
  background: var(--tf-raised);
  color: var(--tf-muted);
  border-color: var(--tf-border);
  box-shadow: none;
  cursor: not-allowed;
}
html[data-tf-theme] body :is(input:not([type="checkbox"]), select, textarea),
html[data-tf-theme] body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(input:not([type="checkbox"]), select, textarea) {
  background: var(--tf-panel);
  color: var(--tf-text);
  border-color: var(--tf-border);
}
html[data-tf-theme] body :is(input, textarea)::placeholder { color: var(--tf-muted); opacity: 1; }
html[data-tf-theme] body :focus-visible { outline: 3px solid var(--tf-focus); outline-offset: 3px; }
html[data-tf-theme] body .nav-toggle span { background-color: var(--tf-text); }
html[data-tf-theme] body .account-menu__link.is-active { background: var(--tf-raised); color: var(--tf-accent); border-color: var(--tf-border); box-shadow: inset 3px 0 var(--tf-accent); }
html[data-tf-theme] body .account-menu__link:hover { background: var(--tf-raised); color: var(--tf-text); }
.tf-theme-toggle { min-height: 44px; padding: 6px 11px; border-radius: 8px; font: inherit; font-size: .82rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
html[data-tf-section] .site-head__inner { flex-wrap: wrap; gap: 8px 12px; }
html[data-tf-theme="light"] .brand:has(.brand__mark) .brand__mark { content: url('/design-preview/assets/brand/mark-dark.svg'); width: 38px; height: 38px; }
html[data-tf-theme="light"] .brand:has(.brand__mark) .brand__text { position: static; width: auto; height: auto; clip-path: none; color: var(--tf-text); }
html[data-tf-theme="light"] .brand:has(> img:not(.brand__mark)) { padding: 3px 6px; background: #102022; border-radius: 8px; }

html[data-tf-section] { --tf-scene: url('/design-preview/assets/cinema/closing.webp'); --tf-position: center 58%; --tf-banner: #0e2527; }
html[data-tf-section="dashboard"] { --tf-scene: url('/catalog-preview/scenes/dashboard.webp'); --tf-position: center; }
html[data-tf-section="accounts"] { --tf-scene: url('/catalog-preview/scenes/accounts.webp'); --tf-position: center; }
html[data-tf-section="challenges"] { --tf-scene: url('/catalog-preview/scenes/challenges.webp'); --tf-position: center; }
html[data-tf-section="orders"] { --tf-scene: url('/catalog-preview/scenes/orders.webp'); --tf-position: center; }
html[data-tf-section="profile"] { --tf-scene: url('/catalog-preview/scenes/profile.webp'); --tf-position: center; }
html[data-tf-section="support"] { --tf-scene: url('/catalog-preview/scenes/support.webp'); --tf-position: center; }
html[data-tf-section="settings"] { --tf-scene: url('/catalog-preview/scenes/settings.webp'); --tf-position: center; }
html[data-tf-section="notifications"] { --tf-scene: radial-gradient(ellipse at 92% 25%,#2c5a57,#122b2d 60%); }
html[data-tf-section="register"] { --tf-scene: url('/catalog-preview/scenes/register.webp'); --tf-position: center; }
html[data-tf-section="login"] { --tf-scene: url('/catalog-preview/scenes/login.webp'); --tf-position: center; }
html[data-tf-section] body :is(.account-hero, .page-head, .auth__aside),
html[data-tf-section] body:has(.account-layout, .auth, .checkout-grid, main > .page-head) :is(.account-hero, .page-head, .auth__aside) {
  --text: #f5fafa;
  --navy-800: #f5fafa;
  --muted: #c3d9d6;
  --navy-700: #a2f1e2;
  --tf-accent: #a2f1e2;
  color: #f5fafa;
  background: linear-gradient(90deg,#081719f5 8%,#081719da 54%,#08171991), var(--tf-scene) var(--tf-position) / cover, var(--tf-banner);
}
html[data-tf-section] :is(.account-hero, .page-head, .auth__aside) :is(h1,h2,.lead,p) { color: inherit; }
html[data-tf-section] .account-hero .account-stat { --tf-text: #f5fafa; color: var(--tf-text); background: #112527; border-color: #668d86; }
html[data-tf-section] .account-hero .account-stat span { color: #c3d9d6; }
@media (max-width: 540px) {
  .tf-theme-toggle { font-size: .76rem; padding-inline: 8px; }
  html[data-tf-section] .site-head__inner { row-gap: 4px; }
  html[data-tf-section] .account-menu__link { min-height: 44px; }
}

/* Compact account overview, with a separate editing destination. */
html[data-tf-section="profile"] .account-hero { padding-block: 22px; }
html[data-tf-section="profile"] .account-hero .account-stats { display: none; }
html[data-tf-section="profile"] .profile-grid {
  grid-template-columns: minmax(0,1fr);
  gap: 14px;
}
html[data-tf-section="profile"] .profile-card__head {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  align-items: center;
  gap: 4px 14px;
  background: var(--tf-raised);
  padding: clamp(15px,3vw,24px);
}
html[data-tf-section="profile"] .profile-card__head::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 54px;
  height: 54px;
  border: 1px solid var(--tf-border);
  border-radius: 50%;
  background: #102729 url('/mountain-favicon.png') center / 86% no-repeat;
}
html[data-tf-section="profile"] .profile-card__head > :is(h3,p) { grid-column: 2; overflow-wrap: anywhere; }
.tf-profile-actions, .tf-catalog-next { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-profile-actions { grid-column: 1 / -1; margin-top: 10px; }
.tf-profile-actions a { min-height: 44px; }
.tf-catalog-next { padding-bottom: 32px; }
html[data-tf-section="profile"] .profile-card__body { padding: clamp(14px,3vw,22px); }
html[data-tf-section="profile"] .profile-card__body .kv { margin-block: 0; }
html[data-tf-section="profile"] #edit-profile { scroll-margin-top: 100px; }
@media (min-width: 700px) {
  html[data-tf-section="profile"] #edit-profile { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html[data-tf-section="profile"] #edit-profile > label:has([name="phone"]) { grid-column: 1 / -1; }
  html[data-tf-section="profile"] #edit-profile > button { justify-self: start; }
}
@media (max-width: 480px) {
  .tf-profile-actions > a { flex: 1 1 auto; justify-content: center; }
  .account-content .table--stack td { overflow-wrap: anywhere; }
}

.tf-app-footer {
  background: var(--tf-panel);
  color: var(--tf-muted);
  border-top: 1px solid var(--line-soft);
  padding: 10px 0;
}
.tf-app-footer > .container, .tf-app-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}
.tf-app-footer a { color: var(--tf-accent); display: inline-flex; align-items: center; min-height: 44px; font-size: .82rem; }
.tf-app-footer a:hover { text-decoration: underline; }
html[data-tf-section="payments"] { --tf-scene: linear-gradient(115deg,#102729 23%,#183c3a 63%,#13292e); }
html[data-tf-section="checkout"] { --tf-scene: url('/design-preview/assets/cinema/foreground.webp'); --tf-position: center bottom; }
html[data-tf-section="orders"] .account-content .card--flush { border: 1px solid var(--tf-border); overflow: auto; }
html[data-tf-section="orders"] .account-content .table td { font-variant-numeric: tabular-nums; }
html[data-tf-section="accounts"] .account-content .account-card { border-top: 2px solid var(--tf-border); }
html[data-tf-section="notifications"] .account-content .card { border-inline-start: 2px solid var(--tf-accent); }
html[data-tf-section="support"] .account-content textarea { min-height: 9rem; resize: vertical; }
html[data-tf-section="settings"] .account-content > .card { border-inline-start: 2px solid var(--tf-border); }
html[data-tf-section="checkout"] .checkout-summary { border: 1px solid var(--tf-border); }
html[data-tf-section] .account-layout .account-content { min-width: 0; }
html[data-tf-section] .account-content :is(.kv dd, input, select, textarea) { max-width: 100%; }
html[data-tf-section] .account-content .table--stack :is(th, td) { overflow-wrap: anywhere; }
html[data-tf-section] .account-content :is(input,select,textarea,button) { min-height: 44px; }
@media (max-width: 480px) {
  html[data-tf-section] .account-menu__nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html[data-tf-section] .account-menu__link { font-size: .79rem; padding-inline: 7px; }
  html[data-tf-section] .account-layout :is(.grid-2,.account-stats) { min-width: 0; }
  .tf-app-footer nav { gap: 4px 12px; }
}

/* Hero metrics remain on a dark plate in both palettes. */
html[data-tf-theme][data-tf-section] body .account-hero .account-stat {
  --tf-panel: #112527;
  background-color: #112527 !important;
  border-color: #668d86;
  color: #f5fafa;
}
html[data-tf-theme][data-tf-section] .account-stat :is(b, span, small) { color: #e6f3f0; }
html[data-tf-theme][data-tf-section] .account-hero .account-stat b { color: #f5fafa; }
html[data-tf-theme][data-tf-section] .account-hero .account-stat :is(span,small) { color: #c3d9d6; }
html[data-tf-theme="light"][data-tf-section] .brand:has(.brand__mark) .brand__text {
  display: flex;
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
}
html[data-tf-theme][data-tf-section] .checkout-contact :is(span,small) { color: var(--tf-muted); }
html[data-tf-theme][data-tf-section] .checkout-contact b { color: var(--tf-text); }

.tf-skip-link {
  position: absolute;
  inset: 8px auto auto 8px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--tf-action-ink);
  background: var(--tf-action);
  transform: translateY(calc(-100% - 16px));
}
.tf-skip-link:focus { transform: none; }
html[data-tf-theme] .lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
}

html[data-tf-theme] body :is(.site-nav a, .form label, .check > span, .checkout-totals dt, .checkout-totals dd) {
  color: var(--tf-text);
}
html[data-tf-theme] body .seg { color: var(--tf-text); background: var(--tf-panel); }
html[data-tf-theme] body .seg:hover { background: var(--tf-raised); }
html[data-tf-theme] body .seg[aria-current="page"] {
  color: var(--tf-action-ink);
  background: var(--tf-action);
}
html[data-tf-theme] body .preview-approval {
  color: var(--tf-alert-ink);
  background: var(--tf-alert);
}
html[data-tf-theme] body :is(.checkout-provider-slot, .checkout-summary) { color: var(--tf-text); background: var(--tf-panel); }
html[data-tf-theme] body :is(.checkout-provider-slot, .checkout-summary) :is(b,h3) { color: var(--tf-text); }
html[data-tf-theme] body .auth-card .tiny a { text-decoration: underline; }
html[data-tf-theme] body .auth-card a[href="/register"] { display: inline-flex; min-height: 24px; align-items: center; }
html[data-tf-theme] body .auth-card .auth-form label { color: var(--tf-text); }
html[data-tf-theme] body .auth-card a[href="/forgot-password"] { display: inline-flex; min-height: 24px; align-items: center; }
html[data-tf-theme][data-tf-section="catalog-preview"] .page-head p.preview-approval {
  color: var(--tf-alert-ink);
  background: var(--tf-alert);
}

/* Keep the catalogue status in the same position across each row. */
.preview-plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.preview-plan__head {
  min-height: 92px;
  align-items: flex-end;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(0deg, #071718f5, #07171830), var(--plan-mountain) center / cover;
}
.preview-plan[data-preview-programme="two-step"] { --plan-mountain: url('/mountain-ridge.jpg'); }
.preview-plan[data-preview-programme="one-step"] { --plan-mountain: url('/mountain-summit.jpg'); }
.preview-plan[data-preview-programme="instant"] {
  --plan-mountain: url('/mountain-glacier.jpg');
}
html[data-tf-theme] body .preview-plan__head :is(.pill, .preview-plan__size) {
  color: #f5fafa;
  background: #102527;
  padding: 4px 8px;
  border-radius: 4px;
}
.preview-plan__availability {
  margin-block: auto 0;
  padding-block-start: 12px;
  color: var(--tf-muted);
  font-size: .85rem;
}

@media (max-width: 640px) { html[data-tf-section="dashboard"] { --tf-scene: url('/catalog-preview/scenes/dashboard-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="accounts"] { --tf-scene: url('/catalog-preview/scenes/accounts-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="challenges"] { --tf-scene: url('/catalog-preview/scenes/challenges-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="orders"] { --tf-scene: url('/catalog-preview/scenes/orders-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="profile"] { --tf-scene: url('/catalog-preview/scenes/profile-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="settings"] { --tf-scene: url('/catalog-preview/scenes/settings-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="support"] { --tf-scene: url('/catalog-preview/scenes/support-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="login"] { --tf-scene: url('/catalog-preview/scenes/login-mobile.webp'); } }

@media (max-width: 640px) { html[data-tf-section="register"] { --tf-scene: url('/catalog-preview/scenes/register-mobile.webp'); } }

.preview-plan[data-preview-programme="instant-light"] { --plan-mountain: url('/catalog-preview/scenes/instant-light.webp'); }
@media (max-width: 640px) {
  .preview-plan[data-preview-programme="instant-light"] { --plan-mountain: url('/catalog-preview/scenes/instant-light-mobile.webp'); }
}
html[data-tf-theme] .preview-plan__head { min-height: clamp(8rem, 12vw, 11rem); }
html[data-tf-theme] .preview-plan .btn { margin-block-start: .75rem; width: 100%; }
html[data-tf-theme] .account-menu__link.is-active { font-weight: 750; border-inline-start: 3px solid var(--tf-accent); }
html[data-tf-theme] .account-content :is(h2,h3) { text-wrap: balance; }
html[data-tf-theme] .account-content .table tbody tr:focus-within { outline: 2px solid var(--tf-focus); outline-offset: -2px; }
html[data-tf-theme] body :is(input:not([type=hidden]),select,textarea) { border-color: var(--tf-border); }
.order-status-filter { display: grid; gap: .4rem; width: min(100%, 22rem); margin-bottom: 1rem; color: var(--tf-text); }
.order-status-filter select { min-height: 44px; }
.account-content tr[hidden] { display: none !important; }
html[data-tf-section="notifications"] .account-content .card:not(.is-unread) { border-inline-start-color: var(--tf-border); }
@media (min-width: 900px) {
  html[data-tf-section="dashboard"] .account-hero > .container { display: grid; grid-template-columns: 1fr minmax(20rem, .8fr); gap: .4rem 2rem; }
  html[data-tf-section="dashboard"] .account-hero :is(.eyebrow,h1,.lead) { grid-column: 1; margin-block: 0; }
  html[data-tf-section="dashboard"] .account-stats { grid-area: 1 / 2 / span 3; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; align-self: center; }
}
.account-menu__toggle { display: none; }
@media (max-width: 700px) {
  .account-menu__toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    min-height: 44px; padding: .65rem .85rem; font: inherit; font-weight: 650;
    background: var(--tf-panel); color: var(--tf-text); border: 1px solid var(--tf-border); border-radius: .5rem;
  }
  .account-menu__toggle::after { content: ''; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .account-menu__toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
  .account-menu__toggle[aria-expanded="false"] ~ :is(.account-menu__nav,.account-menu__foot) { display: none; }
}
html[data-tf-theme="light"][data-tf-section] body:has(.account-layout) .account-hero {
  background: linear-gradient(90deg,#f4f8f7fc 7%,#f4f8f7eb 52%,#f4f8f7aa), var(--tf-scene) var(--tf-position) / cover;
  color: var(--tf-text);
}
html[data-tf-theme="light"][data-tf-section] .account-hero :is(h1,.lead,.eyebrow) { color: #13252a; }
