:root {
  --bg: #f4f4f1;
  --panel: #ffffff;
  --ink: #15171c;
  --muted: #6b7079;
  --line: #e4e4df;
  --soft: #f6f6f3;
  --accent: #2f54eb;
  --accent-ink: #ffffff;
  --danger: #d4380d;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .06);
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013;
    --panel: #17191e;
    --ink: #eceef2;
    --muted: #9298a3;
    --line: #2a2d34;
    --soft: #1e2026;
    --accent: #6b8cff;
    --accent-ink: #0b0d12;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }

/* ---- top bar ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.top-actions { display: flex; align-items: center; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.add { width: 100%; justify-content: center; border-style: dashed; padding: 10px; margin-top: 8px; color: var(--muted); }
.btn.add:hover { color: var(--ink); border-color: var(--muted); }
.btn:disabled { opacity: .6; cursor: progress; }
.chev { font-size: 10px; opacity: .7; }

.menu { position: relative; }
.menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.menu-pop.right { left: auto; right: 0; }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: var(--soft); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 10px; }

/* ---- layout ---- */
.app { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 7px var(--panel-w, 400px); min-height: 0; }
.stage { position: relative; padding: 52px 24px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; }
.canvas-wrap { width: 100%; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.canvas { box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; line-height: 0; }
.canvas svg { display: block; width: 100%; height: auto; }
.canvas.transparent { background: repeating-conic-gradient(#e7e7e7 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.stage-note { color: var(--muted); font-size: 12px; margin: 12px 0 0; min-height: 1em; text-align: center; max-width: 640px; }

.panel { background: var(--panel); overflow-y: auto; padding: 0 18px 32px; }
.tabs { display: flex; gap: 4px; position: sticky; top: 0; background: var(--panel); padding: 12px 0 10px; z-index: 5; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.tab { flex: 1; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--soft); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=search], textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; min-height: 54px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.range { display: flex; align-items: center; gap: 8px; height: 38px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { width: 40px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- events ---- */
.events-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 20px; }
.events-head h3 { margin: 0; }
.count { color: var(--muted); font-weight: 500; }
.hint { color: var(--muted); font-size: 11.5px; }
.events { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.ev { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; background: var(--panel); display: grid; grid-template-columns: 44px 1fr; gap: 8px 10px; }
.ev.dragging { opacity: .5; }
.ev-icon {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.ev-icon:hover { border-color: var(--muted); }
.ev-icon svg { width: 22px; height: 22px; }
.ev-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ev-row { display: flex; gap: 6px; }
.ev-row input { padding: 6px 8px; }
.ev-date { flex: 1; min-width: 0; }
.ev-title { font-weight: 600; }
.ev-desc { padding: 6px 8px; min-height: 44px; font-size: 13px; }
.ev-tools { grid-column: 1 / -1; display: flex; align-items: center; gap: 2px; margin-top: -2px; }
.ev-tools .sp { flex: 1; }
.tool { border: 0; background: none; padding: 5px 7px; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.tool:hover { background: var(--soft); color: var(--ink); }
.tool.danger:hover { color: var(--danger); }
.tool svg { width: 15px; height: 15px; }
.handle { cursor: grab; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; position: relative; overflow: hidden; }
.swatch.auto { background: conic-gradient(#f97316, #ec4899, #8b5cf6, #0ea5e9, #10b981, #f97316); }
.swatch input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; width: 30px; height: 30px; }

/* ---- pickers ---- */
.layout-grid, .theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick { border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); padding: 6px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.pick:hover { border-color: var(--muted); }
.pick.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.pick .thumb { border-radius: 6px; overflow: hidden; line-height: 0; border: 1px solid var(--line); }
.pick .thumb svg { width: 100%; height: auto; display: block; }
.pick b { font-size: 13px; font-weight: 600; padding: 0 2px; }
.pick small { display: block; color: var(--muted); font-size: 11.5px; padding: 0 2px 2px; line-height: 1.3; }
.theme-card { border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); }
.theme-dots { display: flex; gap: 4px; }
.theme-dots i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.theme-name { font-weight: 700; font-size: 13px; }

.seg { display: inline-flex; background: var(--soft); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: nowrap; }
.seg.wrap { flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 9px; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.seg button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.opt > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---- icon dialog ---- */
.icon-dialog { border: 0; padding: 0; border-radius: 14px; width: min(640px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 40px)); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.icon-dialog::backdrop { background: rgb(0 0 0 / .35); }
.icon-dialog-inner { display: flex; flex-direction: column; max-height: min(640px, calc(100vh - 40px)); }
.icon-dialog-head, .icon-dialog-foot { display: flex; gap: 8px; align-items: center; padding: 12px; }
.icon-dialog-head { border-bottom: 1px solid var(--line); }
.icon-dialog-foot { border-top: 1px solid var(--line); justify-content: space-between; }
.icon-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; flex-shrink: 0; }
.icon-chips::-webkit-scrollbar { display: none; }
.icon-chips button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; white-space: nowrap; cursor: pointer; color: var(--muted); }
.icon-chips button:hover { color: var(--ink); border-color: var(--muted); }
.icon-chips button.active { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.icon-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; padding: 12px; }
.icon-grid button { aspect-ratio: 1; border: 1px solid transparent; background: none; border-radius: 9px; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.icon-grid button:hover { background: var(--soft); border-color: var(--line); }
.icon-grid button.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.icon-grid svg { width: 24px; height: 24px; }
.icon-grid .more { grid-column: 1 / -1; aspect-ratio: auto; color: var(--muted); font-size: 12px; padding: 8px; cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-weight: 500; transition: .2s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- mobile ---- */
@media (max-width: 860px) {
  body { display: block; height: auto; }
  .app { display: block; }
  .stage { padding: 16px; position: sticky; top: 53px; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
  .stage-note { display: none; }
  .panel { border-left: 0; padding: 0 16px 40px; overflow: visible; }
  .tabs { top: auto; position: relative; }
  .top { padding: 8px 12px; }
  .brand span { display: none; }
  .btn { padding: 7px 10px; }
}
@media (max-width: 380px) {
  .layout-grid, .theme-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .opt { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---- guided mode ---- */
.guide-btn { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); font-weight: 600; }
.guide-btn:hover { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }

.guide { border: 0; padding: 0; border-radius: 18px; width: min(1180px, calc(100vw - 32px)); height: min(780px, calc(100vh - 32px)); max-width: none; max-height: none; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgb(0 0 0 / .3); overflow: hidden; }
.guide::backdrop { background: rgb(10 12 18 / .55); backdrop-filter: blur(3px); }
.guide-inner { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.guide-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line); }
.guide-dots { display: flex; gap: 6px; flex: 1; }
.guide-dots button { flex: 1; max-width: 64px; height: 6px; border-radius: 99px; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.guide-dots button.done { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.guide-dots button.on { background: var(--accent); }
.guide-stepno { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.guide-main { display: grid; grid-template-columns: minmax(0, 1fr) 460px; min-height: 0; }
.guide-preview-wrap { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 28px; min-height: 0; }
.guide-preview { position: relative; width: 100%; max-height: 100%; line-height: 0; box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; display: flex; justify-content: center; }
.guide-preview svg { width: 100%; height: auto; max-height: calc(min(780px, 100vh - 32px) - 190px); display: block; }
.guide-preview.transparent { background: repeating-conic-gradient(#e7e7e7 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.guide-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.guide-panel h2 { margin: 22px 24px 4px; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.guide-sub { margin: 0 24px 6px; color: var(--muted); font-size: 13.5px; }
.guide-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.guide-body h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; font-weight: 600; }
.guide-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.guide-foot .sp { flex: 1; }
.guide-foot .btn.primary { min-width: 110px; justify-content: center; }

.g-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.g-card { text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.g-card:hover { border-color: var(--muted); }
.g-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.g-card b { font-size: 14px; }
.g-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.g-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.g-format { align-items: flex-start; }
.g-shape { height: 64px; display: flex; align-items: center; margin-bottom: 6px; }
.g-shape i { display: block; border: 2px solid currentColor; border-radius: 4px; color: var(--muted); background: var(--soft); }
.g-format.active .g-shape i { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.g-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.g-badge { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); vertical-align: 1px; }
.g-badge.soft { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.g-gap { margin-top: 14px; }
.g-events { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gev { display: grid; grid-template-columns: 18px 44px 1fr auto; gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.gev-n { color: var(--muted); font-size: 12px; font-weight: 700; padding-top: 13px; text-align: center; }
.gev-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gev-fields input { padding: 6px 8px; }
.gev .tool { margin-top: 8px; }
.g-done { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 10px; }
.g-done .g-big { justify-content: center; padding: 14px; font-size: 15px; }
.g-done .hint { text-align: center; margin-top: -4px; }
.g-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.g-row .btn { justify-content: center; }

@media (max-width: 860px) {
  .guide { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .guide-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .guide-preview-wrap { padding: 12px 16px; max-height: 32vh; }
  .guide-preview svg { max-height: calc(32vh - 24px); }
  .guide-panel { border-left: 0; border-top: 1px solid var(--line); }
  .guide-panel h2 { margin: 14px 16px 2px; font-size: 19px; }
  .guide-sub { margin: 0 16px 4px; }
  .guide-body { padding: 6px 16px 16px; }
  .guide-btn span { display: none; }
  .guide-head { padding: 10px 10px 10px 16px; }
  .guide-dots button { max-width: none; }
  .guide-foot .btn.primary { min-width: 0; }
}
@media (max-width: 420px) {
  .g-cards, .g-formats { grid-template-columns: 1fr; }
}
.guide-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.4; }
.guide .toast { bottom: 84px; }

/* ---- layout explorer ---- */
.ex-open-wide { width: 100%; justify-content: center; margin: 14px 0 4px; padding: 10px; font-weight: 600; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.ex-open-wide:hover { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.explorer { border: 0; padding: 0; border-radius: 18px; width: min(1400px, calc(100vw - 32px)); height: calc(100vh - 32px); max-width: none; max-height: none; background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgb(0 0 0 / .3); overflow: hidden; }
.explorer::backdrop { background: rgb(10 12 18 / .55); backdrop-filter: blur(3px); }
.explorer-inner { display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100%; }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 4px 28px; background: var(--panel); }
.ex-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.ex-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.ex-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 28px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ex-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-cats button { white-space: nowrap; flex-shrink: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-weight: 500; color: var(--muted); font-size: 13px; }
.ex-cats button span { opacity: .6; margin-left: 2px; font-variant-numeric: tabular-nums; }
.ex-cats button:hover { color: var(--ink); border-color: var(--muted); }
.ex-cats button.active { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.ex-theme { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ex-theme select { width: auto; padding: 6px 10px; }
.ex-grid { overflow-y: auto; min-height: 0; padding: 24px 28px 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); grid-auto-rows: max-content; gap: 20px; align-content: start; }
.ex-card { min-width: 0; position: relative; text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: 14px; padding: 0; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ex-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--muted); }
.ex-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.ex-thumb { flex-shrink: 0; line-height: 0; border-bottom: 1px solid var(--line); background: var(--soft); display: flex; justify-content: center; min-height: 120px; }
.ex-thumb svg { width: 100%; height: auto; max-height: 340px; display: block; }
.ex-meta { padding: 12px 14px 14px; }
.ex-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ex-name b { font-size: 15px; margin-right: 2px; }
.ex-name .g-badge { margin-left: 0; }
.ex-current { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.ex-meta p { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.ex-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-tags span { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--soft); color: var(--muted); }
.ex-use { position: absolute; top: 10px; right: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 12.5px; padding: 6px 11px; border-radius: 8px; opacity: 0; transform: translateY(-4px); transition: .15s; pointer-events: none; }
.ex-card:hover .ex-use, .ex-card:focus-visible .ex-use { opacity: 1; transform: none; }
@media (max-width: 860px) {
  .explorer { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .ex-head { padding: 14px 10px 2px 16px; }
  .ex-head h2 { font-size: 20px; }
  .ex-bar { padding: 10px 16px 12px; }
  .ex-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .ex-grid { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 30px; gap: 14px; }
  .ex-btn span { display: none; }
  .ex-use { display: none; }
}
.theme-grid .theme-group, .g-thumbs .theme-group { grid-column: 1 / -1; margin: 10px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

/* ---- preview size + resizable editor ---- */
.zoombar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; box-shadow: 0 1px 2px rgb(0 0 0 / .05); z-index: 2; }
.zb { border: 0; background: none; min-width: 30px; height: 28px; border-radius: 7px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; }
.zb:hover { background: var(--soft); }
.zb:disabled { opacity: .35; cursor: default; background: none; }
.zb-txt { font-size: 12.5px; font-weight: 500; }
.zb.on { background: var(--soft); color: var(--accent); }
.zb-val { min-width: 44px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.zb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.splitter { position: relative; cursor: col-resize; background: var(--panel); border-left: 1px solid var(--line); touch-action: none; }
.splitter::after { content: ""; position: absolute; top: 50%; left: 1px; width: 3px; height: 36px; transform: translateY(-50%); border-radius: 3px; background: var(--line); }
.splitter:hover::after, .splitter:focus-visible::after, body.resizing .splitter::after { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
.panel.wide .events { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
.panel.wide .layout-grid, .panel.wide .theme-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.panel.wide .theme-grid .theme-group { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .splitter, .zb-sep, #wideEditor { display: none; }
  .stage { padding-top: 50px; }
  .zoombar { top: 8px; }
}
.lbl-short { display: none; }
@media (max-width: 480px) {
  .top { gap: 6px; }
  .top-actions { gap: 2px; }
  .top .btn { padding: 7px 8px; }
  .top .chev { display: none; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
}

/* ---- share link ---- */
.share-dialog { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgb(0 0 0 / .3); }
.share-dialog::backdrop { background: rgb(10 12 18 / .45); }
.share-inner { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.share-head { display: flex; gap: 12px; align-items: flex-start; }
.share-ic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.share-head h2 { margin: 0; font-size: 19px; }
.share-head p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.share-notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.share-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.share-foot .sp { flex: 1; }
@media (max-width: 860px) { .share-btn span { display: none; } }
@media (max-width: 480px) { .share-btn { display: none; } }

/* ---- privacy, credits & licenses ---- */
.stage-links { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.linkish { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
.linkish:hover { color: var(--ink); }
.about-dialog { border: 0; padding: 0; border-radius: 16px; width: min(760px, calc(100vw - 24px)); height: min(820px, calc(100vh - 40px)); max-height: none; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgb(0 0 0 / .3); }
.about-dialog::backdrop { background: rgb(10 12 18 / .45); }
.about-inner { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.about-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 12px 24px; border-bottom: 1px solid var(--line); }
.about-head h2 { margin: 0; font-size: 19px; }
.about-body { overflow-y: auto; padding: 4px 24px 28px; position: relative; }
.about-body h3 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); margin: 22px 0 10px; }
.about-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.about-list code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.about-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.about-row { display: grid; grid-template-columns: 1fr minmax(180px, 34%); gap: 12px; padding: 10px 12px; font-size: 13px; }
.about-row + .about-row { border-top: 1px solid var(--line); }
.about-lic { font-size: 12.5px; }
.about-body a { color: var(--accent); }
.about-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.about-font { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.about-font b { font-size: 15px; font-weight: 400; }
.about-small { font-size: 12px; margin-top: 16px; }
@media (max-width: 860px) {
  .stage-links { display: none; }
  .about-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .about-row { grid-template-columns: 1fr; gap: 4px; }
}
.about-made { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 12px; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); font-size: 13.5px; }
.about-made dl { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin: 10px 0 0; }
.about-made dt { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.about-made dd { margin: 0; }
.auto-icons { display: inline-flex; gap: 10px; margin-left: auto; margin-right: 10px; font-size: 12px; }
.auto-icons .linkish { color: var(--accent); text-decoration: none; font-weight: 600; }
.auto-icons .linkish:hover { text-decoration: underline; }
.events-head { flex-wrap: wrap; }
.icon-grid .more:first-child { grid-column: 1 / -1; aspect-ratio: auto; }
