/* Layout — phone: header · preview (takes the leftover height) · one settings sheet · icon tab bar.
   Nothing but the sheet scrolls, so the preview never leaves the screen.
   Desktop: preview left, tab bar + sheet as a right rail.
   kestrra.com's rule holds: the UI has no chroma. The only colour on screen is the ground and its swatches. */
@font-face {
  font-family: "Overused Grotesk";
  src: url("fonts/OverusedGrotesk-VF.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/FragmentMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ground: #08090a;
  --raise: rgb(255 255 255 / 0.035);
  --hair: rgb(255 255 255 / 0.08);
  --hair-strong: rgb(255 255 255 / 0.16);
  --hi: rgb(255 255 255 / 0.92);
  --mid: rgb(255 255 255 / 0.64);
  --low: rgb(255 255 255 / 0.5);
  --solid-hi: #ebebeb;
  --font-sans: "Overused Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-tiny: 0.6875rem;
  --t-caption: 0.75rem;
  --t-meta: 0.8125rem;
  --t-body: 0.9375rem;
  --t-lead: 1.1875rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --tap: 44px;
  color-scheme: dark;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--ground); height: 100%; }
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--hi);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--ground);
  z-index: 10;
}
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 0; font-variant-numeric: tabular-nums; }
.dim { color: var(--low); }
/* fixed, so hidden inputs can never stretch a scroll area */
.visually-hidden {
  position: fixed; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
p { margin: 0; }
button { font: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
svg circle[r="1.2"] { fill: currentColor; stroke: none; }
:focus-visible { outline: 1px solid var(--hi); outline-offset: 2px; }

/* ── app frame ─────────────────────────────────────── */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── header ────────────────────────────────────────── */
.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px var(--gutter-r) 6px var(--gutter-l);
  min-height: 48px;
}
.mark { display: flex; align-items: baseline; gap: 8px; flex: none; }
.word { font-weight: 560; font-size: 1.0625rem; letter-spacing: -0.01em; }
.sub { font-family: var(--font-mono); font-size: var(--t-tiny); color: var(--mid); text-transform: uppercase; letter-spacing: 0.14em; }
.meta {
  flex: 1; min-width: 0; min-height: var(--tap);
  background: transparent; border: 0; padding: 0 4px; cursor: pointer;
  color: var(--low); font-size: var(--t-caption); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.hdr-btn {
  min-height: var(--tap); padding: 0 8px;
  background: transparent; border: 0; border-bottom: 1px solid transparent; cursor: pointer;
  color: var(--mid); font-size: var(--t-meta);
}
.hdr-btn[aria-pressed="true"] { color: var(--hi); border-bottom-color: var(--hair-strong); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap); padding: 0;
  background: transparent; border: 0; color: var(--mid); cursor: pointer;
  transition: color 200ms var(--ease);
}
.icon-btn[aria-pressed="true"] { color: var(--hi); }
.icon-btn:disabled { color: var(--hair-strong); cursor: default; }

/* ── stage ─────────────────────────────────────────── */
.stage {
  flex: 1 1 auto;
  min-height: 150px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 var(--gutter-r) 0 var(--gutter-l);
}
.viewport { container-type: size; display: grid; place-items: center; min-height: 0; }
.frame {
  --ar: 0.5625;
  position: relative;
  width: min(100cqw, calc(100cqh * var(--ar)));
  max-width: 100%;
  aspect-ratio: 9 / 16;
  outline: 1px solid var(--hair);
  background: #0a0b0c;
}
.frame canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: default; }
.frame canvas.over-layer { cursor: grab; }
.frame canvas:focus-visible { outline: 1px solid var(--hi); outline-offset: 2px; }
.stage-error {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 16px; text-align: center; color: var(--mid); font-size: var(--t-meta);
}
.stage-progress {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 4px;
  background: rgb(8 9 10 / 0.62); text-align: center; font-size: var(--t-caption);
}

