/* ==========================================================================
   bloxig.css — the ONE stylesheet for the whole site (marketing, app, admin).
   Theme: clean light — white / black / blue. Status colours are for pills and
   alerts only. Keep this file the single source of tokens; views must not
   introduce new colours or fonts.
   Sections: 1 tokens · 2 base · 3 components · 4 marketing layout ·
             5 app shell · 6 support · 7 admin · 8 legacy aliases · 9 motion
   ========================================================================== */

/* ── 1. Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:            #FFFFFF;
  --bg-subtle:     #F7F8FA;
  --bg-hover:      #F1F3F6;
  --border:        #E5E7EB;
  --border-strong: #D1D5DB;
  --text:          #0A0A0A;
  --text-muted:    #6B7280;
  --primary:       #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft:  #EFF4FF;
  --primary-border:#BFD3FB;
  --dark:          #0A0A0A;

  /* Status colours: pills + alerts ONLY */
  --success:       #16A34A;
  --success-soft:  #ECFDF3;
  --warning:       #D97706;
  --warning-soft:  #FFF7E8;
  --danger:        #DC2626;
  --danger-soft:   #FEF0F0;

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  --shadow-1: 0 1px 2px rgba(10,10,10,.04), 0 2px 8px rgba(10,10,10,.04);
  --shadow-2: 0 8px 28px rgba(10,10,10,.10), 0 2px 6px rgba(10,10,10,.05);

  --ease: cubic-bezier(.2,.7,.2,1);
  --dur: 160ms;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --text-3xl: 32px;
  --text-4xl: 44px;
  --text-5xl: 60px;

  --sidebar-w: 248px;
  --nav-h: 64px;
}

