/* BloxMaps website: bright cartoon style, light + dark, mobile first. */

:root {
  --font-display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --wrap: 1180px;
  --gutter: 16px;
  --header-h: 64px;

  --bg: #eaf2ff;
  --bg-dots: rgba(47, 107, 255, 0.09);
  --surface: #ffffff;
  --surface-2: #f3f7ff;
  --surface-3: #e6eefc;
  --ink: #16203b;
  --ink-2: #4a5577;
  --ink-3: #7a85a6;
  --line: #d6e0f3;
  --line-2: #c2cee8;
  --drop: #cad6ef;
  --overlay: rgba(14, 20, 44, 0.55);

  --blue: #2f6bff;
  --blue-d: #1a4bd6;
  --blue-soft: #dbe7ff;
  --yellow: #ffc933;
  --yellow-d: #e0a200;
  --yellow-soft: #fff2c7;
  --green: #22c55e;
  --green-d: #15933f;
  --green-soft: #d5f7e1;
  --pink: #ff4f7b;
  --pink-d: #d6305c;
  --pink-soft: #ffe0e8;
  --purple: #7c5cff;
  --purple-d: #5638e0;
  --purple-soft: #e8e1ff;
  --orange: #ff8a2b;
  --focus: #ffb000;
  --ink-on-yellow: #3a2a00;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c1126;
  --bg-dots: rgba(120, 150, 255, 0.07);
  --surface: #161d3b;
  --surface-2: #1c254b;
  --surface-3: #25305e;
  --ink: #eef2ff;
  --ink-2: #b3bcdf;
  --ink-3: #7f8ab6;
  --line: #29346a;
  --line-2: #36437f;
  --drop: #070a18;
  --overlay: rgba(3, 5, 14, 0.7);
  --blue: #4c80ff;
  --blue-d: #2952cc;
  --blue-soft: #1f2e66;
  --yellow-soft: #3b3113;
  --green-soft: #133825;
  --pink-soft: #43182a;
  --purple-soft: #2b2360;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1126;
    --bg-dots: rgba(120, 150, 255, 0.07);
    --surface: #161d3b;
    --surface-2: #1c254b;
    --surface-3: #25305e;
    --ink: #eef2ff;
    --ink-2: #b3bcdf;
    --ink-3: #7f8ab6;
    --line: #29346a;
    --line-2: #36437f;
    --drop: #070a18;
    --overlay: rgba(3, 5, 14, 0.7);
    --blue: #4c80ff;
    --blue-d: #2952cc;
    --blue-soft: #1f2e66;
    --yellow-soft: #3b3113;
    --green-soft: #133825;
    --pink-soft: #43182a;
    --purple-soft: #2b2360;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 2px 2px, var(--bg-dots) 2px, transparent 0);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--blue-d); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--yellow); color: #1b1300; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; font-weight: 800; }
.skip-link:focus { top: 8px; }

@media (min-width: 720px) { :root { --gutter: 24px; } }

/* ---------- icons ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i-fill { fill: currentColor; stroke: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 2px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; flex: none; }
.logo:hover { color: var(--ink); }
.logo svg { width: 36px; height: 36px; filter: drop-shadow(0 3px 0 var(--drop)); transition: transform 0.2s; }
.logo:hover svg { transform: rotate(-8deg) scale(1.06); }
.logo b { color: var(--blue); font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--ink-2); text-decoration: none; padding: 8px 14px; border-radius: 12px; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
.header-right { position: relative; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; box-shadow: 0 3px 0 var(--drop); font: inherit; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop); }
.icon-btn .i { width: 20px; height: 20px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}
.account-slot { display: flex; align-items: center; min-width: 42px; min-height: 42px; }
.account-skel { width: 104px; height: 42px; border-radius: 14px; }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 0.95rem; cursor: pointer; box-shadow: 0 3px 0 var(--drop); max-width: 210px; font-family: inherit; }
.avatar-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex: none; }
.avatar-letter { display: inline-grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; line-height: 1; }
.avatar-lg.avatar-letter { font-size: 2rem; }
.map-card .meta .avatar-letter { font-size: 0.7rem; }
.avatar-lg { width: 72px; height: 72px; border-radius: 22px; border: 3px solid var(--surface); box-shadow: 0 4px 0 var(--drop); }
.menu { position: absolute; right: 0; top: calc(100% + 10px); background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 0 var(--drop), 0 18px 40px rgba(10, 20, 60, 0.18); padding: 8px; min-width: 220px; z-index: 50; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; background: none; border: 0; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-3); }
.menu .menu-head { padding: 8px 12px 10px; border-bottom: 2px solid var(--line); margin-bottom: 6px; }
.menu-toggle { display: none; }
.nav-theme { display: none; }

@media (max-width: 760px) {
  .nav { display: none; position: absolute; left: 0; right: 0; top: var(--header-h); background: var(--surface); border-bottom: 2px solid var(--line); flex-direction: column; padding: 8px var(--gutter) 14px; margin: 0; box-shadow: 0 12px 24px rgba(10, 20, 60, 0.12); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1.1rem; }
  .menu-toggle { display: inline-grid; }
  .nav .nav-theme { display: block; text-align: left; font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink-2); background: none; border: 0; border-top: 2px dashed var(--line); margin-top: 6px; padding: 14px 14px 6px; cursor: pointer; }
  .avatar-btn .name { display: none; }
  .avatar-btn { padding: 3px; }
  .logo { font-size: 1.3rem; }
  .logo svg { width: 32px; height: 32px; }
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--blue); --bd: var(--blue-d); --bt: #fff;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; line-height: 1.1; letter-spacing: 0.01em;
  color: var(--bt); background: var(--b);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%);
  border: 0; border-radius: 16px;
  box-shadow: 0 5px 0 var(--bd), 0 9px 18px rgba(10, 20, 60, 0.16);
  text-decoration: none; text-align: center; cursor: pointer; user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--bt); filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); box-shadow: 0 6px 0 var(--bd), 0 12px 22px rgba(10, 20, 60, 0.18); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd), 0 3px 8px rgba(10, 20, 60, 0.14); }
.btn .i { width: 1.2em; height: 1.2em; }
.btn-go { --b: var(--green); --bd: var(--green-d); }
.btn-yellow { --b: var(--yellow); --bd: var(--yellow-d); --bt: var(--ink-on-yellow); }
.btn-pink { --b: var(--pink); --bd: var(--pink-d); }
.btn-purple { --b: var(--purple); --bd: var(--purple-d); }
.btn-dark { --b: #1b1f2e; --bd: #000; }
:root[data-theme="dark"] .btn-dark { --b: #f3f5ff; --bd: #a9b2d6; --bt: #10152b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-dark { --b: #f3f5ff; --bd: #a9b2d6; --bt: #10152b; } }
.btn-ghost { --b: var(--surface); --bd: var(--drop); --bt: var(--ink); background-image: none; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--drop); }
.btn-ghost:hover { border-color: var(--line-2); box-shadow: 0 5px 0 var(--drop); }
.btn-ghost:active { box-shadow: 0 1px 0 var(--drop); }
.btn-lg { min-height: 58px; padding: 14px 28px; font-size: 1.25rem; border-radius: 20px; }
.btn-xl { min-height: 66px; padding: 16px 32px; font-size: 1.4rem; border-radius: 22px; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.95rem; border-radius: 12px; box-shadow: 0 3px 0 var(--bd); }
.btn-sm:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--bd); }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { --b: var(--surface-3); --bd: var(--line-2); --bt: var(--ink-3); cursor: not-allowed; filter: none; transform: none; background-image: none; }
.btn.is-locked { --b: var(--surface-3); --bd: var(--line-2); --bt: var(--ink-2); background-image: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
.btn-link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- badges, chips, pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.6; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge .i { width: 0.95em; height: 0.95em; stroke-width: 3; }
.badge-lock { background: var(--purple); color: #fff; box-shadow: 0 2px 0 var(--purple-d); }
.badge-lock.lk-login { background: var(--ink); color: var(--surface); box-shadow: none; }
.badge-yellow { background: var(--yellow); color: var(--ink-on-yellow); box-shadow: 0 2px 0 var(--yellow-d); }
.badge-green { background: var(--green); color: #fff; box-shadow: 0 2px 0 var(--green-d); }
.badge-blue { background: var(--blue); color: #fff; box-shadow: 0 2px 0 var(--blue-d); }
.badge-pink { background: var(--pink); color: #fff; box-shadow: 0 2px 0 var(--pink-d); }
.tier-free { background: var(--surface-3); color: var(--ink-2); }
.tier-pro { background: var(--purple); color: #fff; box-shadow: 0 2px 0 var(--purple-d); }
.tier-studio { background: var(--yellow); color: var(--ink-on-yellow); box-shadow: 0 2px 0 var(--yellow-d); }
.tier-anonymous { background: var(--surface-3); color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); color: var(--ink-2); font-weight: 700; font-size: 0.92rem; cursor: pointer; box-shadow: 0 3px 0 var(--drop); font-family: inherit; line-height: 1.25; text-align: left; }
.chip:hover { color: var(--ink); border-color: var(--blue); }
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop); }
.chips-scroll { padding: 2px 0 4px; }
.chips-scroll .chip { padding: 5px 12px; font-size: 0.86rem; }
.chips-scroll .chip { flex: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-weight: 800; font-size: 0.8rem; }
.tag .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 6px 0 var(--drop); padding: 22px; }
.card-tight { padding: 16px; }
.card h2, .card h3 { margin-top: 0; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.section-head p { color: var(--ink-2); font-size: 1.1rem; }
.eyebrow { display: inline-block; font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.82rem; color: var(--blue); margin-bottom: 8px; }
.skel { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- forms ---------- */
label { font-weight: 800; }
.field-label { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; margin-bottom: 8px; color: var(--ink); }
.input, .textarea, select.input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.45; }
.counter { font-size: 0.8rem; color: var(--ink-3); font-weight: 700; }
.counter.warn { color: var(--pink); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 16px; }
.seg-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 42px; padding: 6px 4px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-2); font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; cursor: pointer; line-height: 1.1; }
.seg-btn:hover { background: var(--surface-3); color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
.seg-btn.locked { color: var(--ink-3); }
.seg-btn .badge { position: absolute; top: -9px; right: -4px; font-size: 0.62rem; padding: 0 6px; line-height: 1.5; }

.picker-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 12px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; text-align: left; }
.picker-btn:hover { border-color: var(--blue); }
.picker-btn .sw { width: 30px; height: 30px; border-radius: 9px; flex: none; border: 2px solid rgba(0, 0, 0, 0.08); }
.picker-btn .pv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn .i-chev { color: var(--ink-3); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 10px; padding-top: 6px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; min-height: 76px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 16px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; box-shadow: 0 3px 0 var(--drop); }
.tile:hover { border-color: var(--blue); }
.tile:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--drop); }
.tile[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 3px 0 var(--blue); }
.tile b { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.15; }
.tile span.h { font-size: 0.8rem; color: var(--ink-2); font-weight: 700; line-height: 1.25; }
.tile .sw { width: 100%; height: 34px; border-radius: 10px; margin-bottom: 6px; border: 2px solid rgba(0, 0, 0, 0.06); }
.tile .badge { position: absolute; top: -9px; right: 8px; font-size: 0.66rem; padding: 0 7px; }
.tile.locked b, .tile.locked span.h { opacity: 0.65; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 800; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 48px; height: 28px; border-radius: 999px; background: var(--surface-3); border: 2px solid var(--line-2); position: relative; transition: background 0.15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2); transition: transform 0.18s; }
.switch input:checked + .track { background: var(--green); border-color: var(--green-d); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- alerts / notes ---------- */
.note { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: var(--r); background: var(--blue-soft); color: var(--ink); border: 2px solid color-mix(in srgb, var(--blue) 30%, transparent); }
.note .i { color: var(--blue); width: 22px; height: 22px; margin-top: 1px; }
.note-yellow { background: var(--yellow-soft); border-color: color-mix(in srgb, var(--yellow-d) 40%, transparent); }
.note-yellow .i { color: var(--yellow-d); }
.note-pink { background: var(--pink-soft); border-color: color-mix(in srgb, var(--pink) 35%, transparent); }
.note-pink .i { color: var(--pink); }
.note-green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.note-green .i { color: var(--green-d); }
.note p:last-child { margin-bottom: 0; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 440px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--ink); color: var(--surface); font-weight: 800; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25), 0 14px 30px rgba(0, 0, 0, 0.25); animation: toast-in 0.25s cubic-bezier(0.2, 1.4, 0.4, 1); max-width: 100%; }
.toast.ok { background: var(--green-d); color: #fff; }
.toast.err { background: var(--pink-d); color: #fff; }
.toast.out { animation: toast-out 0.2s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(94vw, 640px); width: 100%; max-height: min(88vh, 860px); overflow: visible; }
dialog.modal::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop 0.24s cubic-bezier(0.2, 1.3, 0.4, 1); }
.modal-box { background: var(--surface); border: 2px solid var(--line); border-radius: 28px; box-shadow: 0 8px 0 var(--drop), 0 30px 60px rgba(0, 0, 0, 0.3); padding: 24px; max-height: min(88vh, 860px); overflow: auto; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 1.5rem; }
.modal-head .icon-btn { margin-left: auto; }
dialog.modal.modal-wide { max-width: min(96vw, 860px); }
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(10px); } }
@media (max-width: 560px) {
  dialog.modal, dialog.modal.modal-wide { max-width: 100vw; margin: auto 0 0; max-height: 92vh; }
  .modal-box { border-radius: 26px 26px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; }
  dialog.modal[open] { animation: sheet 0.26s cubic-bezier(0.2, 1, 0.3, 1); }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

/* ---------- plan cards (pricing + upsell) ---------- */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 24px 22px; box-shadow: 0 6px 0 var(--drop); }
.plan.hot { border-color: var(--purple); box-shadow: 0 6px 0 var(--purple-d); }
.plan.gold { border-color: var(--yellow-d); box-shadow: 0 6px 0 var(--yellow-d); }
.plan .ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); }
.plan h3 { font-size: 1.5rem; margin: 0; }
.plan .price { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1; }
.plan .price small { font-size: 1rem; color: var(--ink-2); font-weight: 600; }
.plan .tagline { color: var(--ink-2); font-weight: 700; margin: 0; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 9px; }
.plan li { display: flex; gap: 9px; align-items: flex-start; font-weight: 700; }
.plan li .i { color: var(--green); stroke-width: 3; margin-top: 2px; }
.plan li.no { color: var(--ink-3); font-weight: 600; }
.plan li.no .i { color: var(--ink-3); }
.plan .btn { margin-top: auto; }
.mini-plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.mini-plan { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; background: var(--surface-2); border: 2px solid var(--line); }
.mini-plan.hot { border-color: var(--purple); background: var(--purple-soft); }
.mini-plan .price { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1; }
.mini-plan .price small { font-size: 0.85rem; color: var(--ink-2); }
.mini-plan ul { margin: 0; padding-left: 18px; font-size: 0.9rem; font-weight: 700; color: var(--ink-2); }
.mini-plan .btn { margin-top: auto; }

