/*
 * WebLab: the tool's own components, styled in the site's design language (11 Nov 2026, on the UltraCompress Pro template,
 * after HandWritten, whose shared block the first part of this file follows). Base: /libs/site-pages.css (tokens, Inter
 * and Space Grotesk, theme toggle, focus rings) and /libs/shared-nav.css (the site's header and footer). The second part
 * is the original's components (the live editor's bar, code boxes, page and console; Minify and Format; Many files; the
 * menus and windows) on the site's tokens. The scripts build their parts with the original's class names (btn, seg, pill,
 * ce, proj-row, tpl ...) and the code boxes take their colours from the CSS variables below (--ed-*, --hl-*), so those
 * names are kept. Light is the default; dark applies when <html> has no data-theme. Written once from HandWritten's file
 * and the original's style.css, then edited by hand: the source.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --bad: #b91c1c;
    --warn: #92400e;
    --info: #1d4ed8;
    --ok-soft: rgba(22, 101, 52, 0.08);
    --bad-soft: rgba(185, 28, 28, 0.07);
    --warn-soft: rgba(217, 119, 6, 0.1);
    --info-soft: rgba(29, 78, 216, 0.08);
    --head: 81px;              /* the site's header */
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --check-a: #ffffff;        /* the chequered stage around a page shown at a device size */
    --check-b: #eef0f4;
    /* the code boxes (editor.js reads these) */
    --ed-bg: #ffffff;
    --ed-gutter: #f7f8fa;
    --ed-line: #f4f2fd;
    --ed-sel: #ddd6fe;
    --ed-num: #636b78;
    --hl-kw: #c2185b;
    --hl-str: #0a3069;
    --hl-num: #0550ae;
    --hl-cm: #5f6873;
    --hl-tag: #116329;
    --hl-attr: #6639ba;
    --hl-prop: #0550ae;
    --hl-fn: #7a3fcf;
    --hl-var: #953800;
    --hl-type: #953800;
    --hl-punc: #57606a;
    --hl-bad: #cf222e;
    /* the original's names, used by the scripts and the code boxes */
    --panel: var(--surface);
    --panel-2: var(--surface-2);
    --border: var(--line);
    --border-strong: var(--line-strong);
    --muted: var(--text-2);
    --faint: var(--text-3);
    --lab: var(--brand);
    --lab-ink: #ffffff;
    --lab-soft: var(--tint-brand);
    --accent-soft: var(--surface-2);
    --good: var(--ok);
    --shadow: var(--surface-shadow);
    --focus: var(--brand);
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --info: #93c5fd;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad-soft: rgba(248, 113, 113, 0.12);
    --warn-soft: rgba(251, 191, 36, 0.1);
    --info-soft: rgba(147, 197, 253, 0.1);
    --check-a: #1a1a26;
    --check-b: #12121b;
    --ed-bg: #101019;
    --ed-gutter: #14141f;
    --ed-line: #1b1b2a;
    --ed-sel: #3b2f6b;
    --ed-num: #8b93a1;
    --hl-kw: #ff7b72;
    --hl-str: #a5d6ff;
    --hl-num: #79c0ff;
    --hl-cm: #8b949e;
    --hl-tag: #7ee787;
    --hl-attr: #d2a8ff;
    --hl-prop: #79c0ff;
    --hl-fn: #d2a8ff;
    --hl-var: #ffa657;
    --hl-type: #ffa657;
    --hl-punc: #a8b0bc;
    --hl-bad: #ff7b72;
}
@media (max-width: 639.98px) { :root { --head: 65px; } }

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden], body > [hidden] { display: none !important; } /* the scripts hide parts that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hint { color: var(--text-3); font-size: 0.82rem; font-weight: 400; line-height: 1.45; margin: 0; }
.hint:empty { display: none; }
.muted { color: var(--text-2); margin: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.center { justify-content: center; }
.actions.end { justify-content: flex-end; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
code { font-family: var(--mono); font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); border-bottom-width: 2px; background: var(--chip); color: var(--text-strong); }

/* ----- Buttons (the scripts' class names: btn, primary, ghost, danger, big, small-btn, icon-btn) ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 1px solid var(--surface-border); border-radius: 9999px; background: var(--surface); color: var(--text-strong); font-family: inherit; font-weight: 600; font-size: 0.925rem; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn .ico { width: 17px; height: 17px; }
.btn:hover:not([disabled]) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn.primary, .btn.big, .btn.run-btn { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn.primary:hover:not([disabled]), .btn.big:hover:not([disabled]), .btn.run-btn:hover:not([disabled]) { color: #fff; border-color: transparent; box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); }
.btn.big { min-height: 52px; padding: 12px 26px; font-size: 1rem; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not([disabled]) { border-color: var(--surface-border); }
.btn.danger { color: var(--danger); border-color: rgba(185, 28, 28, 0.35); }
.btn.danger:hover:not([disabled]) { background: var(--danger-strong); color: #fff; border-color: transparent; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn .chev { width: 14px; height: 14px; margin-left: -2px; }
.btn.small-btn, .small-btn { min-height: 36px; padding: 6px 14px; font-size: 0.85rem; gap: 6px; }
.small-btn .ico { width: 16px; height: 16px; }
.run-btn .ico { fill: currentColor; stroke-width: 1.5; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--surface-border); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; color: var(--text-strong); flex: none; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover:not([disabled]) { border-color: var(--brand); color: var(--link); }
.icon-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.icon-btn[aria-pressed="true"] { background: var(--tint-brand); border-color: var(--tint-brand-border); color: var(--link); }
.icon-btn.small { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.small .ico { width: 16px; height: 16px; }
.icon-btn:focus-visible, .link:focus-visible, .btn:focus-visible, .link-btn:focus-visible, .ce-loc:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar: the four tools as pill tabs ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.view-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab .ico { width: 16px; height: 16px; }
.view-tab:hover { color: var(--link); }
.view-tab[aria-current="page"] { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.shell-hint { margin-top: 18px; color: var(--text-3); font-size: 0.85rem; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field.end { justify-content: flex-end; }
.fields { display: flex; flex-direction: column; gap: 16px; }
.label { font-weight: 600; font-size: 0.875rem; color: var(--text-strong); }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.select { width: auto; max-width: 100%; cursor: pointer; }
.small-sel { min-height: 36px; padding: 5px 12px; font-size: 0.85rem; border-radius: 9999px; }
.input.tiny { width: 4.6rem; min-height: 34px; padding: 4px 8px; font-size: 0.875rem; text-align: right; font-variant-numeric: tabular-nums; border-radius: 10px; }
textarea.input { min-height: 72px; resize: vertical; line-height: 1.4; }
.times { color: var(--text-2); }
.check-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.check-row small { display: block; color: var(--text-3); font-size: 0.82rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; align-self: flex-start; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover:not([disabled]) { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"], .seg button[aria-checked="true"]:hover:not([disabled]) { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg button .sub { font-weight: 500; font-size: 0.78rem; opacity: 0.85; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; padding: 1px 9px; border-radius: 9999px; background: var(--tint-brand); color: var(--link); }
.pill:empty { display: none; }
.pill.good { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
/* the sliding switches (Auto, Live): the input is invisible, the track shows the state */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--text-strong); user-select: none; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.2s ease; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.switch input:checked + .switch-track { background: var(--gradient-brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 2px solid currentColor; font-size: 0.9rem; margin: 0; }
.note > span { color: var(--text); flex: 1; min-width: 12rem; }
.note.bad { color: var(--bad); }
.note.warn { color: var(--warn); }
.note.info { color: var(--info); }

/* ----- The three screens ----- */
.screen { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.head-text h2 { margin: 0; font-size: 1.5rem; }
.lead { color: var(--text-2); max-width: 80ch; margin: 0; }

/* ----- Live editor ----- */
.play { gap: 12px; min-height: 560px; height: calc(100vh - var(--head) - 48px); height: calc(100dvh - var(--head) - 48px); max-height: 1100px; }
.bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.bar-group { gap: 6px; }
.bar-end { margin-left: auto; gap: 6px; }
.bar .btn.ghost { padding-left: 12px; padding-right: 12px; }
.proj-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--surface-border); border-radius: 9999px; background: var(--surface); color: var(--text-strong); font-family: inherit; font-weight: 700; font-size: 0.95rem; max-width: 22rem; min-width: 0; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.proj-btn:hover { border-color: var(--brand); color: var(--link); }
.proj-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.proj-btn .chev { width: 14px; height: 14px; color: var(--text-2); }
.proj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved { font-size: 0.78rem; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.layout-seg { gap: 4px; }
.layout-seg button { min-width: 40px; padding: 5px 9px; }
.bar-narrow { display: none; }
@media (max-width: 1199px) {
    .bar-wide .btn span { display: none; }
    .bar-wide .btn .chev { display: none; }
    .bar-wide .btn { min-width: 44px; padding: 0 12px; }
}
@media (max-width: 899px) {
    .bar-wide { display: none; }
    .bar-narrow { display: inline-grid; }
}
@media (min-width: 760px) and (max-width: 1099px) {
    .play .ws[data-layout="side"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(140px, var(--code-h, 42%)) 10px minmax(220px, 1fr); }
    .play .ws[data-layout="side"] > .split { cursor: row-resize; }
    .play .ws[data-layout="side"] > .split::after { width: 40px; height: 4px; margin: -2px 0 0 -20px; }
    .layout-seg { display: none; }
}
@media (max-width: 759px) {
    .bar { gap: 8px; flex-wrap: nowrap; }
    .layout-seg, #settingsBtn { display: none; }
    .proj-btn { max-width: 9rem; }
    .proj-btn .saved { display: none; }
}
@media (max-width: 420px) {
    .proj-btn { max-width: 7.5rem; }
    .play-bar .switch > span:last-child { display: none; }
    .btn.run-btn { padding-left: 14px; padding-right: 16px; }
}

.ws { display: grid; gap: 0; width: 100%; flex: 1; min-height: 0; }
.ws[data-layout="side"] { grid-template-columns: minmax(240px, var(--code-w, 1fr)) 10px minmax(240px, 1fr); }
.ws[data-layout="stack"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(140px, var(--code-h, 42%)) 10px minmax(220px, 1fr); }
.ws.page-only { display: flex; }
.ws.page-only > .view-pane { flex: 1; }
.ws.page-only .code-pane, .ws.page-only > .split { display: none; }
.pane { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.split { cursor: col-resize; position: relative; touch-action: none; }
.split::after { content: ""; position: absolute; top: 50%; left: 50%; width: 4px; height: 40px; margin: -20px 0 0 -2px; border-radius: 2px; background: var(--line-strong); }
.split:hover::after, .split:focus-visible::after, .split.dragging::after { background: var(--brand); }
.split:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 6px; }
.ws[data-layout="stack"] > .split { cursor: row-resize; }
.ws[data-layout="stack"] > .split::after { width: 40px; height: 4px; margin: -2px 0 0 -20px; }
.pane-tabs { display: flex; align-items: center; gap: 2px; padding: 4px 4px 0; border-bottom: 1px solid var(--line); background: var(--surface-2); min-height: 46px; overflow-x: auto; scrollbar-width: none; }
.pane-tabs::-webkit-scrollbar { display: none; }
.ptab-list { display: contents; }
.ptab { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--text-2); font-family: inherit; font-weight: 600; font-size: 0.875rem; white-space: nowrap; position: relative; top: 1px; cursor: pointer; }
.ptab:hover { color: var(--link); }
.ptab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ptab[aria-selected="true"] { background: var(--ed-bg); color: var(--text-strong); border-color: var(--line); }
.ptab[aria-selected="true"]::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--gradient-brand); }
.ptab .ico { width: 16px; height: 16px; }
.dot-lang { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dot-lang.html { background: #e44d26; }
.dot-lang.css { background: #2965f1; }
.dot-lang.js { background: #d4b106; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 0.7rem; font-weight: 700; display: inline-grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.pane-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 0 2px 4px; }
.phone-only { display: none; }
.editors { flex: 1; min-height: 0; display: flex; }
.ed-col { flex: 1; min-width: 0; display: none; flex-direction: column; }
.ed-col.on { display: flex; }
.col-head { display: none; align-items: center; gap: 7px; font-weight: 600; font-size: 0.82rem; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.col-flag { font-size: 0.7rem; font-weight: 700; padding: 0 6px; border-radius: 6px; background: var(--tint-brand); color: var(--link); }
.ed-host { flex: 1; min-height: 0; position: relative; background: var(--ed-bg); }
.ed-host > .cm-editor { position: absolute; inset: 0; }
/* three columns side by side when the code sits above the page */
@media (min-width: 1000px) {
    .ws[data-layout="stack"] .ptab[data-pane] { display: none; }
    .ws[data-layout="stack"] .pane-tabs { min-height: 0; padding: 0; border: 0; }
    .ws[data-layout="stack"] .pane-tools { position: absolute; right: 4px; top: 2px; z-index: 3; padding: 0; }
    .ws[data-layout="stack"] .code-pane { position: relative; }
    .ws[data-layout="stack"] .ed-col { display: flex; }
    .ws[data-layout="stack"] .ed-col + .ed-col { border-left: 1px solid var(--line); }
    .ws[data-layout="stack"] .col-head { display: flex; }
    .ws[data-layout="stack"] .ed-col.on .col-head { color: var(--text-strong); box-shadow: inset 0 3px 0 var(--brand); }
}
.statusline { display: flex; gap: 14px; align-items: center; padding: 4px 8px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--text-2); background: var(--surface-2); font-variant-numeric: tabular-nums; min-height: 28px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: inherit; color: var(--warn); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-btn.bad { color: var(--bad); }

/* the page */
.view-pane { position: relative; }
.pv-bar { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; min-height: 46px; }
.pv-size { font-size: 0.78rem; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-tools { margin-left: auto; display: inline-flex; gap: 4px; }
.custom-size { display: inline-flex; align-items: center; gap: 4px; }
.pv-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; background: repeating-conic-gradient(var(--check-a) 0% 25%, var(--check-b) 0% 50%) 0 0 / 16px 16px; }
.pv-box { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; }
.pv-box.device { box-shadow: 0 0 0 1px var(--line-strong), 0 8px 30px rgba(0, 0, 0, 0.18); }
.pv-box iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.pv-stuck { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; padding: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--text); }
.pv-stuck p { margin: 0; }
.split.h { cursor: row-resize; height: 8px; flex: none; background: var(--surface-2); border-top: 1px solid var(--line); }
.split.h::after { width: 40px; height: 4px; margin: -2px 0 0 -20px; }

/* the console */
.console { display: flex; flex-direction: column; height: var(--con-h, 32%); min-height: 40px; background: var(--surface); }
.console.closed { height: auto !important; min-height: 0; }
.console.closed .con-body, .console.closed .con-input, .console.closed .con-filter { display: none; }
.con-bar { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.console.closed .con-bar { border-bottom: 0; }
.con-title { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-strong); font-family: inherit; font-weight: 700; font-size: 0.875rem; min-height: 34px; padding: 0 4px; cursor: pointer; border-radius: 8px; }
.con-title:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.con-title .chev { width: 14px; height: 14px; transition: transform 0.15s; }
.console.closed .con-title .chev { transform: rotate(-90deg); }
.con-counts { display: inline-flex; gap: 6px; font-size: 0.75rem; }
.con-filter { margin-left: auto; gap: 4px; }
.con-filter button { min-height: 28px; padding: 2px 10px; font-size: 0.78rem; }
.con-body { flex: 1; min-height: 0; overflow: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.45; color: var(--text); background: var(--ed-bg); }
.con-empty { color: var(--text-2); padding: 8px; font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem; }
.ce { display: flex; gap: 8px; padding: 3px 8px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.ce-msg { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ce-loc { flex: none; color: var(--text-2); background: none; border: 0; padding: 0; font: inherit; font-size: 0.75rem; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ce-loc:hover { color: var(--link); }
.ce-count { flex: none; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--surface-2); font-size: 0.7rem; display: grid; place-items: center; font-weight: 700; }
.ce.warn { background: var(--warn-soft); }
.ce.warn .ce-msg { color: var(--warn); }
.ce.error { background: var(--bad-soft); }
.ce.error .ce-msg { color: var(--bad); }
.ce.info .ce-msg { color: var(--info); }
.ce.debug .ce-msg { color: var(--text-2); }
.ce.input .ce-msg { color: var(--text-2); }
.ce.result .ce-msg::before { content: "\2190  "; color: var(--text-2); }
.ce.input .ce-msg::before { content: "\203A  "; }
.ce.system .ce-msg { color: var(--text-2); font-style: italic; font-family: 'Inter', system-ui, sans-serif; }
.ce.group { font-weight: 700; cursor: pointer; }
.v-str { color: var(--hl-str); }
.ce-msg > .v-str:first-child, .ce-msg > .v-str.plain { color: inherit; }
.v-num { color: var(--hl-num); }
.v-bool, .v-null { color: var(--hl-kw); }
.v-fn { color: var(--hl-fn); font-style: italic; }
.v-key { color: var(--hl-attr); }
.v-el { color: var(--hl-tag); }
.v-muted { color: var(--text-2); }
details.v-obj { display: inline; }
details.v-obj > summary { display: inline; cursor: pointer; list-style: none; }
details.v-obj > summary::-webkit-details-marker { display: none; }
details.v-obj > summary::before { content: "\25B8 "; color: var(--text-2); font-size: 0.8em; }
details.v-obj[open] > summary::before { content: "\25BE "; }
.v-kids { display: block; padding-left: 16px; border-left: 1px dotted var(--line-strong); margin-left: 3px; }
.v-kid { display: block; }
.ce table { border-collapse: collapse; margin: 2px 0; font-size: 0.78rem; }
.ce th, .ce td { border: 1px solid var(--line-strong); padding: 1px 6px; text-align: left; }
.ce th { background: var(--surface-2); }
.con-input { display: flex; align-items: flex-start; gap: 6px; padding: 4px 8px; border-top: 1px solid var(--line); background: var(--surface); margin: 0; }
.con-input .prompt { color: var(--link); font-weight: 700; font-family: var(--mono); line-height: 1.6; }
.con-input textarea { flex: 1; border: 0; background: transparent; color: var(--text); resize: none; font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; padding: 2px 0; min-height: 26px; max-height: 120px; outline: none; }
.con-input:focus-within { box-shadow: inset 0 0 0 2px var(--brand); border-radius: 0 0 16px 16px; }

@media (max-width: 759px) {
    .play { min-height: 460px; height: calc(100vh - var(--head) - 32px); height: calc(100dvh - var(--head) - 32px); }
    .ws, .ws[data-layout="side"], .ws[data-layout="stack"] { display: flex; flex-direction: column; grid-template-columns: none; grid-template-rows: none; }
    .ws > .split { display: none; }
    .phone-only { display: inline-flex; }
    .code-pane { flex: 1; }
    .view-pane { display: none; }
    .ws.show-view .code-pane { flex: none; border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: none; }
    .ws.show-view .code-pane .editors, .ws.show-view .code-pane .statusline { display: none; }
    .ws.show-view .view-pane { display: flex; flex: 1; border-top: 0; border-radius: 0 0 16px 16px; }
    .ws.show-view[data-show="result"] .console, .ws.show-view[data-show="result"] .split.h { display: none; }
    .ws.show-view[data-show="console"] .pv-bar, .ws.show-view[data-show="console"] .pv-stage, .ws.show-view[data-show="console"] .split.h { display: none; }
    .ws.show-view[data-show="console"] .console { flex: 1; height: auto; }
    .ws.show-view[data-show="console"] .con-title { pointer-events: none; }
    .ws.show-view[data-show="console"] .con-title .chev { display: none; }
    .pane-tools .small-btn span { display: none; }
    .ws.show-view .pane-tools { display: none; }
    .ptab { padding: 6px 10px; }
    .pv-bar .pv-size { display: none; }
    .pv-bar { flex-wrap: nowrap; }
    .pv-bar .small-sel { max-width: 10rem; min-width: 0; }
    .ws.show-view[data-show="console"] .con-title, .ws.show-view[data-show="console"] .con-counts { display: none; }
    .ws.show-view[data-show="console"] .con-filter { margin-left: 0; }
    .con-bar { flex-wrap: nowrap; }
}
@media (max-width: 420px) {
    .ptab { padding: 6px 8px; gap: 5px; }
    .ptab .ico { display: none; }
    .pane-tabs { gap: 0; }
    .pv-bar .small-sel { max-width: 8.5rem; }
}

/* ----- Minify and Format ----- */
.tidy { gap: 16px; }
.tidy-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tidy-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
.tidy-controls .field.end { margin-left: auto; }
.level-hint { margin-top: -6px; }
.tidy-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 1100px) {
    .tidy-panes { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; }
}
.tp { height: clamp(320px, 56vh, 760px); }
.tp-head { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); min-height: 46px; flex-wrap: wrap; }
.tp-title { font-weight: 700; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 8px; color: var(--text-strong); }
.tp-tools { margin-left: auto; gap: 2px; }
.tidy-go { display: flex; align-items: center; justify-content: center; }
.tidy-go .btn { flex-direction: column; gap: 4px; min-width: 104px; padding: 14px 18px; border-radius: 20px; }
@media (max-width: 1099px) { .tidy-go .btn { flex-direction: row; width: 100%; border-radius: 9999px; } }
#outPane { position: relative; }
.busy { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; box-shadow: var(--surface-shadow); font-size: 0.875rem; z-index: 5; }
.tp.dropping { outline: 3px dashed var(--brand); outline-offset: -3px; }
.result { display: flex; flex-direction: column; gap: 12px; }
.result:empty { display: none; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); }
.stat-label { color: var(--text-2); font-size: 0.82rem; }
.stat-value { font-size: 1.35rem; font-weight: 700; font-family: 'Space Grotesk', 'Inter', sans-serif; color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stat-value.good { color: var(--ok); }
.stat-sub { color: var(--text-2); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.sizebar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; position: relative; }
.sizebar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 5px; }
.sizebar b { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--brand) 40%, transparent); border-radius: 5px; }
.bar-key { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-2); margin-top: -4px; }
.bar-key span[class] { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.bar-key span + span[class] { margin-left: 8px; }
.key-min { background: color-mix(in srgb, var(--brand) 40%, transparent); }
.key-gz { background: var(--brand); }
.key-all { background: var(--line); }
.changes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.changes .chip { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 12px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-2); font-size: 0.82rem; font-weight: 600; }
.err-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid rgba(185, 28, 28, 0.3); border-radius: 14px; background: var(--bad-soft); color: var(--bad); }
.err-box span { color: var(--text); flex: 1; min-width: 12rem; }
.err-box code { white-space: pre-wrap; }
.warn-list { margin: 0; padding-left: 18px; color: var(--warn); font-size: 0.875rem; }
.warn-list li span { color: var(--text); }