/* ── 2. Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.035em; line-height: 1.12; color: var(--text); }
h1, h2 { letter-spacing: -0.045em; }
h3, h4 { font-weight: 600; letter-spacing: -0.03em; }
a { color: inherit; text-decoration: none; }
p a, .link { color: var(--primary); }
p a:hover, .link:hover { color: var(--primary-hover); text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
code, kbd, pre { font-family: var(--font-mono); }
code {
  font-size: .86em; background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 1px 6px; color: var(--text);
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.mut   { color: var(--text-muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ── 3. Components ───────────────────────────────────────────────────────── */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font-size: var(--text-sm); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--r-md);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 24px; font-size: var(--text-base); border-radius: var(--r-lg); }
.btn--full { width: 100%; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); color: #fff; }
.btn--secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--bg-subtle); border-color: var(--text-muted); }
.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #B91C1C; color: #fff; }
.btn--danger-outline { background: var(--bg); color: var(--danger); border-color: #F5C2C2; }
.btn--danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--on-dark { background: #fff; color: var(--text); }
.btn--on-dark:hover { background: #E5E7EB; color: var(--text); }
.btn--outline-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn--outline-dark:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }
.btn.is-copied { color: var(--success); border-color: var(--success); }

/* Cards */
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card--flat { box-shadow: none; }
.card--subtle { background: var(--bg-subtle); box-shadow: none; }
.card--hover:hover, .card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.card--info { background: var(--primary-soft); border-color: var(--primary-border); box-shadow: none; }

/* Badges + pills */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  font-size: 12px; font-weight: 600; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text-muted); white-space: nowrap;
}
.badge--blue,  .badge--accent  { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }
.badge--gray   { background: var(--bg-subtle); color: var(--text-muted); }
.badge--green, .badge--success { background: var(--success-soft); border-color: #BDE9CC; color: var(--success); }
.badge--amber, .badge--gold    { background: var(--warning-soft); border-color: #F6D9A8; color: var(--warning); }
.badge--red,   .badge--danger  { background: var(--danger-soft); border-color: #F5C2C2; color: var(--danger); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  font-size: 12px; font-weight: 600; border-radius: var(--r-full); border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--open        { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.pill--in_progress { background: var(--bg); color: var(--primary); border-color: var(--primary); }
.pill--waiting     { background: var(--warning-soft); color: var(--warning); border-color: #F6D9A8; }
.pill--resolved    { background: var(--success-soft); color: var(--success); border-color: #BDE9CC; }
.pill--high        { background: var(--danger-soft); color: var(--danger); border-color: #F5C2C2; }
.pill--normal      { background: var(--bg-subtle); color: var(--text-muted); border-color: var(--border); }

/* Forms */
.field, .form-field { display: flex; flex-direction: column; gap: 6px; }
.label, .form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.hint, .form-hint { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: var(--danger); }
.input, .select, .textarea, .form-input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); font-size: var(--text-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.select, select.form-input {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input::placeholder, .textarea::placeholder, .form-input::placeholder { color: #9CA3AF; }
.input:hover, .select:hover, .textarea:hover, .form-input:hover { border-color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus, .form-input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.input:disabled, .form-input:disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
.input--sm { height: 34px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }


/* Tables */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--shadow-1); }
.table-wrap--scroll { overflow: auto; }   /* wide admin tables; do not use with ⋮ menus (they would clip) */
.table thead th:first-child { border-top-left-radius: calc(var(--r-lg) - 1px); }
.table thead th:last-child  { border-top-right-radius: calc(var(--r-lg) - 1px); }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: calc(var(--r-lg) - 1px); }
.table tbody tr:last-child td:last-child  { border-bottom-right-radius: calc(var(--r-lg) - 1px); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th {
  position: sticky; top: 0; z-index: 1; background: var(--bg-subtle); text-align: left; white-space: nowrap;
  padding: 11px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--bg-subtle); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; }
.table .actions { width: 1%; text-align: right; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a, .tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px;
  font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a::after, .tabs button::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--primary); transform: scaleX(0); transition: transform var(--dur) var(--ease);
}
.tabs a.is-active, .tabs button.is-active { color: var(--text); font-weight: 600; }
.tabs a.is-active::after, .tabs button.is-active::after { transform: scaleX(1); }
.tabs .count { font-size: 11px; font-weight: 600; background: var(--bg-hover); color: var(--text-muted); border-radius: var(--r-full); padding: 1px 7px; }
.tabs .is-active .count { background: var(--primary-soft); color: var(--primary); }

/* Menu (⋮ dropdown) */
.menu { position: relative; display: inline-block; }
.menu__trigger {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); color: var(--text-muted); transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.menu__trigger:hover, .menu.is-open .menu__trigger { background: var(--bg-hover); color: var(--text); }
.menu__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.menu--up .menu__list { top: auto; bottom: calc(100% + 6px); transform: translateY(4px); }
.menu.is-open .menu__list { opacity: 1; visibility: visible; transform: none; }
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left;
  font-size: var(--text-sm); color: var(--text); border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease);
}
.menu__item:hover, .menu__item:focus-visible { background: var(--bg-subtle); outline: none; }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover, .menu__item--danger:focus-visible { background: var(--danger-soft); }
.menu__sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

/* Modal (replaces window.confirm everywhere) */
.modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(10,10,10,.45);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__card {
  width: 100%; max-width: 420px; background: var(--bg); border-radius: var(--r-xl); box-shadow: var(--shadow-2);
  padding: 24px; transform: translateY(8px) scale(.98); transition: transform 200ms var(--ease);
}
.modal.is-open .modal__card { transform: none; }
.modal__title { font-size: var(--text-lg); margin-bottom: 8px; }
.modal__body { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.6; margin-bottom: 22px; }
.modal__body strong { color: var(--text); }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Toasts + flash */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 240px; max-width: 380px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: var(--text-sm); pointer-events: auto;
  animation: toast-in 200ms var(--ease);
}
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger); }
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }
.toast__close { margin-left: auto; color: var(--text-muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.toast__close:hover { color: var(--text); }
@keyframes toast-in  { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateX(12px); } }

/* Alerts (inline) */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-size: var(--text-sm); border: 1px solid var(--primary-border); background: var(--primary-soft); color: var(--text); }
.alert--error   { background: var(--danger-soft);  border-color: #F5C2C2; color: var(--danger); }
.alert--success { background: var(--success-soft); border-color: #BDE9CC; color: var(--success); }
.alert--warning { background: var(--warning-soft); border-color: #F6D9A8; color: var(--warning); }

/* Empty state */
.empty-state, .empty {
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--bg-subtle);
  padding: 44px 20px; text-align: center; color: var(--text-muted); font-size: var(--text-sm);
}
.empty-state h3 { font-size: var(--text-base); color: var(--text); margin-bottom: 6px; }
.empty-state p, .empty p { margin: 0 auto 16px; max-width: 380px; }

/* Misc */
.eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 14px; }
.divider { border: none; height: 1px; background: var(--border); }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field code { flex: 1; word-break: break-all; padding: 10px 12px; font-size: 12px; }

/* ── 4. Marketing layout ─────────────────────────────────────────────────── */
.container     { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container--sm { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 24px; }
.section       { padding: 96px 0; }
.section--sm   { padding: 64px 0; }
.section--lg   { padding: 128px 0; }
.section--subtle { background: var(--bg-subtle); }
.section-head  { max-width: 600px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 12px; }
.section-head p { color: var(--text-muted); font-size: var(--text-base); }

/* Logo — markup/colour must not change (see layout/header.ejs). */
.navbar__logo { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-base); font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.navbar__logo-mark { width: 22px; height: 22px; border-radius: 6px; background: #4f7bf7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform var(--dur) var(--ease); }
.navbar__logo:hover .navbar__logo-mark { transform: rotate(8deg); }
.navbar__logo-mark svg { width: 12px; height: 12px; fill: #fff; }

.navbar {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur) var(--ease);
}
.navbar.is-scrolled { border-bottom-color: var(--border); }
.navbar__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.navbar__nav { display: flex; align-items: center; gap: 28px; }
.navbar__link { position: relative; font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); padding: 4px 0; transition: color var(--dur) var(--ease); }
.navbar__link::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.navbar__link:hover, .navbar__link.is-active { color: var(--text); }
.navbar__link:hover::after, .navbar__link.is-active::after { transform: scaleX(1); }
.navbar__actions { display: flex; align-items: center; gap: 8px; }
.navbar__toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--r-md); }
.navbar__toggle:hover { background: var(--bg-hover); }
.navbar__drawer { display: none; }

