/* ==========================================================================
   opencookie.no — design system (open-base)
   Ultra-minimal: light neutral background, white borderless surfaces, pills,
   near-monochrome. Geist for content, Geist Mono for numbers and micro labels.
   The accent color is reserved for alarm/critical states only.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-var-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1EFF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-var-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1EFF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --surface-3: #e9e9e6;
  --text: #171717;
  --text-2: #666666;
  --text-3: #6f6f6f;
  --border: rgba(0, 0, 0, 0.05);
  --border-strong: rgba(0, 0, 0, 0.1);

  --accent: #d92d20;
  --accent-soft: rgba(217, 45, 32, 0.08);

  --ok: #157f3d;

  --inverse-bg: #171717;
  --inverse-text: #fafafa;

  --ring: rgba(0, 0, 0, 0.1);
  --shadow-overlay: 0 4px 12px rgba(0, 0, 0, 0.04), 0 24px 60px rgba(0, 0, 0, 0.1);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6f6f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #191919;
  --surface-2: #0e0e0e;
  --surface-3: #262626;
  --text: #ededed;
  --text-2: #a3a3a3;
  --text-3: #9a9a9a;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  --accent: #f4645a;
  --accent-soft: rgba(244, 100, 90, 0.12);

  --ok: #6ccb8b;

  --inverse-bg: #fafafa;
  --inverse-text: #171717;

  --ring: rgba(255, 255, 255, 0.16);
  --shadow-overlay: 0 4px 12px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);

  --chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* System dark mode applies unless the user explicitly chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e;
    --surface: #191919;
    --surface-2: #0e0e0e;
    --surface-3: #262626;
    --text: #ededed;
    --text-2: #a3a3a3;
    --text-3: #9a9a9a;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);

    --accent: #f4645a;
    --accent-soft: rgba(244, 100, 90, 0.12);

    --ok: #6ccb8b;

    --inverse-bg: #fafafa;
    --inverse-text: #171717;

    --ring: rgba(255, 255, 255, 0.16);
    --shadow-overlay: 0 4px 12px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);

    --chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Numbers and data: mono with tabular digits so nothing jumps */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

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

::selection { background: var(--surface-3); }

/* UI chrome must not be text-selectable (iOS long-press etc.).
   Real content/data the user may want to copy stays selectable. */
button, .site-header, .site-footer, .menu, .toast {
  -webkit-user-select: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header { background: transparent; }

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-tld { color: var(--text-3); font-weight: 500; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) { .icon-btn:hover { background: var(--surface-3); } }
.icon-btn:active { transform: scale(0.94); }

.icon-btn.open { background: var(--inverse-bg); color: var(--inverse-text); }

/* Toggle buttons (on/off states) invert when active */
.toggle-btn.on { background: var(--inverse-bg); color: var(--inverse-text); }
@media (hover: hover) { .toggle-btn.on:hover { opacity: 0.85; background: var(--inverse-bg); } }

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease,
              transform 0.15s ease, opacity 0.15s ease;
}

.pill-btn:active { transform: scale(0.97); }

.pill-btn.primary { background: var(--inverse-bg); color: var(--inverse-text); }
@media (hover: hover) { .pill-btn.primary:hover { opacity: 0.85; } }

.pill-btn.ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
}

@media (hover: hover) { .pill-btn.ghost:hover { background: var(--surface-2); } }
.pill-btn[disabled] { opacity: 0.4; pointer-events: none; }

/* --------------------------------------------------------------------------
   Settings menu
   -------------------------------------------------------------------------- */

.settings-wrap { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 296px;
  max-height: min(560px, calc(100dvh - 90px));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-overlay);
  padding: 20px;
  z-index: 60;
  transform-origin: top right;
  animation: menu-in 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes menu-in {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.menu-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* Options share the row evenly when they fit; locales with long words
   («Pantalla completa», «Бегущая строка») wrap to their own row rather
   than wrapping inside the button. gap applies both ways, so the spacing
   between wrapped rows equals the spacing within a row */
.menu-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-grid .opt-btn { flex: 1 1 auto; white-space: nowrap; }

.menu-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background-color: var(--surface-2);
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 15px;
  border: none;
  border-radius: 12px;
  padding: 11px 44px 11px 14px;
  cursor: pointer;
}

.opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border: none;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  color: var(--text-2);
  transition: background-color 0.13s ease, color 0.13s ease, transform 0.13s ease;
}

.opt-btn .icon { width: 14px; height: 14px; }

@media (hover: hover) { .opt-btn:hover { background: var(--surface-3); color: var(--text); } }
.opt-btn:active { transform: scale(0.97); }

.opt-btn.active {
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-weight: 600;
}

.opt-btn.wide { width: 100%; }
.opt-btn.copied { background: var(--ok); color: #fff; }

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 18px -20px;
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  cursor: pointer;
  transition: background-color 0.18s ease;
  margin: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s ease;
}

.switch:checked { background: var(--inverse-bg); }
.switch:checked::after { transform: translateX(17px); background: var(--inverse-text); }

.menu-info {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--text-3);
}

.menu-info a { color: var(--text-2); text-decoration: none; }
@media (hover: hover) { .menu-info a:hover { text-decoration: underline; } }

.menu-year { margin-top: 6px; }

/* --------------------------------------------------------------------------
   THE TOOL — the configurator: editor on the left, the live banner on a
   neutral mock site on the right (sticky), one linear flow 1 → 5.
   -------------------------------------------------------------------------- */

/* Wider than the family's 900–980px: the preview needs room to look like
   a real page next to the editor */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
}

.intro {
  max-width: 720px;
  margin: clamp(4px, 2vh, 20px) 0 28px;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 600px;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 32px;
}

.editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.side {
  position: sticky;
  top: 16px;
  min-width: 0;
}

.card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  transition: background-color 0.25s ease;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.editor .card:nth-child(2) { animation-delay: 0.04s; }
.editor .card:nth-child(3) { animation-delay: 0.08s; }
.side .card { animation-delay: 0.06s; }

/* starts at 0.01, never 0 (LCP), opacity only (no stacking contexts) */
@keyframes rise {
  from { opacity: 0.01; }
  to { opacity: 1; }
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.step {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- fields */

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field.wide { grid-column: 1 / -1; }

.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.text-input {
  width: 100%;
  height: 44px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border: none;
  border-radius: 12px;
  padding: 0 14px;
  transition: background-color 0.25s ease, box-shadow 0.13s ease;
}

.text-input.mono { font-family: var(--font-mono); font-size: 13.5px; }
.text-input.area { height: auto; min-height: 88px; padding: 11px 14px; line-height: 1.5; resize: vertical; }
.text-input::placeholder, .code-input::placeholder { color: var(--text-3); opacity: 0.8; }
.text-input:focus, .code-input:focus { outline: none; box-shadow: 0 0 0 2px var(--ring); }

.text-input:-webkit-autofill,
.text-input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

.text-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 2px var(--ring), 0 0 0 1000px var(--surface-2) inset;
}

.text-input:autofill { background: var(--surface-2); }
.text-input:-moz-ui-invalid { box-shadow: none; }
.text-input:user-invalid { box-shadow: none; }
.text-input.bad { box-shadow: 0 0 0 2px var(--accent-soft), inset 0 0 0 1px var(--accent); }

.code-input {
  display: block;
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  transition: border-color 0.15s ease, box-shadow 0.13s ease;
}

.code-input:focus { border-style: solid; border-color: transparent; }

.hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--text-3);
}

.hint.block { display: block; margin-top: 3px; }
.self-start { align-self: flex-start; }

