/* IrisPrompt — premium dark: near-black backdrop, frosted-glass cards,
   neon accents tinted by the chosen iris colour (--accent, set from app.js). */

:root {
  --bg: #050507;
  --bg-2: #0b0b12;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-strong: rgba(255, 255, 255, 0.06);
  --glass-line: rgba(255, 255, 255, 0.08);
  --glass-line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef0f6;
  --muted: #8b90a3;
  --accent: #4a86d8;
  --accent-text: #ffffff;
  --glow: color-mix(in srgb, var(--accent) 55%, transparent);
  --glow-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --radius-card: 16px;
  --radius-btn: 6px;
  --blur: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px 620px at 18% -8%, var(--glow-soft), transparent 70%),
    radial-gradient(900px 700px at 100% 110%, rgba(70, 40, 140, 0.16), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-color: var(--bg);
  background-attachment: fixed;
  transition: background .6s;
}

button, input, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

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

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

.top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .01em;
}
.brand img {
  align-self: center;
  border-radius: 50%;
  box-shadow: 0 0 18px var(--glow);
}
.brand b {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 18px var(--glow);
  transition: color .3s, text-shadow .3s;
}
.brand-block { display: flex; flex-direction: column; gap: 2px; }
.tagline { margin: 0; color: var(--muted); letter-spacing: .01em; font-size: 13px; }

