/* SocialSpire Site Builder. Brand colors and Archivo from context/brand-visual.md.
   Rounded corners allowed since 2026-10-31. Light and dark themes. */
:root {
  --ground: #F3F2F2;
  --surface: #EAE9E9;
  --ink: #201E1D;
  --red: #EC3013;
  --red-700: #AE1800;

  --bg: var(--ground);
  --card: #FFFFFF;
  --raised: var(--surface);
  --text: var(--ink);
  --muted: #5A5654;
  --line: rgba(32, 30, 29, 0.12);
  --line-strong: rgba(32, 30, 29, 0.28);
  --red-text: var(--red-700);
  --on-red: #FFFFFF;
  --focus: var(--ink);
  --shadow: 0 1px 2px rgba(32, 30, 29, 0.06), 0 8px 24px rgba(32, 30, 29, 0.06);
  --shadow-lg: 0 2px 6px rgba(32, 30, 29, 0.08), 0 24px 60px rgba(32, 30, 29, 0.14);
  --ok: #2E7D4F;
  --warn: #B7791F;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --pill: 999px;
  --gutter: 16px;
  --top-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #201E1D;
  --card: #2A2827;
  --raised: #33312F;
  --text: #F3F2F2;
  --muted: #B9B4B1;
  --line: rgba(243, 242, 242, 0.12);
  --line-strong: rgba(243, 242, 242, 0.3);
  --red-text: #FF6244;
  --on-red: #FFFFFF;
  --focus: #F3F2F2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.45);
  --ok: #5CC28A;
  --warn: #E2A84B;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif; font-weight: 400;
  font-size: 17px; line-height: 1.55; min-height: 100vh; overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--card); padding: 10px 14px; border-radius: var(--r); }
.skip:focus { left: 8px; }
.boot { padding: 40px var(--gutter); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.red { color: var(--red-text); }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 680px; margin: 0 auto; padding: 0 var(--gutter); }
main { padding: 32px 0 96px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 12px; height: var(--top-h); max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: 0 0 auto; }
.mark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; }
.mark i { display: block; width: 4px; background: var(--text); border-radius: 1px; }
.mark i:nth-child(1) { height: 26%; } .mark i:nth-child(2) { height: 40%; } .mark i:nth-child(3) { height: 59%; } .mark i:nth-child(4) { height: 100%; background: var(--red); }
.word { font-weight: 800; letter-spacing: -0.035em; font-size: 1.05rem; text-transform: uppercase; white-space: nowrap; }
.word .o { display: inline-block; width: .72em; height: .72em; border-radius: 50%; background: var(--red); vertical-align: -0.02em; margin: 0 .01em; }
.brand small { font-weight: 400; color: var(--muted); font-size: .9rem; letter-spacing: 0; text-transform: none; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav button.link { text-decoration: none; padding: 8px 12px; border-radius: var(--pill); color: var(--text); font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button.link:hover { background: var(--raised); }
.nav a[aria-current="page"] { background: var(--raised); font-weight: 800; }
.credit-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--line); font-size: .9rem; text-decoration: none; white-space: nowrap; }
.credit-pill b { font-weight: 800; }
.credit-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: inline-grid; place-items: center; cursor: pointer; flex: 0 0 auto; color: var(--text); }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { position: fixed; inset: var(--top-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); display: none; }
  .nav.open { display: flex; }
  .nav a, .nav button.link { padding: 12px 14px; font-size: 1.05rem; text-align: left; }
  .menu-btn { display: inline-grid; margin-left: auto; }
  .brand small { display: none; }
}
.show-xs { display: none; }
@media (max-width: 480px) {
  .top-in { gap: 8px; }
  .word { font-size: .95rem; }
  .hide-xs { display: none; }
  .credit-pill { padding: 6px 10px; }
  .icon-btn { width: 36px; height: 36px; }
}

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font-weight: 800; font-size: 1rem; letter-spacing: 0; word-spacing: .06em; cursor: pointer; text-decoration: none; transition: transform .12s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--on-red); font-size: 1.1875rem; box-shadow: 0 6px 18px rgba(236, 48, 19, 0.28); }
.btn.primary:hover { background: #D92A0E; border-color: #D92A0E; }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--raised); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn.danger { color: var(--red-text); }
.btn.block { width: 100%; white-space: normal; text-align: center; }
.btn.small.primary { font-size: 1.1875rem; min-height: 40px; }
.cost { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.22); font-size: .8rem; font-weight: 800; letter-spacing: 0; }
.btn:not(.primary) .cost { background: var(--raised); }
.free { color: var(--ok); font-weight: 800; font-size: .8rem; }

