:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #eef2f6;
  --line: #dde3ea;
  --ink: #0d1520;
  --mut: #5a6b7c;
  --acc: #0b80c5;
  --acc-ink: #ffffff;
  --ok: #138a4d;
  --warn: #b26a00;
  --bad: #c0362c;
  --stage: #e4e9ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 21, 32, .06), 0 8px 24px rgba(13, 21, 32, .06);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05090d;
    --panel: #0c131a;
    --panel-2: #121c25;
    --line: #1d2a36;
    --ink: #f1f5f9;
    --mut: #8fa3b5;
    --acc: #25a4ec;
    --acc-ink: #04121c;
    --ok: #3ccf82;
    --warn: #f0b04a;
    --bad: #ff6b5e;
    --stage: #0a1016;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #05090d; --panel: #0c131a; --panel-2: #121c25; --line: #1d2a36; --ink: #f1f5f9;
  --mut: #8fa3b5; --acc: #25a4ec; --acc-ink: #04121c; --ok: #3ccf82; --warn: #f0b04a;
  --bad: #ff6b5e; --stage: #0a1016; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans); overflow-x: hidden;
}
b { font-weight: 600; }
a { color: var(--acc); }

/* ---------- header ---------- */
.top { max-width: 1180px; margin: 0 auto; padding: 28px 16px 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--acc);
  background-image:
    linear-gradient(#fff 0 0), linear-gradient(#fff 0 0), linear-gradient(#fff 0 0), linear-gradient(#fff 0 0);
  background-size: 8px 8px; background-repeat: no-repeat;
  background-position: 5px 5px, 15px 5px, 5px 15px, 17px 17px;
}
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.08; letter-spacing: -.025em; margin: 18px 0 8px; max-width: 18ch; }
.brand-tag { color: var(--mut); margin: 0 0 6px; max-width: 62ch; font-size: 16px; }
.privacy { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13px; margin: 10px 0 0; }
.privacy .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }

/* ---------- layout ---------- */
.layout {
  max-width: 1180px; margin: 0 auto; padding: 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 24px; align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.editor { display: grid; gap: 16px; min-width: 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: grid; gap: 12px; min-width: 0;
}
.card h2 { margin: 0; font-size: 15px; font-weight: 650; display: flex; align-items: baseline; gap: 8px; }
.card h2 .sub { font-weight: 400; color: var(--mut); font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

label { display: grid; gap: 5px; font-size: 12.5px; color: var(--mut); font-weight: 500; min-width: 0; }
label.inline { display: flex; align-items: center; gap: 8px; }
input:not([type]), input[type=text], input[type=tel], input[type=email], input[type=url], select {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
label.inline select { width: auto; padding: 7px 10px; font-size: 14px; }
input:focus, select:focus, button:focus-visible { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); }
input::placeholder { color: color-mix(in srgb, var(--mut) 70%, transparent); }
.hint { margin: 0; font-size: 12.5px; color: var(--mut); }

.color { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; }
.color input[type=color] { width: 34px; height: 30px; border: 0; padding: 0; background: none; border-radius: 7px; cursor: pointer; }
.color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type=color]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 7px; }
.color output { font-family: var(--mono); font-size: 13px; color: var(--ink); text-transform: uppercase; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; padding: 0;
  position: relative; overflow: hidden;
}
.swatch::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 12px; height: 12px; border-radius: 4px; background: var(--sw-acc); }

fieldset.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
fieldset.seg legend { font-size: 12.5px; color: var(--mut); font-weight: 500; padding: 0; margin-bottom: 6px; width: 100%; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .tabs button {
  display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font-size: 13px; cursor: pointer; font-weight: 500;
}
.seg input:checked + span, .tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 35%, transparent); }