.transport { display: flex; align-items: center; gap: 6px; }
.transport .icon-btn { margin-left: -12px; }
#play .ico-play { display: none; }
#play[aria-pressed="true"] .ico-play { display: block; }
#play[aria-pressed="true"] .ico-pause { display: none; }
.scrub { flex: 1; height: var(--tap); display: grid; align-items: center; cursor: pointer; touch-action: none; }
.scrub-track { height: 1px; background: var(--hair-strong); position: relative; }
.scrub-fill { position: absolute; inset: 0; background: var(--mid); transform-origin: left; transform: scaleX(0); }
.scrub-fill::after {
  content: ""; position: absolute; right: -1px; top: -5px; width: 2px; height: 11px; background: var(--hi);
}
.clock { font-size: var(--t-caption); color: var(--mid); white-space: nowrap; }

/* ── sheet ─────────────────────────────────────────── */
.sheet {
  flex: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(48svh, 460px);
  border-top: 1px solid var(--hair);
  background: var(--ground);
  transition: height 260ms var(--ease);
}
.app[data-sheet="full"] .sheet { height: 66svh; }
.app[data-sheet="closed"] .sheet { height: 0; border-top-color: transparent; overflow: hidden; }
.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--gutter-r) 0 var(--gutter-l);
  min-height: 40px;
}
.sheet-title {
  margin: 0; font-weight: 400; font-size: var(--t-caption);
  color: var(--mid); text-transform: uppercase; letter-spacing: 0.14em;
}
.sheet-value {
  flex: 1; min-width: 0; font-size: var(--t-caption); color: var(--hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 8px;
}
#sheetSize { margin-right: -12px; }
#sheetSize svg { transition: transform 260ms var(--ease); }
.app[data-sheet="full"] #sheetSize svg { transform: rotate(180deg); }
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--gutter-r) 20px var(--gutter-l);
  -webkit-overflow-scrolling: touch;
}
.tabpanel { display: grid; gap: 14px; padding-top: 2px; }
.tabpanel > *, .subpanel > *, .field > *, .sub-group > * { min-width: 0; }

/* sub-tabs: one small set of controls at a time */
.subtabs {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 0 18px; overflow-x: auto; scrollbar-width: none;
  background: var(--ground);
  border-bottom: 1px solid var(--hair);
  margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l));
  padding: 0 var(--gutter-r) 0 var(--gutter-l);
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button {
  flex: none; min-height: var(--tap); padding: 0;
  background: transparent; border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px;
  color: var(--low); cursor: pointer;
  font-family: var(--font-mono); font-size: var(--t-meta); text-transform: lowercase; letter-spacing: 0.015em;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.subtabs button[aria-selected="true"] { color: var(--hi); border-bottom-color: var(--hi); }
.subpanel { display: grid; gap: 14px; }

/* ── tab bar ───────────────────────────────────────── */
.tabbar {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--hair);
  padding: 0 var(--gutter-r) 0 var(--gutter-l);
  background: var(--ground);
}
.tabbar [role="tab"] {
  position: relative;
  display: grid; justify-items: center; align-content: center; gap: 3px;
  min-height: 58px; padding: 6px 0 4px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--low);
  transition: color 200ms var(--ease);
}
.tabbar [role="tab"] span { font-family: var(--font-mono); font-size: var(--t-tiny); letter-spacing: 0.02em; }
.tabbar [role="tab"][aria-selected="true"] { color: var(--hi); }
.tabbar [role="tab"][aria-selected="true"]::before {
  content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 1px; background: var(--hi);
}
.tabbar-progress { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--hair); z-index: 1; }
#tabbarBar { height: 100%; background: var(--hi); transform-origin: left; transform: scaleX(0); transition: transform 120ms linear; }