.footer { background: var(--dark); color: #D1D5DB; padding: 64px 0 40px; }
.footer a:hover { color: #fff; }
.footer__top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer__brand { max-width: 320px; }
.footer__logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px; }
.footer__tagline { font-size: var(--text-sm); color: #9CA3AF; }
.footer__cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer__col h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #9CA3AF; margin-bottom: 14px; }
.footer__col a { display: block; font-size: var(--text-sm); color: #D1D5DB; padding: 4px 0; transition: color var(--dur) var(--ease); }
.footer__bottom { padding-top: 24px; font-size: 13px; color: #9CA3AF; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Hero */
.hero { padding: 88px 0 72px; position: relative; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.6vw, 62px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.04; margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero__sub { font-size: clamp(16px, 2vw, 19px); color: var(--text-muted); max-width: 520px; margin-bottom: 32px; line-height: 1.6; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__note { margin-top: 18px; font-size: 13px; color: var(--text-muted); }

/* Figma-frame → Studio-Explorer illustration (pure HTML/CSS) */
.illo { display: grid; grid-template-columns: 1fr 36px 1.2fr; align-items: center; gap: 4px; }
.illo__panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.illo__bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--text-muted); }
.illo__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.illo__frame { position: relative; margin: 16px; height: 190px; border: 1px dashed var(--primary); background: var(--primary-soft); border-radius: 4px; }
.illo__frame i { position: absolute; width: 8px; height: 8px; background: #fff; border: 1.5px solid var(--primary); }
.illo__frame i:nth-child(1) { left: -5px; top: -5px; } .illo__frame i:nth-child(2) { right: -5px; top: -5px; }
.illo__frame i:nth-child(3) { left: -5px; bottom: -5px; } .illo__frame i:nth-child(4) { right: -5px; bottom: -5px; }
.illo__title { position: absolute; left: 14px; top: 14px; right: 14px; height: 18px; border-radius: 4px; background: var(--text); width: 55%; }
.illo__line { position: absolute; left: 14px; height: 8px; border-radius: 4px; background: var(--primary-border); }
.illo__btn { position: absolute; left: 14px; bottom: 16px; height: 30px; width: 96px; border-radius: 8px; background: var(--primary); }
.illo__btn2 { position: absolute; left: 120px; bottom: 16px; height: 30px; width: 60px; border-radius: 8px; background: var(--bg); border: 1px solid var(--primary-border); }
.illo__arrow { color: var(--primary); display: flex; justify-content: center; }
.illo__tree { padding: 10px 8px 14px; font-family: var(--font-mono); font-size: 12px; }
.illo__row { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--text); white-space: nowrap; }
.illo__row.l1 { padding-left: 24px; } .illo__row.l2 { padding-left: 40px; }
.illo__row small { margin-left: auto; padding-left: 7px; font-family: var(--font-sans); font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-full); padding: 0 7px; }
.illo__ico { width: 12px; height: 12px; border-radius: 3px; background: var(--primary); flex-shrink: 0; }
.illo__ico.o { background: var(--bg); border: 1.5px solid var(--primary); }
.illo__chip { display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 0 24px; padding: 4px 10px; font-family: var(--font-sans); font-size: 11px; font-weight: 600; color: var(--success); background: var(--success-soft); border: 1px solid #BDE9CC; border-radius: var(--r-full); }

.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step3 { position: relative; padding: 28px; }
.step3__n { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.step3 h3 { font-size: var(--text-lg); margin-bottom: 8px; }
.step3 p { font-size: var(--text-sm); color: var(--text-muted); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { padding: 24px; }
.feature__icon { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature h3 { font-size: var(--text-base); margin-bottom: 6px; }
.feature p { font-size: var(--text-sm); color: var(--text-muted); }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.pricing-card, .plan { display: flex; flex-direction: column; gap: 20px; padding: 32px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-1); transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease; }
/* Every pricing card lifts 4px and picks up a soft blue glow on hover. */
.pricing-card:hover, .plan:hover { transform: translateY(-4px); border-color: var(--primary-border); box-shadow: 0 0 0 1px rgba(37,99,235,.28), 0 14px 36px rgba(37,99,235,.18); }
/* Featured card: blue border at rest only (no permanent glow). */
.plan--featured, .pricing-card--accent { border-color: var(--primary); }
.plan--featured:hover, .pricing-card--accent:hover { border-color: var(--primary); }
.plan--compact { padding: 22px; gap: 12px; }
.plan--compact .plan__price { font-size: 30px; }
.plan--compact .plan__desc { min-height: 0; }
.pricing--compact { gap: 16px; }
.plan__name { font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan__price { font-size: 44px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.plan__price small { font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.plan__desc { font-size: var(--text-sm); color: var(--text-muted); min-height: 42px; }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; font-size: var(--text-sm); }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { color: var(--primary); flex-shrink: 0; margin-top: 3px; }

.cta-band { background: var(--dark); color: #fff; border-radius: var(--r-xl); padding: 72px 32px; text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-bottom: 14px; }
.cta-band p { color: #9CA3AF; max-width: 480px; margin: 0 auto 28px; }
.cta-band .btn--primary:hover { background: #3B82F6; }

/* Auth / narrow content pages keep working with legacy classes (see §8) */

/* ── 5. App shell ────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px 14px; background: var(--bg-subtle); border-right: 1px solid var(--border);
}
.sidebar__logo { padding: 4px 10px 18px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 500; color: var(--text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.side-link svg { flex-shrink: 0; }
.side-link:hover { background: var(--bg-hover); color: var(--text); }
.side-link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar__foot { margin-top: auto; }
.user-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; text-align: left;
  border-radius: var(--r-md); transition: background var(--dur) var(--ease);
}
.user-btn:hover, .menu.is-open .user-btn { background: var(--bg-hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-btn__text { min-width: 0; flex: 1; }
.user-btn__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn__plan { margin-top: 2px; }
.sidebar .menu { display: block; }
.sidebar .menu__list { left: 0; right: 0; min-width: 0; }

.topbar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(10,10,10,.4); opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur); }

.main { min-width: 0; padding: 36px 40px 80px; }
.main__inner { max-width: 1040px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 4px; }
.page-head p { font-size: var(--text-sm); color: var(--text-muted); max-width: 560px; }
.back-link { display: inline-block; font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 14px; }
.back-link:hover { color: var(--text); }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack--sm { gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.section-title { font-size: var(--text-lg); font-weight: 700; margin-bottom: 4px; }
.section-sub { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 16px; max-width: 560px; }
.sub-nav { margin-bottom: 28px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.setup-bar { height: 4px; background: var(--bg-hover); border-radius: 2px; overflow: hidden; margin: 16px 0 6px; }
.setup-bar span { display: block; height: 100%; background: var(--primary); transition: width 300ms var(--ease); }
.checklist { list-style: none; }
.check { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.check:first-child { border-top: none; }
.check__mark { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); border: 1px solid var(--border-strong); }
.check--done .check__mark { background: var(--primary); border-color: var(--primary); color: #fff; }
.check__text { flex: 1; min-width: 0; }
.check__title { font-size: var(--text-sm); font-weight: 600; }
.check--done .check__title { color: var(--text-muted); text-decoration: line-through; }
.check__body { font-size: 13px; color: var(--text-muted); }
.check--done .check__body { display: none; }

.project { display: flex; flex-direction: column; gap: 14px; }
.project__top { display: flex; align-items: center; gap: 12px; }
.project__icon { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--primary-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.project__name { min-width: 0; flex: 1; }
.project__name h3 { font-size: var(--text-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project__name p { font-size: 12px; color: var(--text-muted); }
.idbox { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; }
.idbox > p { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.idbox > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.idbox code { background: none; border: none; padding: 0; font-size: 12px; word-break: break-all; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: var(--text-sm); }
.kv dt { color: var(--text-muted); }
.kv dd { color: var(--text); }
.avatar-grid { display: none; grid-template-columns: repeat(6, 48px); gap: 10px; margin-top: 14px; }
.avatar-grid.is-open { display: grid; }
.avatar-opt { width: 48px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 50%; overflow: hidden; line-height: 0; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.avatar-opt:hover { transform: scale(1.06); }
.avatar-opt.is-selected { border-color: var(--primary); }
.pw-bars { display: flex; gap: 3px; margin-top: 8px; }
.pw-bars span { height: 3px; flex: 1; border-radius: 2px; background: var(--border); transition: background var(--dur) var(--ease); }

/* ── 6. Support ──────────────────────────────────────────────────────────── */
.support-wrap { max-width: 760px; margin: 0 auto; padding: 56px 24px 88px; }
.support-wrap--wide { max-width: 1040px; }
.faq { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); }
.faq details { border-top: 1px solid var(--border); }
.faq details:first-child { border-top: none; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 20px; font-size: var(--text-sm); font-weight: 600; display: flex; justify-content: space-between; gap: 12px; transition: background var(--dur) var(--ease); }
.faq summary:hover { background: var(--bg-subtle); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--text-muted); font-family: var(--font-mono); }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 20px 18px; font-size: var(--text-sm); line-height: 1.7; color: var(--text-muted); }
.help-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.ticket-list { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); box-shadow: var(--shadow-1); }
.ticket-row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) auto auto; align-items: center; gap: 16px;
  padding: 14px 18px; border-top: 1px solid var(--border); font-size: var(--text-sm);
  transition: background var(--dur) var(--ease);
}
.ticket-row:first-child { border-top: none; }
.ticket-row:hover { background: var(--bg-subtle); }
.ticket-row__id { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.ticket-row__topic { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-row__preview { display: block; font-weight: 400; font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ticket-row__time { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.timeline { list-style: none; position: relative; display: flex; flex-direction: column; gap: 18px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-left: 36px; }
.tl-item::before { content: ''; position: absolute; left: 6px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border-strong); }
.tl-item--status::before { border-color: var(--primary); }
.tl-item--message::before { background: var(--primary); border-color: var(--primary); }
.tl-item__meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.bubble { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; font-size: var(--text-sm); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* ── 7. Admin ────────────────────────────────────────────────────────────── */
.admin { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.admin__side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; background: var(--bg-subtle); border-right: 1px solid var(--border); }
.admin__main { padding: 28px 32px 64px; min-width: 0; }
.admin__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 12px; }
.admin__top h1 { font-size: var(--text-2xl); font-weight: 800; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav .side-link { justify-content: space-between; }
.nav-count { font-size: 11px; font-weight: 700; color: #fff; background: var(--primary); border-radius: var(--r-full); min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { width: auto; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--text-sm); color: var(--text-muted); transition: all var(--dur) var(--ease); }
.pager a:hover { border-color: var(--border-strong); color: var(--text); }
.pager a.on { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat .n { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.03em; }
.stat .l { font-size: var(--text-sm); color: var(--text-muted); }
.row-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }

.inbox { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); min-height: 520px; box-shadow: var(--shadow-1); }
.inbox__list { border-right: 1px solid var(--border); max-height: calc(100vh - 230px); overflow-y: auto; }
.inbox__item { display: block; padding: 11px 14px; border-bottom: 1px solid var(--border); transition: background var(--dur) var(--ease); }
.inbox__item:hover { background: var(--bg-subtle); }
.inbox__item.is-active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.inbox__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.inbox__from { font-weight: 600; font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__topic { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__pills { display: flex; gap: 6px; flex-wrap: wrap; }
.inbox__detail { padding: 24px; min-width: 0; }
.inbox__cols { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 24px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; background: var(--border-strong); }
.sdot--open { background: var(--primary); }
.sdot--in_progress { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.sdot--waiting { background: var(--warning); }
.sdot--resolved { background: var(--success); }
.tk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.tk-head__title { font-size: var(--text-lg); margin-bottom: 4px; }
.tk-head__id { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.tk-head__ctl { display: flex; gap: 10px; flex-shrink: 0; }
.tk-head__ctl .field { gap: 4px; min-width: 150px; }
.note-box > summary { list-style: none; cursor: pointer; width: fit-content; }
.note-box > summary::-webkit-details-marker { display: none; }
.mini-tl { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mini-tl li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.side-panel { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; font-size: var(--text-sm); display: flex; flex-direction: column; gap: 12px; align-self: start; }
.side-panel .k { font-size: 12px; color: var(--text-muted); }

/* ── 8. Legacy aliases ───────────────────────────────────────────────────────
   Older views (auth, legal, docs, marketplace, admin) still use the previous
   variable and class names. They map onto the new tokens so every page gets the
   new look without a rewrite. Prefer the new names in new code. */
:root {
  --bg-base: var(--bg);
  --bg-muted: var(--bg-subtle);
  --bg-elevated: var(--bg-subtle);
  --bg-overlay: var(--bg-hover);
  --border-faint: var(--border);
  --border-subtle: var(--border);
  --border-base: var(--border);
  --text-primary: var(--text);
  --text-secondary: #4B5563;
  --text-tertiary: var(--text-muted);
  --text-disabled: #9CA3AF;
  --accent: var(--primary);
  --accent-hover: var(--primary-hover);
  --accent-dim: var(--primary-soft);
  --accent-border: var(--primary-border);
  --gold: var(--warning);
}
.pricing-card--gold { border-color: var(--warning); }
.btn--gold { background: var(--primary); color: #fff; }
.btn--xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--xl { height: 52px; padding: 0 28px; font-size: var(--text-base); border-radius: var(--r-lg); }
.card--interactive { cursor: default; }
/* Plan badge text colours used by older markup */
.dropdown-plan.free { color: var(--text-muted); }
.dropdown-plan.pro  { color: var(--primary); }

/* ── 9. Motion ───────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .steps3, .help-cards { grid-template-columns: 1fr; }
  .detail-grid, .inbox__cols { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .inbox__list { border-right: none; border-bottom: 1px solid var(--border); max-height: 320px; }
}
@media (max-width: 860px) {
  .navbar__nav, .navbar__actions .btn--ghost { display: none; }
  .navbar__toggle { display: inline-flex; }
  .navbar__drawer { display: none; position: absolute; left: 0; right: 0; top: var(--nav-h); background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 24px 20px; box-shadow: var(--shadow-2); }
  .navbar__drawer.is-open { display: flex; flex-direction: column; gap: 4px; }
  .navbar__drawer a { padding: 12px 0; font-weight: 500; border-bottom: 1px solid var(--border); }
  .navbar__drawer a:last-child { border-bottom: none; }

  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 80; height: 56px; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .topbar__btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); }
  .topbar__btn:hover { background: var(--bg-hover); }
  .sidebar { position: fixed; z-index: 100; left: 0; top: 0; bottom: 0; width: min(280px, 84vw); transform: translateX(-102%); transition: transform 220ms var(--ease); box-shadow: var(--shadow-2); }
  .shell.is-drawer-open .sidebar { transform: none; }
  .shell.is-drawer-open .scrim { opacity: 1; visibility: visible; }
  .main { padding: 24px 16px 64px; }

  .admin { grid-template-columns: 1fr; }
  .admin__side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin__main { padding: 20px 16px 48px; }
}
@media (max-width: 700px) { .hide-sm { display: none; } }
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .field-row { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .illo { grid-template-columns: 1fr; }
  .illo__arrow { transform: rotate(90deg); padding: 6px 0; }
  .ticket-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ticket-row__id, .ticket-row__time { display: none; }
  .footer__cols { gap: 36px; }
  .avatar-grid { grid-template-columns: repeat(4, 48px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .btn:active, .card--hover:hover, .card--interactive:hover, .pricing-card:hover, .plan:hover { transform: none; }
}

/* Footer logo reuses the header markup on the dark band */
.footer .navbar__logo { color: #fff; }
.footer__logo { margin-bottom: 12px; }

/* ── Hero media slot + before/after comparison ───────────────────────────── */
.media-card { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-xl); overflow: hidden; background: var(--bg-subtle); border: 1px solid var(--border); box-shadow: var(--shadow-2); }
.media-card__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 300ms ease; }
.media-card__fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg-subtle); }
.media-card.is-poster .media-card__poster { opacity: 1; }
.media-card__play { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; color: #fff; }
.media-card__play svg { box-sizing: content-box; padding: 20px 18px 20px 22px; border-radius: 50%; background: var(--primary); box-shadow: var(--shadow-2); transition: transform 150ms ease; }
.media-card__play:hover svg, .media-card__play:focus-visible svg { transform: scale(1.08); }
.media-card__iframe { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; border: 0; }
.media-card__video { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 300ms ease; }
.media-card.is-video .media-card__video { opacity: 1; }
.media-card.is-video .media-card__fallback { display: none; }
.media-card__play--pill { inset: auto; left: 14px; bottom: 14px; width: auto; height: auto; gap: 8px; padding: 8px 14px 8px 10px; border-radius: var(--r-full); background: rgba(10,10,10,.72); font-size: 13px; font-weight: 600; }
.media-card__play--pill svg { padding: 6px 5px 6px 7px; }
.media-card.is-poster .media-card__fallback { display: none; }

.compare-wrap { max-width: 960px; margin: 0 auto; }
.compare__stage { display: none; position: relative; aspect-ratio: 16 / 9; --pos: 50%; overflow: hidden; user-select: none; border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--bg-subtle); box-shadow: var(--shadow-2); }
.compare-wrap.is-ready .compare__stage { display: block; }
.compare-wrap.is-ready .compare__fallback { display: none; }
.compare__fallback { display: flex; justify-content: center; padding: 28px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-xl); }
.compare__fallback .illo { width: 100%; max-width: 680px; }
.compare__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(10,10,10,.12); pointer-events: none; }
.compare__handle svg { max-width: none; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; padding: 10px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; color: var(--primary); box-shadow: var(--shadow-2); }
.compare__stage:focus-within .compare__handle svg { outline: 2px solid var(--primary); outline-offset: 2px; }
.compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare__tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; background: rgba(255,255,255,.92); color: var(--text); box-shadow: var(--shadow-1); pointer-events: none; }
.compare__tag--l { left: 12px; }
.compare__tag--r { right: 12px; }
@media (max-width: 640px) {
  .media-card:not(.is-poster):not(.is-video) { aspect-ratio: auto; }
  .media-card:not(.is-poster):not(.is-video) .media-card__fallback { position: static; }
}

/* Hover colour for muted links/icon buttons (was an inline onmouseover handler; the CSP now forbids those). */
.hover-secondary:hover { color: var(--text-secondary) !important; }

/* Ticket screenshot thumbnails (user ticket page + admin inbox) */
/* ── Ticket screenshots: thumbnails (partials/shots.ejs) + viewer (js/lightbox.js) ── */
.shots-block { margin-top: 12px; }
.shots-block__title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-width: 560px; }
.shot { position: relative; display: block; aspect-ratio: 16 / 10; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg-subtle); box-shadow: var(--shadow-1); transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--ease); }
.shot:hover, .shot:focus-visible { border-color: var(--primary); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.shot:hover img { transform: scale(1.04); }
.shot__label { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot__size { font-weight: 400; opacity: .85; }

.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; grid-template-rows: 52px minmax(0, 1fr); align-items: center; background: rgba(8,10,14,.88); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity 180ms var(--ease), visibility 180ms; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 12px; color: #fff; }
.lightbox__count { margin-right: auto; padding-left: 8px; font-size: 13px; opacity: .85; }
.lightbox__stage { grid-row: 2; grid-column: 2; height: 100%; display: flex; align-items: center; justify-content: center; padding: 8px 0 24px; min-height: 0; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-md); box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #111; }
.lightbox__btn, .lightbox__nav { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-full); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; transition: background var(--dur) var(--ease); }
.lightbox__btn:hover, .lightbox__nav:hover, .lightbox__btn:focus-visible, .lightbox__nav:focus-visible { background: rgba(255,255,255,.22); }
.lightbox__nav { grid-row: 2; justify-self: center; }
.lightbox__nav--prev { grid-column: 1; } .lightbox__nav--next { grid-column: 3; }
.lightbox__nav[hidden] { display: none; }

/* ── Screenshot picker (partials/screenshots-field.ejs + js/support-form.js) ── */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 22px 16px; text-align: center; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--bg-subtle); cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.dropzone:hover, .dropzone:focus-within, .dropzone.is-drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.is-drag { border-style: solid; }
.dropzone.is-full { opacity: .6; }
.dropzone__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: var(--r-full); background: var(--bg); color: var(--primary); box-shadow: var(--shadow-1); }
.dropzone__title { font-size: var(--text-sm); font-weight: 600; }
.dropzone__link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.dropzone__hint { font-size: 12px; color: var(--text-muted); }
.shot-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.shot-previews:empty { display: none; }
.shot-preview { position: relative; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg); box-shadow: var(--shadow-1); }
.shot-preview img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-subtle); }
.shot-preview__meta { display: block; padding: 6px 8px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-preview__remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: var(--r-full); background: rgba(10,10,10,.65); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.shot-preview__remove:hover, .shot-preview__remove:focus-visible { background: var(--danger); }
.hint--error { color: var(--danger); }

/* ── Admin support inbox: Gmail-style list + ticket popup (views/admin/support.ejs) ── */
.mail { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); box-shadow: var(--shadow-1); }
.mail__row { display: grid; grid-template-columns: 10px minmax(120px, 200px) minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: var(--text-sm); transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.mail__row:last-child { border-bottom: none; }
.mail__row:hover { background: var(--bg-subtle); box-shadow: inset 0 -1px 0 var(--border), 0 1px 4px rgba(10,10,10,.06); position: relative; z-index: 1; }
.mail__row.is-active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.mail__from, .mail__subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail__snippet { color: var(--text-muted); }
.mail__row.is-unread .mail__from, .mail__row.is-unread .mail__topic { font-weight: 700; }
.mail__row:not(.is-unread) { background: var(--bg-subtle); }
.mail__row:not(.is-unread):hover { background: var(--bg-hover); }
.mail__meta { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.mail__row.is-unread .mail__time { color: var(--text); font-weight: 600; }
.mail__clip { display: inline-flex; align-items: center; gap: 3px; }
.mail__badge { height: 20px; font-size: 11px; }

.tk-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; overflow-y: auto; animation: tk-fade 160ms var(--ease); }
.tk-modal__backdrop { position: fixed; inset: 0; background: rgba(10,12,16,.45); backdrop-filter: blur(2px); }
.tk-modal__card { position: relative; width: min(1020px, 100%); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: 0 24px 80px rgba(10,10,10,.28); animation: tk-pop 200ms var(--ease); outline: none; }
.tk-modal__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0; z-index: 1; }
.tk-modal__nav { display: flex; align-items: center; gap: 4px; }
.tk-modal__body { padding: 24px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--r-full); color: var(--text-muted); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.icon-btn:hover, .icon-btn:focus-visible { background: var(--bg-hover); color: var(--text); }
.icon-btn.is-disabled { opacity: .35; pointer-events: none; }
html.has-modal { overflow: hidden; }
@keyframes tk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tk-pop { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .mail__row { grid-template-columns: 10px minmax(0, 1fr) auto; row-gap: 2px; }
  .mail__subject { grid-column: 2 / -1; grid-row: 2; }
  .mail__meta { grid-column: 3; grid-row: 1; }
  .tk-modal { padding: 0; }
  .tk-modal__card { border-radius: 0; min-height: 100%; }
  .tk-modal__body { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tk-modal, .tk-modal__card, .lightbox, .shot, .shot img { animation: none; transition: none; }
}