/* Subscribe, Gallery, Sign in: one compact group. */
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  align-self: center;
}
.top-actions .signin-btn, .top-actions .account-btn { margin-left: 0; }
.gallery-btn {
  padding: 5px 11px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.gallery-btn:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.gallery-btn[aria-current="page"] { box-shadow: 0 0 0 1px var(--text), 0 0 14px -3px var(--glow); }

/* Creators: a bright call to AI content creators, distinct from Subscribe. */
.creators-btn {
  padding: 5px 11px;
  border: 0;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #ff5fa2, #a45bff 55%, #5b8cff);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 18px -4px rgba(200, 90, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.creators-btn:hover { filter: brightness(1.1); }
.creators-card .creators-actions { justify-content: flex-start; }
.creators-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.creators-email code {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  user-select: all;
  max-width: 100%;
  word-break: break-all;
}
@media (max-width: 420px) {
  .access-card { padding: 18px 16px 14px; }
  .access-card h2 { font-size: 17px; }
}
.access-card h2, .access-card p {
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Subscribe (Stripe Payment Link) */
.subscribe-btn {
  padding: 5px 11px;
  border-radius: var(--radius-btn);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 18px -4px var(--glow);
}
.subscribe-btn:hover { filter: brightness(1.08); }
.subscribe-btn + .lang { margin-left: 8px; }

.signin-btn {
  align-self: center;
  margin-left: 8px;
  padding: 5px 10px;
  border: 1px solid var(--glass-line-strong);
  border-radius: var(--radius-btn);
  background: var(--glass);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.signin-btn:hover { border-color: var(--glow); }
.account-btn { margin-left: auto; color: var(--accent); font-weight: 600; }
.signin-btn + .lang, .account-btn + .lang { margin-left: 8px; }

/* Language switcher (globe + code, dropdown of native names) */
.lang { position: relative; margin-left: auto; align-self: center; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .15s, border-color .15s;
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--text); border-color: var(--glass-line); }
.lang-btn svg { width: 18px; height: 18px; }
.lang-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
  margin-top: 6px;
  min-width: 150px;
  padding: 6px;
  background: rgba(14, 14, 20, 0.82);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.lang-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius-btn);
  background: none;
  text-align: left;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.lang-menu button:hover { color: var(--text); background: var(--glass-strong); }
.lang-menu button[aria-current="true"] { color: var(--text); }

/* Eye-type navigation: tabs under the brand; wraps on wide screens and
   scrolls sideways on phones. */
.species-nav {
  order: 4;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  scrollbar-width: none;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
}
.species-nav::-webkit-scrollbar { display: none; }
.species-nav a {
  flex: none;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s, box-shadow .2s;
}
.species-nav a:hover { color: var(--text); background: var(--glass-strong); }
.species-nav a[aria-current="page"] {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: var(--accent);
  box-shadow: 0 0 14px -3px var(--glow), inset 0 0 10px -4px var(--glow);
}

/* Gallery link: brighter than the eye-type tabs. */
.species-nav a.nav-gallery {
  color: var(--accent-text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 0 18px -4px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.species-nav a.nav-gallery:hover { filter: brightness(1.08); }
.species-nav a.nav-gallery[aria-current="page"] {
  color: var(--accent-text);
  box-shadow: 0 0 0 2px var(--text), 0 0 22px -2px var(--glow);
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "stage color" "stage other";
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  align-items: start;
}
.stage { grid-area: stage; min-width: 0; }
.controls-color { grid-area: color; }
.controls-other { grid-area: other; }
.stage {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 16px;
}

/* Glass needs something behind it to frost: soft colour orbs fixed behind the
   page (one follows the iris accent), blurred and tinted by every card. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 22%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
    radial-gradient(34vmax 34vmax at 88% 30%, rgba(124, 72, 230, 0.26), transparent 70%),
    radial-gradient(40vmax 30vmax at 62% 100%, rgba(30, 170, 190, 0.18), transparent 70%),
    radial-gradient(26vmax 26vmax at 40% 62%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  transition: background .6s;
}

/* Frosted glass cards: a dark smoked base keeps text contrast high, a light
   diagonal sheen and a brighter top/left edge read as a pane of glass. */
.preview-card, .output-card, .group, .legal, .step, .tutorial-foot {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025) 42%, rgba(255, 255, 255, 0.045)),
    rgba(12, 12, 22, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top-color: rgba(255, 255, 255, 0.22);
  border-left-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-card);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 24px 60px -14px rgba(0, 0, 0, 0.65),
    0 0 48px -24px var(--glow);
}

/* The preview itself stays neutral (white sclera, no glow) so colours read true. */
.preview-card { padding: 20px; }
#preview {
  display: block;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 16px 40px rgba(0, 0, 0, 0.5);
}


/* Both-eyes mode: two panes, the one being edited is outlined. */
.eyes-view {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  grid-template-areas: "ml lp rp mr" ". lt rt .";
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
  align-items: start;
}
.eye-minis-left { grid-area: ml; }
.eye-pane-left { grid-area: lp; }
.eye-pane-right { grid-area: rp; }
.eye-minis-right { grid-area: mr; }
.eye-type-left { grid-area: lt; }
.eye-type-right { grid-area: rt; }

/* Labelled thumbnails of each eye's active patterns. */
/* Thumbnails of the patterns on each eye, framed and labelled. */
.eye-minis {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--glass-line-strong);
  border-radius: 8px;
}
.eye-minis-title { font-size: 10px; line-height: 1.2; color: var(--muted); text-align: center; max-width: 64px; }
.preview-eyeonly-prompt { max-width: none; margin: 12px 0 0; }
.eye-mini { margin: 0; width: 64px; text-align: center; }
.eye-mini canvas {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.eye-mini figcaption { margin-top: 3px; font-size: 10.5px; line-height: 1.2; color: var(--muted); }
.eye-pane {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  transition: border-color .15s;
}
.eye-pane canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.eye-pane-label { font-size: 13px; color: var(--muted); }
.eye-type { display: grid; gap: 4px; padding: 0 6px; }
.eye-type-label { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.eye-type select {
  width: 100%;
  padding: 6px 8px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--glass-line-strong);
  border-radius: var(--radius-btn);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
/* ‹ select › stepper for the eye type */
.eye-step { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.eye-step select { flex: 1; min-width: 0; }
.step-btn {
  flex: none;
  min-width: 34px;
  padding: 0 8px;
  border: 1px solid var(--glass-line-strong);
  border-radius: var(--radius-btn);
  background: var(--glass);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.step-btn:hover { border-color: var(--accent); color: var(--accent); }
#preview, .eye-pane { touch-action: pan-y; }
.preview-frame { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.preview-frame[hidden] { display: none; }
.preview-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-btn);
  background: rgba(10, 10, 15, 0.6);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.preview-arrow:hover { border-color: var(--accent); color: var(--accent); }
.preview-prev { left: 6px; }
.preview-next { right: 6px; }
/* Single eye: the arrows sit on the preview itself. */
.eye-type-single .step-btn { display: none; }
.eye-type select:focus { outline: none; border-color: var(--accent); }
.eye-type option { background: #14141b; color: var(--text); }
.eye-pane:hover { border-color: var(--glass-line-strong); }
.eye-pane[aria-pressed="true"] { border-color: var(--accent); }
.eye-pane[aria-pressed="true"] .eye-pane-label { color: var(--text); font-weight: 600; }

/* Which eye the controls edit; stays in view while scrolling the controls. */
.eye-switch {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(14, 14, 20, 0.88);
}
.eye-switch .hint { margin: 0; }
.eye-switch .seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.both-title { color: var(--text) !important; }

.stage-notes { padding: 0 4px; }
.eye-type-single { max-width: 440px; margin: 14px auto 0; padding: 0; }

/* Always-visible reminder that prompts cover the eye only. */
.preview-eyeonly {
  margin: 14px auto 0;
  max-width: 440px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-btn);
}
.preview-eyeonly + .preview-combined { margin-top: 8px; max-width: none; text-align: left; }

.preview-combined {
  margin: 14px auto 0;
  max-width: 440px;
  padding: 6px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: var(--radius-btn);
}
.preview-combined + .preview-note { margin-top: 8px; }

.preview-note {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.preview-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.output-card { padding: 18px; }
.output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 18px; letter-spacing: .01em; }
h3 { font-size: 13px; color: var(--muted); margin-top: 16px; font-weight: 500; }

textarea {
  width: 100%;
  margin-top: 12px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #d9dcea;
}
textarea:focus { outline: none; border-color: var(--glow); }

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.copied { color: var(--accent); font-size: 13px; text-shadow: 0 0 10px var(--glow); }

/* ---------- Buttons (lightly rounded, not pills) ---------- */

.btn {
  border: 1px solid var(--glass-line-strong);
  background: var(--glass);
  border-radius: var(--radius-btn);
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .2s;
}
.btn:hover { border-color: var(--glow); box-shadow: 0 0 16px -6px var(--glow); }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  border-color: transparent;
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: 0 0 22px -4px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn.primary:hover { box-shadow: 0 0 30px -2px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.ghost { background: transparent; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-line);
  border-radius: 8px;
}
.seg button {
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  transition: color .15s, background .15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--glow-soft);
}

/* ---------- Controls ---------- */

.controls { display: grid; gap: 12px; }
.group {
  margin: 0;
  padding: 16px 18px 18px;
  min-width: 0;
}
legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}
/* Everything after the floated legend starts on its own line (also when a
   hidden element, like the phone-only Swipe hint, comes first). */
.group > :not(legend) { clear: both; }
legend output { color: var(--accent); font-weight: 500; margin-left: 6px; text-shadow: 0 0 10px var(--glow); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--glass-line-strong);
  background: var(--glass);
  border-radius: var(--radius-btn);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #cfd3e0;
  transition: border-color .15s, background .15s, box-shadow .2s, color .15s;
}
.chips button:hover { border-color: var(--glow); color: var(--text); }
.chips button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 14px -3px var(--glow), inset 0 0 10px -4px var(--glow);
}

