:root {
  --bg: #f6f5ff; --surface: #ffffff; --surface-2: #efedfb; --text: #1b1640; --muted: #6f6a92; --line: #e4e1f7;
  --accent: #6d5dfc; --accent-2: #ff5c8a; --accent-soft: rgba(109, 93, 252, .12); --ok: #12a26b; --bad: #e5484d;
  --grad: linear-gradient(135deg, #6d5dfc 0%, #a35cff 50%, #ff5c8a 100%);
  --shadow: 0 1px 2px rgba(27, 22, 64, .05), 0 10px 30px rgba(27, 22, 64, .08);
  --radius: 18px; --bar-h: 76px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #120f24; --surface: #1c1836; --surface-2: #26213f; --text: #efedff; --muted: #a29dc6; --line: #2f2a52;
  --accent: #8b7dff; --accent-soft: rgba(139, 125, 255, .16); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 16px/1.5 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.has-modal { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1 { font-size: 27px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 20px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; }
.gap-s { gap: 8px; }
.stack { display: grid; gap: 10px; }
.wrap { flex-wrap: wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 20px; height: 20px; flex: none; }
.span-all { grid-column: 1 / -1; }

.boot { min-height: 100vh; display: grid; place-items: center; gap: 18px; align-content: center; }
.boot img { width: 64px; height: 64px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }
.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 12px auto; }
.spinner.big { width: 36px; height: 36px; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen { max-width: 640px; margin: 0 auto; padding: 12px 16px calc(var(--bar-h) + 24px + env(safe-area-inset-bottom)); min-height: 100vh; animation: enter .22s ease; }
.screen.center { display: grid; place-items: center; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15.5px; text-decoration: none; transition: transform .12s ease, opacity .12s, background .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(109, 93, 252, .3); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.dashed { background: transparent; border: 2px dashed var(--line); color: var(--accent); margin-top: 12px; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-soft { background: rgba(229, 72, 77, .12); color: var(--bad); }
.btn.wide { width: 100%; }
.btn.small-btn { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy .ico { opacity: 0; }
.btn.is-busy::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.soft.is-busy::after, .btn.dashed.is-busy::after { border-color: var(--accent-soft); border-top-color: var(--accent); }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); flex: none; }
.icon-btn.soft { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.tool { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); flex: none; }
.tool:active { background: var(--surface-2); }
.tool:disabled { opacity: .3; }
.tool.danger { color: var(--bad); }
.tool .ico { width: 18px; height: 18px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: #1b1640; color: #fff; font-weight: 600; font-size: 14.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); animation: toast .2s ease; text-align: center; }
.toast.err { background: var(--bad); }
.toast[hidden] { display: none; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); max-width: 640px; margin: 0 auto; }
.save-bar { transform: translateY(110%); transition: transform .22s ease; }
.save-bar.show { transform: none; }

.topbar { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 8px; }
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-title strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.login-card { width: 100%; max-width: 420px; margin: 8vh auto 0; text-align: center; background: var(--surface); border-radius: 28px; padding: 36px 24px; box-shadow: var(--shadow); }
.login-art { width: 88px; height: 88px; margin: 0 auto 22px; border-radius: 26px; display: grid; place-items: center; background: var(--accent-soft); }
.login-art img { width: 60px; height: 60px; }
.login-card .btn { margin-top: 12px; }

.home-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.logo { height: 34px; }
:root[data-theme="dark"] .logo { filter: brightness(1.6) saturate(1.1); }
.hello { margin: 22px 0 18px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.empty-hero { background: var(--surface); border-radius: 28px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow); }
.empty-art { position: relative; height: 150px; margin: 0 auto 18px; max-width: 260px; }
.empty-art span { position: absolute; border-radius: 16px; background: var(--grad); }
.empty-art .b1 { inset: 10px 40px 40px 10px; opacity: .2; }
.empty-art .b2 { left: 40px; right: 20px; top: 30px; height: 26px; opacity: .9; }
.empty-art .b3 { left: 40px; width: 120px; top: 70px; height: 52px; background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line); }
.empty-hero h2 { font-size: 21px; }
.empty-hero p { font-family: ui-monospace, monospace; font-size: 14px; }

.site-list { display: grid; gap: 14px; }
.site-card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.site-card-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.site-avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.site-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.site-card-text strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card-stats { display: flex; gap: 16px; margin: 12px 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.site-card-stats span { display: inline-flex; align-items: center; gap: 6px; }
.site-card-stats .ico { width: 16px; height: 16px; }
.site-card-actions { display: flex; gap: 8px; }
.site-card-actions .btn { flex: 1; min-height: 42px; padding: 0 10px; font-size: 14.5px; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); flex: none; margin-left: 4px; }
.badge.published { background: rgba(18, 162, 107, .13); color: var(--ok); }
.badge.hidden, .badge.draft { background: rgba(234, 160, 0, .14); color: #b77b00; }
.badge.blocked { background: rgba(229, 72, 77, .13); color: var(--bad); }
.badge.best { background: var(--grad); color: #fff; }

.wiz-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0 10px; }
.wiz-bar { display: block; height: 100%; background: var(--grad); border-radius: 3px; transition: width .3s ease; }
.wiz-bar.step-0 { width: 14%; } .wiz-bar.step-1 { width: 28%; } .wiz-bar.step-2 { width: 43%; } .wiz-bar.step-3 { width: 57%; }
.wiz-bar.step-4 { width: 71%; } .wiz-bar.step-5 { width: 86%; } .wiz-bar.step-6 { width: 100%; }
.wiz-head { margin-bottom: 10px; font-weight: 700; }
.wiz-body h1 { margin-bottom: 6px; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice-grid.two { grid-template-columns: repeat(2, 1fr); }
.choice-list { display: grid; gap: 10px; margin-top: 16px; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 14px 8px; border-radius: 16px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow); text-align: center; transition: transform .12s, border-color .15s; }
.choice:active { transform: scale(.96); }
.choice.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.choice.row { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 72px; padding: 14px 16px; gap: 14px; }
.choice-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.choice-ico .ico { width: 24px; height: 24px; }
.choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-text strong { font-size: 14.5px; line-height: 1.25; }
.choice.row .choice-text strong { font-size: 16px; }
.style-sample { display: flex; gap: 4px; width: 100%; height: 42px; padding: 6px; border-radius: 10px; }
.style-sample i { flex: 1; border-radius: 6px; }
.style-serious { background: #eef2f8; } .style-serious i { background: #1e3a8a; } .style-serious i:nth-child(2) { background: #b8860b; flex: .4; } .style-serious i:nth-child(3) { background: #cbd5e1; }
.style-minimal { background: #fff; box-shadow: inset 0 0 0 1px #e5e5e5; } .style-minimal i { background: #111; flex: .2; } .style-minimal i:nth-child(2) { background: #e5e5e5; flex: 1; } .style-minimal i:nth-child(3) { background: #f4f4f4; }
.style-bright { background: linear-gradient(135deg, #1f6feb, #0ea5a4); } .style-bright i { background: rgba(255, 255, 255, .85); } .style-bright i:nth-child(2) { background: #fde047; }
.style-gentle { background: #fff6f8; } .style-gentle i { background: #f7c6d4; border-radius: 50%; } .style-gentle i:nth-child(2) { background: #e1306c; } .style-gentle i:nth-child(3) { background: #d8b4fe; }
.style-playful { background: #fffaf0; } .style-playful i { background: #f43f5e; border-radius: 12px 4px; } .style-playful i:nth-child(2) { background: #06b6d4; } .style-playful i:nth-child(3) { background: #facc15; }
.style-dark { background: #0b0f17; } .style-dark i { background: #141a26; box-shadow: inset 0 0 0 1px #38bdf8; } .style-dark i:nth-child(2) { background: #38bdf8; }

.palette-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.palette-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: 16px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 13.5px; }
.palette-card.selected { border-color: var(--accent); }
.swatch { display: flex; width: 100%; max-width: 92px; height: 34px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch i { flex: 1; }
.swatch.any { background: conic-gradient(#1f6feb, #0f9d77, #ea580c, #e1306c, #7c3aed, #1f6feb); }

.toggle-list { display: grid; gap: 8px; margin-top: 14px; }
.toggle-item { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; text-align: left; }
.toggle-item .check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s; flex: none; }
.toggle-item .check .ico { width: 16px; height: 16px; stroke-width: 3; }
.toggle-item.on .check { background: var(--accent); border-color: var(--accent); color: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; min-width: 0; }
.label { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; resize: none; font-size: 16px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.big { font-size: 19px; font-weight: 700; min-height: 56px; }
.input.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
textarea.input { line-height: 1.55; }
.domain-input { display: flex; align-items: stretch; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); overflow: hidden; }
.domain-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.domain-input .input { border: 0; box-shadow: none !important; min-width: 0; flex: 1; border-radius: 0; }
.domain-suffix { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font: 600 13px ui-monospace, monospace; white-space: nowrap; }
.sub-status { display: flex; align-items: center; gap: 6px; min-height: 22px; margin: 2px 0 0; font-weight: 700; color: var(--muted); }
.sub-status.ok { color: var(--ok); }
.sub-status.bad { color: var(--bad); }
.sub-status .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font: 600 14px ui-monospace, monospace; color: var(--accent); }
.chips.wrap .chip { font-family: inherit; color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff !important; }

.reco { display: grid; gap: 14px; margin: 16px 0; }
.reco-card { position: relative; display: block; width: 100%; padding: 0; border-radius: 22px; border: 2.5px solid transparent; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.reco-card.selected { border-color: var(--accent); }
.reco-frame { display: block; position: relative; height: 250px; overflow: hidden; background: var(--surface-2); pointer-events: none; }
.reco-frame iframe { position: absolute; top: 0; left: 0; width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; }
.reco-info { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.reco-info > span:first-child { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.reco-check { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.reco-card.selected .reco-check { display: grid; }
.reco-check .ico { stroke-width: 3; }

.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
.tpl-card { position: relative; border-radius: 16px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.tpl-card.selected { border-color: var(--accent); }
.tpl-pick { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.tpl-thumb { display: flex; flex-direction: column; gap: 6px; height: 112px; padding: 10px; background: var(--tb); }
.tpl-thumb i { display: block; border-radius: 4px; }
.tpl-thumb .t-hero { height: 30px; background: linear-gradient(135deg, var(--ta), var(--ta2)); border-radius: 6px; }
.tpl-thumb .t-line { height: 7px; width: 70%; background: var(--tt); opacity: .7; }
.tpl-thumb .t-line.short { width: 45%; opacity: .35; }
.tpl-thumb .t-cards { display: flex; gap: 5px; flex: 1; }
.tpl-thumb .t-cards b { flex: 1; border-radius: 5px; background: var(--ts); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .18); }
.tpl-thumb.lay-classic .t-hero { background: none; height: 22px; } .tpl-thumb.lay-classic .t-line { margin: 0 auto; }
.tpl-thumb.lay-minimal .t-hero { background: var(--tt); height: 8px; width: 40%; } .tpl-thumb.lay-minimal .t-cards b { background: none; box-shadow: inset 0 2px 0 var(--tt); border-radius: 0; }
.tpl-thumb.lay-bold .t-hero { height: 44px; }
.tpl-thumb.lay-card { background: color-mix(in srgb, var(--ta) 12%, var(--tb)); } .tpl-thumb.lay-card .t-cards b { box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }
.tpl-thumb.lay-split .t-hero { width: 55%; }
.tpl-thumb.lay-soft .t-hero { width: 34px; height: 34px; border-radius: 50%; margin: 0 auto; } .tpl-thumb.lay-soft .t-line { margin: 0 auto; } .tpl-thumb.lay-soft .t-cards b { border-radius: 10px; }
.tpl-thumb.lay-magazine .t-hero { background: var(--tt); height: 14px; width: 80%; } .tpl-thumb.lay-magazine .t-cards b:first-child { flex: 2; background: linear-gradient(135deg, var(--ta), var(--ta2)); }
.tpl-thumb.lay-dark .t-cards b { box-shadow: inset 0 0 0 1px var(--ta); }
.tpl-name { display: flex; flex-direction: column; padding: 10px 12px 12px; gap: 2px; }
.tpl-name strong { font-size: 15px; }
.tpl-name .small { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-eye { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .9); color: #1b1640; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.tpl-eye .ico { width: 18px; height: 18px; }

.created-card { text-align: center; padding-top: 6vh; }
.burst { position: relative; width: 120px; height: 120px; margin: 0 auto 22px; }
.burst-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--grad); opacity: .18; animation: ring 1.6s ease-out infinite; }
.burst-check { position: absolute; inset: 18px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 14px 30px rgba(109, 93, 252, .4); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.burst-check .ico { width: 44px; height: 44px; stroke-width: 3; }
@keyframes ring { from { transform: scale(.7); opacity: .35; } to { transform: scale(1.35); opacity: 0; } }
@keyframes pop { from { transform: scale(.3); } }
.url-pill { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 20px 0; padding: 14px 16px; border-radius: 14px; border: 1.5px dashed var(--accent); background: var(--accent-soft); color: var(--accent); font: 700 15px ui-monospace, monospace; word-break: break-all; }
.url-pill .ico { width: 18px; height: 18px; flex: none; }

.site-head { position: sticky; top: 0; z-index: 30; background: var(--bg); margin: -12px -16px 12px; padding: 12px 16px 0; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); margin-bottom: 8px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.tab .ico { width: 19px; height: 19px; }
.tab.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.block-list { display: grid; gap: 10px; }
.block-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; transition: opacity .15s; }
.block-card.is-hidden { opacity: .55; }
.block-card.open { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.block-head { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 0; }
.block-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 12px; border: 0; background: none; text-align: left; }
.block-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.block-title { display: flex; flex-direction: column; min-width: 0; }
.block-title strong { font-size: 15px; }
.block-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-tools { display: flex; }
@media (max-width: 380px) { .block-tools .tool { width: 32px; } }
.block-form { padding: 0 14px 16px; border-top: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .two-col { grid-template-columns: 1fr; } }
.items { display: grid; gap: 10px; margin-top: 14px; }
.item-row { position: relative; padding: 2px 12px 12px; border-radius: 14px; background: var(--surface-2); }
.item-row .input { background: var(--surface); }
.item-tools { display: flex; justify-content: flex-end; margin-top: 8px; }
.image-field img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; margin-bottom: 8px; }
.image-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 110px; border-radius: 14px; border: 2px dashed var(--line); background: var(--surface-2); color: var(--accent); font-weight: 700; }
.image-empty .ico { width: 28px; height: 28px; }
.gallery-edit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.g-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.g-tile img { width: 100%; height: 100%; object-fit: cover; }
.g-remove { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.g-remove .ico { width: 16px; height: 16px; }
.g-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface-2); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 12.5px; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); margin-top: 12px; }
.seg { flex: 1; min-height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; }
.seg.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.sheet-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 25, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.sheet-overlay.show { background: rgba(10, 8, 25, .5); }
.sheet { width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; background: var(--bg); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .9, .3, 1); padding-bottom: env(safe-area-inset-bottom); }
.sheet-overlay.show .sheet { transform: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; flex: none; }
.sheet-head strong { font-size: 18px; }
.sheet-head .icon-btn { box-shadow: none; background: var(--surface-2); }
.sheet-body { overflow-y: auto; padding: 4px 16px 20px; -webkit-overflow-scrolling: touch; }
.sheet-foot { position: sticky; bottom: -20px; padding: 12px 0 4px; background: var(--bg); }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.m-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.m-pick { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.m-pick img { width: 100%; height: 100%; object-fit: cover; }
.m-check { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .25); display: grid; place-items: center; color: transparent; }
.m-check .ico { width: 15px; height: 15px; stroke-width: 3; }
.m-tile.picked { box-shadow: inset 0 0 0 3px var(--accent); }
.m-tile.picked .m-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.m-del { position: absolute; bottom: 6px; right: 6px; width: 30px; height: 30px; border-radius: 9px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.m-del .ico { width: 15px; height: 15px; }

.modal.full { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; border-bottom: 1px solid var(--line); }
.modal-head strong { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-wrap { flex: 1; display: flex; justify-content: center; background: var(--surface-2); overflow: hidden; }
.preview-wrap iframe { width: 100%; max-width: 480px; height: 100%; border: 0; background: #fff; transition: max-width .25s; }
.preview-wrap.desktop iframe { max-width: 100%; }

.pad { display: block; }
.section-title { font-size: 17px; margin: 22px 0 8px; }
.pad > .section-title:first-child, .panel > .section-title:first-child { margin-top: 0; }
.color-row { margin-top: 8px; }
.color-input { width: 56px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: none; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 12px; }
.font-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.font-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 14px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.font-card.selected { border-color: var(--accent); color: var(--accent); }
.font-sample { font-size: 26px; color: var(--text); line-height: 1.1; }
.f-serif, .f-elegant { font-family: Georgia, 'Times New Roman', serif; }
.f-mono { font-family: ui-monospace, monospace; }
.f-rounded { font-family: 'Nunito', 'Arial Rounded MT Bold', system-ui, sans-serif; font-weight: 900; }
.f-bold { font-weight: 900; }
.f-grotesk { letter-spacing: -.04em; }

.post-list { display: grid; gap: 10px; margin-top: 16px; }
.post-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: var(--shadow); text-align: left; width: 100%; }
.post-row img, .post-ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.post-ph { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.post-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-row-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-small { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--accent); text-align: center; }
.empty-small .ico { width: 36px; height: 36px; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.title-input { font-size: 24px; font-weight: 800; border: 0; padding: 8px 2px; background: transparent; box-shadow: none !important; min-height: 0; }
.body-input { min-height: 260px; font-size: 16.5px; border-top-left-radius: 0; border-top-right-radius: 0; }
.toolbar { display: flex; gap: 2px; margin-top: 16px; padding: 4px; border-radius: 14px 14px 0 0; border: 1.5px solid var(--line); border-bottom: 0; background: var(--surface-2); overflow-x: auto; }
.toolbar + .input { margin-top: 0; }
.extra { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.extra summary { font-weight: 700; cursor: pointer; }
.danger-zone { margin-top: 22px; }

.panel { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.panel > .btn { margin-top: 14px; }
.panel .url-pill { margin: 0 0 12px; }
.danger-panel { box-shadow: 0 0 0 1.5px rgba(229, 72, 77, .25); }
.danger-panel .input { margin-top: 8px; }
.switch-row { display: flex; align-items: center; gap: 12px; }
.switch-row > span { flex: 1; display: flex; flex-direction: column; }
.switch { position: relative; width: 54px; height: 32px; border-radius: 999px; border: 0; background: var(--line); flex: none; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.on { background: var(--ok); }
.switch.on span { transform: translateX(22px); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-tile { background: var(--surface); border-radius: 14px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-tile strong { font-size: 20px; }
.stat-tile span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.admin-list, .report-list { display: grid; gap: 8px; margin-top: 12px; }
.admin-row { display: flex; align-items: center; gap: 4px; padding: 10px 6px 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.admin-row strong { font-family: ui-monospace, monospace; font-size: 14px; }
.admin .input[type="search"] { margin-top: 4px; }

@media (min-width: 560px) {
  .choice-grid { grid-template-columns: repeat(4, 1fr); }
  .palette-grid { grid-template-columns: repeat(4, 1fr); }
  .tpl-grid { grid-template-columns: repeat(3, 1fr); }
  .media-grid, .gallery-edit { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
