:root {
  --bg: #171613; --chrome: #201e1a; --panel: #26241f; --panel-2: #2e2b25; --line: #3a362f; --line-2: #4a453c;
  --text: #ede8dc; --muted: #a59d8c; --faint: #6f685b;
  --accent: #16a974; --accent-ink: #062b1d; --accent-2: #8ff0c4;
  --warn: #ff9a3d; --err: #ff5a4b; --info: #5fb2ff;
  --radius: 7px; --font: "AtkUI", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#app { display: grid; height: 100vh; grid-template-columns: 52px 1fr 318px; grid-template-rows: 48px 1fr; grid-template-areas: "top top top" "tools stage side"; }

/* ---------- top bar ---------- */
.topbar { grid-area: top; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--chrome); border-bottom: 1px solid var(--line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 7px; padding-right: 6px; white-space: nowrap; }
.brand b { font-size: 16px; letter-spacing: .02em; }
.brand .sub { color: var(--muted); font-size: 11.5px; }
.logo { width: 24px; height: 24px; color: var(--accent); display: inline-flex; }
.logo svg { width: 24px; height: 24px; }
.menus { display: flex; gap: 2px; position: relative; }
.menu > button { background: none; border: 0; padding: 6px 9px; border-radius: 5px; color: var(--text); }
.menu > button:hover, .menu.open > button { background: var(--panel-2); }
.menu { position: relative; }
.menu .dropdown { position: absolute; top: 100%; left: 0; min-width: 236px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px; box-shadow: 0 12px 36px rgba(0,0,0,.45); z-index: 50; display: none; }
.menu.open .dropdown { display: block; }
.dropdown button { display: flex; width: 100%; justify-content: space-between; gap: 20px; background: none; border: 0; padding: 6px 9px; border-radius: 5px; text-align: left; }
.dropdown button:hover { background: var(--accent); color: var(--accent-ink); }
.dropdown button kbd { color: var(--muted); font: 11px var(--font); }
.dropdown button:hover kbd { color: var(--accent-ink); }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.tb-group { display: flex; align-items: center; gap: 2px; }
.icon-btn { width: 30px; height: 30px; border-radius: 6px; background: none; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.icon-btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 17px; height: 17px; }
.text-btn { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.text-btn:hover { background: var(--panel-2); }
#zoom-label { min-width: 46px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.tb-select { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.tb-select select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; color: var(--text); max-width: 180px; }
.status-pill { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 999px; padding: 5px 12px; white-space: nowrap; font-weight: 700; font-size: 12px; }
.status-pill.ok { border-color: #1e7a57; color: var(--accent-2); }
.status-pill.warn { border-color: #8a5a22; color: var(--warn); }
.status-pill.err { border-color: #8f2e25; color: var(--err); }
.primary { background: var(--accent); color: #fff; border: 0; border-radius: 7px; padding: 8px 14px; font-weight: 700; white-space: nowrap; }
.primary:hover { filter: brightness(1.08); }

/* ---------- tool bar ---------- */
.toolbar { grid-area: tools; background: var(--chrome); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 3px; }
.tool { width: 38px; height: 36px; border-radius: 7px; border: 1px solid transparent; background: none; display: flex; align-items: center; justify-content: center; color: var(--text); position: relative; }
.tool svg { width: 19px; height: 19px; }
.tool:hover { background: var(--panel-2); }
.tool.active { background: var(--accent); color: #fff; }
.tool-sep { width: 26px; border-top: 1px solid var(--line); margin: 4px 0; }
.swatch-tool { margin-top: auto; width: 30px; height: 30px; border-radius: 6px; border: 2px solid var(--line-2); padding: 0; overflow: hidden; }
.swatch-tool input { width: 44px; height: 44px; margin: -7px; border: 0; padding: 0; cursor: pointer; }

/* ---------- stage ---------- */
.stage { grid-area: stage; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2c2a25 0, #1a1916 70%); }
#canvas { position: absolute; inset: 0 0 26px 0; width: 100%; height: calc(100% - 26px); display: block; touch-action: none; }
.statusbar { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; display: flex; gap: 18px; align-items: center; padding: 0 12px; background: var(--chrome); border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.statusbar .grow { flex: 1; }
.tool-options { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(38,36,31,.94); border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 10px; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: 12px; }
.tool-options:empty { display: none; }
.tool-options label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.tool-options input[type=number] { width: 58px; }
.drop-hint { position: absolute; inset: 14px; border: 2px dashed var(--accent); border-radius: 14px; display: none; align-items: center; justify-content: center; font-size: 18px; color: var(--accent-2); background: rgba(22,169,116,.08); pointer-events: none; }
.stage.dragover .drop-hint { display: flex; }

/* ---------- sidebar ---------- */
.sidebar { grid-area: side; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--chrome); }
.tabs button { background: none; border: 0; padding: 10px 2px 9px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 12.5px; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; font-size: 10.5px; line-height: 16px; background: var(--line-2); color: var(--text); }
.badge.err { background: var(--err); color: #200; } .badge.warn { background: var(--warn); color: #2a1500; } .badge.ok { background: var(--accent); color: #fff; }
.badge:empty { display: none; }
.panel { overflow-y: auto; overflow-x: hidden; flex: 1; padding: 4px 0 30px; }
.sec { border-bottom: 1px solid var(--line); }
.sec > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: flex; justify-content: space-between; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: "▾"; color: var(--faint); }
.sec:not([open]) > summary::after { content: "▸"; }
.sec .body { padding: 0 14px 14px; display: grid; gap: 9px; }
.row { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; }
.row > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 5px; }
.field { display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 0 0 8px; }
.field > span { color: var(--faint); font-size: 11.5px; min-width: 12px; }
.field input, .field select { background: none; flex: 1; border: 0; outline: 0; padding: 6px 6px 6px 0; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.field:focus-within { border-color: var(--accent); }
label.lbl { color: var(--muted); font-size: 12px; display: grid; gap: 4px; }
input[type=number], input[type=text], select, textarea { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 7px; color: var(--text); outline: 0; }
select option, select optgroup { background: var(--panel); }
textarea { resize: vertical; min-height: 54px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); padding: 2px; cursor: pointer; }
.btn { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.go { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.small { padding: 4px 7px; font-size: 12px; }
.btn svg { width: 18px; height: 18px; }
.btn.icon { padding: 5px; }
.btn-col { display: grid; gap: 2px; justify-items: center; font-size: 10.5px; color: var(--muted); padding: 6px 2px; }
.btn-col svg { width: 22px; height: 22px; color: var(--text); }
.help { color: var(--muted); font-size: 12px; margin: 0; }
.help b { color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatches button { width: 20px; height: 20px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); padding: 0; }
.slider-row { display: grid; grid-template-columns: 88px 1fr 40px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.slider-row output { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.empty-note { padding: 18px 16px; color: var(--muted); }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segmented button { flex: 1; background: var(--panel-2); border: 0; border-right: 1px solid var(--line); padding: 5px 0; }
.segmented button:last-child { border-right: 0; }
.segmented button.on { background: var(--accent); color: #fff; }

/* layers */
.layer { display: grid; grid-template-columns: 22px 16px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border-bottom: 1px solid #2d2a24; cursor: pointer; }
.layer:hover { background: var(--panel-2); }
.layer.sel { background: #183f30; }
.layer .chip { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255,255,255,.3); background-image: linear-gradient(45deg,#777 25%,transparent 25%,transparent 75%,#777 75%), linear-gradient(45deg,#777 25%,transparent 25%,transparent 75%,#777 75%); background-size: 6px 6px; background-position: 0 0, 3px 3px; }
.layer .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer .name small { color: var(--faint); margin-left: 4px; }
.layer button { background: none; border: 0; color: var(--muted); padding: 2px 4px; border-radius: 4px; }
.layer button:hover { background: var(--line); color: var(--text); }
.layer .ops { display: flex; gap: 0; opacity: .0; }
.layer:hover .ops, .layer.sel .ops { opacity: 1; }
.layer.hidden-item .name { color: var(--faint); text-decoration: line-through; }

/* issues */
.issue { margin: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--info); border-radius: 7px; padding: 9px 10px; background: var(--panel-2); display: grid; gap: 5px; }
.issue.error { border-left-color: var(--err); } .issue.warning { border-left-color: var(--warn); }
.issue .t { font-weight: 700; display: flex; gap: 7px; align-items: baseline; }
.issue .t .sev { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 1px 5px; border-radius: 3px; background: var(--line-2); }
.issue.error .sev { background: var(--err); color: #200; } .issue.warning .sev { background: var(--warn); color: #2a1500; }
.issue .d { color: var(--muted); font-size: 12px; }
.issue .acts { display: flex; gap: 6px; }
.ready-card { margin: 12px; padding: 14px; border-radius: 9px; background: #163a2c; border: 1px solid #1e7a57; color: var(--accent-2); }
.ready-card b { display: block; font-size: 15px; color: #c9ffe6; margin-bottom: 3px; }

/* export */
.cut-layer, .mu-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.cut-layer .chip, .mu-row .chip { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,.3); }
ol.steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; display: grid; gap: 4px; }
ol.steps b { color: var(--text); }

/* toasts + modal */
#toasts { position: fixed; bottom: 38px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; z-index: 100; pointer-events: none; }
.toast { background: #0f0e0c; border: 1px solid var(--line-2); padding: 8px 14px; border-radius: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.5); animation: tin .18s ease-out; max-width: 520px; }
.toast.warn { border-color: var(--warn); } .toast.error { border-color: var(--err); } .toast.ok { border-color: var(--accent); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 90; }
.modal-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 18px 20px; width: min(640px, 92vw); max-height: 84vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-card h2 { margin: 0 0 10px; font-size: 17px; }
.modal-card table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.modal-card td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.modal-card td:last-child { text-align: right; color: var(--muted); }
.modal-card .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 1100px) { #app { grid-template-columns: 48px 1fr 284px; } .brand .sub, .tb-select span { display: none; } }

/* ---------- phones & small tablets ---------- */
.menu-btn, .tb-break, .primary .short, .sheet-toggle, .sel-bar { display: none; }
button, select, input, label { touch-action: manipulation; }
@media (hover: none) { .layer .ops { opacity: 1; } }

/* desktop & large tablets: the side panel collapses to a thin rail (▸ / ◂) */
.sheet-toggle { display: block; color: var(--text) !important; font-size: 14px; }
.tabs { grid-template-columns: repeat(4, 1fr) 30px; }
#app:not(.sheet-open) { grid-template-columns: 52px 1fr 40px; }
#app:not(.sheet-open) .sidebar .panel { display: none; }
#app:not(.sheet-open) .tabs { grid-template-columns: 1fr; grid-auto-rows: auto; align-content: start; border-bottom: 0; height: 100%; }
#app:not(.sheet-open) .tabs button { writing-mode: vertical-rl; padding: 12px 0; border-bottom: 0; border-left: 2px solid transparent; }
#app:not(.sheet-open) .tabs .sheet-toggle { writing-mode: horizontal-tb; order: -1; padding: 10px 0; }
.menu-ver { display: none; }

@media (max-width: 760px), (pointer: coarse) and (max-width: 1100px), (pointer: coarse) and (max-height: 520px) {
  html, body { font-size: 14px; }
  html, body { touch-action: pan-x pan-y; overscroll-behavior: none; }
  #app, #app:not(.sheet-open) { height: 100vh; height: 100dvh; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top" "stage" "side" "tools"; }

  /* top bar: two rows (menu, undo, status, export) / (material, mat, zoom) */
  .topbar { flex-wrap: wrap; gap: 6px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand b, .brand .sub { display: none; }
  .brand { padding-right: 0; }
  .menu-btn { display: inline-flex; font-size: 19px; }
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn svg { width: 20px; height: 20px; }
  .tb-break { display: block; flex-basis: 100%; height: 0; order: 5; }
  .tb-select, .tb-group.zoom { order: 6; }
  .tb-select { flex: 1 1 0; min-width: 0; }
  .tb-select span { display: none; }
  .tb-select select { max-width: none; width: 100%; padding: 8px 6px; font-size: 16px; }
  .tb-group.zoom #zoom-label { min-width: 40px; font-size: 12px; }
  .text-btn { padding: 8px 10px; }
  .status-pill { padding: 8px 10px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .primary { padding: 10px 12px; }
  .primary .long { display: none; } .primary .short { display: inline; }

  /* menus become a sheet under the ☰ button */
  .menus { display: none; position: fixed; z-index: 60; left: 8px; right: 8px; top: 54px; max-height: 76vh; overflow-y: auto; flex-direction: column;
    background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
  #app.menus-open .menus { display: flex; }
  .menu > button { width: 100%; text-align: left; padding: 12px; font-weight: 700; }
  .menu .dropdown { position: static; box-shadow: none; border: 0; background: var(--panel-2); min-width: 0; }
  .dropdown button { padding: 12px; }
  .dropdown button kbd { display: none; }

  /* tools: one scrollable row along the bottom */
  .toolbar { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); gap: 4px; justify-content: flex-start; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .tool { width: 44px; height: 44px; flex: 0 0 auto; }
  .tool svg { width: 22px; height: 22px; }
  .tool-sep { width: 0; height: 26px; border-top: 0; border-left: 1px solid var(--line); margin: 0 3px; flex: 0 0 auto; }
  .swatch-tool { margin: 0 0 0 4px; width: 40px; height: 40px; flex: 0 0 auto; }
  .swatch-tool input { width: 56px; height: 56px; margin: -8px; }

  /* canvas fills the stage; no status bar */
  .statusbar { display: none; }
  #canvas { inset: 0; height: 100%; }
  .tool-options { top: 6px; left: 6px; right: 6px; transform: none; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; }
  .tool-options input[type=number] { width: 64px; font-size: 16px; }
  .tool-options .btn { padding: 8px 12px; }
  .tool-options .hint { display: none; }
  .sel-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 2px; background: rgba(38,36,31,.96);
    border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; box-shadow: 0 8px 26px rgba(0,0,0,.5); }
  .sel-bar[hidden] { display: none !important; }
  .sel-bar button { background: none; border: 0; border-radius: 8px; padding: 10px 13px; font-weight: 700; }
  .sel-bar button:active { background: var(--accent); color: #fff; }

  /* panels: a bottom sheet. Tabs always show; tap one to open, tap again (or ▾) to close */
  .sidebar { border-left: 0; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
  .tabs, #app:not(.sheet-open) .tabs { grid-template-columns: repeat(4, 1fr) 46px; grid-auto-rows: auto; height: auto; border-bottom: 1px solid var(--line); }
  #app:not(.sheet-open) .tabs button { writing-mode: horizontal-tb; padding: 12px 2px 11px; border-left: 0; border-bottom: 2px solid transparent; }
  #app:not(.sheet-open) .tabs button.active { border-bottom-color: var(--accent); }
  #app:not(.sheet-open) .tabs .sheet-toggle { order: 0; }
  .menu-ver { display: block; color: var(--faint); font-size: 12px; padding: 10px 12px 4px; }
  .tabs button { padding: 12px 2px 11px; font-size: 13px; }
  .sheet-toggle { display: block; font-size: 16px; color: var(--text) !important; }
  .sidebar .panel { display: none; }
  #app.sheet-open .sidebar .panel:not([hidden]) { display: block; height: 40vh; height: 40dvh; flex: none; padding-bottom: 20px; overscroll-behavior: contain; }
  #app.sheet-open.sheet-tall .sidebar .panel:not([hidden]) { height: 70vh; height: 70dvh; }

  /* bigger touch targets and no iOS zoom-on-focus (inputs need 16px) */
  input[type=number], input[type=text], select, textarea, .field input, .field select { font-size: 16px; }
  .btn { padding: 9px 11px; }
  .btn.small { padding: 7px 9px; font-size: 13px; }
  .btn.icon { padding: 8px; }
  .sec > summary { padding: 14px; font-size: 12.5px; }
  .swatches button { width: 30px; height: 30px; }
  input[type=color] { width: 42px; height: 38px; }
  input[type=checkbox] { width: 20px; height: 20px; }
  input[type=range] { height: 30px; }
  .slider-row { grid-template-columns: 84px 1fr 44px; }
  .layer { padding: 10px 10px 10px 12px; }
  .layer button { padding: 6px 8px; }
  .segmented button { padding: 9px 0; }
  .issue .acts .btn { padding: 8px 12px; }

  #toasts { bottom: auto; top: 100px; width: calc(100vw - 24px); }
  .toast { max-width: none; text-align: center; }
  .modal { align-items: flex-end; }
  .modal-card { width: 100vw; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; padding: 16px 14px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .modal-card .acts { flex-wrap: wrap; }
  .modal-card .acts .btn { flex: 1 1 auto; padding: 11px 12px; }
}

/* phones held sideways: tools on the left, one-row top bar, panels slide in from the right over the canvas */
@media (orientation: landscape) and (pointer: coarse) and (max-width: 1100px), (orientation: landscape) and (max-height: 520px) and (pointer: coarse), (orientation: landscape) and (max-height: 520px) and (max-width: 760px) {
  #app, #app:not(.sheet-open) { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "tools stage" "tools side"; }
  .topbar { flex-wrap: nowrap; gap: 4px; padding: 4px 8px; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .tb-break, .tb-group.zoom #zoom-label { display: none; }
  .tb-select, .tb-group.zoom { order: 0; }
  .icon-btn { width: 36px; height: 36px; }
  .tb-select select { padding: 6px; }
  .status-pill { max-width: 20vw; padding: 7px 9px; }
  .primary { padding: 8px 10px; }
  .toolbar { flex-direction: column; overflow-x: hidden; overflow-y: auto; border-top: 0; border-right: 1px solid var(--line); padding: 4px; padding-left: max(4px, env(safe-area-inset-left)); }
  .tool { width: 42px; height: 40px; }
  .tool-sep { width: 26px; height: 0; border-left: 0; border-top: 1px solid var(--line); margin: 3px 0; }
  .swatch-tool { margin: 4px 0 0; }
  .tabs button { padding: 9px 2px 8px; }
  #app.sheet-open .sidebar .panel:not([hidden]), #app.sheet-open.sheet-tall .sidebar .panel:not([hidden]) { position: fixed; z-index: 40; right: 0; top: 45px; bottom: 41px; height: auto; width: min(400px, 56vw);
    background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -14px 0 40px rgba(0,0,0,.5); padding-right: env(safe-area-inset-right); }
  .menus { top: 46px; max-height: 84vh; }
  #toasts { top: 56px; }
  .menu-ver { display: block; }
}