.hint { color: var(--muted); font-size: 13px; margin: 14px 0 10px; }
.hint output { margin-left: 6px; color: var(--accent); font-weight: 500; }

input[type="range"] { width: 100%; accent-color: var(--accent); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.check-first { margin-top: 0; }

/* ---------- Colour picker ---------- */

.picker { display: grid; gap: 12px; }
.picker-sv {
  position: relative;
  height: 170px;
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsl(var(--hue, 0) 100% 50%));
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 0 30px -14px var(--picked, transparent);
}
.picker-sv:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.picker-sv-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .5);
  pointer-events: none;
}

.picker-hue {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  margin: 0;
  border-radius: 7px;
  background: linear-gradient(to right, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  cursor: pointer;
}
.picker-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: hsl(var(--hue, 0) 100% 50%);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .5);
}
.picker-hue::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
}
.picker-hue::-moz-range-track { background: transparent; }

.picker-sat-row {
  display: grid;
  grid-template-columns: auto 1fr 3.2em;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.picker-sat {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  margin: 0;
  border-radius: 6px;
  background: linear-gradient(to right, var(--sat-none, #808080), var(--sat-full, #ff0000));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  cursor: pointer;
}
.picker-sat::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--picked, #fff);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .5);
}
.picker-sat::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--picked, #fff); border: 2px solid #fff; }
.picker-sat-out { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

.picker-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.picker-swatch {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-btn);
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 0 18px -4px var(--picked, transparent);
}
.picker-hex {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
}
.picker-hex input {
  width: 108px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--glass-line-strong);
  border-radius: var(--radius-btn);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: lowercase;
}
.picker-hex input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 12px -4px var(--glow); }
.picker-hex input[aria-invalid="true"] { border-color: #e0605e; box-shadow: 0 0 12px -4px #e0605e; }
.picker-name { font-weight: 500; color: var(--text); }

.foot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px 36px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Gallery ---------- */

.gallery-page {
  max-width: 935px;
  margin: 0 auto;
  padding: 16px;
}
.gallery-head { margin: 8px 0 18px; text-align: center; }
.gallery-head h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.gallery-caption { margin: 0 auto; max-width: 560px; color: var(--muted); }
.gallery-empty { text-align: center; }

/* Instagram-style: three square tiles per row, hairline gaps. */
.ig-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.ig-grid { align-items: start; }

/* Examples: the same prompt in several models. Cards in two columns on
   desktop, one after another on phones. One bright frame runs around the
   whole card (images + captions); the images inside touch, no divider. */
.ex-grid {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.ig-pair {
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 75%, #fff);
  border-radius: 16px;
  background: rgba(12, 12, 22, 0.6);
  box-shadow: 0 0 22px -4px var(--glow), 0 22px 50px -18px rgba(0, 0, 0, 0.75);
}
.ig-pair-frame { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.ig-pair-frame .ig-open { background: #000; }
.ig-pair-caps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.ig-tile { position: relative; }
.ig-open {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #111;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.ig-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s, filter .3s;
  -webkit-user-drag: none;
  user-select: none;
}
.ig-open:hover img { filter: brightness(1.06); }
.ig-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ig-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-btn);
  background: rgba(10, 10, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  transition: background .15s, box-shadow .2s;
}
.ig-copy svg { width: 18px; height: 18px; }
.ig-copy:hover { background: rgba(10, 10, 14, 0.8); box-shadow: 0 0 14px -4px var(--glow); }

/* Model that made a real result, captioned under its image. */
.ig-model {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 7px 4px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
.ig-model::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
}
.lightbox-model { padding: 0 6px 0 0; }

/* Viewer: fits the screen, capped size, no zoom. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 3, 6, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: none;
}
.lightbox-inner { display: grid; gap: 12px; justify-items: center; }
.lightbox-inner img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 720px);
  max-height: min(78vh, 720px);
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lightbox-bar { display: flex; align-items: center; gap: 10px; }
.lightbox-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--glass-line-strong);
  border-radius: var(--radius-btn);
  background: var(--glass);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { border-color: var(--glow); }
body.no-scroll { overflow: hidden; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 1px solid var(--glass-line-strong);
  border-radius: 8px;
  background: rgba(14, 14, 20, 0.92);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 0 20px -6px var(--glow);
}

/* ---------- Access: locked prompt, free counter, dialogs ---------- */

/* The prompt as one short, non-selectable line (see index.html). */
.prompt-line {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: #d9dcea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
  /* Its long one-line text must not widen the column it sits in. */
  contain: inline-size;
  min-width: 0;
}
.prompt-line.locked { filter: blur(4px); }
.prompt-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.prompt-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-line-strong);
  border-radius: 10px;
}
.prompt-lock p { margin: 0; max-width: 420px; color: var(--text); }
.prompt-lock-title { font-size: 16px; font-weight: 700; }
.top-break { display: none; }
.swipe-hint { display: none; }
.free-left { margin-left: auto; font-size: 13px; color: var(--muted); }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.access-actions a.btn { text-decoration: none; }
button.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.access-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  /* The card never gets wider than the screen; when it is taller (large
     phone text, in-app browsers) the dialog scrolls instead of pushing the
     card's top and bottom off screen. */
  display: flex;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(3, 3, 6, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.access-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-width: 0;
  margin: auto;
  overflow-wrap: break-word;
  padding: 22px 22px 18px;
  background: #121219;
  border: 1px solid var(--glass-line-strong);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.access-card h2 { margin: 0 24px 8px 0; font-size: 18px; }
.access-card p { margin: 0 0 10px; color: #d4d7e2; line-height: 1.5; }
.access-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-btn);
  background: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
.access-close:hover { color: var(--text); }
.access-form { display: flex; gap: 8px; }
.access-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--glass-line-strong);
  border-radius: var(--radius-btn);
  color: var(--text);
  font: inherit;
}
.access-form input:focus { outline: none; border-color: var(--accent); }