label.field, .field { display: block; }
.field > span, .label { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 6px; }
.field small, .hint { display: block; color: var(--muted); font-size: .9rem; margin-top: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"], input:not([type]), textarea, select {
  width: 100%; padding: 13px 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font-size: 1rem; line-height: 1.4; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 12%, transparent); }
input[type="color"] { width: 48px; height: 48px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r); background: none; cursor: pointer; }
.err { color: var(--red-text); font-weight: 800; font-size: .95rem; }
.alert { padding: 14px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--red) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); overflow-wrap: anywhere; }
.note { padding: 14px 16px; border-radius: var(--r); background: var(--raised); overflow-wrap: anywhere; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill); background: var(--raised); font-size: .82rem; font-weight: 800; white-space: nowrap; }
.tag.live::before, .tag.work::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.tag.work::before { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.hero-card { display: grid; gap: 20px; padding: clamp(24px, 5vw, 48px); border-radius: var(--r-xl); background: var(--text); color: var(--bg); }
.hero-card .btn:not(.primary) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.hero-card .muted { color: color-mix(in srgb, var(--bg) 72%, transparent); }

.site-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease; }
.site-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.thumb { aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: var(--raised); position: relative; }
.thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; border: 0; pointer-events: none; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.new-card { display: grid; place-items: center; min-height: 260px; border: 2px dashed var(--line-strong); background: transparent; box-shadow: none; cursor: pointer; text-align: center; }
.new-card:hover { border-color: var(--text); }
.plus { width: 52px; height: 52px; border-radius: 50%; background: var(--red); color: #fff; display: inline-grid; place-items: center; font-size: 28px; font-weight: 800; margin-bottom: 10px; }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - var(--top-h)); display: grid; place-items: center; padding: 32px var(--gutter); }
.auth .card { width: 100%; max-width: 440px; padding: 32px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--raised); }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: var(--pill); font-weight: 800; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- plans ---------- */
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.plan .price small { font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan li { display: flex; gap: 10px; }
.plan li::before { content: ""; flex: 0 0 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.plan.on { border: 2px solid var(--red); }
.plan .btn { margin-top: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 800; color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
.plus-n { color: var(--ok); font-weight: 800; } .minus-n { color: var(--red-text); font-weight: 800; }

/* ---------- wizard ---------- */
.progress { height: 6px; border-radius: var(--pill); background: var(--raised); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--red); border-radius: var(--pill); transition: width .35s ease; }
.q-title { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choice { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px 18px; border-radius: var(--r-lg); border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer; transition: border-color .15s, transform .12s, box-shadow .15s; }
.choice:hover { border-color: var(--text); }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.choice b { font-weight: 800; font-size: 1.05rem; }
.choice span { color: var(--muted); font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 16px; border-radius: var(--pill); border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer; font-weight: 800; font-size: .95rem; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.links-list { display: grid; gap: 10px; }
.link-row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr auto; align-items: start; }
@media (max-width: 640px) { .link-row { grid-template-columns: 1fr; } }
.mood-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.mood { padding: 16px; border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.mood.love { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.mood.hate { opacity: .55; }
.swatches { display: flex; gap: 6px; }
.swatches i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); }
.mood .row .btn { flex: 1; }
.drop { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 28px; text-align: center; background: var(--card); }
.drop.over { border-color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--card)); }
.uploads { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.up { position: relative; border-radius: var(--r); overflow: hidden; background: var(--raised); aspect-ratio: 1; }
.up img, .up video { width: 100%; height: 100%; object-fit: cover; display: block; }
.up .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; font-size: 16px; }
.up .kind { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: var(--pill); }
.up .file-ph { display: grid; place-items: center; height: 100%; font-weight: 800; color: var(--muted); }
.wizard-foot { position: sticky; bottom: 0; margin-top: 32px; padding: 16px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); display: flex; gap: 12px; justify-content: space-between; align-items: center; }

/* ---------- working ---------- */
.working { display: grid; gap: 24px; justify-items: center; text-align: center; padding: 40px 0; }
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--raised); border-top-color: var(--red); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; text-align: left; width: 100%; max-width: 560px; }
.log li { padding: 10px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); font-size: .95rem; overflow-wrap: anywhere; }
.log li:first-child { border-color: var(--red); }