/* ---------- footer ---------- */
.site-footer { margin-top: 64px; background: var(--surface); border-top: 2px solid var(--line); padding: 36px 0 28px; color: var(--ink-2); font-size: 0.95rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.footer-grid h4 { font-size: 1rem; color: var(--ink); margin-bottom: 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.footer-grid a:hover { color: var(--blue); }
.footer-fine { margin-top: 26px; padding-top: 18px; border-top: 2px dashed var(--line); font-size: 0.82rem; color: var(--ink-3); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.footer-brand p { margin-top: 10px; max-width: 320px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- landing ---------- */
.hero { position: relative; padding: 48px 0 40px; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; grid-template-columns: 1.1fr 1fr; align-items: center; }
.hero h1 { margin-bottom: 16px; font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
.hero h1 .pop { display: inline-block; color: var(--blue); position: relative; }
.hero h1 .mark { background: linear-gradient(180deg, transparent 60%, var(--yellow) 60%, var(--yellow) 90%, transparent 90%); padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 540px; font-weight: 600; }
.hero-prompt { margin-top: 22px; display: flex; gap: 10px; padding: 8px; background: var(--surface); border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 6px 0 var(--drop); max-width: 600px; }
.hero-prompt input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.08rem; font-weight: 700; color: var(--ink); padding: 8px 10px; }
.hero-prompt input:focus { outline: none; }
.hero-prompt:focus-within { border-color: var(--blue); }
.hero .chips { margin-top: 16px; max-width: 620px; }
.hero-trust { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; font-weight: 800; color: var(--ink-2); font-size: 0.92rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .i { color: var(--green); stroke-width: 3; }
.hero-art { position: relative; aspect-ratio: 16 / 11; }
.hero-card { position: absolute; border-radius: 22px; overflow: hidden; border: 4px solid var(--surface); box-shadow: 0 8px 0 var(--drop), 0 24px 50px rgba(10, 20, 60, 0.25); background: var(--surface-3); }
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card.c1 { inset: 0 12% 18% 0; transform: rotate(-2.5deg); animation: bob 6s ease-in-out infinite; }
.hero-card.c2 { width: 48%; aspect-ratio: 16 / 10; right: 0; bottom: 0; transform: rotate(4deg); animation: bob 6s ease-in-out -3s infinite; }
.hero-bubble { position: absolute; left: -2%; bottom: 6%; max-width: 62%; background: var(--surface); border: 2px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-weight: 800; box-shadow: 0 5px 0 var(--drop); font-size: 0.95rem; z-index: 2; }
.hero-bubble .caret { display: inline-block; width: 2px; height: 1.05em; background: var(--blue); vertical-align: -0.15em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.hero-sticker { position: absolute; top: -4%; right: 8%; z-index: 2; transform: rotate(8deg); }
@keyframes bob { 50% { translate: 0 -8px; } }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 560px; width: 100%; margin: 8px auto 0; }
}
@media (max-width: 520px) {
  .hero { padding-top: 28px; }
  .hero-prompt { flex-direction: column; border-radius: 20px; }
  .hero-prompt .btn { width: 100%; }
}

.steps { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); counter-reset: step; }
.step { position: relative; padding: 26px 22px 22px; }
.step .num { position: absolute; top: -18px; left: 20px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: #fff; background: var(--blue); box-shadow: 0 4px 0 var(--blue-d); }
.step:nth-child(2) .num { background: var(--purple); box-shadow: 0 4px 0 var(--purple-d); }
.step:nth-child(3) .num { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.step h3 { margin-top: 10px; }
.step p { color: var(--ink-2); margin: 0; font-weight: 600; }
.step .step-art { margin-top: 14px; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 2px solid var(--line); aspect-ratio: 16 / 9; display: grid; place-items: center; }
.step .step-art img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 30px; } }

.genres { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.genre { padding: 10px 18px; border-radius: 16px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); text-decoration: none; }
.genre:hover { color: #fff; transform: translateY(-2px) rotate(-1deg); }
.genre:nth-child(6n + 1) { background: var(--blue); }
.genre:nth-child(6n + 2) { background: var(--pink); }
.genre:nth-child(6n + 3) { background: var(--green); }
.genre:nth-child(6n + 4) { background: var(--purple); }
.genre:nth-child(6n + 5) { background: var(--orange); }
.genre:nth-child(6n + 6) { background: #14b8c4; }

.cta-band { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; border-radius: 32px; padding: 44px 28px; text-align: center; box-shadow: 0 8px 0 var(--purple-d); position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, 0.9); font-size: 1.12rem; font-weight: 700; }
.cta-band::before, .cta-band::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 28px; background: rgba(255, 255, 255, 0.1); transform: rotate(20deg); }
.cta-band::before { top: -50px; left: -30px; }
.cta-band::after { bottom: -60px; right: -20px; width: 180px; height: 180px; }

/* ---------- gallery ---------- */
.grid-maps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.map-card { display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 5px 0 var(--drop); color: var(--ink); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.map-card:hover { color: var(--ink); transform: translateY(-3px) rotate(-0.4deg); box-shadow: 0 8px 0 var(--drop), 0 16px 30px rgba(10, 20, 60, 0.14); }
.map-card .thumb { position: relative; aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; }
.map-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.map-card:hover .thumb img { transform: scale(1.04); }
.map-card .thumb .badge { position: absolute; top: 10px; left: 10px; }
.map-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.map-card .prompt { font-weight: 800; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.map-card .meta { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 0.85rem; color: var(--ink-3); font-weight: 700; min-width: 0; }
.map-card .meta .avatar { width: 22px; height: 22px; }
.map-card .meta .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-card.skel-card .thumb { animation: shimmer 1.4s linear infinite; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; }
.map-card .status-pill { position: absolute; bottom: 10px; left: 10px; }
.placeholder-art { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #8fd3ff, #bff0a8); color: rgba(20, 40, 80, 0.55); }
.placeholder-art svg { width: 38%; height: auto; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input { padding-left: 42px; }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty .blob { width: 120px; margin: 0 auto 14px; }

/* ---------- create ---------- */
.create-grid { display: grid; gap: 24px; grid-template-columns: minmax(320px, 420px) 1fr; align-items: start; padding-top: 28px; }
.create-panel { position: static; }
@media (min-width: 901px) and (min-height: 940px) { .create-panel { position: sticky; top: calc(var(--header-h) + 16px); } }
.create-panel .card { padding: 20px; }
.create-panel h1 { font-size: 1.7rem; margin-bottom: 4px; }
.opt-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.opt-grid .full { grid-column: 1 / -1; }
.prompt-wrap { position: relative; }
.prompt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.advanced { border-top: 2px dashed var(--line); padding-top: 12px; }
.advanced summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary .i { transition: transform 0.2s; }
.advanced[open] summary .i { transform: rotate(90deg); }
.seed-row { display: flex; gap: 8px; margin-top: 10px; }
.seed-row .input { flex: 1; }
.gen-foot { display: flex; flex-direction: column; gap: 10px; }
.quota { display: flex; align-items: center; gap: 8px; justify-content: center; font-weight: 800; font-size: 0.9rem; color: var(--ink-2); text-align: center; }
.quota .dots { display: inline-flex; gap: 4px; }
.quota .dots i { width: 10px; height: 10px; border-radius: 4px; background: var(--green); display: inline-block; box-shadow: 0 2px 0 var(--green-d); }
.quota .dots i.used { background: var(--surface-3); box-shadow: 0 2px 0 var(--line-2); }
.turnstile-box { display: flex; justify-content: center; min-height: 0; }

.stage { min-height: 440px; }
.stage-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; min-height: 440px; padding: 30px; border: 3px dashed var(--line-2); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--ink-2); }
.stage-empty h2 { font-size: 1.6rem; color: var(--ink); margin: 0; }
.stage-empty .iso { width: 190px; }

.gen-card { overflow: hidden; padding: 0; }
.gen-visual { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(180deg, #8fd3ff 0%, #d4f0ff 60%, #bdeaa5 100%); overflow: hidden; }
:root[data-theme="dark"] .gen-visual { background: linear-gradient(180deg, #1c2a66 0%, #2c3f8a 60%, #1f5a3a 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gen-visual { background: linear-gradient(180deg, #1c2a66 0%, #2c3f8a 60%, #1f5a3a 100%); } }
.gen-visual > img { width: 100%; height: 100%; object-fit: cover; }
.gen-visual.top-mode > img { object-fit: contain; background: #0f5b66; }
.builder { position: absolute; inset: 0; display: grid; place-items: center; }
.builder svg { width: min(58%, 340px); height: auto; overflow: visible; }
.builder .blk { transform-box: fill-box; transform-origin: center; animation: drop 2.4s cubic-bezier(0.3, 1.4, 0.5, 1) infinite; opacity: 0; }
@keyframes drop { 0% { opacity: 0; transform: translateY(-60px); } 18%, 78% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(0); } }
.gen-progress { padding: 20px 22px 22px; }
.progress { position: relative; height: 22px; border-radius: 999px; background: var(--surface-3); border: 2px solid var(--line); overflow: hidden; }
.progress > span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background-color: var(--green); background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 0 10px, transparent 10px 20px); background-size: 28px 28px; animation: stripes 0.8s linear infinite; transition: width 0.6s ease; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15); }
@keyframes stripes { to { background-position: 28px 0; } }
.stage-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(4, 1fr); }
.stage-list li { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 0.86rem; color: var(--ink-3); }
.stage-list li .dot { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line-2); flex: none; display: grid; place-items: center; }
.stage-list li.on { color: var(--ink); }
.stage-list li.on .dot { border-color: var(--blue); border-right-color: transparent; animation: spin 0.9s linear infinite; }
.stage-list li.done { color: var(--green-d); }
.stage-list li.done .dot { background: var(--green); border-color: var(--green); }
.stage-list li.done .dot::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
@media (max-width: 560px) { .stage-list { grid-template-columns: 1fr 1fr; } }
.gen-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.gen-status h2 { font-size: 1.3rem; margin: 0; }
.gen-status .elapsed { font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.view-tabs { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(12, 18, 40, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 2; }
.view-tabs button { border: 0; background: transparent; color: #fff; font-family: var(--font-display); font-weight: 600; padding: 6px 12px; border-radius: 10px; cursor: pointer; font-size: 0.92rem; }
.view-tabs button[aria-pressed="true"] { background: #fff; color: #10152b; }
.visual-name { position: absolute; left: 14px; bottom: 12px; z-index: 2; padding: 6px 14px; border-radius: 14px; background: rgba(12, 18, 40, 0.6); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-body { padding: 18px 22px 22px; display: grid; gap: 16px; }
.result-prompt { font-size: 1.1rem; font-weight: 800; margin: 0; }
.result-prompt q { quotes: "\201C" "\201D"; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.stat span { font-size: 0.78rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 10px; align-items: start; }
.actions .btn { min-width: 0; }
@media (max-width: 560px) { .actions { grid-template-columns: 1fr 1fr; } .actions .export-slot { grid-column: 1 / -1; } }
.export-slot { display: flex; flex-direction: column; gap: 6px; }
.export-sub { font-size: 0.82rem; font-weight: 800; color: var(--ink-3); text-align: center; }
.lock-banner { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, var(--purple-soft), var(--blue-soft)); border: 2px solid color-mix(in srgb, var(--purple) 35%, transparent); }
.lock-banner .lk { width: 48px; height: 48px; border-radius: 16px; background: var(--purple); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 var(--purple-d); flex: none; }
.lock-banner .lk .i { width: 24px; height: 24px; }
.lock-banner p { margin: 0; font-weight: 800; }
.lock-banner .grow { flex: 1; min-width: 0; }
@media (max-width: 560px) { .lock-banner { flex-wrap: wrap; } .lock-banner .btn { width: 100%; } }
.export-done { display: grid; gap: 12px; padding: 16px; border-radius: 20px; background: var(--green-soft); border: 2px solid color-mix(in srgb, var(--green) 40%, transparent); }
.export-done h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.export-done ol { margin: 0; padding-left: 20px; font-weight: 700; display: grid; gap: 4px; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 4px; border-top: 2px dashed var(--line); }
.recent { margin-top: 28px; }
.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.recent-item { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--drop); cursor: pointer; text-align: left; padding: 0; font: inherit; color: var(--ink); }
.recent-item:hover { border-color: var(--blue); }
.recent-item .thumb { aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; }
.recent-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-item span { padding: 6px 10px 8px; font-size: 0.82rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item[aria-current="true"] { border-color: var(--blue); box-shadow: 0 3px 0 var(--blue); }
@media (max-width: 900px) {
  .create-grid { grid-template-columns: 1fr; padding-top: 18px; }
  .create-panel { position: static; }
  .stage, .stage-empty { min-height: 300px; }
}
@media (max-width: 420px) { .opt-grid { grid-template-columns: 1fr; } }

/* ---------- share ---------- */
.share-hero { padding-top: 28px; display: grid; gap: 24px; grid-template-columns: 1.6fr 1fr; align-items: start; }
.share-side { display: grid; gap: 18px; }
.owner-line { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.owner-line .avatar { width: 40px; height: 40px; }
.top-thumb { border-radius: 18px; overflow: hidden; border: 2px solid var(--line); aspect-ratio: 1; background: #0f5b66; }
.top-thumb img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 900px) { .share-hero { grid-template-columns: 1fr; } }

/* ---------- pricing ---------- */
.pricing-head { padding: 48px 0 34px; text-align: center; }
.pricing-head p { font-size: 1.15rem; color: var(--ink-2); font-weight: 600; max-width: 620px; margin: 0 auto; }
.pack { display: grid; gap: 20px; grid-template-columns: auto 1fr auto; align-items: center; background: linear-gradient(135deg, var(--yellow-soft), var(--surface)); border: 2px solid var(--yellow-d); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: 0 6px 0 var(--yellow-d); margin-top: 34px; }
.pack .coin { width: 76px; height: 76px; }
.pack h3 { font-size: 1.45rem; margin-bottom: 4px; }
.pack p { margin: 0; color: var(--ink-2); font-weight: 700; }
.pack .price { font-family: var(--font-display); font-weight: 700; font-size: 2rem; text-align: right; line-height: 1; margin-bottom: 8px; }
@media (max-width: 700px) { .pack { grid-template-columns: 1fr; text-align: center; } .pack .coin { margin: 0 auto; } .pack .price { text-align: center; } }
.compare-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface); box-shadow: 0 6px 0 var(--drop); -webkit-overflow-scrolling: touch; }
table.compare { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare th, .compare td { padding: 13px 16px; text-align: center; border-bottom: 2px solid var(--line); font-weight: 700; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare thead th { font-family: var(--font-display); font-size: 1.1rem; background: var(--surface-2); }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare .yes { color: var(--green-d); }
.compare .no { color: var(--ink-3); }
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 4px 18px; box-shadow: 0 4px 0 var(--drop); }
.faq summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--blue); }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { color: var(--ink-2); font-weight: 600; }

/* ---------- account ---------- */
.account-grid { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; padding-top: 28px; }
.account-grid .span-2 { grid-column: 1 / -1; }
.profile { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile h1 { font-size: 1.9rem; margin: 0; }
.profile .spacer { min-width: 10px; }
.usage { display: grid; gap: 16px; }
.usage-row .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 800; margin-bottom: 6px; }
.usage-row .top span { color: var(--ink-2); font-size: 0.9rem; }
.bar { height: 18px; border-radius: 999px; background: var(--surface-3); border: 2px solid var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--blue); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15); transition: width 0.8s cubic-bezier(0.2, 1, 0.3, 1); }
.bar.green > span { background: var(--green); }
.bar.warn > span { background: var(--orange); }
.bar.full > span { background: var(--pink); }
.credits { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.credits .big { font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--yellow-d); text-shadow: 0 3px 0 color-mix(in srgb, var(--yellow-d) 30%, transparent); }
.devices { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 16px; }
.device .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 3px 0 var(--blue-d); }
.device .grow { flex: 1; min-width: 0; }
.device b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device small { color: var(--ink-3); font-weight: 700; }
.device.revoked { opacity: 0.55; }
.steps-mini { margin: 0; padding-left: 20px; font-weight: 700; color: var(--ink-2); display: grid; gap: 4px; }
.my-maps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 860px) { .account-grid { grid-template-columns: 1fr; } }

/* ---------- link / login ---------- */
.narrow { max-width: 560px; margin: 0 auto; padding-top: 44px; }
.hero-icon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 6px 0 var(--blue-d); transform: rotate(-4deg); }
.hero-icon .i { width: 42px; height: 42px; }
.hero-icon.green { background: var(--green); box-shadow: 0 6px 0 var(--green-d); }
.hero-icon.purple { background: var(--purple); box-shadow: 0 6px 0 var(--purple-d); }
.code-input { width: 100%; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 8vw, 2.6rem); letter-spacing: 0.16em; text-transform: uppercase; padding: 14px 10px; border-radius: 20px; border: 3px solid var(--line-2); background: var(--surface-2); color: var(--ink); }
.code-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 22%, transparent); }
.code-input.bad { border-color: var(--pink); animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.login-card { text-align: center; }
.login-card .perm { text-align: left; margin: 18px 0; display: grid; gap: 8px; }
.login-card .perm div { display: flex; gap: 10px; align-items: center; font-weight: 700; color: var(--ink-2); }
.login-card .perm .i { color: var(--green); stroke-width: 3; }

/* ---------- legal ---------- */
.legal { max-width: 780px; margin: 0 auto; padding-top: 36px; }
.legal h1 { font-size: 2.3rem; }
.legal h2 { font-size: 1.35rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--ink-2); font-weight: 600; }
.legal li { margin-bottom: 6px; }
.legal .card { padding: 28px; }
@media (max-width: 560px) { .legal .card { padding: 18px; } }

