/* StratusCanvas/Web — shell.css
   The docked editor shell shared by the Stratus web apps (Vector, Photo, and Design once it migrates).
   Desktop:  menu bar · [tool strip | hint bar / rulers + canvas / status bar | inspector].
   Phone (≤780px): hint bar, canvas, status bar, bottom tool bar; tools, panels, the inspector and menus
   are bottom sheets. Nothing floats over the canvas: everything is docked or in a sheet.
   Load after StratusUI (stratus-ui.css): the sui-* components are themed by mapping their --sui-* tokens
   onto the light theme below (with a dark variant). Apps override --accent and friends in their own CSS. */

:root {
  --accent: #2f6bff;
  --bg: #f6f6f8;
  --panel: #ffffff;
  --card: #f2f2f5;
  --line: rgba(20, 20, 40, 0.10);
  --line-strong: rgba(20, 20, 40, 0.16);
  --fg: #1c1c22;
  --fg-2: #55566a;
  --fg-3: #8a8b9c;
  --hover: rgba(20, 20, 40, 0.06);
  --active: rgba(47, 107, 255, 0.13);
  --pasteboard: #e3e3e8;
  --ruler: #f0f0f3;
  --ruler-fg: #85869a;
  --ok: #2e9d4f; --warn: #d98a00; --bad: #d83a3a;

  --sui-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --sui-surface: var(--panel);
  --sui-surface-2: #ffffff;
  --sui-border: var(--line-strong);
  --sui-fg: var(--fg);
  --sui-text: var(--fg-2);
  --sui-text-dim: var(--fg-3);
  --sui-text-faint: #b9bac6;
  --sui-accent: var(--accent);
  --sui-accent-2: var(--accent);
  --sui-accent-contrast: #ffffff;
  --sui-accent-soft: rgba(47, 107, 255, 0.22);
  --sui-radius: 12px;
  --sui-radius-sm: 7px;
  --sui-shadow: 0 12px 36px rgba(20, 20, 40, 0.16), 0 2px 6px rgba(20, 20, 40, 0.08);

  --menubar-h: 38px;
  --hint-h: 34px;
  --status-h: 30px;
  --ruler-w: 20px;
  --inspector-w: 296px;
  --strip-w: 48px;
  --tabbar-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #5b8cff;
    --bg: #1c1c21; --panel: #24242a; --card: #2c2c33;
    --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.14);
    --fg: #ececf1; --fg-2: #b1b2c0; --fg-3: #80818f;
    --hover: rgba(255, 255, 255, 0.07); --active: rgba(91, 140, 255, 0.22);
    --pasteboard: #303036; --ruler: #26262c; --ruler-fg: #8d8e9c;
    --sui-surface-2: #34343c; --sui-text-faint: #5c5d6a;
    --sui-accent-soft: rgba(91, 140, 255, 0.3);
    --sui-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --accent: #5b8cff;
  --bg: #1c1c21; --panel: #24242a; --card: #2c2c33;
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.14);
  --fg: #ececf1; --fg-2: #b1b2c0; --fg-3: #80818f;
  --hover: rgba(255, 255, 255, 0.07); --active: rgba(91, 140, 255, 0.22);
  --pasteboard: #303036; --ruler: #26262c; --ruler-fg: #8d8e9c;
  --sui-surface-2: #34343c; --sui-text-faint: #5c5d6a;
  --sui-accent-soft: rgba(91, 140, 255, 0.3);
  --sui-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
/* No rubber-banding and no swipe-to-navigate: horizontal trackpad swipes pan the canvas instead. */
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); color: var(--fg); font: 13px/1.35 var(--sui-font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }

.sc-app { display: grid; grid-template-rows: var(--menubar-h) minmax(0, 1fr); height: 100dvh; }