/* ----- Many files ----- */
.drop-zone { position: relative; background: var(--surface); border: 3px dashed rgba(139, 92, 246, 0.45); border-radius: 24px; padding: 3.5rem 2rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; box-shadow: var(--surface-shadow); transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease; }
.drop-zone:hover, .drop-zone:focus-within, .drop-zone.dropping { border-color: var(--brand); background: var(--tint-brand); transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.dz-circle { width: 96px; height: 96px; border-radius: 50%; background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35); transition: transform 0.3s ease; }
.dz-circle .dz-ico { width: 44px; height: 44px; stroke-width: 1.8; }
.drop-zone:hover .dz-circle { transform: scale(1.1); }
.dz-title { font-weight: 700; font-size: 1.5rem; color: var(--text-strong); font-family: 'Space Grotesk', 'Inter', sans-serif; margin: 0; }
.drop-zone .actions { margin-top: 0.75rem; }
.drop-zone.compact { padding: 18px 16px; flex-direction: row; justify-content: center; flex-wrap: wrap; }
.drop-zone.compact .dz-circle, .drop-zone.compact .hint { display: none; }
.drop-zone.compact .dz-title { font-size: 1.1rem; }
.drop-zone.compact .actions { margin-top: 0; }
.files-work { display: flex; flex-direction: column; gap: 16px; }
.files-controls { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.files-end { margin-left: auto; flex-wrap: wrap; }
.table-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--surface-border); border-radius: 16px; background: var(--surface); box-shadow: var(--surface-shadow); }
table.grid { border-collapse: collapse; width: 100%; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--text); }
table.grid th, table.grid td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.grid th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; font-size: 0.82rem; color: var(--text-strong); }
:root:not([data-theme="light"]) table.grid th, :root:not([data-theme="light"]) table.grid tfoot td { background: #1c1c29; }
table.grid .num { text-align: right; }
table.grid tfoot td { font-weight: 700; border-bottom: 0; background: var(--surface-2); position: sticky; bottom: 0; }
:root[data-theme="light"] table.grid th, :root[data-theme="light"] table.grid tfoot td { background: #f3f4f8; }
.f-name { max-width: 34rem; overflow: hidden; text-overflow: ellipsis; }
.f-dir { color: var(--text-2); }
.f-kind { font-size: 0.75rem; font-weight: 700; padding: 1px 8px; border-radius: 9999px; background: var(--surface-2); color: var(--text-2); }
.f-kind.code { background: var(--tint-brand); color: var(--link); }
.f-status.bad { color: var(--bad); white-space: normal; min-width: 12rem; }
.f-status.good { color: var(--ok); }
.f-act { display: inline-flex; gap: 2px; }

/* ----- Menus ----- */
.menu { position: fixed; z-index: 2950; min-width: 230px; max-width: calc(100vw - 16px); padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--surface-border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22); display: flex; flex-direction: column; gap: 2px; }
.menu button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font-family: inherit; text-align: left; font-size: 0.9rem; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--tint-brand); color: var(--link); outline: none; }
.menu button[disabled] { opacity: 0.45; cursor: not-allowed; }
.menu button[aria-checked="true"]::after { content: ""; margin-left: auto; width: 14px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translateY(-2px); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu .menu-note { font-size: 0.78rem; color: var(--text-2); padding: 2px 10px 4px; }

/* ----- Projects, templates, sharing, options ----- */
.proj-list { display: flex; flex-direction: column; border-top: 1px solid var(--surface-border); max-height: 46vh; overflow: auto; }
.proj-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.proj-row.current .proj-title::after { content: "open now"; margin-left: 8px; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 9999px; background: var(--tint-brand); color: var(--link); }
.proj-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; display: flex; flex-direction: column; gap: 1px; color: var(--text); font-family: inherit; cursor: pointer; border-radius: 8px; }
.proj-open:hover .proj-title { color: var(--link); }
.proj-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.proj-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.proj-meta { font-size: 0.8rem; color: var(--text-2); }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 560px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tpl { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; min-height: 84px; background: var(--surface); color: var(--text); font-family: inherit; border: 1px solid var(--surface-border); border-radius: 16px; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.tpl:hover { border-color: var(--brand); box-shadow: var(--surface-hover-shadow); transform: translateY(-2px); }
.tpl:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tpl-title { font-weight: 700; color: var(--text-strong); }
.tpl-sub { color: var(--text-2); font-size: 0.85rem; }
.share-box { font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-group h3 { margin: 0; font-size: 1rem; color: var(--text-strong); }

/* ----- Code boxes (the editor bundle): colours live in editor.js (CSS variables above); these are layout details ----- */
.cm-foldGutter .cm-gutterElement { cursor: pointer; }
.cm-tooltip-autocomplete > ul { font-family: var(--mono); max-height: 16em; }
.cm-tooltip-autocomplete > ul > li { padding: 2px 8px !important; }
.cm-completionDetail { color: var(--text-2); font-style: normal; margin-left: 8px; }
.cm-tooltip-lint { padding: 0; }
.cm-diagnostic { padding: 6px 10px; font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem; border-left-width: 4px; }
.cm-diagnostic-error { border-left-color: var(--bad); }
.cm-diagnostic-warning { border-left-color: var(--warn); }
.cm-diagnostic-info { border-left-color: var(--info); }
.cm-lintRange-error { background-image: none; text-decoration: wavy underline var(--bad); text-underline-offset: 3px; }
.cm-lintRange-warning { background-image: none; text-decoration: wavy underline var(--warn); text-underline-offset: 3px; }
.cm-lintRange-info { background-image: none; text-decoration: dotted underline var(--info); text-underline-offset: 3px; }
.cm-lint-marker { width: 0.85em; height: 0.85em; }
.cm-search { font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem; padding: 6px 8px !important; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cm-search br { flex-basis: 100%; height: 0; content: ""; }
.cm-search label { display: inline-flex; align-items: center; gap: 4px; }
.cm-textfield { padding: 4px 8px !important; font: inherit !important; min-height: 32px; }
.cm-button { padding: 3px 10px !important; min-height: 32px; font: inherit !important; cursor: pointer; }
.cm-search button[name="close"] { font-size: 1.2rem; color: var(--text-2); background: none; border: 0; cursor: pointer; }
.cm-flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--brand) 35%, transparent); } }