.pill-btn.small { height: 36px; padding: 0 14px; font-size: 13px; }
.pill-btn .icon { width: 16px; height: 16px; }
.pill-btn.danger, .pill-btn.primary.danger { background: var(--accent); color: #fff; }

.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small .icon { width: 16px; height: 16px; }

.icon-btn.square {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  flex-shrink: 0;
}

@media (hover: hover) { .icon-btn.square:hover { background: var(--surface-3); color: var(--text); } }
.icon-btn.square .icon { width: 16px; height: 16px; }

.link-btn {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
  transition: color 0.13s ease;
}

@media (hover: hover) { .link-btn:hover { color: var(--text); } }
.link-btn.danger { color: var(--accent); }

.style-card { display: flex; flex-direction: column; gap: 18px; }
.style-card .card-title { margin-bottom: 0; }
.style-row { display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg .opt-btn { flex: 1 1 auto; white-space: nowrap; }
.opt-btn[aria-pressed="true"] { background: var(--inverse-bg); color: var(--inverse-text); font-weight: 600; }

.card .menu-toggle { gap: 18px; }
.card .menu-toggle + .menu-toggle, .adv .menu-toggle { padding-top: 2px; }

/* Colour swatches; the last one opens the native picker */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }

.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}

@media (hover: hover) { .swatch:hover { transform: scale(1.1); } }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

.swatch.custom {
  background: conic-gradient(from 90deg, #ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}

.swatch.custom[aria-pressed="true"] { background: var(--sw); }

.swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.more-btn .icon { width: 16px; height: 16px; transition: transform 0.18s ease; }
.more-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }

.adv { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }

/* ------------------------------------------------------------- services */

.scan-box { display: flex; flex-direction: column; gap: 8px; }

.notes { display: flex; flex-direction: column; gap: 8px; }
.notes:not(:empty) { margin-top: 14px; }

.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.note .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--text-3); }
.note.ok .icon { color: var(--ok); }
.note.warn .icon { color: var(--accent); }
.note b { font-weight: 600; }
.note .note-body { flex: 1; min-width: 0; }
.note .link-btn { margin-top: 4px; display: inline-block; }

.svc-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.svc-list:empty { display: none; }

.svc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  min-height: 48px;
  border-radius: 14px;
  background: var(--surface-2);
  animation: rise 0.3s ease backwards;
}

.svc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.svc-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.svc-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-select {
  flex: none;
  width: auto;
  max-width: 46%;
  font-size: 12.5px;
  padding: 7px 30px 7px 12px;
  border-radius: 999px;
  background-color: var(--surface);
  background-position: right 10px center;
  background-size: 12px;
}

.add-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.combo { position: relative; flex: 1; min-width: 0; }
.combo .text-input { padding-left: 38px; }
.combo-icon { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

.combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-overlay);
}

.combo-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.combo-opt[aria-selected="true"] { background: var(--surface-2); }
.combo-opt .svc-meta { flex: none; }
.combo-empty { padding: 10px 12px; font-size: 13.5px; color: var(--text-3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:not(:empty) { margin-top: 12px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.13s ease, color 0.13s ease, transform 0.13s ease;
}

.chip .icon { width: 12px; height: 12px; }
@media (hover: hover) { .chip:hover { background: var(--surface-3); color: var(--text); } }
.chip:active { transform: scale(0.97); }

.custom-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
}

.form-actions { display: flex; gap: 8px; }

.empty-state {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.5;
}

.empty-state strong { display: block; margin-bottom: 4px; font-weight: 600; }

/* ---------------------------------------------------------- checklist */

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  line-height: 1.45;
}

.check .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--ok); stroke-width: 2.2; }
.check.warn .icon { color: var(--accent); stroke-width: 1.8; }
.check.info .icon { color: var(--text-3); }
.check small { display: block; color: var(--text-3); font-size: 12.5px; }

/* -------------------------------------------------------------- install */

.install-card .code {
  margin: 0;
  padding: 14px 16px;
  max-height: 300px;
  overflow: auto;
  background: var(--surface-2);
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
  -webkit-user-select: all;
  user-select: all;
}