/* ── Menu bar ─────────────────────────────────────────────────────────────── */
.sc-menubar { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.sc-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-right: 6px; white-space: nowrap; }
.sc-brand .logo { width: 20px; height: 20px; border-radius: 5px; }
.sc-menus { display: flex; align-items: center; gap: 1px; }
.sc-menus > button { border: 0; background: transparent; padding: 5px 9px; border-radius: 6px; cursor: default; font-size: 13px; }
.sc-menus > button:hover { background: var(--hover); }
.sc-menus > button[aria-expanded="true"] { background: var(--active); color: var(--accent); }
.sc-doctitle { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--fg-2); font-size: 12.5px; }
.sc-doctitle > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-dirty { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); }
.sc-actions { display: flex; align-items: center; gap: 2px; }
.sc-actions .sui-btn { margin-left: 8px; }

/* Menus (sui-menu-list popovers) */
.sc-menu-pop { min-width: 250px; padding: 5px; max-height: calc(100dvh - 60px); overflow: auto; }
.sc-menu-pop.is-open { opacity: 1; transform: none; }
.sui-menu-list [role^="menuitem"] { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 10px 5px 8px; border: 0; background: transparent; border-radius: 6px; color: var(--fg); font-size: 13px; text-align: left; cursor: default; }
.sui-menu-list [role^="menuitem"]:hover:not([disabled]), .sui-menu-list [role^="menuitem"]:focus-visible { background: var(--accent); color: #fff; outline: none; }
.sui-menu-list [role^="menuitem"][disabled] { color: var(--fg-3); opacity: .6; }
.sc-mi-check { width: 14px; display: inline-flex; color: inherit; }
.sc-mi-label { flex: 1; white-space: nowrap; }
.sc-mi-key { color: var(--fg-3); font-size: 12px; letter-spacing: .5px; white-space: nowrap; }
.sui-menu-list [role^="menuitem"]:hover:not([disabled]) .sc-mi-key { color: rgba(255,255,255,.8); }
.sc-mi-sub { color: var(--fg-3); }
.sc-mi-head { padding: 6px 10px 2px 30px; font-size: 11px; font-weight: 600; color: var(--fg-3); }
.sui-menu-sep { background: var(--line); margin: 4px 6px; }

/* ── Small controls ───────────────────────────────────────────────────────── */
.sc-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--fg-2); cursor: pointer; padding: 0; flex: 0 0 auto; }
.sc-iconbtn:hover:not(:disabled) { background: var(--hover); color: var(--fg); }
.sc-iconbtn:disabled { opacity: .35; cursor: default; }
.sc-iconbtn.is-active { background: var(--active); color: var(--accent); }
.sc-iconbtn.sm { width: 26px; height: 24px; }
.sc-iconbtn.sm .ic { width: 16px; height: 16px; }
.sui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sui-btn.sc-sm { padding: 5px 11px; font-size: 12.5px; font-weight: 600; border-radius: 7px; }
.sui-btn-ghost { background: var(--panel); }
.sui-btn-ghost:hover { border-color: var(--accent); }
.sui-btn:disabled { opacity: .45; cursor: default; }
.sui-btn.sc-plain { background: var(--line); border-color: transparent; color: var(--fg); font-weight: 500; }
.sui-btn.sc-plain:hover { background: var(--line-strong); }
.sui-btn.sc-link { background: transparent; border-color: transparent; color: var(--accent); padding-left: 2px; padding-right: 2px; font-weight: 500; }
.sui-input { padding: 5px 8px; border-radius: 7px; font-size: 12.5px; background: var(--sui-surface-2); color: var(--fg); min-width: 0; }
select.sui-input { appearance: none; -webkit-appearance: none; padding-right: 24px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3-3 3 3M3 7.5l3 3 3-3' fill='none' stroke='%238a8b9c' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 11px; }
textarea.sui-input, .sui-textarea { width: 100%; resize: vertical; font: 13px/1.45 var(--sui-font); }
.sui-input.sc-num { width: 64px; }
.sui-switch { width: 34px; height: 20px; }
.sui-switch .sui-switch-thumb { width: 16px; height: 16px; left: 2px; background: #fff; }
.sui-switch.is-on .sui-switch-thumb { transform: translateX(14px); background: #fff; }
.sui-switch:not(.is-on) { background: var(--line-strong); box-shadow: none; }
.sui-range { height: 4px; accent-color: var(--accent); }

/* ── Workspace ────────────────────────────────────────────────────────────── */
.sc-workspace { display: grid; grid-template-columns: var(--strip-w) minmax(0, 1fr) var(--inspector-w); min-height: 0; }
.sc-workspace.no-inspector { grid-template-columns: var(--strip-w) minmax(0, 1fr) 0; }
.sc-workspace.no-inspector .sc-inspector { display: none; }

.sc-toolstrip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: none; scrollbar-width: none; }
.sc-toolstrip::-webkit-scrollbar { display: none; }
.sc-tool { width: 36px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; padding: 0; }
.sc-tool:hover { background: var(--hover); color: var(--fg); }
.sc-tool.is-active { background: var(--active); color: var(--accent); }
.sc-strip-sep { width: 24px; height: 1px; background: var(--line); margin: 5px 0; flex: 0 0 auto; }

.sc-center { display: grid; grid-template-rows: var(--hint-h) minmax(0, 1fr) var(--status-h); min-width: 0; min-height: 0; }
.sc-hintbar { display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; min-width: 0; overflow: hidden; }
.sc-hintbar > b { font-size: 13.5px; font-weight: 700; flex: 0 0 auto; }
.sc-hint { color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.sc-hint-opts { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; color: var(--fg-2); }
.sc-hint-opts label { display: inline-flex; align-items: center; gap: 6px; }
.sc-hint-opts .sui-input { padding: 3px 6px; }
.sc-hintbar .sc-finish { flex: 0 0 auto; padding: 3px 10px; }
.sc-phone-top { display: none; }

.sc-canvas-area { position: relative; display: grid; grid-template-columns: var(--ruler-w) minmax(0, 1fr); grid-template-rows: var(--ruler-w) minmax(0, 1fr); min-height: 0; background: var(--pasteboard); }
.sc-canvas-area.no-rulers { grid-template-columns: 0 minmax(0, 1fr); grid-template-rows: 0 minmax(0, 1fr); }
.sc-ruler-corner { background: var(--ruler); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.sc-ruler { display: block; width: 100%; height: 100%; background: var(--ruler); }
.sc-canvas-host { position: relative; overflow: hidden; overscroll-behavior: none; min-width: 0; min-height: 0; touch-action: none; }
.sc-canvas-host canvas { position: absolute; left: 0; top: 0; display: block; }
.sc-canvas-host canvas.sc-overlay { pointer-events: none; }

.sc-statusbar { display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-2); white-space: nowrap; min-width: 0; }
.sc-sb-sep { width: 1px; height: 16px; background: var(--line); flex: 0 0 auto; }
.sc-zoomctl { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; }
.sc-zoomval { min-width: 52px; border: 0; background: transparent; padding: 3px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--fg); }
.sc-zoomval:hover { background: var(--hover); }
.sc-selcount { flex: 0 0 auto; font-weight: 600; color: var(--fg); }
.sc-selcount:empty { display: none; }
.sc-status-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg-3); }
.sc-pfbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 3px 8px; border-radius: 6px; cursor: pointer; color: var(--fg-2); font-size: 12px; flex: 0 0 auto; }
.sc-pfbtn:hover { background: var(--hover); }
.sc-pfdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: transparent; border: 1.5px dashed var(--fg-3); }
.sc-pfdot.ok { background: var(--ok); border: 0; } .sc-pfdot.bad { background: var(--bad); border: 0; } .sc-pfdot.warn { background: var(--warn); border: 0; }