/* ---------- Footer links, legal pages, consent banner ---------- */

.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); text-decoration: underline; }

.legal-page { max-width: 820px; margin: 0 auto; padding: 16px; }
.legal {
  padding: 24px 28px;
  line-height: 1.65;
}
.legal h1 { margin: 0 0 4px; font-size: 26px; }
.legal h2 { margin: 24px 0 8px; font-size: 17px; }
.legal p, .legal li { color: #d4d7e2; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent); }
.legal-date { color: var(--muted) !important; font-size: 13px; margin: 0 0 8px; }

.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px 18px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: rgba(14, 14, 20, 0.96);
  border: 1px solid var(--glass-line-strong);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  font-size: 14px;
}
.consent p { margin: 0; flex: 1 1 260px; }
.consent a { color: var(--accent); }
.consent-actions { display: flex; gap: 8px; }

@media (max-width: 860px) {
  /* One column; the stage's parts join the page flow so the prompt can sit
     at the very end, after all settings. */
  .layout { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .stage { display: contents; }
  .stage-top { order: 1; }
  .stage-notes { order: 2; }
  .controls-color { order: 3; }
  .controls-other { order: 4; }
  .output-card { order: 5; }

  /* Sticky, compact preview + eye type, pinned in place: it has no scroll of
     its own and its size does not change with the selected patterns. */
  .stage-top {
    position: sticky;
    top: 0;
    z-index: 20;
    overflow: hidden;
    /* Solid, edge-to-edge bar so settings clearly scroll underneath it. */
    margin: 0 -16px;
    border-radius: 0;
    border-width: 0 0 1px;
    box-shadow: 0 12px 18px -10px rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 0 0 14px 14px;
    background: #0a0a0f;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .stage-top #preview {
    flex: none;
    width: auto;
    height: min(26vh, 220px);
    max-width: none;
    margin: 0;
  }
  .stage-top .eye-pane { padding: 3px; }
  .stage-top .eye-pane canvas { margin: 0 auto; }
  .stage-top .eye-pane-label { font-size: 11px; }
  .stage-top .eye-type-single { flex: 1; min-width: 0; margin: 0; }
  .stage-top .eye-type { padding: 0; }
  /* Both eyes on a phone: two eyes side by side, a swipeable strip of each
     eye's pattern thumbnails under it, then its eye-type select. */
  .stage-top .eyes-view {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "lp rp" "ml mr" "lt rt";
    gap: 4px 10px;
  }
  .stage-top .eye-pane canvas { width: min(26vw, 12vh); }
  .stage-top .eye-minis {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    overflow-x: auto;
    padding: 3px 4px 4px;
    gap: 4px;
    scrollbar-width: none;
  }
  .stage-top .eye-minis::-webkit-scrollbar { display: none; }
  .stage-top .eye-mini { flex: none; width: 40px; }
  .stage-top .eye-mini canvas { width: 32px; height: 32px; margin: 0 auto; }
  .stage-top .eye-mini figcaption { font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stage-top .eye-minis-title { flex-basis: 100%; max-width: none; font-size: 9px; text-align: left; }
  .stage-top .eyes-view .eye-type-label { display: none; }
  .stage-top .eyes-view .eye-type select { padding: 4px 6px; font-size: 12px; }

  /* Iris patterns: one swipeable row with a hint above it. */
  .swipe-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: -4px 0 8px;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--muted);
  }
  .chips[data-multi="patterns"] {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    margin-right: -18px;
    padding-right: 18px;
    scrollbar-width: none;
  }
  .chips[data-multi="patterns"]::-webkit-scrollbar { display: none; }
  .chips[data-multi="patterns"] button { flex: none; scroll-snap-align: start; }

  /* The sticky preview already highlights the eye being edited. */
  .eye-switch { position: static; }

  .stage { position: static; }
  /* Phone header: logo + language on one row, Subscribe / Sign in on the next. */
  .top { gap: 10px; padding-top: 16px; }
  .brand-block { order: 1; }
  .lang { order: 2; margin-left: auto; align-self: center; }
  .top-break { display: block; order: 3; flex-basis: 100%; height: 0; }
  .top-actions { order: 4; margin-left: 0; flex-wrap: wrap; }
  .species-nav { order: 7; margin-top: 0; }
  .swipe-hint .step-btn { min-height: 30px; }
  /* Narrow sticky bar: select on its own row, ‹ › under it. */
  .stage-top .preview-frame { flex: none; margin: 0; }
  .stage-top .preview-arrow { width: 26px; height: 40px; font-size: 20px; }
  .stage-top .preview-prev { left: 3px; }
  .stage-top .preview-next { right: 3px; }
  .stage-top .step-btn { font-size: 18px; }
  .stage-top .eyes-view .step-btn { min-width: 28px; padding: 0 4px; }
  .species-nav { flex-wrap: nowrap; overflow-x: auto; }
  .legal { padding: 18px 16px; }
  .ig-grid { gap: 2px; }
  .ex-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0 12px; }
  .ig-copy { top: 5px; right: 5px; width: 30px; height: 30px; }
  .gallery-page { padding: 8px 0 16px; }
  .gallery-head { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Desktop: full-width, three columns (preview + prompt, colours, other
   settings), each with its own vertical scroll; the page itself stays put. */
@media (min-width: 1100px) {
  /* One page scroll; the preview column stays pinned while the settings
     columns scroll past it. */
  body[data-species] .top { max-width: none; width: 100%; padding: 16px 24px 6px; }
  body[data-species] .layout {
    width: 100%;
    max-width: none;
    padding: 12px 24px;
    grid-template-columns: minmax(380px, 1.15fr) minmax(320px, 1fr) minmax(320px, 1fr);
    grid-template-areas: "stage color other";
    align-items: start;
  }
  body[data-species] .controls { position: static; align-content: start; }
  body[data-species] .stage {
    position: sticky;
    top: 12px;
    gap: 12px;
    align-content: start;
  }
  /* Sized so the whole preview column (preview, notes, prompt) fits the
     screen; on very short screens app.js lifts the column so Copy stays visible. */
  body[data-species] .stage-top { padding: 12px; }
  body[data-species] #preview { width: clamp(200px, calc(100vh - 620px), 440px); }
  body[data-species] .eye-type-single { max-width: clamp(200px, calc(100vh - 620px), 440px); margin-top: 8px; }
  body[data-species] .eye-type-single .eye-type-label { display: none; }
  body[data-species] .stage-notes { gap: 4px; }
  body[data-species] .preview-combined { padding: 6px 10px; font-size: 12px; }
  body[data-species] .preview-actions { margin-top: 4px; }
  body[data-species] .output-card { padding-top: 14px; padding-bottom: 14px; }
  body[data-species] .preview-eyeonly-prompt { font-size: 12px; padding: 8px 10px; }
  body[data-species] #platform button { padding: 5px 7px; font-size: 12px; }
  body[data-species] .output-head h2 { margin-bottom: 0; }
  body[data-species] .prompt-hint { display: none; }
  body[data-species] .eye-switch { top: 0; }
  /* One-line footer, so the pinned preview column fits above it. */
  body[data-species] .foot { max-width: none; padding: 4px 24px 10px; display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: baseline; }
  body[data-species] .foot-links { margin-bottom: 0; }
  body[data-species] .foot p { margin: 0; }
}

/* /?debug=1 diagnostics */
.diag { position: relative; z-index: 100; margin: 12px; padding: 14px; background: #101018; border: 1px solid #f2c14e; border-radius: 10px; color: #eee; }
.diag h2 { margin: 0 0 8px; font-size: 16px; }
.diag-log { white-space: pre-wrap; word-break: break-word; font-size: 11px; line-height: 1.45; max-height: 40vh; overflow: auto; background: #000; padding: 8px; border-radius: 6px; }
.diag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.diag-grid figure { margin: 0; }
.diag-grid canvas { width: 100%; height: auto; display: block; border-radius: 6px; background: #222; }
.diag-grid figcaption { font-size: 10px; color: #bbb; margin-top: 3px; }

/* Note under the fantasy shape chips */
.shape-tip { margin: 8px 0 0; font-size: 12px; }
#zombie-wrap { margin-top: 10px; }

/* Copy buttons stay one line; on narrow screens the free-prompt count drops
   to its own line under them. */
.row-actions { flex-wrap: wrap; }
.row-actions .btn { white-space: nowrap; }
@media (max-width: 860px) {
  .row-actions .free-left { flex-basis: 100%; margin-left: 0; }
}

/* "GPT" badge: options that come out best in GPT Image / Flux (ChatGPT). */
.gpt-badge,
.chips button[data-gpt]::after {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: #10a37f;
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.5;
  vertical-align: 1px;
  box-shadow: 0 0 8px -2px rgba(16, 163, 127, 0.8);
}
.chips button[data-gpt]::after { content: "GPT"; margin-left: 6px; }
.shape-tip { display: flex; align-items: center; gap: 6px; }

/* Strong warning: Crown / Inkblot / Burst outside GPT Image / Flux. */
.shape-warn {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid #f2b705;
  border-left-width: 4px;
  border-radius: var(--radius-btn);
  background: rgba(242, 183, 5, 0.12);
  color: #ffe9a8;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
#limbal-more { margin-top: 10px; }

/* Reset all settings: next to the eye-type select (desktop), under it (phones). */
.eye-type-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  max-width: 440px;
  margin: 14px auto 0;
}
.eye-type-row .eye-type-single { flex: 1; min-width: 0; max-width: none; margin: 0; }
.reset-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--glass-line-strong);
  border-radius: var(--radius-btn);
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.reset-btn:hover { border-color: var(--accent); color: var(--accent); }
.reset-btn:hover svg { transform: rotate(-60deg); }
.reset-btn svg { transition: transform .3s; }
@media (min-width: 1100px) {
  body[data-species] .eye-type-row { max-width: none; margin-top: 8px; }
  body[data-species] .eye-type-row .eye-type-single { flex: 0 1 clamp(200px, calc(100vh - 620px), 440px); max-width: none; margin: 0; }
}
@media (max-width: 860px) {
  /* Sticky bar: preview | eye type with the reset button right under it; in
     Both-eyes mode the button gets its own line under the two eyes. */
  .stage-top { flex-wrap: wrap; }
  .stage-top .eye-type-row { flex: 1 1 140px; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; max-width: none; }
  .stage-top .eye-type-row .eye-type-single { flex: none; }
  .stage-top .reset-btn { justify-content: center; padding: 5px 8px; font-size: 12px; }
}

/* ---------- Tutorial ---------- */

/* Full-width page: step cards with a real screenshot on top, two columns
   on desktop, one on phones. */
.tutorial-page { max-width: 1200px; margin: 0 auto; padding: 16px; }
.tutorial-head { text-align: center; margin: 8px 0 22px; }
.tutorial-head h1 { margin: 0 0 6px; font-size: 28px; }
.tutorial-head p { margin: 0; color: var(--muted); }
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.step { counter-increment: step; padding: 16px 18px 18px; }
/* Step number next to the step title, so it never covers the screenshot. */
.step h2::before {
  content: counter(step);
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  box-shadow: 0 0 16px -3px var(--glow), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.step-shot {
  height: 320px;
  margin: 0 0 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.step-shot img {
  display: block;
  max-width: 100%;
  max-height: 292px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}
.step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 18px; }
.step p, .tutorial-foot p { margin: 0 0 8px; color: #d4d7e2; line-height: 1.6; }
.tutorial b { color: var(--text); font-weight: 600; }
.tutorial a { color: var(--accent); }
.tutorial .tip { font-size: 13px; color: var(--muted); }
.tutorial-foot { margin-top: 20px; padding: 22px 26px; }
.tutorial-foot h2 { margin: 0 0 8px; font-size: 18px; }
.tutorial a.btn { display: inline-block; margin-top: 6px; color: var(--accent-text); text-decoration: none; }
@media (max-width: 760px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .step-shot { height: auto; max-height: 380px; padding: 10px; }
  .step-shot img { max-height: 360px; }
  .tutorial-foot { padding: 18px 16px; }
}

/* Phones: Subscribe, Gallery, Tutorial and Sign in fit on one row. */
@media (max-width: 420px) {
  .top-actions { gap: 5px; }
  .top-actions .subscribe-btn, .top-actions .gallery-btn, .top-actions .signin-btn, .top-actions .creators-btn { padding: 5px 8px; font-size: 12px; }
}

/* ---------- Owner admin panel (admin.html) ---------- */

.admin-page { max-width: 1200px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.admin-page > * { min-width: 0; }
.admin-404 { text-align: center; padding: 80px 16px; color: var(--muted); }
.admin-404 h1 { margin: 0; font-size: 64px; color: var(--text); }
.admin-404 a { color: var(--accent); }
.admin-head h1 { margin: 8px 0 4px; font-size: 28px; }
.admin-head p { margin: 0; color: var(--muted); }
.admin-card { padding: 20px 22px; }
.admin-card h2 { margin: 0 0 12px; font-size: 20px; }
.admin-card h3 { margin: 20px 0 8px; font-size: 15px; }
.admin-muted { color: var(--muted); margin: 0 0 12px; }
.admin-warn { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: rgba(255, 170, 60, 0.12); border: 1px solid rgba(255, 170, 60, 0.4); color: #ffd9a8; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.admin-stats div { padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-line); display: grid; gap: 2px; }
.admin-stats b { font-size: 24px; color: var(--accent); text-shadow: 0 0 12px var(--glow); }
.admin-stats span { color: var(--muted); font-size: 13px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--glass-line); }
.admin-table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-actions .btn { padding: 6px 10px; font-size: 13px; }
.btn.danger { color: #ff9b9b; border-color: rgba(255, 120, 120, 0.4); }
.admin-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.admin-badge.on { background: rgba(60, 200, 120, 0.16); color: #8fe6b4; border: 1px solid rgba(60, 200, 120, 0.4); }
.admin-badge.off { background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--glass-line); }
.admin-row { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-page input[type=text], .admin-page textarea {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--glass-line-strong); background: rgba(0, 0, 0, 0.35); color: var(--text);
}
.admin-page textarea { width: 100%; resize: vertical; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.admin-link { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.admin-link p { margin: 0 0 6px; }
.admin-link code { display: block; margin-bottom: 8px; word-break: break-all; color: var(--text); }
.admin-gallery-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 18px; }
.admin-gallery-form label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 14px; }
.admin-gallery-form .btn { justify-self: start; }
.admin-gallery-form input[type=file] { max-width: 100%; }
.admin-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.admin-gallery li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--glass-line); }
.admin-gallery p { margin: 0; color: #d4d7e2; font-size: 13px; }
.admin-thumbs { display: flex; gap: 4px; }
.admin-thumbs figure { margin: 0; text-align: center; }
.admin-thumbs img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #111; }
.admin-thumbs figcaption { font-size: 10px; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) {
  .admin-gallery li { grid-template-columns: minmax(0, 1fr); }
  .admin-actions { justify-content: flex-start; }
  .admin-row { flex-direction: column; }
  .admin-card { padding: 16px 14px; }
  .admin-stats b { font-size: 20px; }
  /* Tables become one block per row. */
  .admin-table thead { display: none; }
  .admin-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
  .admin-table td { padding: 0; border: 0; overflow-wrap: anywhere; }
  .admin-table td.admin-actions { grid-column: 1 / -1; }
}

/* Payment methods under the subscribe text. */
.pay-methods { font-size: 13px; color: var(--muted) !important; letter-spacing: .02em; }

/* ---------- Support chat (support.js) ---------- */

.support-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
  color: var(--accent-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7), 0 0 20px -6px var(--glow);
}
.support-btn:hover { filter: brightness(1.08); }
.support-panel {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 85;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100dvh - 100px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-line-strong);
  border-radius: 16px;
  background: #111118;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
.support-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--glass-line); }
.support-x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.support-x:hover { color: var(--text); }
.support-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.support-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: break-word; }
.support-msg.bot { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-line); color: #e3e6ef; }
.support-msg.user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 30%, #15151d); color: #fff; }
.support-msg .support-mail { display: inline-block; margin-top: 8px; text-decoration: none; }
.support-link { display: inline-block; margin-left: 6px; color: var(--accent); font-weight: 600; }
.support-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.support-chips button {
  padding: 6px 10px;
  border: 1px solid var(--glass-line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}
.support-chips button:hover { border-color: var(--accent); }
.support-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--glass-line); }
.support-form input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--glass-line-strong); background: rgba(0, 0, 0, 0.35); color: var(--text); font: inherit; font-size: 14px; }
@media (max-width: 520px) {
  .support-btn { right: 12px; bottom: 12px; padding: 9px 13px 9px 11px; font-size: 13px; }
  .support-panel { right: 8px; left: 8px; width: auto; bottom: 64px; max-height: calc(100dvh - 80px); }
}
/* The cookie banner sits at the bottom: the Help button waits until it is gone. */
body:has(.consent) .support-btn { display: none; }

/* Instagram link in the footer: icon in the Instagram gradient. */
.foot-links a.foot-ig { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.foot-ig svg { flex: none; padding: 3px; width: 24px; height: 24px; border-radius: 7px; color: #fff;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.foot-links a.foot-ig:hover { text-decoration: none; filter: brightness(1.1); }

/* Instagram icon in the header, next to Creators. */
.top-ig {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-btn);
  color: #fff;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  box-shadow: 0 0 14px -4px rgba(214, 36, 159, 0.8);
}
.top-ig:hover { filter: brightness(1.1); }
@media (max-width: 420px) { .top-ig { width: 27px; height: 27px; } }

/* PayPal: a secondary option next to the main Subscribe button. */
.paypal-btn { border-color: rgba(255, 196, 57, 0.55) !important; color: #ffd36b !important; }
.paypal-box { min-height: 60px; margin-top: 6px; background: #fff; border-radius: 10px; padding: 12px 12px 4px; }