.install-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.install-card .actions .pill-btn { flex: 1 1 auto; }
.install-lead { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.card-subtitle { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.install-lead strong { color: var(--text); font-weight: 600; }

.steps {
  margin: 18px 0 0;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li { padding-left: 4px; }
.steps li::marker { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.steps code, .inline-code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  word-break: break-all;
}

.divider { height: 1px; background: var(--border); margin: 20px -24px; border: 0; }

.account-pitch {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-2);
}

.account-pitch ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.account-pitch .pill-btn { align-self: flex-start; }

.publish-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.status-dot.pending::before { background: #d97706; }

.self-host { margin-top: 12px; }
.self-host .link-btn { font-family: var(--font-sans); }

.fix-changes { margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text-2); }

/* ------------------------------------------------------------ consent log */

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.stat {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
}

.stat .num { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; }
.stat .field-label { font-size: 9.5px; }

.spark { display: block; width: 100%; height: 56px; margin-top: 14px; }
.spark rect { fill: var(--text); opacity: 0.85; }
.spark rect.none { fill: var(--text-3); opacity: 0.6; }

.log-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12.5px; }
.log-table th { text-align: left; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 6px 8px 6px 0; }
.log-table td { padding: 7px 8px 7px 0; border-top: 1px solid var(--border); vertical-align: top; }
.log-table td.mono { font-family: var(--font-mono); font-size: 11.5px; }
.log-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.log-tools .text-input { flex: 1 1 180px; height: 36px; font-size: 13px; }
.log-tools .menu-select { flex: 0 1 auto; width: auto; padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
.lookup-result { margin-top: 10px; }

/* --------------------------------------------------------------- preview */

.preview-card { padding: 18px; }

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.preview-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.seg.mini {
  flex-wrap: nowrap;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 999px;
}

.seg.mini .opt-btn { flex: 0 0 auto; padding: 5px 10px; background: transparent; }
.seg.mini .opt-btn .icon { width: 14px; height: 14px; }
.seg.mini .opt-btn.active, .seg.mini .opt-btn[aria-pressed="true"] { background: var(--inverse-bg); color: var(--inverse-text); }

.mini-select {
  width: auto;
  max-width: 150px;
  padding: 6px 28px 6px 12px;
  font-size: 12.5px;
  border-radius: 999px;
  background-position: right 10px center;
  background-size: 12px;
}

.stage {
  display: flex;
  justify-content: center;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-2);
}

/* The mock site is deliberately NOT themed with this page: it shows what a
   visitor with a light or a dark system sees (the scheme toggle). */
.mock {
  --m-bg: #ffffff;
  --m-bar: #f1f1ef;
  --m-line: #ebebe8;
  --m-strong: #dcdcd8;
  --m-text: #1f1f1f;
  --m-url: #8a8a86;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--m-bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: width 0.3s ease, border-radius 0.3s ease, background-color 0.25s ease;
}

.mock.dark {
  --m-bg: #141414;
  --m-bar: #1f1f1f;
  --m-line: #272727;
  --m-strong: #333333;
  --m-text: #ededed;
  --m-url: #8e8e8e;
  border-color: rgba(255, 255, 255, 0.12);
}

.mock.mobile { width: 340px; max-width: 100%; border-radius: 30px; border-width: 6px; border-color: #1c1c1c; }
.mock.mobile .mock-bar { justify-content: center; }
.mock.mobile .dots { display: none; }

.mock-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 12px;
  background: var(--m-bar);
  border-bottom: 1px solid var(--m-line);
}

.dots { display: flex; gap: 5px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--m-strong); }

.mock-url {
  flex: 0 1 auto;
  margin: 0 auto;
  max-width: 70%;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--m-bg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--m-url);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-viewport {
  position: relative;
  height: 500px;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--m-text);
}

.mock.mobile .mock-viewport { height: 600px; }