/* ── Inspector ────────────────────────────────────────────────────────────── */
.sc-inspector { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); border-left: 1px solid var(--line); }
.sc-sheet-handle { display: none; }
.sc-panel-tabs { display: grid; grid-template-columns: repeat(var(--panel-cols, 6), 1fr); gap: 2px; padding: 8px 10px 2px; }
.sc-panel-tabs button { height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--fg-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sc-panel-tabs button:hover { background: var(--hover); color: var(--fg); }
.sc-panel-tabs button.is-active { background: var(--active); color: var(--accent); }
.sc-panel-title { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--fg-3); padding: 2px 0 8px; border-bottom: 1px solid var(--line); }
.sc-panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.sc-panel { padding: 4px 12px 16px; }
.sc-group > h4, .sc-list-head { margin: 14px 4px 6px; font-size: 12px; font-weight: 700; color: var(--fg); display: flex; align-items: baseline; gap: 6px; }
.sc-group > h4 small { font-weight: 500; color: var(--fg-3); font-size: 11.5px; }
.sc-group > h4 .sc-h-right { margin-left: auto; display: flex; gap: 2px; }
.sc-card { background: var(--card); border-radius: 10px; padding: 4px 10px; display: flex; flex-direction: column; }
.sc-card > .sc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; border-bottom: 1px solid var(--line); }
.sc-card > .sc-row:last-child { border-bottom: 0; }
.sc-card > .sc-row > .sc-row-label { color: var(--fg); flex: 0 0 auto; }
.sc-row-ctl { display: flex; align-items: center; gap: 8px; min-width: 0; justify-content: flex-end; }
.sc-card > .sc-row select.sui-input { max-width: 168px; }
.sc-card > .sc-row > .sc-row-ctl > input.sui-input:not(.sc-num) { max-width: 168px; }
.sc-card .sc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sc-card .sc-grid2:last-child { border-bottom: 0; }
.sc-card > .sc-block { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sc-card > .sc-block:last-child { border-bottom: 0; }
.sc-fld { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sc-fld > span { width: 14px; color: var(--fg-3); font-size: 12px; text-align: center; flex: 0 0 auto; }
.sc-fld .sui-input { min-width: 0; flex: 1; width: 100%; }
.sc-iconrow { display: flex; gap: 2px; padding: 6px 0; }
.sc-pair { display: flex; align-items: center; gap: 8px; }
.sc-pair output { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); }
.sc-pair .sui-range { width: 110px; }
.sc-color { position: relative; width: 44px; height: 22px; border-radius: 11px; border: 1px solid var(--line-strong); flex: 0 0 auto; padding: 0; cursor: pointer; overflow: hidden; background: transparent; }
.sc-color .sc-color-fill { position: absolute; inset: 0; }
.sc-color.none .sc-color-fill { background: linear-gradient(135deg, transparent 45%, var(--bad) 46%, var(--bad) 54%, transparent 55%), #fff; }
.sc-color input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.sc-card.sc-actions-card { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
.sc-card > .sui-btn { align-self: flex-start; margin: 6px 0; }
.sc-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0 4px; }
.sc-btn-grid .sui-btn { padding: 6px 8px; font-size: 12.5px; font-weight: 500; }
.sc-seg { display: inline-flex; background: var(--line); border-radius: 7px; padding: 2px; gap: 1px; }
.sc-seg button { border: 0; background: transparent; padding: 3px 9px; border-radius: 5px; cursor: pointer; color: var(--fg-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.sc-seg button:hover { color: var(--fg); }
.sc-seg button.is-active { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.sc-seg.wide { display: flex; margin: 6px 0; }
.sc-seg.wide button { flex: 1; padding: 5px 4px; }
.sc-empty { margin: 16px 4px 0; color: var(--fg-3); font-size: 12px; line-height: 1.45; }
.sc-note { color: var(--fg-3); font-size: 11.5px; padding: 0 0 6px; }

/* Lists (layers, artboards, swatches) */
.sc-list { list-style: none; margin: 0; padding: 0; }
.sc-list li { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 2px 6px; border-radius: 7px; cursor: pointer; }
.sc-list li:hover { background: var(--hover); }
.sc-list li.is-active { background: var(--active); }
.sc-list li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-list li .muted { color: var(--fg-3); font-size: 11.5px; }
.sc-list li .sc-iconbtn { opacity: .55; }
.sc-list li:hover .sc-iconbtn, .sc-list li .sc-iconbtn.on { opacity: 1; }
.sc-chip { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line-strong); flex: 0 0 auto; }
.sc-swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; padding: 8px 0; }
.sc-swatch-grid button { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.sc-swatch-grid button:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.sc-panel-foot { position: sticky; bottom: -16px; display: flex; align-items: center; gap: 4px; padding: 8px 2px; margin-top: 8px; background: var(--panel); border-top: 1px solid var(--line); }
.sc-foot-note { color: var(--fg-3); font-size: 11.5px; margin-left: 6px; }

/* ── Phone bottom bar and sheets ──────────────────────────────────────────── */
.sc-tabbar { display: none; }
.sc-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 20, .32); z-index: 50; }
.sc-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--panel); border-radius: 14px 14px 0 0; box-shadow: var(--sui-shadow); max-height: 80dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain; }
.sc-sheet .sc-sheet-handle, .sc-inspector.is-sheet .sc-sheet-handle { display: flex; justify-content: center; padding: 7px 0 2px; touch-action: none; cursor: grab; }
.sc-sheet-handle span { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.sc-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 8px 16px; font-size: 15px; }
.sc-sheet-body { overflow-y: auto; padding: 0 16px 16px; overscroll-behavior: contain; }
.sc-tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sc-tool-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 72px; padding: 10px 4px; border: 0; border-radius: 12px; background: var(--card); color: var(--fg); font-size: 12px; cursor: pointer; text-align: center; }
.sc-tool-grid button.is-active { background: var(--active); color: var(--accent); }
.sc-tool-grid .ic { width: 24px; height: 24px; }
.sc-sheet-body h5 { margin: 14px 4px 8px; font-size: 13px; color: var(--fg-3); font-weight: 600; }
.sc-sheet-body h5:first-child { margin-top: 4px; }
.sc-sheet-body .sc-mgroup { background: var(--card); border-radius: 12px; overflow: hidden; }
.sc-sheet-body .sc-mgroup [role^="menuitem"] { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); font-size: 15px; text-align: left; }
.sc-sheet-body .sc-mgroup [role^="menuitem"]:last-child { border-bottom: 0; }
.sc-sheet-body .sc-mgroup [role^="menuitem"][disabled] { color: var(--fg-3); }
.sc-sheet-body .sc-mi-key { display: none; }