/* ---------- error ---------- */
.error-page { text-align: center; padding: 64px 0 24px; }
.error-page .code { font-family: var(--font-display); font-weight: 700; font-size: clamp(5rem, 22vw, 9rem); line-height: 1; color: var(--blue); text-shadow: 0 8px 0 var(--blue-d); margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .builder .blk { opacity: 1; }
}

/* ---------- utilities ---------- */
.m0 { margin: 0 !important; }
.mb-12 { margin-bottom: 12px; }
.mb-18 { margin-bottom: 18px; }
.mt-12 { margin-top: 12px; }
.mt-18 { margin-top: 18px; }
.mt-24 { margin-top: 24px; }
.grow-1 { flex: 1; min-width: 0; }
.center-row { justify-content: center; }
.skel-line { display: block; height: 18px; width: 80%; }
.skel-line.short { height: 14px; width: 40%; }
.inline-note { display: inline-flex; text-align: left; }
.btn-primary { --b: var(--blue); --bd: var(--blue-d); }
.textarea.bad, .input.bad { border-color: var(--pink); animation: shake 0.35s; }
.chip.on, .chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
@media (max-width: 400px) { .theme-toggle { display: none; } .logo span { font-size: 1.15rem; } }
@media (max-width: 600px) {
  #gallery-filters { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px; scrollbar-width: none; }
  #gallery-filters::-webkit-scrollbar { display: none; }
  #gallery-filters .chip { flex: none; }
}
.result-body > div:empty { display: none; }
.compare tbody th, .compare thead th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.compare thead th:first-child { background: var(--surface-2); }
@media (max-width: 600px) { .compare th, .compare td { padding: 11px 10px; font-size: 0.9rem; } }
.card-title h2 { font-size: 1.5rem; }
.export-slot .btn .badge { position: absolute; top: -11px; right: -6px; font-size: 0.66rem; padding: 0 7px; }
.plan.current::after { content: "Your plan"; position: absolute; top: 14px; right: 16px; font-family: var(--font-display); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--green-d); background: var(--green-soft); padding: 2px 9px; border-radius: 999px; }