.mock-page { padding: 18px 22px; }
.mock.mobile .mock-page { padding: 16px; }
.mock-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.mock-logo { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-links { display: flex; gap: 10px; }
.mock-links i { display: block; width: 34px; height: 7px; border-radius: 4px; background: var(--m-line); }
.mock.mobile .mock-links i:nth-child(n+2) { display: none; }
.mock-hero i { display: block; height: 16px; border-radius: 6px; background: var(--m-strong); margin-bottom: 10px; }
.mock-hero i:nth-child(1) { width: 72%; }
.mock-hero i:nth-child(2) { width: 46%; margin-bottom: 22px; }
.mock-lines i { display: block; height: 8px; border-radius: 4px; background: var(--m-line); margin: 10px 0; }
.mock-lines i:nth-child(2) { width: 94%; }
.mock-lines i:nth-child(3) { width: 88%; }
.mock-lines i:nth-child(4) { width: 60%; }
.mock-embed { margin: 20px 0; max-width: 380px; }
.mock-embed:empty { display: none; }

.preview-note { margin: 12px 4px 0; min-height: 18px; }

.preview-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 4px 0;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-2);
}

.preview-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.preview-status.warn::before { background: var(--accent); }
.preview-status:empty { display: none; }
@media (hover: hover) { .preview-status:hover { color: var(--text); } }

/* Mobile: one tap to the banner */
.jump-btn {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  white-space: nowrap;
  box-shadow: var(--shadow-overlay);
}

@media (min-width: 961px) { .jump-btn { display: none !important; } }

/* ---------------------------------------------------------- header bits */

.site-btn { max-width: 240px; gap: 6px; }
.site-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-btn .chev { width: 13px; height: 13px; color: var(--text-3); }
.site-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.site-menu { width: 300px; }
.site-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.site-list:empty { display: none; }

.site-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.site-item small { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); font-weight: 400; }
@media (hover: hover) { .site-item:hover { background: var(--surface-2); } }
.site-item[aria-current="true"] { background: var(--surface-2); }

.menu-account { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.passkey-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }

.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px 6px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 13.5px;
}

.passkey-row small { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.menu-actions { display: flex; flex-direction: column; gap: 8px; }
.menu-actions .link-btn { align-self: flex-start; margin-top: 4px; font-size: 12.5px; }

/* ---------------------------------------------------------------- sheets */

.sheet {
  border: 0;
  border-radius: 24px;
  padding: 24px;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-overlay);
}

.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
.sheet[open] { animation: menu-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sheet-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.sheet-text { margin: 0 0 16px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.sheet .field { margin-bottom: 16px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sheet-actions .pill-btn { flex: 1 1 auto; }
.sheet .hint { margin-top: 14px; }

.perks { margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; }
.perks li { display: flex; gap: 10px; align-items: flex-start; }
.perks .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--ok); stroke-width: 2.2; }

.recovery-code {
  margin: 4px 0 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  -webkit-user-select: all;
  user-select: all;
}

.error-text { margin: 12px 0 0; font-size: 13.5px; color: var(--accent); }
.error-text:empty { display: none; }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: -1; }
  .mock-viewport { height: 460px; }
}

@media (max-width: 600px) {
  .fields, .custom-form { grid-template-columns: 1fr; }
  .card { padding: 20px; border-radius: 22px; }
  .divider { margin: 18px -20px; }
  .preview-card { padding: 14px; }
  .stage { padding: 10px; border-radius: 16px; }
  .mock-viewport { height: 440px; }
  .mock.mobile { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-row { flex-wrap: wrap; }
  .add-row .combo { flex-basis: 100%; }
  .cat-select { max-width: 52%; }
  .preview-toggles { gap: 6px; }
  .mini-select { max-width: 104px; }
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  inset: auto; /* resets popover UA styling (inset: 0) */
  margin: 0;
  border: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 100;
  max-width: calc(100vw - 40px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--text-2); text-decoration: none; }
@media (hover: hover) { .site-footer a:hover { text-decoration: underline; } }

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .menu { width: min(296px, calc(100vw - 32px)); }
}
