
/* Layout: grouped icon nav | top bar (search, drafts, server) | workspace. Calm neutrals so the user's own designs stay loudest. */
:root {
  --bg: #f4f4f6; --panel: #ffffff; --sunk: #ececf0; --line: #e2e2e8; --hover: #f0f0f4;
  --fg: #18181d; --muted: #6b6b78; --dim: #9a9aa6;
  --accent: #d6446e; --accent-soft: #fbe5ec; --sel: #3b82f6; --sel-soft: #e3eefe;
  --ok: #1f8a55; --ok-soft: #dff2e7; --warn: #a96a07; --warn-soft: #fbefd8; --bad: #c22f2f; --bad-soft: #f9e0e0;
  --canvas: #d9d9df; --chart: #d6446e; --chart-2: #9a9aa6;
  --f-ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-card: "Montserrat", "Onest", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #111114; --panel: #18181c; --sunk: #0d0d10; --line: #2a2a31; --hover: #202026;
  --fg: #ededf2; --muted: #9b9ba8; --dim: #6c6c78;
  --accent: #ef6a91; --accent-soft: #3b1a25; --sel: #60a5fa; --sel-soft: #15243a;
  --ok: #4fcf8b; --ok-soft: #14301f; --warn: #f0b24e; --warn-soft: #33270f; --bad: #f06a6a; --bad-soft: #3a1717;
  --canvas: #08080a; --chart: #ef6a91; --chart-2: #6c6c78; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #111114; --panel: #18181c; --sunk: #0d0d10; --line: #2a2a31; --hover: #202026;
  --fg: #ededf2; --muted: #9b9ba8; --dim: #6c6c78;
  --accent: #ef6a91; --accent-soft: #3b1a25; --sel: #60a5fa; --sel-soft: #15243a;
  --ok: #4fcf8b; --ok-soft: #14301f; --warn: #f0b24e; --warn-soft: #33270f; --bad: #f06a6a; --bad-soft: #3a1717;
  --canvas: #08080a; --chart: #ef6a91; --chart-2: #6c6c78; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14.5px/1.5 var(--f-ui); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
svg { display: block; }

.app { display: grid; grid-template-columns: 88px minmax(0, 1fr); height: 100%; }
.nav { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; padding-left: max(6px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 15px var(--f-card); margin-bottom: 8px; border: 0; flex: none; }
.ngap { height: 1px; width: 40px; background: var(--line); margin: 6px 0; flex: none; }
.nb { width: 76px; border: 0; background: none; border-radius: 10px; padding: 7px 2px 5px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; flex: none; position: relative; }
.nb svg { width: 21px; height: 21px; }
.nb:hover { background: var(--hover); color: var(--fg); }
.nb[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.nb .nbadge { position: absolute; top: 3px; right: 14px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #fff; font: 700 10px/16px var(--f-ui); padding: 0 4px; }

.work { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bar { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px 0 20px; padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); }
.bar h1 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; }
.bar .sp { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--sunk); border-radius: 8px; padding: 5px 10px; color: var(--dim); font-size: 13px; min-width: 240px; }
.search kbd { margin-left: auto; font: 500 11px var(--f-mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--panel); }
.draft { display: flex; align-items: center; gap: 8px; border: 1px solid var(--warn); background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 5px 10px; font-weight: 700; font-size: 13px; }
.draft[hidden] { display: none; }
.srv { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 10px; font-weight: 600; }
.srv i { width: 18px; height: 18px; border-radius: 5px; background: #b6435f; display: inline-block; }
.body { flex: 1; min-height: 0; overflow: auto; }
.page { padding-block: 22px 70px; padding-left: 24px; padding-right: max(24px, env(safe-area-inset-right, 0px)); max-width: 1200px; display: flex; flex-direction: column; gap: 18px; }
.proto { font-size: 12px; color: var(--dim); }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 7px 13px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.pad { padding: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.neu { background: var(--sunk); color: var(--muted); } .pill.sel { background: var(--sel-soft); color: var(--sel); }
h2 { margin: 0; font-size: 20px; text-wrap: balance; }
h3 { margin: 0; font-size: 15px; }
.lead { margin: 2px 0 0; color: var(--muted); max-width: 66ch; }
.hd { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.hd > div { flex: 1; min-width: 240px; }
select, input[type=text], input[type=number], input[type=time], textarea { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.switch { position: relative; width: 40px; height: 22px; border-radius: 11px; background: var(--line); border: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { left: 21px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--sunk); border-radius: 6px; padding: 1px 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.add { border-style: dashed; background: none; color: var(--accent); }
.rd { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list .it:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 180px; }
.list small { display: block; color: var(--muted); font-size: 13px; }
.sec { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin: 4px 0 -6px; }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td input, td select { padding: 4px 8px; }
.thumb { border-radius: 8px; background-size: cover; background-position: center; background-color: var(--sunk); }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 236px minmax(0, 1fr) 280px; height: 100%; min-height: 0; }
.ed-side { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.ed-side.r { border-right: 0; border-left: 1px solid var(--line); padding-right: env(safe-area-inset-right, 0px); }
.ed-sec { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ed-sec h4 { margin: 0; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.ed-sec h4 .sp { flex: 1; }
.tpl { display: flex; flex-direction: column; gap: 1px; }
.tpl button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 6px; text-align: left; font-weight: 600; color: var(--muted); font-size: 13.5px; }
.tpl button[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.tpl button:hover { background: var(--hover); }
.tpl small { margin-left: auto; font-size: 11px; color: var(--dim); font-weight: 500; }
.layers { display: flex; flex-direction: column; gap: 1px; }
.layer { display: flex; align-items: center; gap: 6px; border-radius: 6px; padding: 1px 4px 1px 0; }
.layer:hover { background: var(--hover); }
.layer[aria-selected="true"] { background: var(--sel-soft); }
.layer .ln { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; text-align: left; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer .ic { width: 16px; text-align: center; color: var(--dim); font: 600 11px var(--f-mono); flex: none; }
.layer .lb { border: 0; background: none; color: var(--dim); padding: 2px 4px; border-radius: 4px; font-size: 12px; line-height: 1; }
.layer .lb:hover { color: var(--fg); background: var(--panel); }
.layer .lb[aria-pressed="true"] { color: var(--accent); }
.layer.hid .ln { opacity: .4; }
.ed-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--canvas); }
.ed-tools { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tool { border: 1px solid transparent; background: none; border-radius: 6px; padding: 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tool:hover { background: var(--hover); color: var(--fg); }
.tool[aria-pressed="true"] { background: var(--sel-soft); color: var(--sel); }
.vsep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.lockbar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--sel-soft); color: var(--sel); font-size: 13px; font-weight: 600; }
.stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 28px; }
.art { position: relative; width: min(100%, 1100px); aspect-ratio: 1920 / 880; background-size: cover; border-radius: 10px; container-type: inline-size; box-shadow: 0 20px 60px rgba(0,0,0,.35); user-select: none; touch-action: none; overflow: hidden; }
.art.banner { aspect-ratio: 600 / 338; width: min(100%, 720px); background: radial-gradient(ellipse at 50% 0%, #33405e 0%, #0a0d15 65%); }
.art .guide { position: absolute; pointer-events: none; background: #ff3ea5; opacity: 0; }
.art .guide.v { top: 0; bottom: 0; width: 1px; left: 50%; } .art .guide.h { left: 0; right: 0; height: 1px; top: 50%; }
.art .guide.on { opacity: .9; }
.ly { position: absolute; cursor: grab; outline: 1px dashed transparent; outline-offset: 2px; white-space: nowrap; line-height: 1; color: #fff; }
.ly:hover { outline-color: rgba(96,165,250,.7); }
.ly.sel { outline: 2px solid var(--sel); }
.ly.locked { cursor: not-allowed; }
.ly.dragging { cursor: grabbing; }
.ly[hidden] { display: none; }
.ly.img { border-radius: 50%; background: linear-gradient(135deg, #8aa7d8, #3d4f7a); display: grid; place-items: center; color: rgba(255,255,255,.8); font: 600 1.2cqw var(--f-ui); }
.ly.c { transform: translateX(-50%); } .ly.r { transform: translateX(-100%); }
.ly .tag { position: absolute; left: 0; top: -1.9cqw; font: 600 max(10px, 0.95cqw) var(--f-ui); background: var(--sel); color: #fff; padding: 1px 5px; border-radius: 4px; display: none; white-space: nowrap; }
.ly.sel .tag { display: block; }
.ed-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.ed-foot .sp { flex: 1; }
.ed-foot input { max-width: 190px; }
.nudge { display: none; gap: 4px; }
.vars { display: flex; flex-wrap: wrap; gap: 5px; }
.var { border: 1px solid var(--line); background: var(--sunk); border-radius: 6px; padding: 2px 7px; font: 500 12px var(--f-mono); }
.var:hover { border-color: var(--accent); color: var(--accent); }
.colors { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--line); }
.sw[aria-pressed="true"] { border-color: var(--sel); }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.vers { display: flex; flex-direction: column; gap: 2px; }
.ver { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.ver:hover { background: var(--hover); }
.ver small { color: var(--dim); display: block; font-size: 11.5px; }
.ver .grow { flex: 1; min-width: 0; }

/* ---------- discord preview ---------- */
.dc { background: #313338; color: #dbdee1; border-radius: 12px; padding: 16px; display: flex; gap: 12px; }
.dc .av { width: 40px; height: 40px; border-radius: 50%; background: #b6435f; flex: none; }
.dc .nm { font-weight: 600; color: #f2f3f5; }
.dc .nm span { background: #5865f2; color: #fff; font-size: 10px; border-radius: 3px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.dc .nm time { color: #949ba4; font-size: 12px; font-weight: 400; margin-left: 6px; }
.embed { margin-top: 6px; background: #2b2d31; border-left: 4px solid var(--brand, #ec5f86); border-radius: 4px; padding: 10px 14px; max-width: 460px; }
.embed b { color: #f2f3f5; display: block; margin-bottom: 4px; }
.embed p { margin: 0; white-space: pre-wrap; font-size: 14px; }
.embed .img { margin-top: 10px; aspect-ratio: 2034 / 750; border-radius: 4px; background-size: cover; background-position: center; }
.dbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dbtn { border-radius: 4px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: #fff; background: #4e5058; border: 0; }
.dbtn.p { background: #5865f2; } .dbtn.g { background: #248046; } .dbtn.r { background: #da373c; }
.acwrap { position: relative; }
.ac { position: absolute; z-index: 5; left: 10px; top: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 4px; min-width: 220px; }
.ac button { display: flex; width: 100%; gap: 8px; border: 0; background: none; padding: 5px 8px; border-radius: 5px; font: 500 12.5px var(--f-mono); text-align: left; }
.ac button small { margin-left: auto; font: 400 12px var(--f-ui); color: var(--muted); }
.ac button:hover, .ac button.on { background: var(--sel-soft); }

/* ---------- commands ---------- */
.cgroup h3 { padding: 12px 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.cgroup h3 small { color: var(--muted); font-weight: 500; }
.cmd, .cmd-h { display: grid; grid-template-columns: 44px minmax(150px, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) 80px 34px; gap: 12px; align-items: center; padding: 9px 16px; }
.cmd { border-bottom: 1px solid var(--line); }
.cmd:last-child { border-bottom: 0; }
.cmd-h { padding-block: 7px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 700; }
.cmd .nm { font: 600 13.5px var(--f-mono); }
.cmd .nm small { display: block; font: 400 12.5px var(--f-ui); color: var(--muted); }
.cmd.off .nm, .cmd.off .who, .cmd.off .where { opacity: .45; }
.cmd .who, .cmd .where { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.cmd .cd { font: 500 12.5px var(--f-mono); color: var(--muted); }
.iconbtn { border: 0; background: none; border-radius: 6px; padding: 4px 6px; color: var(--muted); }
.iconbtn:hover { background: var(--hover); color: var(--fg); }

/* ---------- home ---------- */
.attn .it { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.attn .it:last-child { border-bottom: 0; }
.attn .grow { flex: 1; min-width: 200px; }
.attn small { display: block; color: var(--muted); font-size: 13px; }
.mark { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.mark.w { background: var(--warn); } .mark.s { background: var(--sel); }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat b { font: 700 22px/1.2 var(--f-card); font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; color: var(--dim); font-size: 12px; }
.chart text { fill: var(--muted); font: 500 11px var(--f-ui); }
.chart .grid { stroke: var(--line); }
.chart .bar { fill: var(--chart); }
.chart .bar.dim { fill: var(--chart-2); }
.chart .line { stroke: var(--chart); fill: none; stroke-width: 2.5; }
.chart .area { fill: var(--chart); opacity: .12; }
.chart .dotp { fill: var(--chart); }

/* ---------- automations ---------- */
.rule { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rule:last-child { border-bottom: 0; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.blk { border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
.blk.when { background: var(--sel-soft); color: var(--sel); border-color: transparent; }
.blk.if { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.blk.then { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.arrow { color: var(--dim); }
.builder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.step h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- map ---------- */
.mapr { display: grid; grid-template-columns: minmax(0, 1.2fr) 28px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.mapr:last-child { border-bottom: 0; }

/* overlays */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 10px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 9px; font-weight: 600; opacity: 0; transition: .2s; pointer-events: none; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.overlay { position: fixed; inset: 0; background: rgba(8,8,12,.55); z-index: 50; display: grid; place-items: start center; padding: 10vh 16px 16px; overflow-y: auto; }
.dialog { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.dialog .dh { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.dialog .db { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.dialog .df { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dialog > input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 15px 18px; font-size: 16px; }
.res { max-height: 52vh; overflow-y: auto; padding: 6px; }
.res .sec { margin: 10px 8px 4px; }
.res button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; }
.res button:hover { background: var(--hover); }
.res small { color: var(--muted); margin-left: auto; font-size: 12px; }
.diff { font: 13px/1.6 var(--f-mono); background: var(--sunk); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.diff .m { color: var(--bad); } .diff .p { color: var(--ok); }
.steps { display: flex; flex-direction: column; gap: 8px; }
.steps div { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.steps i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 700; flex: none; }


/* split layouts: list | editor | preview — collapse instead of overflowing */
.split3 { display: grid; grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.split3 > * { min-width: 0; }
.split2 { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; align-items: start; }
.split2 > * { min-width: 0; }
.work, .page { min-width: 0; }
.work { overflow-x: clip; }
.pick { display: flex; flex-direction: column; }
.pick button { border: 0; background: none; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.pick button:last-child { border-bottom: 0; }
.pick button[aria-current="true"] { background: var(--accent-soft); }
.pick small { display: block; color: var(--muted); font-size: 12.5px; }
.devsw { margin-left: auto; }
.dc.phone { max-width: 360px; }

/* editable rows (instead of wide tables) */
.erow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 140px 70px 44px; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.erow:last-child { border-bottom: 0; }
.erow.h { padding-block: 7px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 700; }
.erow .sold { color: var(--muted); font-variant-numeric: tabular-nums; }
.earn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.earn:last-child { border-bottom: 0; }
.earn small { display: block; color: var(--muted); font-size: 13px; }
.unit { display: flex; align-items: center; gap: 6px; }
.unit span { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* games */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.game .gh { display: flex; align-items: center; gap: 10px; }
.game .gh b { flex: 1; font-size: 15px; }
.gf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.edge { font-size: 13px; border-radius: 8px; padding: 8px 10px; background: var(--sunk); }
.edge b { font-variant-numeric: tabular-nums; }
.edge.bad { background: var(--bad-soft); color: var(--bad); }
.edge.ok { background: var(--ok-soft); color: var(--ok); }

/* mobile "more" sheet */
.nb.more { display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-radius: 16px 16px 0 0; padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sheet .nb { width: auto; padding: 12px 4px; }
.sheet h4 { grid-column: 1 / -1; margin: 0 0 4px; font-size: 13px; color: var(--muted); }

@media (max-width: 1200px) {
  .split3 { grid-template-columns: 220px minmax(0, 1fr); }
  .split3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .split2 { grid-template-columns: minmax(0, 1fr); }
  .games { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .split3 { grid-template-columns: minmax(0, 1fr); }
  .split3 > :last-child { grid-column: auto; }
  .pick { flex-direction: row; overflow-x: auto; }
  .pick button { border-bottom: 0; border-right: 1px solid var(--line); white-space: nowrap; flex: none; }
  .erow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .erow > b { grid-column: 1 / -1; }
  .erow .sold, .erow.h { display: none; }
  .earn { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .gf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { justify-content: space-around; overflow-x: visible; }
  .nav .nb.second { display: none; }
  .nav .nb.more { display: flex; }
  .nb { flex: 1; width: auto; min-width: 0; }
}

.sandbar { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 20px; padding-right: max(20px, env(safe-area-inset-right, 0px)); background: var(--sel-soft); color: var(--sel); font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.sandbar[hidden] { display: none; }
.sandbtn { border: 1px solid var(--line); }
@media (max-width: 760px) { .sandbtn span { display: none; } .sandbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 1200px) {
  .editor { grid-template-columns: 220px minmax(0, 1fr); height: auto; } .ed-side.r { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .cmd, .cmd-h { grid-template-columns: 44px minmax(0, 1fr) 34px; } .cmd .who, .cmd .where, .cmd .cd, .cmd-h .hide { display: none; }
  .g3, .builder { grid-template-columns: minmax(0, 1fr); }
  .search span, .search kbd { display: none; } .search { min-width: 0; }
  .mapr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mapr .arrow { display: none; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: auto; min-height: 100%; }
  .nav { grid-row: 2; position: sticky; bottom: 0; flex-direction: row; justify-content: flex-start; border-right: 0; border-top: 1px solid var(--line); padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); z-index: 5; overflow-x: auto; overflow-y: hidden; }
  .logo, .ngap { display: none; }
  .nb { width: 66px; }
  .bar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); gap: 6px; }
  .bar h1 { font-size: 15px; }
  .srv span, .draft span { display: none; }
  .body { overflow: visible; }
  .page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .ed-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-side.l { order: 2; } .ed-main { order: 1; } .ed-side.r { order: 3; }
  .stage { padding: 14px; }
  .nudge { display: flex; }
  .g2, .g4, .ff { grid-template-columns: minmax(0, 1fr); }
  .rule { grid-template-columns: 44px minmax(0, 1fr); } .rule > .row { grid-column: 2; }
}

/* ---- real app additions ---- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.login .card { max-width: 400px; width: 100%; padding: 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login .logo { margin: 0 auto; width: 52px; height: 52px; font-size: 19px; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; padding: 10px 16px; font-size: 15px; }
.soon { padding: 28px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.soon ul { margin: 0; padding-left: 20px; color: var(--muted); }
.nb .soonmark { position: absolute; top: 4px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.logs { background: #0d0c11; color: #d9d5e3; font: 12.5px/1.65 var(--f-mono); border-radius: 0 0 12px 12px; padding: 12px 16px; overflow: auto; max-height: 62vh; min-height: 240px; }
.logs .ln { white-space: pre-wrap; word-break: break-word; }
.logs .t { color: #77728a; } .logs .b { color: #ec8fab; } .logs .e { color: #f06a6a; } .logs .w { color: #f0b24e; }
.logs-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.logs-tools select, .logs-tools input { width: auto; }
.logs-tools input { flex: 1; min-width: 160px; }
.empty { padding: 22px 16px; color: var(--muted); text-align: center; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.meter { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter i.hi { background: var(--warn); }
.botgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bot { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.bot .top { display: flex; align-items: center; gap: 10px; }
.bot .top .grow { flex: 1; min-width: 0; }
.bot .top small { display: block; color: var(--muted); font-size: 12.5px; }
.sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.sdot.bad { background: var(--bad); } .sdot.warn { background: var(--warn); }
.me-chip { display: flex; align-items: center; gap: 8px; }
.me-chip img, .me-chip .ph { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); }
@media (max-width: 860px) { .botgrid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* рамки слоёв поверх настоящей картинки от бота */
.ly.box { transform: none; border-radius: 4px; background: transparent; }
.ly.box:hover { outline: 1px dashed rgba(96,165,250,.8); background: rgba(96,165,250,.06); }
.ly.box.sel { outline: 2px solid var(--sel); background: rgba(96,165,250,.08); }
.ly.box .tag { top: auto; bottom: 100%; margin-bottom: 3px; font-size: 11px; }
#artImg { pointer-events: none; user-select: none; }
.art { background: #000; }