/* photo + logo pickers */
.photo-row { display: flex; gap: 16px; align-items: center; }
.photo-ctl { display: grid; gap: 10px; flex: 1; min-width: 0; }
.avatar-drop, .logo-drop {
  position: relative; flex: none; padding: 0; cursor: pointer; overflow: hidden;
  border: 1.5px dashed var(--line); background: var(--panel-2); color: var(--mut);
}
.avatar-drop { width: 84px; height: 84px; border-radius: 50%; }
.logo-drop { width: 110px; height: 66px; border-radius: 12px; background: #fff; }
.avatar-drop canvas, .logo-drop canvas { width: 100%; height: 100%; display: block; }
.avatar-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; line-height: 1.2; text-align: center; color: var(--mut); }
.logo-drop .avatar-empty { color: #6b7a89; }
.has-img .avatar-empty { display: none; }
.has-img { border-style: solid; }
.dragover { border-color: var(--acc); }
.range { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; }
.range label { font-size: 12.5px; }
input[type=range] { width: 100%; accent-color: var(--acc); }

/* buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  font: inherit; font-size: 14px; font-weight: 550; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  border-radius: 10px; padding: 9px 14px; transition: transform .08s, background .15s, opacity .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: transparent; }
.btn.big { width: 100%; padding: 14px 16px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--mut); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- preview ---------- */
.preview { position: sticky; top: 16px; display: grid; gap: 14px; min-width: 0; }
@media (max-width: 900px) { .preview { position: static; } }
.tabs { display: flex; gap: 6px; }
.tabs button { font: inherit; font-size: 13px; }
.stage {
  background: var(--stage); border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  display: grid; place-items: center;
}
.phone {
  position: relative; width: min(300px, 72vw); aspect-ratio: var(--ar, 1206 / 2622);
  border-radius: 13% / 6%; overflow: hidden; background: #000;
  box-shadow: 0 0 0 7px #1b1f24, 0 0 0 8px #3a414a, 0 24px 60px rgba(0, 0, 0, .35);
  container-type: inline-size;
}
.phone canvas { width: 100%; height: 100%; display: block; }
.chrome { position: absolute; inset: 0; pointer-events: none; color: rgba(255, 255, 255, .92); font-family: var(--sans); text-align: center; }
.chrome.light-bg { color: rgba(10, 15, 20, .88); }
.chrome[hidden] { display: none; }
.island { position: absolute; top: 1.6%; left: 50%; width: 31%; height: 3.6%; transform: translateX(-50%); background: #000; border-radius: 99px; }
.date { position: absolute; top: 7%; left: 0; right: 0; font-size: 5.2cqw; font-weight: 600; }
.time { position: absolute; top: 9.9%; left: 0; right: 0; font-size: 26cqw; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.corner { position: absolute; bottom: 5.6%; width: 13.5cqw; height: 13.5cqw; border-radius: 50%; background: rgba(40, 44, 50, .55); backdrop-filter: blur(6px); }
.corner.l { left: 11%; } .corner.r { right: 11%; }
.homebar { position: absolute; bottom: 1.2%; left: 50%; width: 36%; height: .55%; transform: translateX(-50%); border-radius: 9px; background: currentColor; }
.poster { width: 100%; max-width: 360px; }
.poster canvas { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); justify-self: center; }
.toggle input { accent-color: var(--acc); }

.status {
  display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.4;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 42px;
}
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mut); flex: none; margin-top: 4px; }
.status.ok::before { background: var(--ok); }
.status.warn::before { background: var(--warn); }
.status.bad::before { background: var(--bad); }
.status small { display: block; color: var(--mut); font-family: var(--mono); font-size: 11.5px; margin-top: 2px; }
.actions { display: grid; gap: 10px; }
.actions .btn-row .btn { flex: 1; }

.how { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.how summary { cursor: pointer; font-weight: 600; }
.how ol { padding-left: 18px; margin: 10px 0; display: grid; gap: 6px; }

.jump {
  display: none; position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--acc); color: var(--acc-ink); text-align: center; padding: 13px; border-radius: 12px;
  font-weight: 600; text-decoration: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); z-index: 5;
}
@media (max-width: 900px) { .jump.show { display: block; } }

/* ---------- SEO / explainer content ---------- */
.explain { max-width: 1180px; margin: 24px auto 0; padding: 0 16px; display: grid; gap: 40px; }
.explain h2 { font-size: clamp(22px, 3.2vw, 30px); letter-spacing: -.02em; margin: 0 0 14px; line-height: 1.15; }
.explain p { color: var(--mut); max-width: 68ch; margin: 0 0 10px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; counter-increment: s; }
.steps li::before { content: "0" counter(s); font-family: var(--mono); color: var(--acc); font-size: 13px; display: block; margin-bottom: 8px; }
.steps h3 { margin: 0 0 6px; font-size: 16px; }
.steps p { margin: 0; font-size: 14px; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; font-size: 14.5px; }

.foot {
  max-width: 1180px; margin: 48px auto 0; padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between;
  align-items: center; color: var(--mut); font-size: 13px;
}
.foot a { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); }
.foot a:hover { color: var(--acc); }
@media (max-width: 900px) { .foot { padding-bottom: 96px; } }

.brand { text-decoration: none; color: inherit; width: fit-content; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.split figure { margin: 0; }
.split img { display: block; width: 220px; height: auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split figure { justify-self: center; } }
.foot-r { display: flex; gap: 20px; align-items: center; }
.foot-r a { font-weight: 500; border: 0; color: var(--mut); }