/* ---------- looks ---------- */
.looks { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.look { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.look .thumb { aspect-ratio: 4 / 5; }
.look .thumb iframe { width: 300%; height: 300%; transform: scale(.3333); }

/* ---------- editor ---------- */
.ed { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--top-h)); }
.ed-side { border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.ed-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); }
.ed-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 0; background: none; border-radius: var(--r); cursor: pointer; font-size: .75rem; font-weight: 800; color: var(--muted); }
.ed-tabs button svg { width: 20px; height: 20px; }
.ed-tabs button[aria-selected="true"] { background: var(--raised); color: var(--text); }
.ed-panel { overflow-y: auto; padding: 16px; flex: 1; min-height: 0; }
.ed-panel h3 { margin-bottom: 4px; }
.ed-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--raised); }
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-bar select { width: auto; min-width: 140px; padding: 8px 12px; border-radius: var(--pill); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--pill); background: var(--raised); }
.seg button { border: 0; background: none; padding: 6px 10px; border-radius: var(--pill); cursor: pointer; display: inline-grid; place-items: center; color: var(--muted); }
.seg button svg { width: 18px; height: 18px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.stage { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; padding: 16px; position: relative; }
.frame-box { width: 100%; height: 100%; max-width: 100%; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-lg); transition: max-width .3s ease; position: relative; }
.frame-box.tablet { max-width: 820px; } .frame-box.phone { max-width: 390px; }
.frame-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.busy-veil { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 5; }
.busy-veil .card { display: flex; gap: 14px; align-items: center; max-width: 420px; }
.busy-veil .spinner { width: 36px; height: 36px; border-width: 4px; flex: 0 0 auto; }

.inspector { position: absolute; right: 16px; bottom: 16px; width: min(400px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; z-index: 6; padding: 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.inspector .what { font-size: .85rem; color: var(--muted); }
.inspector textarea { min-height: 84px; }
.part-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.part { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); }
.part.on { border-color: var(--red); }
.part button.name { flex: 1; text-align: left; border: 0; background: none; cursor: pointer; font-weight: 800; font-size: .92rem; padding: 4px 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part .tools { display: flex; gap: 2px; }
.part .tools button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.part .tools button:hover { background: var(--raised); color: var(--text); }
.part .tools svg { width: 16px; height: 16px; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row code { font-size: .85rem; color: var(--muted); }
.ver { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.check-item { display: flex; gap: 10px; padding: 8px 0; font-size: .92rem; }
.check-item::before { content: ""; flex: 0 0 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--ok); }
.check-item.bad::before { background: var(--red); }
.check-item.warn::before { background: var(--warn); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 80px; }
.bars i { flex: 1; background: var(--red); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.stat { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.repeat { display: grid; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
details.box { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
details.box > summary { cursor: pointer; padding: 12px 14px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.box > summary::after { content: "+"; font-size: 1.2rem; }
details.box[open] > summary::after { content: "\2212"; }
details.box > div { padding: 0 14px 14px; }
@media (max-width: 900px) {
  .ed { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: calc(100dvh - var(--top-h)); }
  .ed-main { order: 1; }
  .ed-side { order: 2; border-right: 0; border-top: 1px solid var(--line); max-height: 46dvh; }
  .ed-side.closed .ed-panel { display: none; }
  .ed-tabs { grid-template-columns: repeat(8, 1fr); order: 2; border-bottom: 0; border-top: 1px solid var(--line); padding: 4px; }
  .ed-tabs button { font-size: .62rem; padding: 6px 0; }
  .ed-panel { order: 1; }
  .inspector { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .stage { padding: 8px; }
  .ed-bar .hide-sm { display: none; }
}

/* ---------- dialogs and toasts ---------- */
dialog { border: 0; padding: 0; border-radius: var(--r-xl); background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(20, 18, 17, 0.5); backdrop-filter: blur(3px); }
dialog .dlg { padding: 28px; display: grid; gap: 16px; }
dialog.wide { width: min(1100px, calc(100% - 32px)); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(480px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 14px 18px; border-radius: var(--r-lg); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 800; animation: rise .25s ease; pointer-events: auto; overflow-wrap: anywhere; }
.toast.bad { background: var(--red-700); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.mail { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.mail-list { display: grid; gap: 6px; align-content: start; }
.mail-list button { text-align: left; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); cursor: pointer; display: grid; gap: 2px; }
.mail-list button[aria-current="true"] { border-color: var(--red); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) { .mail { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--pill); background: var(--raised); color: var(--muted); font-size: .85rem; font-weight: 800; }
.steps li b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card); font-size: .75rem; }
.steps li.on { background: var(--text); color: var(--bg); }
.steps li.on b { background: var(--red); color: #fff; }
.steps li.done b { background: var(--ok); color: #fff; }
.working .steps { justify-content: center; }