/* ── type, rows, labels ────────────────────────────── */
.hint { font-size: var(--t-meta); color: var(--low); line-height: 1.45; max-width: 60ch; }
.hint.warn { color: var(--mid); }
.field { display: grid; gap: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
label, .label {
  font-family: var(--font-mono); font-size: var(--t-meta); color: var(--mid);
  text-transform: lowercase; letter-spacing: 0.015em;
}
label[for] { cursor: default; user-select: none; }
output { font-family: var(--font-mono); font-size: var(--t-meta); color: var(--hi); }
.sub-group { display: grid; gap: 2px; }
.sub-label { margin: 0; font-weight: 400; font-size: var(--t-caption); color: var(--low); letter-spacing: 0.02em; }
.current { display: flex; align-items: center; gap: 8px; }
.chip-sm { width: 10px; height: 10px; flex: none; }

/* ── colour chooser — the share button's: a thin chip and a mono name, no box.
   Selected takes more light (low → hi) and the chip's hairline brightens. */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); column-gap: 16px; }
.sw {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 0;
  background: transparent; border: 0;
  color: var(--low); text-align: left; cursor: pointer;
  font-family: var(--font-mono); font-size: var(--t-meta); letter-spacing: 0.015em;
  text-transform: lowercase;
  transition: color 250ms var(--ease);
}
.sw .chip { width: 1.5rem; height: 0.5rem; flex: none; outline: 1px solid rgb(255 255 255 / 0.14); transition: outline-color 250ms var(--ease); }
.sw-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sw[aria-pressed="true"], .sw.is-on { color: var(--hi); }
.sw[aria-pressed="true"] .chip, .sw.is-on .chip-input::-webkit-color-swatch { outline-color: rgb(255 255 255 / 0.55); }
.sw.custom { cursor: default; gap: 2px; }

/* colour inputs: a 44px tap box with the thin chip drawn inside */
input[type="color"].chip-input {
  -webkit-appearance: none; appearance: none;
  width: 44px; height: var(--tap); padding: 0; margin-left: -10px; border: 0; border-radius: 0;
  background: transparent; cursor: pointer; flex: none;
}
input[type="color"].chip-input::-webkit-color-swatch-wrapper { padding: 18px 10px; }
input[type="color"].chip-input::-webkit-color-swatch { border: 0; border-radius: 0; outline: 1px solid rgb(255 255 255 / 0.3); }
input[type="color"].chip-input::-moz-color-swatch { border: 0; border-radius: 0; height: 8px; }
input[type="text"].hexline {
  flex: 0 1 9ch; height: var(--tap); padding: 0;
  background: transparent; border: 0; border-bottom: 1px solid transparent; border-radius: 0;
  color: inherit; font-size: 1rem; letter-spacing: 0.015em;
}
input[type="text"].hexline:focus { outline: none; border-bottom-color: var(--hair-strong); }

.photo-pick { display: flex; }
.photo-tones { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; }
.photo-tones .swatches { grid-template-columns: minmax(0, 1fr); }
.thumb { width: 56px; height: 56px; object-fit: cover; outline: 1px solid var(--hair); margin-top: 8px; }

input[type="text"], input[type="number"] {
  flex: 1; min-width: 0; height: var(--tap); padding: 0 12px;
  background: var(--raise); color: var(--hi);
  border: 1px solid var(--hair-strong); border-radius: 2px;
  font-size: 1rem; /* 16px keeps iOS from zooming on focus */
}
.seedrow { display: flex; gap: 16px; align-items: center; }
.seedrow input { max-width: 9rem; }

/* ranges: 44px tall to grab, 1px track, 20px thumb */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 36px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--hair-strong); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--hair-strong); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -9.5px; border-radius: 50%;
  background: var(--solid-hi); border: 0;
}
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--solid-hi); border: 0; }

/* steppers replace sliders for small whole-number ranges */
input[type="range"].is-stepped { display: none; }
.stepper { display: inline-flex; align-items: center; }
.stepper button {
  width: 40px; height: var(--tap); padding: 0;
  background: transparent; border: 0; color: var(--mid); cursor: pointer;
  font-family: var(--font-mono); font-size: 1.125rem;
}
.stepper button:disabled { color: var(--hair-strong); cursor: default; opacity: 1; }
.stepper output { min-width: 5ch; text-align: center; }