/* ---------------------------------------------------------------- worlds (/world/{id}, result card, account) */
.world-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.world-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 900px) { .world-layout { grid-template-columns: 1fr; } }
.world-board-card { padding: 16px; overflow-x: auto; }
.world-board { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0; max-width: 100%; margin: 0 auto;
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 12px, var(--surface-3) 12px 24px); border-radius: 18px; overflow: hidden; }
.world-cell { position: relative; aspect-ratio: 1; min-width: 0; }
.world-cell.sec { background: #0f5b66; }
.world-cell.sec img { display: block; width: 100%; height: 100%; object-fit: cover; }
.world-cell.sec a { display: block; width: 100%; height: 100%; color: #fff; }
.world-cell.sec a:focus-visible { outline: 4px solid var(--focus); outline-offset: -4px; }
.world-cell .sec-label { position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; gap: 6px; align-items: center; pointer-events: none; }
.world-cell .sec-label span { background: rgba(10, 16, 40, 0.72); color: #fff; border-radius: 999px; padding: 1px 8px; font-weight: 800; font-size: 0.72rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.world-cell.busy { display: grid; place-items: center; background: var(--blue-soft); color: var(--ink-2); font-weight: 800; font-size: 0.8rem; text-align: center; padding: 6px; }
.world-cell.busy .spin { width: 26px; height: 26px; border-radius: 50%; border: 4px solid var(--blue); border-right-color: transparent; animation: spin 0.8s linear infinite; margin: 0 auto 6px; }
.world-cell.failed { display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-d); font-weight: 800; font-size: 0.8rem; text-align: center; padding: 6px; }
.world-cell .add { position: absolute; inset: 14%; display: grid; place-items: center; border-radius: 16px; border: 3px dashed var(--line-2);
  background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--blue); cursor: pointer; font: inherit; font-weight: 800; }
.world-cell .add:hover { border-color: var(--blue); background: var(--surface); }
.world-cell .add .i { width: 34%; height: 34%; max-width: 40px; max-height: 40px; }
.world-cell .add[disabled] { cursor: not-allowed; color: var(--ink-3); border-color: var(--line); }
.world-cell .add .add-text { display: block; font-size: 0.72rem; }
@media (max-width: 520px) { .world-cell .add .add-text { display: none; } }
.world-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; border-top: 2px dashed var(--line); }
.world-row .grow-1 { font-weight: 700; color: var(--ink-2); }
.world-card .thumb { aspect-ratio: 1; }
.world-cell .sec-label span:first-child { flex: none; }
@media (max-width: 520px) { .world-cell .sec-label span + span { display: none; } }

/* plugin install paths (account page) */
.plugin-paths { margin: 6px 0 2px; padding-left: 18px; font-weight: 500; display: grid; gap: 3px; }
.plugin-paths code { font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.15)); word-break: break-all; }