/* Toasts sit above the bottom bar on a phone. */
.sui-toast-host { bottom: calc(var(--status-h) + 14px); }

/* ── Dialogs (sheets on a phone) ──────────────────────────────────────────── */
.sc-dlg { border: 1px solid var(--line-strong); border-radius: 14px; padding: 0; width: 100%; max-width: min(480px, calc(100vw - 32px)); background: var(--panel); color: var(--fg); box-shadow: var(--sui-shadow); }
.sc-dlg::backdrop { background: rgba(10, 10, 20, .32); }
.sc-dlg-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px; }
.sc-dlg-head { display: flex; align-items: center; justify-content: space-between; }
.sc-dlg-head h3 { margin: 0; font-size: 15px; }
.sc-dlg-body > label, .sc-dlg-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--fg-2); }
.sc-dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-dlg-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Narrower desktops ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --inspector-w: 268px; }
  .sc-brand > span { display: none; }
  .sc-hint-opts .sc-opt-label { display: none; }
}

/* ── Phone width ──────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  :root { --hint-h: 44px; --status-h: 32px; --ruler-w: 18px; }
  .sc-app { grid-template-rows: minmax(0, 1fr) auto; }
  .sc-menubar, .sc-toolstrip { display: none; }
  .sc-workspace, .sc-workspace.no-inspector { grid-template-columns: minmax(0, 1fr); }
  .sc-workspace.no-inspector .sc-inspector { display: flex; }
  .sc-center { grid-template-rows: calc(var(--hint-h) + env(safe-area-inset-top)) minmax(0, 1fr) var(--status-h); }
  .sc-hintbar { padding: env(safe-area-inset-top) 4px 0 12px; gap: 8px; }
  .sc-hintbar > b { font-size: 15px; }
  .sc-hint { font-size: 13px; }
  .sc-hint-opts { display: none; }
  .sc-phone-top { display: flex; align-items: center; flex: 0 0 auto; }
  .sc-phone-top .sc-iconbtn { width: 40px; height: 40px; }
  .sc-hintbar .sui-btn.sc-finish { height: 34px; padding: 0 12px; font-size: 14px; }
  .sc-statusbar { gap: 6px; padding: 0 10px; }
  .sc-status-msg, .sc-zoomctl .sc-iconbtn { display: none; }
  .sc-selcount { flex: 1; overflow: hidden; text-overflow: ellipsis; }

  /* The inspector is a bottom sheet with a drag handle. */
  .sc-inspector { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 72dvh; border: 0; border-radius: 14px 14px 0 0; box-shadow: var(--sui-shadow); transform: translateY(105%); transition: transform .22s ease; padding-bottom: env(safe-area-inset-bottom); visibility: hidden; }
  .sc-inspector.is-open { transform: none; visibility: visible; }
  .sc-inspector .sc-sheet-handle { display: flex; justify-content: center; padding: 8px 0 2px; touch-action: none; }
  .sc-inspector .sc-panel-tabs { display: none; }
  .sc-inspector.show-tabs .sc-panel-tabs { display: grid; }
  .sc-panel-tabs { padding: 4px 12px 2px; }
  .sc-panel-tabs button { height: 44px; }
  .sc-panel-title { font-size: 15px; font-weight: 700; color: var(--fg); padding: 2px 0 10px; }

  .sc-tabbar { display: grid; grid-template-columns: repeat(var(--tab-count, 8), 1fr); background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .sc-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--tabbar-h); border: 0; background: transparent; color: var(--fg); font-size: 10.5px; padding: 4px 0; cursor: pointer; min-width: 0; }
  .sc-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sc-tab .ic { width: 24px; height: 24px; }
  .sc-tab.is-active { color: var(--accent); }

  /* 44px targets, 16px fields (no focus zoom on iOS) */
  .sui-input, select.sui-input, textarea.sui-input, .sc-dlg input, .sc-dlg select { font-size: 16px; }
  .sui-input { min-height: 38px; }
  .sc-card > .sc-row { min-height: 48px; }
  .sui-btn.sc-sm { min-height: 40px; font-size: 14px; }
  .sc-iconbtn.sm { width: 40px; height: 40px; }
  .sc-seg button { min-height: 34px; min-width: 40px; }
  .sui-switch { width: 44px; height: 26px; } .sui-switch .sui-switch-thumb { width: 22px; height: 22px; } .sui-switch.is-on .sui-switch-thumb { transform: translateX(18px); }
  .sc-list li { min-height: 44px; font-size: 15px; }
  .sc-chip { width: 24px; height: 24px; }
  .sc-dlg { max-width: 100vw; width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; max-height: 88dvh; border: 0; }
  .sc-dlg-body { padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); }
  .sc-dlg-actions .sui-btn { flex: 1 1 auto; min-height: 44px; }
  .sc-dlg-grid { grid-template-columns: 1fr; }
  .sui-toast-host { bottom: calc(var(--status-h) + var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); left: 16px; right: 16px; max-width: none; }
}