/* options — text that takes more light, with a hairline under the one that's on */
.seg, .opts { display: flex; flex-wrap: wrap; gap: 0 20px; }
.seg button, .opt {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 0;
  background: transparent; border: 0; border-bottom: 1px solid transparent; border-radius: 0;
  color: var(--low); cursor: pointer;
  font-family: var(--font-mono); font-size: var(--t-meta); letter-spacing: 0.015em;
  text-transform: lowercase;
  transition: color 250ms var(--ease), border-color 250ms var(--ease);
}
.seg button small { font-size: var(--t-caption); color: var(--low); }
.seg button[aria-pressed="true"] { color: var(--hi); border-bottom-color: var(--hair-strong); }
.seg button[aria-pressed="true"] small { color: var(--mid); }
.opt { color: var(--mid); }
.opts.quick { margin-top: -6px; }
.menu-list { display: grid; justify-items: start; }
#safeZone[aria-pressed="true"] { color: var(--hi); }
#wmToggle[aria-pressed="true"] { color: var(--hi); border-bottom-color: var(--hair-strong); }

.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: #d8d8d8; }
.check span { font-family: var(--font-mono); font-size: var(--t-meta); color: var(--mid); }

/* buttons */
.primary, .ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px; border-radius: 2px; cursor: pointer;
  font-size: var(--t-body); transition: background 150ms var(--ease), border-color 150ms var(--ease), opacity 150ms;
}
.primary { background: var(--solid-hi); color: var(--ground); border: 1px solid var(--solid-hi); font-weight: 560; }
.ghost { background: transparent; color: var(--hi); border: 1px solid var(--hair-strong); }
button:disabled { opacity: 0.38; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions > * { flex: 1 1 140px; }

.progress { display: grid; gap: 4px; }
.track { height: 2px; background: var(--hair); overflow: hidden; }
.track-fill { height: 100%; background: var(--hi); transform-origin: left; transform: scaleX(0); transition: transform 120ms linear; }
.progress .mono { font-size: var(--t-caption); }
.result { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--hair-strong); border-radius: 2px; background: var(--raise); }
.result-name { font-size: var(--t-caption); color: var(--mid); overflow-wrap: anywhere; }