/* ----- Dropping files anywhere ----- */
.drop-overlay { position: fixed; inset: 0; z-index: 2900; display: grid; place-items: center; pointer-events: none; background: color-mix(in srgb, var(--bg) 82%, transparent); border: 3px dashed var(--brand); }
.drop-overlay span { background: var(--surface); color: var(--text-strong); border: 1px solid var(--tint-brand-border); border-radius: 14px; padding: 14px 18px; font-weight: 700; box-shadow: var(--surface-shadow); }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog.wide { width: min(880px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2, .dialog-body > h2 { margin: 0; font-size: 1.2rem; color: var(--text-strong); }
.dialog-head .icon-btn { border-radius: 50%; }
.help p { max-width: 75ch; color: var(--text-2); margin: 0; }
.help h3 { font-size: 1rem; margin: 0 0 2px; color: var(--text-strong); }
.help a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.help-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 32px; }
.help-grid section { display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 760px) { .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.keys { display: grid; gap: 6px; margin: 0; }
.keys div { display: flex; gap: 12px; }
.keys dt { min-width: 9rem; }
.keys dd { margin: 0; color: var(--text-2); }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast.bad { border-left-color: #f87171; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; min-height: 32px; flex: none; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; }

/* ----- Phones and tablets ----- */
@media (max-width: 1023.98px) and (min-width: 640px) {
    .info-section .info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    /* four tabs at 16 px do not fit one row on a phone: two, then two */
    .app-toolbar .view-tabs { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; border-radius: 24px; }
    .app-toolbar .view-tab { padding: 8px 6px; gap: 5px; min-width: 0; }
    .toolbar-right { width: 100%; }
    .toolbar-right .btn { flex: 1 1 auto; }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body { padding: 16px; }
    .head-text h2 { font-size: 1.3rem; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
    .drop-zone { padding: 2.5rem 1rem; border-radius: 20px; }
    .dz-circle { width: 80px; height: 80px; }
    .dz-circle .dz-ico { width: 36px; height: 36px; }
    .dz-title { font-size: 1.25rem; }
    .tidy-controls .field.end { margin-left: 0; }
    .files-end { margin-left: 0; }
    .keys div { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .dialog[open], .toast, .seg button, .view-tab, .tpl, .drop-zone, .dz-circle, .switch-track, .switch-track::after, .proj-btn, .spinner, .cm-flash { transition: none; animation: none; }
    .btn:hover:not([disabled]), .info-card:hover, .tpl:hover, .seg button:hover:not([disabled]), .drop-zone:hover, .drop-zone:focus-within, .drop-zone.dropping, .drop-zone:hover .dz-circle { transform: none; }
}
@media print {
    .app-toolbar, .toasts, .theme-toggle, .shell-hint, .bar, .pane-tabs, .statusline, .pv-bar, .console { display: none !important; }
}
/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The code, the console's lines and the page are
   the visitor's own content in their own sizes. */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]) { min-height: 44px; }
    main .seg button, main .view-tab, main .btn.small-btn, main .small-sel, main .ptab, main .proj-btn, main .con-title { min-height: 44px; }
    main .icon-btn, main .icon-btn.small { width: 44px; height: 44px; min-width: 44px; }
    main .check-row input { width: 22px; height: 22px; }
    main .seg button { min-width: 44px; }
    main .check-row { min-height: 44px; align-items: center; }
    main .switch { min-height: 44px; }
    main .con-filter button { min-height: 44px; padding: 2px 10px; }
    main .ce-loc, main .link-btn { min-height: 44px; display: inline-flex; align-items: center; }
    main :is(p, li, dt, dd, .hint, .label, .input, .select, kbd, .seg button, .lead, .btn, .view-tab, .shell-hint, .ptab, .proj-btn, .switch, .check-row, .pill, .stat-label, .stat-sub, .chip, .statusline, .pv-size, .con-title, .tp-title, .f-kind, .f-status, table.grid td, table.grid th, .con-empty) { font-size: 1rem; }
    main .con-input textarea { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog select, .dialog input:not([type="checkbox"]) { min-height: 44px; }
    .dialog .icon-btn, .dialog .icon-btn.small { width: 44px; height: 44px; }
    .dialog :is(p, li, td, kbd, dt, dd, .btn, .label, .hint, .check-row, .tpl-title, .tpl-sub, .proj-title, .proj-meta, .input, .select, small) { font-size: 1rem; }
    .menu button { min-height: 44px; font-size: 1rem; }
    .menu .menu-note { font-size: 1rem; }
    main .cm-search .cm-button, main .cm-search .cm-textfield, main .cm-search label, main .cm-search button[name="close"] { min-height: 44px; font-size: 1rem !important; }
    main .cm-search .cm-button, main .cm-search button[name="close"] { min-width: 44px; }
    main .con-input textarea { min-height: 44px; }
    .dialog .check-row { min-height: 44px; align-items: center; }
    .dialog .check-row input { width: 22px; height: 22px; }
}