body.is-busy .sheet-body .tabpanel:not(#panel-export) { opacity: 0.5; pointer-events: none; }

/* ── text ──────────────────────────────────────────── */
textarea {
  width: 100%; min-height: var(--tap); resize: none; padding: 10px 12px; overflow-y: auto;
  background: var(--raise); color: var(--hi);
  border: 1px solid var(--hair-strong); border-radius: 2px;
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.35;
}
textarea:focus { outline: none; border-color: var(--mid); }
#textEditor { display: grid; gap: 14px; }
.layers { gap: 0 18px; }
.layers .opt { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: var(--tap); }
.layers .opt[aria-pressed="true"] { color: var(--hi); border-bottom-color: var(--hair-strong); }
.layers .opt.add { color: var(--mid); }
.fonts { display: flex; flex-wrap: wrap; gap: 0 18px; }
.fonts button {
  min-height: var(--tap); padding: 0;
  background: transparent; border: 0; border-bottom: 1px solid transparent;
  color: var(--low); cursor: pointer; font-size: 1.0625rem; line-height: 1.2;
  transition: color 250ms var(--ease), border-color 250ms var(--ease);
}
.fonts button[aria-pressed="true"] { color: var(--hi); border-bottom-color: var(--hair-strong); }
.fonts button.is-missing { opacity: 0.55; }
.fonts button.is-missing::after { content: " +"; font-family: var(--font-mono); font-size: var(--t-caption); }
.seg button.keep-case { text-transform: none; }
.seg button em { font-style: italic; }
#throughControls, #outlineControls { display: grid; gap: 10px; }
#tColorRow { display: grid; gap: 4px; }
.pos { display: grid; gap: 0; }

.palette { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.pal {
  position: relative;
  width: 28px; height: 14px; margin: 15px 0; padding: 0; border: 0; cursor: pointer;
  outline: 1px solid rgb(255 255 255 / 0.14); outline-offset: 0;
}
.pal::before { content: ""; position: absolute; inset: -15px -8px; }

.phrases { display: grid; }
.phrases button {
  text-align: left; min-height: var(--tap); padding: 6px 0;
  background: transparent; border: 0; color: var(--mid); cursor: pointer;
  font-family: "Golos Text", var(--font-sans); font-size: 1rem; line-height: 1.3;
  transition: color 250ms var(--ease);
}

/* ── images ────────────────────────────────────────── */
.img-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; }
.img-strip::-webkit-scrollbar { display: none; }
.img-tabs { display: flex; gap: 10px; }
.img-tab, .img-add {
  flex: none;
  display: grid; justify-items: center; gap: 4px; width: 64px; padding: 0;
  background: transparent; border: 0; cursor: pointer; color: var(--low);
  font-family: var(--font-mono); font-size: var(--t-caption); text-transform: none;
}
.img-tab canvas { width: 56px; height: 56px; outline: 1px solid var(--hair); background: #111214; }
.img-tab span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-tab[aria-pressed="true"] { color: var(--hi); }
.img-tab[aria-pressed="true"] canvas { outline-color: rgb(255 255 255 / 0.7); }
.img-add { color: var(--mid); }
.img-add svg { width: 56px; height: 56px; padding: 17px; outline: 1px dashed var(--hair-strong); }
#imageEditor, #wmEditor { display: grid; gap: 14px; }

/* ── toast ─────────────────────────────────────────── */
.toast {
  position: fixed; z-index: 20;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 0 6px 0 14px;
  background: #16171a; border: 1px solid var(--hair-strong);
  font-family: var(--font-mono); font-size: var(--t-meta); color: var(--hi);
}
.toast .opt { color: var(--hi); }

/* hover only where there's a mouse, so a tap never looks like a selection */
@media (hover: hover) {
  .sw:hover, .seg button:hover, .fonts button:hover, .subtabs button:hover, .tabbar [role="tab"]:hover { color: var(--mid); }
  .opt:hover, .phrases button:hover, .icon-btn:not(:disabled):hover, .hdr-btn:hover, .meta:hover { color: var(--hi); }
  .primary:hover { background: #ffffff; }
  .ghost:hover { border-color: var(--mid); }
  .pal:hover { outline-color: rgb(255 255 255 / 0.55); }
}
.sw:active, .seg button:active, .opt:active, .fonts button:active, .phrases button:active { color: var(--hi); }

/* ── tablet & desktop: preview left, rail right ────── */
@media (min-width: 760px) and (min-aspect-ratio: 4/5) {
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "bar bar" "stage tabs" "stage sheet";
  }
  .bar { grid-area: bar; border-bottom: 1px solid var(--hair); padding-block: 10px; }
  .meta { text-align: right; }
  .stage { grid-area: stage; padding: 20px 28px 12px var(--gutter-l); min-height: 0; }
  .tabbar { grid-area: tabs; border-top: 0; border-bottom: 1px solid var(--hair); border-left: 1px solid var(--hair); padding: 0 8px; }
  .tabbar [role="tab"][aria-selected="true"]::before { top: auto; bottom: -1px; }
  .sheet, .app[data-sheet] .sheet { grid-area: sheet; height: auto; border-top: 0; border-left: 1px solid var(--hair); min-height: 0; }
  .app[data-sheet="closed"] .sheet { overflow: visible; }
  .sheet-head, .sheet-body { padding-left: 20px; padding-right: 20px; }
  .subtabs { margin: 0 -20px; padding: 0 20px; }
  #sheetSize { display: none; }
  .toast { bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.layers .opt { text-transform: none; }
.sw.identity .sw-name { text-transform: lowercase; }

.layer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--tap); }
.layer-row .layers { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.layer-row .layers::-webkit-scrollbar { display: none; }
.layer-actions { display: flex; flex: none; margin-right: -12px; }
.img-name { font-size: var(--t-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#wmSwitch button { min-width: 2.5em; }
@media (max-width: 430px) { .sub { display: none; } }
