:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20232a;
  background: #f3f4f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --border: #e3e5e9;
  --muted: #747985;
  --blue: #0d99ff;
  --primary-action-bg: #0077b8;
  --primary-action-hover: #006aa4;
  --primary-action-border: #0077b8;
  --panel: #fff;
  --surface-subtle: #f7f8fa;
  --surface-hover: #f0f2f5;
  --ink: #20232a;
  --focus-ring: #005fcc;
  --canvas-base: #262a32;
  --topbar-shadow: 0 2px 10px rgba(20,30,44,.07);
  --floating-panel-background: rgba(255,255,255,.98);
  --floating-panel-border: rgba(221,225,231,.95);
  --toolbar-shadow: 0 10px 28px rgba(20,24,32,.14), 0 2px 6px rgba(20,24,32,.08), 0 0 1px rgba(20,24,32,.24);
  --panel-shadow: 0 12px 32px rgba(15,18,24,.2), 0 2px 7px rgba(15,18,24,.1);
  --control-radius: 7px;
}
* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html, body, .app-shell { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-size: 12px; user-select: none; -webkit-font-smoothing: antialiased; }
button, input, select { color: inherit; font: inherit; }
button { border: 0; background: transparent; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #80caff; outline-offset: 1px; }
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr); position: relative; background: #fff; }
.topbar { z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 48px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--border); }
.topbar-leading, .topbar-trailing, .document-title-wrap { display: flex; align-items: center; min-width: 0; }
.topbar-leading { gap: 7px; flex: 1 1 0; }
.topbar-trailing { justify-content: flex-end; gap: 9px; flex: 1 1 0; }
.icon-button, .canvas-action-button, .tiny-icon-button { display: inline-grid; place-items: center; border-radius: 6px; color: #555; }
.icon-button { width: 32px; height: 32px; font-size: 16px; }
.icon-button:hover, .canvas-action-button:hover, .tiny-icon-button:hover { background: #f0f0f0; }
.brand-button { width: 34px; }
.brand-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #1e1e1e; color: #fff; font-weight: 700; font-size: 14px; }
.topbar-button { height: 30px; display: flex; gap: 8px; align-items: center; padding: 0 10px; border-radius: 6px; font-size: 12px; color: #333; }
.topbar-button:hover { background: #f4f4f4; }
.file-glyph { font-size: 14px; }
.chevron { color: #777; font-size: 11px; margin-left: 2px; }
.topbar-divider { height: 22px; border-left: 1px solid var(--border); margin: 0 4px; }
.document-title-wrap { flex: 0 1 330px; justify-content: center; flex-direction: column; gap: 1px; }
.document-name { width: 100%; max-width: 220px; padding: 3px 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; text-align: center; font-size: 12px; font-weight: 550; }
.document-name:hover, .document-name:focus { border-color: #ddd; background: #fff; outline: 0; }
.save-state { display: flex; align-items: center; gap: 5px; color: #888; font-size: 10px; white-space: nowrap; }
.save-state-compact { display: none; }
.storage-mode-chip { display: none; }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: #19a974; }
.save-state.is-saving .save-dot { background: #f2a139; animation: pulse 1s infinite; }
.save-state.is-error .save-dot { background: #e5484d; }
@keyframes pulse { 50% { opacity: .35; } }
.mode-switcher { border: 1px solid #e8e8e8; }
.quiet-button { background: #1e1e1e; color: #fff; height: 28px; padding: 0 13px; }
.quiet-button:hover { background: #333; }
.avatar-button { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #fff; background: #8654d8; font-weight: 650; }
.mobile-panel-toggle { display: none; }
.workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr) 280px; min-height: 0; overflow: hidden; }
.left-panel, .right-panel { z-index: 3; position: relative; display: flex; flex-direction: column; min-height: 0; background: #fff; }
.left-panel { border-right: 1px solid var(--border); }
.right-panel { border-left: 1px solid var(--border); }
.sidebar-tabs { height: 43px; display: flex; align-items: stretch; gap: 20px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.sidebar-tab, .inspector-tab { position: relative; color: #777; font-size: 12px; font-weight: 500; }
.sidebar-tab.is-active, .inspector-tab.is-active { color: #222; }
.sidebar-tab.is-active::after, .inspector-tab.is-active::after { position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; content: ""; background: #1e1e1e; border-radius: 2px 2px 0 0; }
.pages-section { padding: 12px 8px 8px; border-bottom: 1px solid var(--border); }
.section-heading { height: 23px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: #666; font-size: 11px; font-weight: 600; }
.heading-actions { display: flex; gap: 3px; }
.tiny-icon-button { width: 23px; height: 23px; font-size: 15px; }
.pages-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.page-row { position: relative; width: 100%; min-height: 29px; display: flex; align-items: center; gap: 2px; padding: 0 3px 0 0; border-radius: 5px; color: #444; }
.page-row:hover { background: #f4f4f4; }
.page-row.is-active { color: #222; background: #efefef; font-weight: 550; }
.page-row-select { min-width: 0; min-height: 29px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 8px; overflow: hidden; border-radius: 5px; text-align: left; }
.page-row-select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.page-row-menu { position: relative; flex: 0 0 26px; align-self: stretch; display: flex; align-items: center; }
.page-row-menu > summary { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 5px; color: #68707c; font-size: 16px; line-height: 1; list-style: none; cursor: pointer; }
.page-row-menu > summary::-webkit-details-marker { display: none; }
.page-row-menu > summary:hover, .page-row-menu[open] > summary { background: var(--surface-hover); }
.page-actions-menu { position: absolute; z-index: 8; top: 25px; right: 0; width: 150px; display: grid; gap: 2px; padding: 5px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); box-shadow: var(--panel-shadow); }
.page-actions-menu button { min-height: 32px; padding: 0 8px; border-radius: 5px; color: var(--ink); text-align: left; font-size: 11px; }
.page-actions-menu button:hover:not(:disabled) { background: var(--surface-hover); }
.page-actions-menu button:disabled { opacity: .45; }
.page-actions-menu .page-delete-action { color: #c43c35; }
.page-row-icon { width: 14px; color: #888; font-size: 12px; }
.page-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.layers-section, .assets-section { min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 10px 8px 6px; }
.layers-section[hidden], .assets-section[hidden] { display: none; }
.layers-heading { padding: 0 8px; }
.layer-selection-hint { margin: 2px 8px 4px; padding: 7px 8px; border-radius: 6px; background: var(--surface-subtle); color: var(--muted); font-size: 11px; line-height: 1.4; }
.layer-selection-hint[hidden] { display: none; }
.layer-select-mode { min-width: 94px; min-height: 23px; padding: 0 7px; border: 1px solid #e5e5e5; border-radius: 5px; color: #555; font-size: 9px; white-space: nowrap; }
.layer-select-mode:hover { background: #f5f5f5; }
.layer-select-mode.is-active { border-color: #a9d9ff; background: #e9f5ff; color: #087dcc; }
.layer-search-wrap { padding: 4px 5px 6px; }
.layer-search-wrap input { width: 100%; height: 27px; padding: 0 8px; border: 1px solid #e1e1e1; border-radius: 5px; background: #fff; outline-color: #80caff; }
.layers-list { min-height: 0; overflow: auto; padding-top: 5px; }
.layer-row { height: 29px; min-width: 0; display: flex; align-items: center; gap: 6px; padding-right: 5px; border-radius: 5px; color: #454545; white-space: nowrap; cursor: grab; }
.layer-row.is-dragging { opacity: .38; }
.layer-row.is-drop-before { box-shadow: inset 0 2px #0d99ff; }
.layer-row.is-drop-after { box-shadow: inset 0 -2px #0d99ff; }
.layer-row.is-drop-inside { outline: 2px solid #0d99ff; outline-offset: -2px; background: color-mix(in srgb, #0d99ff 12%, transparent); }
.layer-row:hover { background: #f4f4f4; }
.layer-row.is-selected { color: #137ed0; background: #e5f3ff; }
.layer-position-section { min-height: 22px; display: flex; align-items: center; margin-top: 4px; padding: 0 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.layer-depth-marker { display: none; }
.layer-chevron, .layer-chevron-placeholder { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; padding: 0; border-radius: 5px; color: #777; font-size: 15px; line-height: 1; touch-action: manipulation; }
.layer-chevron:hover { background: var(--surface-hover, #eceff3); }
.layer-chevron:focus-visible { outline: 2px solid #0d99ff; outline-offset: 1px; }
.layer-icon { display: grid; place-items: center; width: 14px; height: 16px; flex: 0 0 14px; color: #777; }
.layer-name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; font-size: 11px; }
.layer-reorder-handle { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; padding: 0; border-radius: 5px; color: var(--muted, #777); background: transparent; font-size: 17px; line-height: 1; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.layer-reorder-handle:hover, .layer-reorder-handle:active { color: var(--ink, #333); background: var(--surface-hover, #eceff3); }
.layer-reorder-handle:active { cursor: grabbing; }
.layer-reorder-handle:focus-visible { outline: 2px solid var(--focus-ring, #0d99ff); outline-offset: -2px; }
.layer-order-control { display: none; width: 21px; height: 21px; flex: 0 0 21px; padding: 0; border-radius: 4px; color: #777; font-size: 12px; line-height: 1; touch-action: manipulation; }
.layer-actions-menu { display: none; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; padding: 0; border-radius: 4px; color: #777; font-size: 17px; line-height: 1; touch-action: manipulation; }
.layer-row:hover .layer-order-control, .layer-row.is-selected .layer-order-control, .layer-row:focus-within .layer-order-control { display: grid; place-items: center; }
.layer-order-control:hover:not(:disabled) { background: #e8e8e8; color: #333; }
.layer-order-control:disabled { opacity: .35; cursor: default; }
.layer-visibility { display: none; width: 21px; height: 21px; flex: 0 0 21px; color: #777; }
.layer-row:hover .layer-visibility, .layer-row.is-selected .layer-visibility { display: grid; place-items: center; }
.layer-row:hover .layer-actions-menu, .layer-row.is-selected .layer-actions-menu, .layer-row:focus-within .layer-actions-menu { display: grid; }
.layer-actions-menu:hover { background: #e8e8e8; color: #333; }
.layer-hidden { opacity: .45; }
.layer-locked .layer-name::after { content: ' · locked'; color: #929292; font-size: 10px; }
.recipe-picker { width: 100%; margin-bottom: 8px; }
.recipe-save-button, .recipe-apply-button { width: 100%; }
.recipe-save-button { margin-bottom: 9px; }
.recipe-management { margin-top: 8px; border-top: 1px solid var(--border); }
.recipe-management > summary { min-height: 36px; display: flex; align-items: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.recipe-management-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 4px 0 2px; }
.recipe-management-actions .add-fill { min-height: 38px; margin: 0; }
.recipe-management-actions [data-action="update-image-recipe"] { grid-column: 1 / -1; }
.empty-sidebar { display: flex; align-items: center; flex-direction: column; gap: 6px; padding: 42px 22px; color: #8a8a8a; text-align: center; }
.empty-sidebar[hidden] { display: none; }
.empty-sidebar strong { color: #666; font-size: 11px; font-weight: 550; }
.empty-layer-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #e5e5e5; border-radius: 9px; font-size: 20px; color: #888; }
.empty-sidebar span { font-size: 10px; line-height: 1.45; }
.empty-layer-actions { width: 100%; display: grid; gap: 7px; margin-top: 5px; }
.empty-layer-actions button { min-height: 38px; justify-content: center; }
.sidebar-footer { height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 15px; border-top: 1px solid var(--border); color: #888; font-size: 10px; }
.sidebar-footer .tiny-icon-button { margin-left: auto; }
.device-icon { color: #16a16a; font-size: 11px; }
.assets-list { min-height: 0; flex: 1 1 0; display: flex; flex-direction: column; gap: 8px; padding: 5px; overflow: auto; }
.placed-image-assets { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.image-library-root { min-width: 0; min-height: 0; flex: 1 0 auto; }
.color-styles-list { max-height: 38%; flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 4px 5px 10px; overflow: auto; }
.color-style-row { min-width: 0; display: flex; align-items: center; gap: 4px; }
.components-list { max-height: 25%; flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px 5px 9px; overflow: auto; }
.local-component-library-heading { flex: 0 0 auto; }
.component-library-list { min-height: 0; max-height: 24%; flex: 0 1 auto; overflow: auto; padding: 3px 5px 8px; }
.local-library-card { margin-bottom: 7px; padding: 7px; border: 1px solid #ededed; border-radius: 7px; background: #fff; }
.local-library-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #444; font-size: 10px; }
.local-library-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-library-header small, .local-library-component small { color: #999; font-size: 8px; }
.local-library-publish { width: 100%; min-height: 27px; margin: 6px 0; border: 1px solid #e5e5e5; border-radius: 5px; color: #555; font-size: 9px; text-align: left; padding: 4px 7px; }
.local-library-publish:hover:not(:disabled) { border-color: #bfdcf2; background: #f7fbff; }
.local-library-publish:disabled { opacity: .48; }
.local-library-components { display: grid; gap: 4px; }
.local-library-component { min-width: 0; min-height: 35px; display: flex; align-items: center; gap: 6px; padding: 4px 5px; border: 1px solid transparent; border-radius: 5px; text-align: left; }
.local-library-component:hover { border-color: #bfdcf2; background: #f7fbff; }
.local-library-component .component-card-name { flex: 1; }
.local-library-empty { padding: 4px 1px; color: #999; font-size: 9px; line-height: 1.45; }
.variable-collections-list { max-height: 28%; flex: 0 0 auto; display: grid; gap: 6px; padding: 4px 5px 8px; overflow: auto; }
.variable-collection-card { min-width: 0; padding: 7px; border: 1px solid #ededed; border-radius: 6px; background: #fff; }
.variable-collection-header, .variable-collection-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.variable-collection-header { margin-bottom: 5px; color: #555; font-size: 10px; }
.variable-collection-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.variable-collection-controls .select-field { min-width: 0; flex: 1; height: 26px; }
.variable-mode-add { height: 25px; padding: 0 6px; border: 1px solid #e9e9e9; border-radius: 5px; color: #666; font-size: 9px; white-space: nowrap; }
.variable-mode-add:hover { background: #f7f7f7; }
.variable-rows { display: grid; gap: 5px; margin-top: 5px; }
.variable-row { min-width: 0; display: grid; gap: 5px; padding: 5px; border: 1px solid #f0f0f0; border-radius: 5px; }
.variable-item-heading { min-width: 0; display: flex; align-items: center; gap: 5px; }
.variable-apply { min-width: 0; flex: 1; height: 25px; display: flex; align-items: center; gap: 7px; padding: 0 4px; border-radius: 4px; text-align: left; }
.variable-apply:hover { background: #f5f5f5; }
.variable-swatch { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid rgba(0,0,0,.12); border-radius: 4px; }
.variable-name { min-width: 0; flex: 1; overflow: hidden; color: #555; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.variable-type-badge { padding: 2px 4px; border-radius: 3px; background: #f4f4f4; color: #777; font-size: 8px; }
.variable-mode-values { display: grid; gap: 4px; }
.variable-mode-value { min-width: 0; display: grid; grid-template-columns: minmax(42px, .8fr) minmax(68px, 1fr) minmax(50px, .8fr); align-items: center; gap: 4px; }
.variable-scopes-editor { min-width: 0; border-top: 1px solid #f0f0f0; }
.variable-scopes-editor summary { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; color: #666; font-size: 9px; list-style-position: inside; }
.variable-scopes-editor summary span { color: #888; }
.variable-scopes-options { max-height: 190px; display: grid; gap: 7px; overflow: auto; padding: 3px 2px 5px; }
.variable-scope-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px; }
.variable-scope-group > span { grid-column: 1 / -1; color: #888; font-size: 8px; font-weight: 600; }
.variable-scope-group label { min-width: 0; display: flex; align-items: center; gap: 4px; color: #555; font-size: 8px; line-height: 1.25; }
.variable-scope-group input { width: 13px; height: 13px; flex: 0 0 13px; margin: 0; }
.variable-mode-name { overflow: hidden; color: #888; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.variable-alias { width: 100%; height: 25px; padding: 0 4px; font-size: 8px; }
.variable-value { width: 100%; min-width: 0; height: 25px; padding: 2px 4px; border: 1px solid #e5e5e5; border-radius: 5px; background: #fff; font-size: 9px; }
.variable-value[type="color"] { padding: 2px; }
.variable-value[type="checkbox"] { justify-self: start; width: 16px; height: 16px; }
.variable-value:disabled { opacity: .45; }
.variable-remove { width: 21px; height: 21px; font-size: 13px; }
.variables-empty { padding: 4px 2px 7px; color: #999; font-size: 9px; line-height: 1.45; }
.component-card { min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 5px 7px; border: 1px solid #ededed; border-radius: 6px; text-align: left; }
.component-card:hover { border-color: #cfcfcf; background: #fafafa; }
.component-card-icon { width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-items: center; border-radius: 5px; background: #f1ecff; color: #7253c4; font-size: 13px; }
.component-card-name { overflow: hidden; color: #555; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.components-empty { grid-column: 1 / -1; padding: 4px 2px 8px; color: #999; font-size: 9px; }
.component-set-card { grid-column: 1 / -1; min-width: 0; display: grid; gap: 8px; padding: 8px; border: 1px solid #e8e5ed; border-radius: 7px; background: #fff; }
.component-set-heading, .component-set-heading label, .component-set-placement, .component-set-placement label { min-width: 0; display: grid; gap: 5px; }
.component-set-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.component-set-heading label > span, .component-set-placement label > span,
.component-set-add-axis label > span, .component-set-axis-name > span,
.component-set-variant-values label > span { color: #777; font-size: 9px; }
.component-set-heading input, .component-set-axis-name input,
.component-set-add-axis input, .component-set-variant-values input,
.component-set-placement .select-field { width: 100%; min-width: 0; min-height: 44px; padding: 7px; border: 1px solid #e4e2e8; border-radius: 6px; background: #fff; font-size: 11px; }
.component-set-heading small { padding-bottom: 11px; color: #888; font-size: 9px; white-space: nowrap; }
.component-set-placement { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.component-set-place-selected, .component-set-place-variant,
.component-set-add-axis > button, .component-set-remove-axis { min-width: 44px; min-height: 44px; padding: 7px 10px; border: 1px solid #e3dcef; border-radius: 6px; background: #f7f3ff; color: #573c91; font-size: 11px; }
.component-set-place-selected:hover, .component-set-place-variant:hover,
.component-set-add-axis > button:hover, .component-set-remove-axis:hover { border-color: #bba9dc; background: #f0eafd; }
.component-set-editor { min-width: 0; border-top: 1px solid #f0edf3; padding-top: 6px; }
.component-set-editor > summary { min-height: 44px; display: flex; align-items: center; color: #655585; font-size: 10px; font-weight: 550; cursor: pointer; }
.component-set-axis-list, .component-set-variants { min-width: 0; display: grid; gap: 6px; }
.component-set-axis { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: end; gap: 6px; }
.component-set-axis-name, .component-set-add-axis label, .component-set-variant-values label { min-width: 0; display: grid; gap: 4px; }
.component-set-remove-axis { font-size: 17px; }
.component-set-add-axis { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 8px 0; border-bottom: 1px solid #f0edf3; }
.component-set-add-axis > button { grid-column: 1 / -1; }
.component-set-variants { padding-top: 8px; }
.component-set-variant { min-width: 0; display: grid; gap: 6px; padding: 7px; border: 1px solid #eeeaf2; border-radius: 6px; }
.component-set-variant-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #555; font-size: 10px; }
.component-set-variant-heading strong { min-width: 0; overflow-wrap: anywhere; font-weight: 550; }
.component-set-place-variant { min-height: 44px; }
.component-set-remove-variant { min-height: 44px; flex: 0 0 auto; padding-inline: 7px; color: #6d4952; }
.component-set-remove-variant:disabled { opacity: .58; cursor: not-allowed; }
.component-set-variant-values { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 6px; }
.component-set-heading input:focus-visible, .component-set-axis input:focus-visible,
.component-set-add-axis input:focus-visible, .component-set-variant-values input:focus-visible,
.component-set-placement .select-field:focus-visible,
.component-set-card button:focus-visible, .component-set-editor > summary:focus-visible { outline: 2px solid #8b68d0; outline-offset: 2px; }
.component-link-copy { display: grid; gap: 3px; margin: 0 0 7px; padding: 2px 1px; }
.component-link-copy strong { overflow: hidden; color: #393242; font-size: 10px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.component-link-copy span { color: #888; font-size: 9px; line-height: 1.4; }
.variant-controls { display: grid; gap: 6px; margin: 0 0 7px; }
.component-property-editor-wrap { display: grid; gap: 7px; margin: 8px 0; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.component-property-heading { display: flex; align-items: center; justify-content: space-between; color: #555; font-size: 10px; font-weight: 600; }
.component-property-heading span, .component-property-definition small { color: #888; font-size: 9px; font-weight: 400; }
.component-property-definition { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 4px 7px; border: 1px solid #ececec; border-radius: 6px; background: #fff; }
.component-property-definition strong { min-width: 0; overflow: hidden; font-size: 10px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.component-property-definition small { flex: 0 0 auto; }
.component-property-editor { display: grid; gap: 6px; }
.component-property-editor .text-field, .component-property-editor .select-field { width: 100%; min-width: 0; min-height: 38px; }
.component-property-values { display: grid; gap: 6px; margin: 7px 0; }
.component-property-value { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 1.2fr); align-items: center; gap: 8px; min-height: 42px; color: #555; font-size: 10px; }
.component-property-value input[type="text"], .component-property-value .select-field { width: 100%; min-width: 0; min-height: 38px; }
.component-property-value input[type="checkbox"] { justify-self: end; width: 22px; height: 22px; }
.component-property-value[data-component-property-highlight]:hover,
.component-property-value[data-component-property-highlight]:focus-within,
.component-slot-value[data-component-property-highlight]:hover,
.component-slot-value[data-component-property-highlight]:focus-within { border-radius: 6px; outline: 2px solid rgb(151 71 255 / 35%); outline-offset: 2px; }
.component-nested-exposure { display: grid; gap: 7px; margin-top: 4px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.component-nested-exposure > strong { color: #555; font-size: 10px; font-weight: 600; }
.component-nested-exposure > small, .component-property-nested-group > small { color: #888; font-size: 9px; line-height: 1.4; }
.component-nested-exposure .secondary-button { min-height: 40px; }
.component-exposure-dialog { width: min(560px, calc(100vw - 24px)); }
.component-exposure-dialog form { display: grid; gap: 12px; }
.component-exposure-status { color: #6d7480; font-size: 10px; line-height: 1.45; }
.component-exposure-status.is-error { color: #b42318; }
.component-exposure-options { max-height: min(420px, 48dvh); overflow: auto; overscroll-behavior: contain; border: 1px solid #e5e8ed; border-radius: 8px; background: #fff; }
.component-exposure-option { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 58px; padding: 7px 10px; border-bottom: 1px solid #f0f1f3; color: #343a45; cursor: pointer; }
.component-exposure-option:last-child { border-bottom: 0; }
.component-exposure-option:hover { background: #f8f5ff; }
.component-exposure-option input { justify-self: center; width: 20px; height: 20px; accent-color: #9747ff; }
.component-exposure-option > span { display: grid; min-width: 0; gap: 4px; }
.component-exposure-option strong { overflow: hidden; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.component-exposure-option small { overflow: hidden; color: #818895; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.component-exposure-option em { color: #777e8a; font-size: 9px; font-style: normal; white-space: nowrap; }
.component-property-nested-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.component-property-nested-group > strong { display: block; overflow: hidden; color: #555; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.component-slot-value { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 5px; min-height: 44px; }
.component-slot-copy { display: grid; min-width: 0; gap: 3px; }
.component-slot-copy strong { overflow: hidden; color: #555; font-size: 10px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.component-slot-copy small { color: #888; font-size: 9px; }
.component-slot-value .secondary-button { min-height: 38px; padding-inline: 9px; }
.component-slot-reset { width: 38px; height: 38px; border: 1px solid #e2e5e9; }
.variant-control { min-width: 0; display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 6px; color: #777; font-size: 9px; }
.variant-control .prop-input { min-width: 0; width: 100%; height: 27px; }
.color-style-card { min-width: 0; height: 34px; flex: 1 1 auto; display: flex; align-items: center; gap: 7px; padding: 0 6px; border: 1px solid #ededed; border-radius: 5px; text-align: left; }
.color-style-card:hover { border-color: #cfcfcf; background: #fafafa; }
.color-style-swatch { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid rgba(0,0,0,.12); border-radius: 4px; }
.color-style-name { overflow: hidden; color: #555; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.color-styles-empty { grid-column: 1 / -1; padding: 4px 2px 8px; color: #999; font-size: 9px; }
.text-styles-list { max-height: 30%; min-height: 0; flex: 0 1 auto; display: grid; align-content: start; gap: 5px; padding: 4px 5px 8px; overflow: auto; }
.typography-styles-hint, .typography-styles-empty { color: #888; font-size: 9px; line-height: 1.4; padding: 2px 1px 4px; }
.typography-style-row { min-width: 0; display: flex; align-items: center; gap: 5px; padding: 3px; border: 1px solid #ededed; border-radius: 6px; background: #fff; }
.typography-style-apply { min-width: 0; min-height: 38px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 3px 5px; border-radius: 4px; text-align: left; }
.typography-style-apply:hover { background: #f7f6fb; }
.typography-style-mark { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; overflow: hidden; border: 1px solid #eeeaf3; border-radius: 5px; background: #faf8fd; color: #5f477f; line-height: 1; }
.typography-style-copy { min-width: 0; display: grid; gap: 3px; }
.typography-style-name, .typography-style-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typography-style-name { color: #4a4650; font-size: 10px; }
.typography-style-copy small { color: #89858d; font-size: 8px; }
.typography-style-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.typography-style-actions button { min-width: 28px; min-height: 30px; padding: 0 5px; border-radius: 4px; color: #777; font-size: 9px; }
.typography-style-actions button:hover { background: #f2f0f5; color: #443b50; }
.local-fonts-heading { margin-top: 2px; border-top: 1px solid var(--border); }
.local-fonts-note { flex: 0 0 auto; margin: 0 5px; }
.font-assets-list { display: grid; flex: 0 0 auto; gap: 5px; max-height: 150px; padding: 5px; overflow: auto; }
.local-font-row { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) 30px; align-items: center; gap: 7px; padding: 4px 5px; border: 1px solid #ececf0; border-radius: 6px; background: #fff; }
.local-font-sample { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 5px; background: #f5f3f8; color: #524566; font-size: 17px; }
.local-font-copy { min-width: 0; display: grid; gap: 2px; }
.local-font-copy strong, .local-font-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-font-copy strong { color: #45414a; font-size: 10px; font-weight: 600; }
.local-font-copy small { color: #85818a; font-size: 8px; }
.local-font-remove { min-width: 30px; min-height: 30px; }
.local-fonts-empty { padding: 8px 5px; color: #87838c; font-size: 9px; line-height: 1.45; }
.font-import-descriptors { gap: 10px; }
.font-import-descriptors .field-label { min-width: 0; }
.font-import-descriptors select { width: 100%; margin-top: 6px; }
.local-assets-heading { margin-top: 2px; border-top: 1px solid var(--border); }
.asset-card { width: 90px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.asset-card.is-selected .asset-thumb { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(13,153,255,.18); }
.asset-thumb { width: 90px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e8e8e8; border-radius: 5px; background: #f5f5f5; }
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; }
.asset-thumb.is-preview-paused, .asset-thumb.is-preview-updating { color: #737782; font-size: 10px; text-align: center; }
.asset-thumb.is-preview-paused::after { content: 'Preview paused'; }
.asset-thumb.is-preview-updating::after { content: 'Updating preview'; }
.asset-thumb.is-preview-paused img, .asset-thumb.is-preview-updating img { display: none; }
.asset-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #666; font-size: 10px; }
.asset-hint { margin-top: auto; padding: 10px 8px; border-top: 1px solid var(--border); color: #888; font-size: 10px; line-height: 1.45; }
.canvas-region { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: #e9e9e9; }
.frame-quick-add-controls { z-index: 4; position: absolute; inset: 0; pointer-events: none; }
.frame-quick-add-controls[hidden] { display: none; }
.frame-quick-add-side { position: absolute; display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(0,0,0,.08); border-radius: 999px; background: #fff; box-shadow: 0 3px 12px rgba(20,24,32,.2); transform: translate(-50%,-50%); pointer-events: auto; }
.frame-quick-add-side button { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; font-size: 17px; line-height: 1; }
.frame-quick-add-side button[data-frame-quick-add-mode="duplicate"] { background: #0d99ff; color: #fff; }
.frame-quick-add-side button[data-frame-quick-add-mode="duplicate"]:hover { background: #087dcc; }
.frame-quick-add-side button[data-frame-quick-add-mode="blank"] { border: 1px solid var(--border); color: var(--ink); }
.frame-quick-add-side button[data-frame-quick-add-mode="blank"]:hover { background: var(--surface-hover); }
.frame-quick-add-side button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.canvas-topline { z-index: 1; position: absolute; top: 0; left: 0; right: 0; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid rgba(0,0,0,.06); background: rgba(255,255,255,.9); backdrop-filter: blur(8px); }
.canvas-breadcrumb { display: flex; align-items: center; gap: 8px; color: #666; font-size: 11px; }
.canvas-page-picker { display: inline-flex; align-items: center; gap: 4px; padding: 4px 5px; border-radius: 4px; color: inherit; }
.canvas-page-picker:hover { background: var(--surface-hover); }
.canvas-page-picker:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.canvas-page-picker .crumb-chevron { margin-left: 0; }
.crumb-file { color: #333; font-weight: 550; }
.crumb-separator { color: #b2b2b2; }
.crumb-chevron { margin-left: -4px; color: #888; }
.canvas-top-actions { display: flex; gap: 3px; }
.canvas-action-button { width: 27px; height: 27px; font-size: 15px; color: #666; }
#help-actions-button { width: auto; min-width: 52px; padding: 0 6px; font-size: 11px; font-weight: 550; white-space: nowrap; }
.canvas-action-button.is-active { color: #0b76c5; background: #e6f4ff; }
.canvas-scroll { position: absolute; inset: 40px 0 0; overflow: hidden; touch-action: none; }
.canvas-scroll.is-text-editing { touch-action: auto; }
.canvas-scroll:has(#image-crop-toolbar[data-crop-mode="true"]) #scene-canvas { cursor: crosshair; }
.canvas-scroll:has(#image-crop-toolbar[data-crop-mode="true"]) #scene-canvas.tool-hand { cursor: grab; }
.canvas-scroll:has(#image-crop-toolbar[data-crop-mode="true"]) #scene-canvas.tool-hand.is-panning { cursor: grabbing; }
.empty-canvas-guide[hidden] { display: none; }
.empty-canvas-guide { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.empty-canvas-card { box-sizing: border-box; width: min(440px, 100%); display: grid; gap: 10px; padding: 22px; border: 1px solid var(--floating-panel-border); border-radius: 14px; background: var(--floating-panel-background); box-shadow: var(--toolbar-shadow); color: var(--ink); pointer-events: auto; }
.empty-canvas-card h2 { margin: 0; font-size: 18px; font-weight: 650; }
.empty-canvas-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-canvas-card .empty-canvas-crop-help { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.empty-canvas-crop-help h3 { margin: 0; color: var(--ink); font-size: 12px; font-weight: 650; }
.empty-canvas-crop-help ol { display: grid; gap: 4px; margin: 0; padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.empty-canvas-crop-help li { padding-left: 1px; }
.empty-canvas-crop-help strong { color: var(--ink); }
.empty-canvas-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-canvas-actions > button { min-width: 118px; min-height: 44px; flex: 1 1 auto; }
.image-crop-toolbar { position: absolute; z-index: 5; left: 50%; bottom: 76px; box-sizing: border-box; width: max-content; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 13px; transform: translateX(-50%); border: 1px solid var(--floating-panel-border); border-radius: 11px; background: var(--floating-panel-background); box-shadow: var(--toolbar-shadow); color: var(--ink); }
.image-crop-toolbar[data-crop-mode="true"] { top: 8px; bottom: auto; gap: 8px; padding-block: 5px; }
.image-crop-toolbar[data-crop-mode="true"] .image-crop-toolbar-copy span { font-size: 11px; line-height: 1.25; }
.image-crop-toolbar[data-crop-mode="true"] .image-crop-ratio-control select { width: 76px; }
.image-crop-toolbar[hidden] { display: none; }
.image-crop-toolbar-copy { min-width: 0; display: grid; gap: 3px; }
.image-crop-toolbar-copy strong { font-size: 11px; font-weight: 650; }
.image-crop-toolbar-copy span { max-width: min(420px, 58vw); color: var(--muted); font-size: 12px; line-height: 1.4; }
.image-context-single, .image-context-batch { min-width: 0; display: flex; align-items: center; gap: 7px; }
.image-context-single[hidden], .image-context-batch[hidden] { display: none; }
.image-crop-ratio-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.image-crop-ratio-control[hidden] { display: none; }
.image-crop-ratio-control select { box-sizing: border-box; width: 84px; min-height: 36px; padding: 0 7px; color: var(--ink); font-size: 11px; }
.image-context-adjustments, .image-context-save-recipe, .image-context-undo, .image-context-export { height: 36px; min-height: 36px; flex: 0 0 auto; padding-inline: 10px; white-space: nowrap; }
.image-context-export { display: none; }
.image-context-batch { flex: 1 1 320px; }
.image-context-recipe-picker { width: min(220px, 35vw); min-width: 0; min-height: 36px; flex: 1 1 150px; font-size: 11px; }
.image-context-apply-recipe { height: auto; min-height: 36px; flex: 0 0 auto; padding-inline: 10px; white-space: nowrap; }
.image-crop-toolbar-done { min-width: 92px; min-height: 36px; flex: 0 0 auto; padding: 0 10px; border: 1px solid var(--primary-action-border); border-radius: 7px; background: var(--primary-action-bg); color: #fff; font-size: 11px; font-weight: 600; }
.image-crop-toolbar-done:hover { background: var(--primary-action-hover); }
#scene-canvas { display: block; width: 100%; height: 100%; cursor: default; touch-action: none; }
#shape-builder-bar[hidden] { display: none; }
.shape-builder-bar { position: absolute; z-index: 4; left: 50%; bottom: 16px; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 24px); padding: 8px 10px; transform: translateX(-50%); border: 1px solid rgba(20,25,32,.12); border-radius: 12px; background: var(--floating-panel-background); box-shadow: var(--toolbar-shadow); }
.shape-builder-copy { min-width: 0; display: grid; gap: 3px; }
.shape-builder-copy strong { color: var(--ink); font-size: 11px; font-weight: 650; }
.shape-builder-copy span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.shape-builder-actions { display: flex; gap: 5px; }
.shape-builder-actions button { min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); color: var(--ink); font-size: 10px; font-weight: 550; white-space: nowrap; }
.shape-builder-actions button.is-selected { border-color: #a9d7f8; background: #e9f5ff; color: #0569ac; }
.shape-builder-actions .shape-builder-done { border-color: var(--primary-action-border); background: var(--primary-action-bg); color: #fff; }
.shape-builder-actions .shape-builder-done:hover { background: var(--primary-action-hover); }
.pen-drawing-bar { z-index: 4; position: absolute; left: 50%; bottom: 76px; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 24px); padding: 8px 10px; transform: translateX(-50%); border: 1px solid var(--floating-panel-border); border-radius: 12px; background: var(--floating-panel-background); box-shadow: var(--toolbar-shadow); }
.pen-drawing-bar[hidden] { display: none; }
.pen-drawing-copy { min-width: 0; display: grid; gap: 3px; }
.pen-drawing-copy strong { color: var(--ink); font-size: 11px; font-weight: 650; }
.pen-drawing-copy span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.pen-drawing-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.pen-drawing-actions button { min-height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); color: var(--ink); font-size: 11px; font-weight: 550; white-space: nowrap; }
.pen-drawing-actions .pen-drawing-finish { border-color: var(--primary-action-border); background: var(--primary-action-bg); color: #fff; }
.pen-drawing-actions .pen-drawing-finish:hover:not(:disabled) { background: var(--primary-action-hover); }
.pen-drawing-actions button:disabled { cursor: not-allowed; opacity: .55; }
#scene-canvas.tool-hand, #scene-canvas.is-panning { cursor: grab; }
#scene-canvas.is-panning { cursor: grabbing; }
#scene-canvas.tool-frame, #scene-canvas.tool-section, #scene-canvas.tool-rectangle, #scene-canvas.tool-ellipse, #scene-canvas.tool-line, #scene-canvas.tool-polygon, #scene-canvas.tool-star, #scene-canvas.tool-pen, #scene-canvas.tool-pencil { cursor: crosshair; }
#scene-canvas.tool-eyedropper { cursor: crosshair; }
#scene-canvas.tool-image-erase { cursor: crosshair; }
#scene-canvas.tool-object-isolation { cursor: crosshair; }
#scene-canvas.tool-text { cursor: text; }
.canvas-drop-overlay { display: none; position: absolute; inset: 12px; place-items: center; border: 2px dashed #0d99ff; border-radius: 10px; background: rgba(226,244,255,.82); color: #0879cb; font-size: 14px; font-weight: 600; pointer-events: none; }
.canvas-drop-overlay.is-visible { display: grid; }
.prototype-connect-prompt {
  z-index: 4;
  position: absolute;
  left: 50%;
  bottom: 64px;
  width: min(420px, calc(100% - 16px));
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px 7px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--panel-shadow);
  color: var(--ink);
  backdrop-filter: blur(14px);
  pointer-events: none;
}
.prototype-connect-prompt[hidden] { display: none; }
.prototype-connect-message { min-width: 0; color: var(--ink); font-size: 12px; line-height: 1.4; }
.prototype-connect-prompt button {
  min-width: 72px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
  pointer-events: auto;
  touch-action: manipulation;
}
.prototype-connect-prompt button:hover { background: var(--surface-hover); }
.prototype-connect-prompt button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.canvas-ruler { z-index: 3; position: absolute; overflow: hidden; color: #686868; background: rgba(255,255,255,.94); box-shadow: 0 0 1px rgba(0,0,0,.3); touch-action: none; user-select: none; }
.canvas-ruler:focus-visible { outline: 2px solid #0d99ff; outline-offset: -2px; }
.canvas-ruler canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.ruler-horizontal { top: 0; left: 0; right: 0; height: 24px; cursor: ns-resize; }
.ruler-vertical { left: 0; top: 0; bottom: 0; width: 26px; cursor: ew-resize; }
.ruler-vertical { z-index: 4; }
.zoom-controls { z-index: 2; position: absolute; right: 18px; bottom: 58px; height: 35px; display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #e1e1e1; border-radius: 7px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.zoom-readout { min-width: 46px; height: 27px; border-radius: 5px; font-size: 10px; color: #555; }
.zoom-readout:hover { background: #f2f2f2; }
.zoom-divider { height: 16px; border-left: 1px solid #e7e7e7; margin: 0 2px; }
.fit-button { font-size: 17px; }
.fit-button-label { display: none; }
.bottom-toolbar { z-index: 4; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; width: max-content; max-width: calc(100vw - 24px); min-height: 48px; padding: 5px 7px; border: 1px solid #e5e5e5; border-radius: 9px; background: #fff; box-shadow: var(--toolbar-shadow); }
.bottom-toolbar-viewport { min-width: 0; max-width: 100%; flex: 1 1 auto; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tool-button { position: relative; width: 38px; height: 37px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: #4c4c4c; }
.tool-button:hover { background: #f2f2f2; }
.tool-button.is-selected { background: #e7f4ff; color: #0b79cb; }
.tool-button span[data-icon] svg { width: 18px; height: 18px; display: block; }
.tool-button kbd { position: absolute; right: 2px; bottom: 1px; color: #9b9b9b; font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.toolbar-more-tools { display: none; }
.design-tool-tooltip { position: fixed; z-index: 10000; max-width: min(280px, calc(100vw - 16px)); padding: 7px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; background: #252932; box-shadow: 0 4px 14px rgba(0,0,0,.24); color: #fff; font: 11px/1.4 system-ui, sans-serif; text-align: center; pointer-events: none; }
.design-tool-tooltip[hidden] { display: none; }
.toolbar-separator { height: 24px; margin: 0 4px; border-left: 1px solid #e8e8e8; }
.canvas-status { position: absolute; left: 15px; bottom: 22px; z-index: 2; display: flex; align-items: center; gap: 8px; color: #797979; font-size: 10px; }
.status-divider { height: 12px; border-left: 1px solid #c9c9c9; }
.right-panel { box-sizing: border-box; min-width: 0; max-width: 100%; overflow: hidden; }
.selected-layer-summary { min-width: 0; display: grid; gap: 3px; margin: 0 0 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.selected-layer-summary .selected-layer-eyebrow { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.selected-layer-summary strong, .selected-layer-summary > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-layer-summary strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.selected-layer-summary > span:last-child { color: var(--muted); font-size: 10px; }
.inspector-tabs {
  width: 100%;
  min-width: 0;
  flex: 0 0 43px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  padding-inline: 4px;
  border-bottom: 1px solid var(--border);
}
.inspector-tab {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0 1px;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.inspector-content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0 12px;
}
.inspector-content > * { box-sizing: border-box; min-width: 0; max-width: 100%; }
.comments-panel { display: grid; align-content: start; gap: 12px; padding: 12px; }
.motion-panel { display: grid; align-content: start; }
.motion-section { display: grid; gap: 11px; padding: 14px 12px; border-bottom: 1px solid var(--border); }
.motion-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.motion-panel-heading > div { min-width: 0; display: grid; gap: 4px; }
.motion-eyebrow { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .08em; }
.motion-panel-heading strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.motion-duration-field { display: grid; gap: 4px; color: var(--muted); font-size: 9px; }
.motion-duration-field input { box-sizing: border-box; width: 94px; min-height: 32px; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink); background: var(--panel); font: inherit; }
.motion-playback-controls { display: grid; grid-template-columns: 52px minmax(70px, 1fr) auto; align-items: center; gap: 9px; }
.motion-play-button { min-height: 34px; padding-inline: 8px; }
.motion-playback-controls input[type="range"] { width: 100%; min-width: 0; accent-color: var(--blue); }
.motion-playback-controls output { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.motion-preview-note, .motion-track-create small { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.motion-track-create > label { color: var(--ink); font-size: 10px; font-weight: 550; }
.motion-track-create > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.motion-track-create .select-field { min-width: 0; min-height: 36px; }
.motion-track-create .secondary-button, .motion-add-keyframe { min-height: 36px; padding-inline: 9px; font-size: 10px; }
.motion-track-list { display: grid; align-content: start; gap: 10px; padding: 10px 12px 14px; }
.motion-track-card { display: grid; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); }
.motion-track-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.motion-track-card > header strong { color: var(--ink); font-size: 10px; font-weight: 600; }
.motion-track-lane { position: relative; height: 23px; margin: 0 7px; border: 1px solid var(--border); border-radius: 5px; background: repeating-linear-gradient(to right, transparent 0 calc(25% - 1px), var(--border) calc(25% - 1px) 25%); }
.motion-lane-help { margin: -4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.motion-keyframe-marker { position: absolute; top: 50%; width: 30px; height: 30px; padding: 0; transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: transparent; cursor: grab; touch-action: pan-y; user-select: none; }
.motion-keyframe-marker.is-dragging { z-index: 2; cursor: grabbing; }
.motion-keyframe-marker:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.motion-keyframe-marker::before { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%) rotate(45deg); border: 2px solid var(--panel); border-radius: 2px; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); content: ''; }
.motion-keyframe-marker:hover::before { background: var(--blue-strong, #0876c4); }
.motion-keyframe-list { display: grid; gap: 7px; }
.motion-keyframe-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) 38px; align-items: end; gap: 6px; }
.motion-keyframe-row label { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 8px; }
.motion-keyframe-row label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.motion-keyframe-row label input, .motion-keyframe-row label select { box-sizing: border-box; width: 100%; min-width: 0; height: 32px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--ink); background: var(--panel); font: inherit; font-size: 10px; }
.motion-keyframe-row .motion-easing-field { grid-column: 1 / 3; }
.motion-remove-keyframe { grid-column: 3; grid-row: 1 / span 2; width: 36px; height: 36px; align-self: center; }
.motion-empty, .motion-empty-keyframes { margin: 0; padding: 12px 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.motion-empty-keyframes { padding: 2px; }
.comments-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 39px; }
.comments-panel-header > div { min-width: 0; display: grid; gap: 4px; }
.comments-panel-header strong { font-size: 12px; font-weight: 600; }
.comments-panel-header span { color: #888; font-size: 9px; }
.comment-new-button { min-height: 32px; flex: 0 0 auto; padding: 0 9px; border: 1px solid #dcecf8; border-radius: 6px; background: #f3faff; color: #0879c8; font-size: 10px; font-weight: 550; }
.comment-text-button { min-height: 32px; flex: 0 0 auto; padding: 0 8px; border: 1px solid #e5e5e5; border-radius: 6px; font-size: 10px; }
.comment-anchor-hint { padding: 8px 9px; border-radius: 6px; background: #f1f8fd; color: #4a6a80; font-size: 10px; }
.comment-compose { display: grid; gap: 7px; padding: 10px; border: 1px solid #e6e6e6; border-radius: 8px; background: #fafafa; }
.comment-compose > label { color: #555; font-size: 10px; font-weight: 550; }
.comment-compose textarea { width: 100%; min-height: 78px; resize: vertical; padding: 9px; border: 1px solid #dedede; border-radius: 6px; outline: 0; background: #fff; font-family: inherit; font-size: 11px; line-height: 1.45; user-select: text; }
.comment-compose textarea:focus { border-color: #83c7f4; box-shadow: 0 0 0 2px rgba(13,153,255,.12); }
.comment-compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.comment-compose-actions > span { color: #999; font-size: 9px; }
.comment-compose-actions > div { display: flex; gap: 5px; }
.comment-compose-actions .primary-button, .comment-compose-actions .secondary-button { min-height: 32px; }
.comment-thread-list { display: grid; gap: 6px; }
.comment-thread-row { display: flex; align-items: center; gap: 9px; min-height: 58px; padding: 8px; border: 1px solid #ededed; border-radius: 7px; background: #fff; text-align: left; }
.comment-thread-row:hover { border-color: #c9e6f8; background: #f8fcff; }
.comment-mini-pin { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-action-bg); color: #fff; font-size: 9px; font-weight: 650; }
.comment-thread-row.is-resolved .comment-mini-pin { background: #59636f; }
.comment-row-copy { min-width: 0; flex: 1; display: grid; gap: 4px; }
.comment-row-copy strong { overflow: hidden; color: #444; font-size: 10px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; }
.comment-row-copy small { color: #929292; font-size: 9px; }
.comment-row-arrow { color: #999; font-size: 18px; }
.comment-list-limit { margin: 0; color: #888; font-size: 9px; line-height: 1.45; }
.comments-empty { display: grid; justify-items: center; gap: 7px; padding: 38px 15px; color: #929292; text-align: center; }
.comments-empty > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f4f6f7; color: #70808c; font-size: 19px; }
.comments-empty strong { color: #555; font-size: 11px; font-weight: 550; }
.comments-empty p { max-width: 190px; margin: 0; font-size: 10px; line-height: 1.5; }
.comment-message { padding: 10px; border: 1px solid #ececec; border-radius: 8px; background: #fff; }
.comment-message header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comment-message header strong { font-size: 10px; font-weight: 600; }
.comment-message time { color: #999; font-size: 9px; }
.comment-message p { margin: 7px 0 0; color: #444; font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.comment-thread-actions { display: flex; align-items: center; justify-content: space-between; }
.comment-thread-actions .secondary-button, .comment-delete-button { min-height: 32px; }
.comment-delete-button { padding: 0 8px; border: 1px solid #eee; border-radius: 6px; color: #a33a3a; font-size: 10px; }
.inspector-footer { height: 50px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-top: 1px solid var(--border); }
.inspector-footer .export-button { min-width: 0; flex: 1 1 0; }
.export-button { height: 29px; padding: 0 12px; border: 1px solid #e2e2e2; border-radius: 5px; background: #fff; font-size: 11px; font-weight: 550; }
.export-button:hover { background: #f7f7f7; }
.inspector-empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 52px 24px; color: #888; text-align: center; }
.inspector-empty.has-start-actions { padding: 24px 16px 10px; }
.inspector-empty .empty-layer-icon { width: 40px; height: 40px; font-size: 18px; }
.inspector-empty strong { color: #666; font-weight: 550; }
.inspector-empty span { font-size: 10px; line-height: 1.5; }
.inspector-start-actions { display: grid; gap: 7px; padding: 0 16px 14px; }
.inspector-start-actions button { min-height: 38px; justify-content: center; }
.property-section { min-width: 0; border-bottom: 1px solid var(--border); padding: 12px 15px 13px; }
#outline-stroke-progress { flex-shrink: 0; }
#outline-stroke-progress .add-fill { min-height: 44px; }
#boolean-operation-progress { flex-shrink: 0; }
#boolean-operation-progress .add-fill { min-height: 44px; }
.frame-preset-picker { display: grid; gap: 6px; }
.frame-preset-group { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; }
.frame-preset-group > summary { min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--surface-subtle); color: var(--ink); cursor: pointer; list-style-position: inside; font-size: 10px; font-weight: 550; }
.frame-preset-count { margin-left: auto; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.frame-preset-options { display: grid; gap: 4px; padding: 5px; }
.frame-preset-fit-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.frame-resize-to-fit { flex: 1 1 auto; min-width: 0; }
.frame-resize-to-fit-shortcut { flex: 0 0 auto; color: var(--muted); font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.frame-preset-resize-label { display: grid; gap: 6px; }
.frame-preset-resize-select { width: 100%; min-width: 0; min-height: 36px; }
.frame-preset-option { width: 100%; min-width: 0; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); color: var(--ink); text-align: left; }
.frame-preset-option:hover { background: var(--surface-hover); }
.frame-preset-option > span:first-child { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 10px; }
.frame-preset-dimensions { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delete-layer-button { width: 100%; min-height: 38px; margin-top: 7px; padding: 0 12px; border: 1px solid #e5b8b4; border-radius: 6px; background: transparent; color: #a43a33; font-size: 11px; font-weight: 550; text-align: center; }
.delete-layer-button:hover { border-color: #d78f88; background: #fff5f4; }
.delete-layer-button:focus-visible { outline: 2px solid #d94b45; outline-offset: 2px; }
.property-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; color: #444; font-size: 11px; font-weight: 550; }
.property-heading > :first-child { min-width: 0; overflow-wrap: anywhere; }
.property-heading .tiny-icon-button { margin: -5px -5px -5px 0; }
.image-ai-tools > summary { box-sizing: border-box; min-height: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 8px; margin: 0; cursor: pointer; list-style: none; }
.image-ai-tools > summary::-webkit-details-marker { display: none; }
.image-ai-tools > summary::after { content: '⌄'; grid-column: 2; grid-row: 1; color: var(--muted); }
.image-ai-tools:not([open]) > summary::after { content: '›'; }
.image-ai-tools > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.image-ai-tools > summary > span { grid-column: 1; grid-row: 1; }
.image-ai-tools > summary > small { grid-column: 1 / -1; grid-row: 2; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.35; }
.image-ai-tools-content > .image-properties-note:first-child { margin-top: 0; }
.image-ai-tools-content > .property-section:last-child { border-bottom: 0; }
.image-adjustment-group { min-width: 0; margin: 0 0 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.image-adjustment-group > summary { box-sizing: border-box; min-height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 8px; padding: 6px 9px; background: var(--surface-subtle); color: var(--ink); cursor: pointer; list-style: none; }
.image-adjustment-group > summary::-webkit-details-marker { display: none; }
.image-adjustment-group > summary::after { content: '⌄'; grid-column: 2; grid-row: 1; color: var(--muted); }
.image-adjustment-group:not([open]) > summary::after { content: '›'; }
.image-adjustment-group > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.image-adjustment-group > summary > span { grid-column: 1; grid-row: 1; font-size: 10px; font-weight: 600; }
.image-adjustment-group > summary > small { grid-column: 1 / -1; grid-row: 2; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.35; }
.image-adjustment-group-content { display: grid; gap: 5px; padding: 5px 8px 8px; }
.image-adjustment-group-content > .image-transform-controls { margin: 0; }
.image-adjustment-help { margin: 2px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.corner-radius-controls { display: grid; gap: 8px; margin-top: 8px; }
.corner-radius-controls .property-field label { width: auto; flex: 0 0 auto; padding-inline: 5px; font: 10px Inter, Arial, sans-serif; white-space: nowrap; }
.typography-font-family { grid-column: span 2; width: 100%; min-width: 0; }
.fill-type-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 8px; margin: 2px 0 8px; color: #777; font-size: 10px; }
.fill-type-row .select-field { width: 100%; min-width: 0; height: 29px; }
.blend-mode-select { width: 100%; min-height: 30px; }
.image-fill-controls { display: grid; gap: 8px; margin: 8px 0; }
.image-fill-source { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 8px; color: #777; font-size: 10px; }
.image-fill-source .select-field { width: 100%; min-width: 0; height: 29px; }
.image-output-field { grid-column: span 2; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.image-output-field .select-field { grid-column: span 2; width: 100%; min-width: 0; }
.image-output-field input[type="range"] { width: 100%; min-width: 0; accent-color: var(--blue); }
.image-output-field output { min-width: 3.4em; text-align: right; }
.gradient-stops { display: grid; gap: 6px; margin: 8px 0; }
.gradient-editor { display: grid; gap: 7px; margin: 8px 0; }
.gradient-geometry-controls { display: grid; gap: 6px; margin: 7px 0; }
.gradient-geometry-toggle { min-height: 34px; text-align: center; }
.gradient-geometry-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gradient-geometry-fields[hidden] { display: none; }
.gradient-geometry-point { min-width: 0; display: grid; gap: 6px; padding: 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); }
.gradient-geometry-point > strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.gradient-geometry-point > label { min-width: 0; display: grid; gap: 3px; color: var(--muted); font-size: 9px; }
.gradient-geometry-point input { box-sizing: border-box; width: 100%; min-width: 0; height: 32px; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); color: var(--ink); font: inherit; font-size: 11px; }
.gradient-geometry-point input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.gradient-geometry-point input[aria-invalid="true"] { border-color: #d94b45; box-shadow: 0 0 0 1px #d94b4540; }
.gradient-stop-rail { overflow-x: hidden; overflow-x: clip; padding: 0 1px; }
.gradient-stop-track {
  position: relative;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--panel);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.gradient-stop-track::before {
  position: absolute;
  inset: 5px 4px;
  border-radius: 3px;
  background: var(--gradient-preview);
  content: "";
  pointer-events: none;
}
.gradient-stop-handle {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: clamp(8px, var(--gradient-stop-position), calc(100% - 8px));
  width: 18px;
  height: 24px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  cursor: ew-resize;
  transform: translate(-50%, -50%);
  touch-action: none;
}
.gradient-stop-marker {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: block;
  width: 16px;
  height: 20px;
  border: 1px solid #fff;
  border-radius: 5px;
  outline: 1px solid #4c4c4c;
  background: var(--gradient-stop-color);
  box-shadow: 0 1px 3px #0004;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.gradient-stop-handle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.gradient-stop-handle:disabled { cursor: not-allowed; }
.gradient-stop-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(56px, .7fr)) 30px; align-items: end; gap: 6px; }
.gradient-stop-row label { min-width: 0; display: grid; gap: 3px; color: #888; font-size: 9px; }
.gradient-stop-row input[type=color] { width: 100%; min-width: 0; height: 29px; padding: 2px; border: 1px solid #dedede; border-radius: 5px; background: #fff; }
.gradient-stop-row input[type=number] { width: 100%; min-width: 0; height: 29px; padding: 0 5px; border: 1px solid #e6e6e6; border-radius: 5px; background: #fff; color: #444; font-size: 11px; }
.property-field { min-width: 0; height: 29px; display: flex; align-items: center; border: 1px solid transparent; border-radius: 5px; background: #f6f6f6; }
.property-field:focus-within { border-color: #93cef6; background: #fff; }
.property-field label { min-width: 0; width: 25px; flex: 0 0 25px; overflow: hidden; color: #929292; text-align: center; text-overflow: ellipsis; white-space: nowrap; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Numeric controls use narrow glyph labels for geometry, but descriptive
   labels need their own bounded space so they cannot cover the value input. */
.property-field--descriptive label { width: auto; max-width: 52%; flex: 0 1 auto; padding-inline: 5px; text-align: left; font: 10px Inter, ui-sans-serif, sans-serif; }
.property-field--descriptive input { width: 0; min-width: 0; flex: 1 1 0; }
.property-field input { width: 100%; min-width: 0; height: 100%; padding: 0 5px 0 1px; border: 0; outline: 0; background: transparent; color: #444; font-size: 10px; }
.property-field input[type=number]::-webkit-inner-spin-button { display: none; }
.multi-selection-property-grid .property-field label { width: 38px; flex-basis: 38px; }
.multi-selection-property-grid .property-field input { font-size: 11px; }
.size-limit-field { min-width: 0; height: 29px; display: flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: #f6f6f6; }
.size-limit-field:focus-within { border-color: #93cef6; background: #fff; }
.size-limit-field span { flex: 0 0 auto; color: #777; font-size: 9px; white-space: nowrap; }
.size-limit-field input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #444; font-size: 10px; text-align: right; }
.size-limit-field input::placeholder { color: #aaa; }
.property-inline { display: flex; align-items: center; gap: 5px; }
.property-inline .property-field { flex: 1; }
.property-separator { width: 13px; text-align: center; color: #aaa; }
.lock-ratio { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 5px; color: #888; }
.lock-ratio.is-locked { color: #0b8bdc; background: #e7f4ff; }
.select-field { min-width: 0; height: 29px; padding: 0 7px; border: 1px solid #e6e6e6; border-radius: 5px; background: #fff; font-size: 10px; }
.field-caption { align-self: center; overflow: hidden; color: #777; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.variable-binding-row, .frame-variable-mode { min-width: 0; display: grid; grid-template-columns: minmax(58px, 38%) minmax(0, 1fr); align-items: center; gap: 7px; margin-top: 7px; color: #777; font-size: 10px; }
.variable-binding-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variable-binding-row .select-field, .frame-variable-mode .select-field { min-width: 0; width: 100%; }
.auto-layout-variable-bindings { margin: 9px 0 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.auto-layout-variable-bindings > summary { color: var(--muted); cursor: pointer; font-size: 11px; user-select: none; }
.auto-layout-variable-bindings[open] > summary { margin-bottom: 7px; }
.grid-track-editor { margin-top: 8px; border-top: 1px solid var(--line); }
.grid-track-editor > summary { min-height: 36px; display: flex; align-items: center; color: var(--muted); cursor: pointer; font-size: 11px; user-select: none; }
.grid-track-list { display: grid; gap: 6px; }
.grid-track-entry { min-width: 0; display: grid; gap: 3px; }
.grid-track-row { min-width: 0; display: grid; grid-template-columns: minmax(0, .6fr) minmax(0, 1.1fr) minmax(0, .9fr) 34px 34px; align-items: center; gap: 4px; }
.grid-track-name { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.grid-track-row .select-field { width: 100%; height: 34px; padding-inline: 5px; }
.grid-track-delete, .grid-track-move-menu-button { width: 34px; min-width: 34px; height: 34px; }
.grid-track-move-menu-button { cursor: pointer; }
.grid-track-add { margin-top: 7px; }
.grid-track-value { min-width: 0; height: 34px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: 9px; }
.grid-track-value input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; text-align: right; }
.grid-track-content { grid-column: 3; overflow: hidden; color: var(--muted); font-size: 9px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.grid-track-minimum { min-width: 0; margin-left: 7px; padding-left: 7px; border-left: 2px solid var(--line); }
.grid-track-minimum > summary { min-height: 24px; display: flex; align-items: center; color: var(--muted); cursor: pointer; font-size: 9px; user-select: none; }
.grid-track-minimum-controls { max-width: 260px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 2px 0 5px; }
.grid-track-minimum-controls label { min-width: 0; display: grid; gap: 3px; color: var(--muted); font-size: 9px; }
.grid-track-minimum-controls .select-field { width: 100%; height: 32px; }
.grid-track-bound-value { min-width: 0; height: 32px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: 9px; }
.grid-track-bound-value input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; text-align: right; }
.fill-row { display: flex; align-items: center; gap: 7px; height: 29px; }
.color-swatch { position: relative; width: 24px; height: 24px; overflow: hidden; border: 1px solid #d9d9d9; border-radius: 5px; background: conic-gradient(#fff 25%, #ddd 0 50%, #fff 0 75%, #ddd 0) 0 0/8px 8px; }
.color-swatch input { position: absolute; inset: -5px; width: 34px; height: 34px; opacity: 0; cursor: pointer; }
.color-value { flex: 1; height: 27px; min-width: 0; padding: 0 7px; border: 1px solid #e8e8e8; border-radius: 5px; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.fill-opacity { width: 40px; height: 27px; padding: 0 4px; border: 1px solid #e8e8e8; border-radius: 5px; text-align: right; font-size: 10px; }
.add-fill { width: 100%; height: 25px; margin-top: 6px; border-radius: 5px; color: #888; text-align: left; font-size: 10px; }
.add-fill:hover { background: #f5f5f5; }
.auto-layout-suggestion-preview { display: grid; gap: 5px; margin-top: 8px; padding: 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-subtle); color: var(--muted); font-size: 10px; line-height: 1.45; }
.auto-layout-suggestion-preview strong { color: var(--ink); font-size: 11px; font-weight: 600; }
.auto-layout-suggestion-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr); gap: 7px; margin-top: 8px; }
.auto-layout-suggestion-actions .primary-button, .auto-layout-suggestion-actions .secondary-button { width: 100%; min-width: 0; min-height: 36px; height: auto; padding: 5px 8px; }
.auto-layout-suggest-button:disabled { color: #8b929d; cursor: not-allowed; }
.vector-point-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.vector-point-actions .add-fill { margin: 0; }
.vector-point-actions .add-fill:disabled { color: #bbb; cursor: default; }
.network-face-control { display: grid; gap: 5px; margin-top: 8px; }
.network-face-heading { display: flex; align-items: center; justify-content: space-between; color: #707070; font-size: 10px; }
.network-face-heading output { color: #888; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.network-face-fields { display: grid; grid-template-columns: 29px minmax(0, 1fr); align-items: center; gap: 8px; }
.network-face-fields input[type=range] { width: 100%; accent-color: var(--blue); }
.slider-row { display: grid; grid-template-columns: 74px 1fr 33px; align-items: center; gap: 7px; margin: 8px 0; }
.slider-row label { color: #666; font-size: 10px; }
.slider-row input[type=range] { width: 100%; accent-color: #0d99ff; }
.slider-row output { color: #777; text-align: right; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.font-axis-section { margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--border, #e5e5e5); }
.font-axis-section > strong { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 600; }
.font-axis-row label code { display: block; color: var(--muted, #777); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.font-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.font-feature-control { display: grid; gap: 4px; min-width: 0; font-size: 10px; }
.font-feature-control select { width: 100%; min-width: 0; }
.font-feature-details > summary { cursor: pointer; font-size: 11px; font-weight: 600; }
.font-feature-custom { display: grid; grid-template-columns: minmax(40px, .6fr) minmax(78px, 1fr) auto; gap: 6px; margin-top: 9px; }
.image-properties-note { margin: 10px 0 0; color: #888; font-size: 9px; line-height: 1.5; }
.frame-role-note, .page-role-note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.paint-blend-warning { padding: 8px 10px; border: 1px solid #ead8ad; border-radius: 8px; background: #fffaf0; color: #6a5734; }
.image-erase-actions { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.image-erase-actions .add-fill { min-width: 0; min-height: 34px; padding-inline: 7px; white-space: nowrap; }
.image-erase-mode-button[aria-pressed="true"] { border-color: #e56b75; background: #fff3f4; color: #9f1d2b; }
.image-erase-brush { grid-template-columns: 44px minmax(0, 1fr) 48px; }
.image-erase-brush output { color: #777; text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.image-erase-hint { padding: 8px 9px; border: 1px solid #f0c9cd; border-radius: 6px; background: #fff7f8; color: #812d36; }
.object-isolation-modes, .object-isolation-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.object-isolation-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.object-isolation-actions .add-fill, .object-isolation-modes .add-fill { min-width: 0; min-height: 38px; padding-inline: 7px; white-space: nowrap; }
.object-isolation-actions .primary-button { min-width: 0; min-height: 38px; padding-inline: 8px; white-space: nowrap; }
.object-isolation-mode-choice[aria-pressed="true"] { border-color: #88cbb1; background: #effaf5; color: #14754e; }
.object-isolation-mode-choice[data-mode="2"][aria-pressed="true"] { border-color: #ef9ca2; background: #fff2f3; color: #a32937; }
.object-isolation-mode-choice[data-mode="3"][aria-pressed="true"] { border-color: #c7a3eb; background: #f8f2ff; color: #7040a0; }
.object-isolation-draw-button[aria-pressed="true"] { border-color: #83b7e5; background: #f0f7ff; color: #175c98; }
.object-isolation-hint { padding: 8px 9px; border: 1px solid #bdd9ef; border-radius: 7px; background: #f4f9ff; color: #284b65; }
.object-isolation-status { display: flex; min-height: 28px; margin-top: 8px; line-height: 1.45; }
.image-expansion-controls { display: grid; gap: 8px; margin-top: 8px; }
.image-expansion-padding-grid .property-field input { min-height: 36px; }
.image-expansion-controls .primary-button, .image-expansion-controls .secondary-button { width: 100%; min-height: 38px; }
.image-engine-status { display: inline-flex; align-items: center; gap: 5px; color: #16a16a; font-size: 9px; }
.image-engine-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.export-setting-row { display: grid; gap: 8px; margin-top: 8px; padding: 9px; border: 1px solid #ededed; border-radius: 7px; background: #fcfcfc; }
.layer-effect-card { display: grid; gap: 8px; margin-top: 8px; padding: 9px; border: 1px solid #ededed; border-radius: 7px; background: #fcfcfc; }
.layer-effect-heading { display: flex; align-items: center; gap: 8px; color: #555; font-size: 11px; }
.layer-effect-heading strong { flex: 1; font-weight: 600; }
.layer-effect-heading label, .effect-color-row label { display: flex; align-items: center; gap: 6px; color: #777; font-size: 10px; }
.stroke-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; align-items: end; }
.stroke-side-widths { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.stroke-paint-controls { grid-column: 1 / -1; display: grid; gap: 5px; min-width: 0; }
.stroke-gradient-controls { min-width: 0; }
.stroke-gradient-controls > .stroke-field { max-width: 50%; }
.stroke-field { min-width: 0; display: grid; gap: 4px; color: #777; font-size: 10px; }
.stroke-field input, .stroke-field select { width: 100%; min-width: 0; height: 32px; padding: 0 7px; border: 1px solid #e6e6e6; border-radius: 5px; background: #fff; color: #333; font-size: 11px; }
.stroke-field input[type=color] { padding: 3px; }
.stroke-custom-dash-field { grid-column: 1 / -1; }
.stroke-field input[aria-invalid="true"] { border-color: #d94b45; box-shadow: 0 0 0 1px #d94b4540; }
.stroke-dash-error { color: #b42318; font-size: 10px; line-height: 1.4; }
.stroke-opacity-row { grid-column: 1 / -1; }
.stroke-stack-card .layer-effect-heading > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stroke-stack-card .layer-effect-heading > .tiny-icon-button { flex: 0 0 32px; }
.effect-color-row { display: flex; align-items: center; gap: 10px; }
.effect-color-row input[type=color] { width: 27px; height: 24px; padding: 2px; border: 1px solid #dedede; border-radius: 5px; background: #fff; }
.effect-opacity { flex: 1; }
.effect-opacity input[type=range] { width: 100%; min-width: 40px; }
.effect-opacity output { min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.glass-effect-slider { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 3px 8px; width: 100%; color: var(--muted); font-size: 11px; }
.glass-effect-slider > span { grid-column: 1 / -1; }
.glass-effect-slider input[type=range] { grid-column: 1; }
.glass-effect-slider output { grid-column: 2; }
.glass-angle-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(56px, .5fr) auto; align-items: center; gap: 8px; margin-block: 2px; color: var(--muted); font-size: 11px; }
.glass-angle-field input { width: 100%; min-width: 0; height: 32px; padding-inline: 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); color: var(--ink); font-size: 13px; }
.glass-angle-field input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.glass-angle-field b { color: var(--muted); font-weight: 500; }
.effect-clip { display: flex; align-items: center; gap: 8px; min-height: 36px; color: #666; font-size: 12px; }
.effect-clip input { width: 16px; height: 16px; margin: 0; accent-color: #0d99ff; }
.export-setting-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.export-setting-row label { min-width: 0; display: grid; gap: 4px; color: #777; font-size: 9px; }
.export-setting-row .select-field, .export-suffix input { width: 100%; min-width: 0; height: 28px; }
.export-suffix input { padding: 0 7px; border: 1px solid #e6e6e6; border-radius: 5px; background: #fff; font-size: 10px; }
.export-quality { grid-template-columns: auto minmax(0, 1fr) 34px; align-items: center; }
.export-quality input { width: 100%; accent-color: var(--blue); }
.export-quality output { color: #777; text-align: right; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.export-setting-actions { display: flex; align-items: center; gap: 5px; }
.export-setting-actions > span { min-width: 0; flex: 1; color: #888; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.export-setting-actions .secondary-button { min-height: 28px; padding: 0 10px; }
.export-setting-actions .tiny-icon-button { width: 28px; height: 28px; border: 1px solid #e8e8e8; background: #fff; }
.layout-guide-card { display: grid; gap: 8px; margin-top: 8px; padding: 8px; border: 1px solid #ededed; border-radius: 7px; background: #fcfcfc; }
.layout-guide-heading { display: grid; grid-template-columns: 28px 28px minmax(0, 1fr) 28px; align-items: center; gap: 6px; }
.layout-guide-heading select, .layout-guide-field input, .layout-guide-field select { min-width: 0; width: 100%; height: 28px; padding: 0 6px; border: 1px solid #e6e6e6; border-radius: 5px; background: #fff; font-size: 10px; }
.layout-guide-heading select { height: 30px; }
.layout-guide-select, .layout-guide-visibility, .layout-guide-remove { width: 28px; height: 28px; border: 1px solid #e8e8e8; background: #fff; }
.layout-guide-select[aria-pressed="true"], .layout-guide-card.is-selected { border-color: #168fe0; }
.layout-guide-select[aria-pressed="true"] { color: #0876c4; background: #e8f4fd; }
.layout-guide-visibility[aria-pressed="true"] { color: #d63c3c; }
.layout-guide-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.layout-guide-field { min-width: 0; display: grid; gap: 4px; color: #777; font-size: 9px; }
.layout-guide-field span, .layout-guide-appearance label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout-guide-appearance { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: end; gap: 8px; }
.layout-guide-appearance label { min-width: 0; display: grid; gap: 4px; color: #777; font-size: 9px; }
.layout-guide-appearance input[type="color"] { width: 34px; height: 28px; padding: 2px; border: 1px solid #e6e6e6; border-radius: 5px; background: #fff; }
.layout-guide-opacity { grid-template-columns: 42px minmax(0, 1fr) 30px; align-items: center; }
.layout-guide-opacity input { width: 100%; accent-color: #ff4848; }
.layout-guide-opacity output { color: #777; text-align: right; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.layout-guide-adds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.layout-guide-adds button { min-width: 0; height: 27px; overflow: hidden; padding: 0 4px; border: 1px solid #e8e8e8; border-radius: 5px; color: #777; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.layout-guide-adds button:hover { background: #f5f5f5; }
.layout-guide-style-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.layout-guide-style-actions .add-fill { height: auto; min-height: 32px; margin: 0; padding: 5px 7px; border: 1px solid var(--border); text-align: center; }
.layout-guide-style-actions .add-fill:disabled { color: var(--muted); cursor: default; }
.multi-selection-card { padding: 18px 15px; border-bottom: 1px solid var(--border); }
.multi-selection-card strong { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 550; }
.multi-selection-card span { color: #888; font-size: 10px; }
.multi-align-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.multi-align-button { min-width: 0; height: 29px; overflow: hidden; padding: 0 3px; border: 1px solid #e8e8e8; border-radius: 5px; color: #555; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.multi-align-button:hover:not(:disabled) { border-color: #b8dfff; background: #f3f9ff; color: #087ecc; }
.multi-align-button:disabled { color: #b8b8b8; cursor: default; }
.multi-tidy-up-button { grid-column: span 2; }
.prototype-placeholder { padding: 20px 16px; color: #777; font-size: 11px; line-height: 1.5; }
.inspect-panel { display: grid; gap: 9px; padding: 10px; }
.inspect-intro { display: grid; gap: 4px; padding: 4px 2px 7px; }
.inspect-intro > span { color: #8a6bb5; font-size: 8px; font-weight: 700; letter-spacing: .09em; }
.inspect-intro > strong { color: #303036; font-size: 13px; font-weight: 600; }
.inspect-intro > small { color: #888; font-size: 9px; line-height: 1.4; }
.inspect-layer-list { display: grid; gap: 7px; }
.inspect-layer-card { overflow: hidden; border: 1px solid #ececf0; border-radius: 7px; background: #fff; }
.inspect-layer-card > header { display: grid; gap: 3px; padding: 9px; border-bottom: 1px solid #f0f0f2; }
.inspect-layer-card > header strong { overflow: hidden; color: #33333b; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.inspect-layer-card > header span { color: #92929a; font-size: 9px; text-transform: capitalize; }
.inspect-layer-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 6px 9px; }
.inspect-layer-card dl > div { min-width: 0; padding: 5px 3px; }
.inspect-layer-card dt, .inspect-text-value > span { color: #8b8b94; font-size: 8px; }
.inspect-layer-card dd { overflow: hidden; margin: 3px 0 0; color: #42424a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.inspect-color { display: inline-flex; align-items: center; gap: 4px; }
.inspect-color i { width: 10px; height: 10px; border: 1px solid rgba(0,0,0,.1); border-radius: 3px; }
.inspect-text-value { padding: 0 12px 10px; }
.inspect-text-value p { overflow-wrap: anywhere; margin: 3px 0 0; color: #444; font-size: 10px; line-height: 1.4; }
.inspect-code-card { min-width: 0; overflow: hidden; border: 1px solid #e9e9ed; border-radius: 7px; background: #fff; }
.inspect-code-card > header { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px; }
.inspect-code-card > header > div { min-width: 0; display: grid; gap: 3px; }
.inspect-code-card > header strong { color: #3d3d45; font-size: 10px; font-weight: 600; }
.inspect-code-card > header span { overflow: hidden; color: #909099; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.inspect-copy { min-height: 30px; flex: 0 0 auto; padding: 0 9px; border: 1px solid #e4e4e8; border-radius: 5px; color: #55545f; background: #fff; font-size: 9px; }
.inspect-copy:hover { background: #f4f2f8; }
.inspect-code-card pre { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; max-height: 220px; overflow: auto; margin: 0; padding: 9px; background: #24242a; color: #e9e8ee; font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; user-select: text; -webkit-overflow-scrolling: touch; }
.inspect-code-card code { display: block; min-width: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.inspect-code-card > p { margin: 0; padding: 7px 9px; color: #8b8992; font-size: 8px; line-height: 1.4; }
.inspect-json-card details { border-top: 1px solid #f0f0f2; }
.inspect-json-card summary { padding: 8px 9px; color: #666; font-size: 9px; cursor: pointer; }
.inspect-empty { display: grid; gap: 6px; padding: 18px 14px; }
.inspect-empty strong { color: #444; font-size: 12px; font-weight: 550; }
.inspect-empty span { color: #888; font-size: 10px; line-height: 1.5; }
.prototype-inspector { padding-bottom: 8px; }
.prototype-section { padding: 13px 15px; border-bottom: 1px solid var(--border); }
.prototype-section-label { margin-bottom: 10px; color: #555; font-size: 10px; font-weight: 600; }
.prototype-flow-controls { display: grid; gap: 8px; margin-bottom: 10px; }
.prototype-flow-controls > label { display: grid; grid-template-columns: 1fr minmax(100px, 1.2fr); align-items: center; gap: 9px; color: #777; font-size: 10px; }
.prototype-flow-controls .select-field { width: 100%; min-width: 0; min-height: 36px; }
.prototype-flow-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.prototype-flow-actions .secondary-button { min-height: 32px; flex: 1 1 auto; padding: 0 8px; font-size: 10px; }
.prototype-current-frame { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: #333; font-size: 11px; }
.prototype-current-frame .secondary-button { height: 27px; padding: 0 8px; font-size: 9px; white-space: nowrap; }
.prototype-present-button { width: 100%; margin-top: 12px; }
.prototype-hint, .prototype-empty-links { margin: 0; color: #888; font-size: 10px; line-height: 1.5; }
.prototype-interaction-row { display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 4px 0; }
.prototype-interaction-row.is-editing { margin-inline: -7px; padding-inline: 7px; border-radius: 6px; background: #f4edff; }
.prototype-interaction-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: #f4edff; color: #8252d4; font-size: 13px; }
.prototype-interaction-copy { min-width: 0; flex: 1; }
.prototype-interaction-copy strong, .prototype-interaction-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prototype-interaction-copy strong { color: #444; font-size: 10px; font-weight: 550; }
.prototype-interaction-copy small { margin-top: 3px; color: #888; font-size: 9px; }
.prototype-edit-button { min-width: 42px; min-height: 30px; padding: 0 6px; border-radius: 5px; color: #69518d; font-size: 9px; }
.prototype-edit-button:hover { background: #eee6fb; }
.prototype-controls { display: grid; gap: 10px; margin-top: 14px; }
.prototype-scroll-position { display: flex; align-items: center; gap: 9px; min-height: 40px; color: var(--muted); font-size: 10px; }
.prototype-scroll-position input { width: 18px; height: 18px; accent-color: #0d99ff; }
.prototype-controls label { display: grid; grid-template-columns: 1fr minmax(105px, 1.15fr); align-items: center; gap: 9px; color: #777; font-size: 10px; }
.prototype-controls label.prototype-expression-field { grid-template-columns: minmax(0, 1fr); }
.prototype-overlay-manual-position { display: grid; grid-column: 1 / -1; gap: 6px; padding: 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface, #fff); }
.prototype-overlay-manual-position > span { color: var(--ink, #444); font-size: 10px; font-weight: 550; }
.prototype-overlay-manual-position > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.prototype-controls .prototype-overlay-manual-position label { grid-template-columns: 14px minmax(0, 1fr); gap: 6px; }
.prototype-overlay-manual-position input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 36px; }
.prototype-overlay-manual-position small { color: var(--muted, #777); font-size: 9px; line-height: 1.35; }
.prototype-controls #prototype-variable-expression { width: 100%; min-height: 40px; }
.prototype-controls > .prototype-hint code { color: var(--ink); }
.prototype-controls .select-field { width: 100%; min-height: 38px; }
.prototype-bezier-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.prototype-controls .prototype-bezier-controls label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; color: #777; font-size: 9px; text-align: center; }
.prototype-bezier-controls .text-input { width: 100%; min-width: 0; min-height: 34px; padding-inline: 4px; text-align: center; font-size: 10px; }
.prototype-controls label:has(#prototype-delay) { grid-template-columns: 1fr auto; }
.prototype-controls #prototype-delay { grid-column: 1 / -1; width: 100%; margin: -4px 0 0; accent-color: #0d99ff; }
.prototype-controls label:has(#prototype-duration) { grid-template-columns: 1fr auto; }
.prototype-controls #prototype-duration { grid-column: 1 / -1; width: 100%; margin: -4px 0 0; accent-color: #0d99ff; }
.prototype-controls label:has(input[type="checkbox"]) { grid-template-columns: 1fr auto; }
.prototype-controls label:has(#prototype-overlay-color) { grid-template-columns: 1fr 74px; }
.prototype-controls #prototype-overlay-color { width: 74px; height: 25px; padding: 2px; border: 1px solid #ddd; border-radius: 5px; background: #fff; }
.prototype-controls #prototype-overlay-opacity { grid-column: 1 / -1; width: 100%; margin: -4px 0 0; accent-color: #0d99ff; }
.prototype-add-link { width: 100%; }
.prototype-action-buttons { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.prototype-action-buttons:has(:only-child) { grid-template-columns: 1fr; }
.prototype-action-buttons .secondary-button { min-height: 38px; padding-inline: 12px; }
.prototype-program-editor { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.prototype-program-tree { display: grid; gap: 5px; }
.prototype-program-action, .prototype-program-if-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.prototype-program-action.is-editing { border-color: #b99be8; background: #f7f2ff; }
.prototype-program-action-label { min-width: 0; overflow: hidden; color: #444; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.prototype-program-step-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.prototype-program-step-actions .tiny-icon-button { width: 25px; min-height: 27px; }
.prototype-program-if { display: grid; gap: 5px; padding: 6px; border: 1px solid #e6dcf5; border-radius: 7px; background: #fbf9ff; }
.prototype-program-if-heading { padding: 2px 0 6px; border: 0; border-bottom: 1px solid #e6dcf5; border-radius: 0; background: transparent; color: #514169; font-size: 10px; }
.prototype-program-branch { display: grid; gap: 4px; margin-left: 9px; padding-left: 7px; border-left: 2px solid #ddd0f0; }
.prototype-program-branch-heading { display: flex; align-items: center; justify-content: space-between; color: #777; font-size: 9px; }
.prototype-program-add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; color: #888; font-size: 9px; }
.prototype-program-add-row > span { grid-column: 1 / -1; }
.prototype-program-add-row .secondary-button { min-height: 31px; padding: 0 6px; font-size: 9px; }
.prototype-connect-hint { padding: 9px; border-radius: 6px; background: #f3edff; color: #6949a0; font-size: 9px; line-height: 1.45; }
.prototype-help { display: grid; gap: 5px; color: #888; font-size: 9px; line-height: 1.45; }
.prototype-help strong { color: #666; font-size: 10px; font-weight: 550; }
.context-menu { z-index: 20; position: fixed; min-width: 205px; padding: 5px; border: 1px solid #e3e3e3; border-radius: 8px; background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.context-menu[hidden] { display: none; }
.context-menu button { display: flex; align-items: center; width: 100%; min-height: 31px; gap: 10px; padding: 0 9px; border-radius: 5px; text-align: left; font-size: 11px; }
.context-menu button > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.context-menu button:hover:not(:disabled) { background: #f3f3f3; }
.context-menu button:disabled { color: #aaa; cursor: default; }
.context-menu button .shortcut { margin-left: auto; color: #9b9b9b; font-size: 10px; }
.context-menu .menu-separator { height: 1px; margin: 4px 5px; background: #eee; }
.context-menu .menu-label { padding: 7px 9px 4px; color: #999; font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.context-menu button[role="menuitemradio"] { gap: 8px; }
.context-menu button[role="menuitemradio"]::before { width: 14px; color: var(--muted); content: "○"; font-size: 13px; }
.context-menu button[role="menuitemradio"][aria-checked="true"]::before { color: var(--blue); content: "●"; }
.context-menu .recipe-option::before { content: '✦'; color: #8a5ce0; }
.context-menu .recipe-option.is-empty { color: #999; cursor: default; }
.bulk-bar { z-index: 12; position: fixed; left: 50%; bottom: 82px; transform: translateX(-50%); width: min(850px, calc(100vw - 32px)); min-height: 66px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(135px, .8fr) minmax(210px, 1fr) auto; align-items: center; gap: 19px; padding: 10px 13px; border: 1px solid #dedede; border-radius: 10px; background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.bulk-bar:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.bulk-bar[hidden] { display: none; }
.recipe-recovery-dialog { width: min(450px, calc(100vw - 28px)); }
.recipe-recovery-content { padding: 22px; }
.recipe-recovery-content .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recipe-recovery-content .dialog-actions button { min-height: 44px; }
#recipe-recovery-resume { grid-column: 1 / -1; }
.workspace-onboarding-dialog { width: min(480px, calc(100vw - 28px)); }
.workspace-onboarding-content { padding: 22px; }
.workspace-onboarding-status { min-height: 34px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.workspace-onboarding-invite-note { margin: 0; padding: 9px 10px; border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: 7px; background: var(--surface-subtle); color: var(--ink); font-size: 12px; line-height: 1.45; }
.workspace-onboarding-status.is-error, .page-pdf-status.is-error { color: #b33a31; }
.workspace-onboarding-content .dialog-actions { justify-content: flex-end; flex-wrap: wrap; }
.page-pdf-dialog { width: min(470px, calc(100vw - 28px)); }
.page-pdf-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.page-pdf-field { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.page-pdf-field .select-field, .page-pdf-field .text-field { width: 100%; min-width: 0; min-height: 38px; }
.page-pdf-custom-size { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.page-pdf-custom-size[hidden] { display: none; }
.page-pdf-status { min-height: 44px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.page-pdf-dialog[aria-busy="true"] .page-pdf-status { padding-left: 24px; position: relative; }
.page-pdf-dialog[aria-busy="true"] .page-pdf-status::before { content: ''; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary-action-bg); border-radius: 50%; animation: spin .8s linear infinite; }
.page-pdf-dialog .dialog-actions > button { min-height: 40px; }
.recipe-recovery-card { display: grid; gap: 5px; margin: 14px 0; padding: 12px; border: 1px solid #e5e2eb; border-radius: 8px; background: #f8f7fa; }
.recipe-recovery-card strong { overflow: hidden; color: #38343e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.recipe-recovery-card span { color: #77717f; font-size: 11px; line-height: 1.45; }
.recipe-recovery-status { min-height: 16px; margin: 8px 0; color: #b33a31; font-size: 11px; line-height: 1.4; }
.bulk-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bulk-spinner { width: 21px; height: 21px; border: 2px solid #dcefff; border-top-color: #0d99ff; border-radius: 50%; animation: spin .8s linear infinite; }
.bulk-spinner.is-done { border-color: #1ca876; animation: none; position: relative; }
.bulk-spinner.is-done::after { content: '✓'; position: absolute; inset: -2px 0 0; display: grid; place-items: center; color: #1ca876; font-size: 12px; }
.bulk-spinner.is-paused { border-color: #eca33a; animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
.bulk-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.bulk-info span { display: block; margin-top: 4px; color: #888; font-size: 10px; }
.bulk-info .bulk-rate { color: #666; font-size: 9px; font-variant-numeric: tabular-nums; }
.bulk-progress-wrap { display: flex; align-items: center; gap: 8px; color: #777; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.bulk-progress-track { height: 5px; flex: 1; overflow: hidden; border-radius: 5px; background: #e9e9e9; }
.bulk-progress-fill { width: 0; height: 100%; border-radius: inherit; background: #0d99ff; transition: width .15s ease-out; }
.speed-control { min-width: 0; display: grid; grid-template-columns: auto minmax(56px, 1fr) 61px; align-items: center; gap: 7px; color: #777; font-size: 10px; white-space: nowrap; }
.speed-control input { width: 100%; accent-color: #0d99ff; }
.speed-control output { color: #555; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.speed-control .speed-help { grid-column: 1 / -1; display: block; margin: -4px 0 0; color: #888; font-size: 9px; line-height: 1.2; white-space: normal; }
.bulk-actions { display: flex; align-items: center; gap: 5px; }
.bar-action { height: 29px; padding: 0 9px; border: 1px solid #e5e5e5; border-radius: 5px; background: #fff; font-size: 10px; }
.bar-action:hover { background: #f5f5f5; }
.bar-action.primary { border-color: var(--primary-action-border); background: var(--primary-action-bg); color: #fff; }
.bar-action.primary:hover { background: var(--primary-action-hover); }
.toast-region { z-index: 30; position: fixed; right: max(12px, calc(env(safe-area-inset-right) + 12px)); bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); left: max(12px, calc(env(safe-area-inset-left) + 12px)); display: flex; align-items: center; flex-direction: column; gap: 7px; pointer-events: none; }
.toast { max-width: min(560px, 100%); padding: 10px 14px; border-radius: 7px; background: #272727; color: #fff; box-shadow: 0 4px 15px rgba(0,0,0,.2); font-size: 11px; overflow-wrap: anywhere; text-align: center; animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal { width: min(420px, calc(100vw - 30px)); border: 1px solid #ddd; border-radius: 12px; padding: 0; box-shadow: 0 18px 54px rgba(0,0,0,.22); }
.modal::backdrop { background: rgba(20,20,20,.25); backdrop-filter: blur(2px); }
.modal form { padding: 22px; }
dialog[data-dialog-modeless-fallback][open] { position: fixed; z-index: 20000; inset: 0; margin: auto; }
.dialog-modeless-fallback-backdrop { position: fixed; z-index: 19999; inset: 0; background: rgba(20,20,20,.25); backdrop-filter: blur(2px); }
.quick-actions-dialog { width: min(600px, calc(100vw - 24px)); max-height: min(680px, calc(100dvh - 28px)); overflow: hidden; }
.quick-actions-content { display: grid; gap: 10px; padding: 16px; }
.quick-actions-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quick-actions-heading h2 { margin: 3px 0 0; color: var(--ink, #20232a); font-size: 17px; font-weight: 600; }
.quick-actions-heading .icon-button { width: 36px; min-height: 36px; }
.quick-actions-search { box-sizing: border-box; height: 46px; font-size: 15px; }
.quick-actions-help, .quick-actions-empty { margin: 0; color: var(--muted, #737985); font-size: 11px; line-height: 1.45; }
.quick-actions-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-actions-suggestions[hidden] { display: none; }
.quick-action-suggestion { min-height: 34px; padding: 6px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 999px; background: var(--surface, #f6f7f8); color: var(--ink, #20232a); font-size: 11px; line-height: 1.25; cursor: pointer; }
.quick-action-suggestion:hover, .quick-action-suggestion:focus-visible { border-color: var(--blue, #0d99ff); background: var(--surface-hover, #f2f8ff); }
.quick-action-suggestion:focus-visible { outline: 2px solid var(--focus-ring, #0d99ff); outline-offset: 2px; }
.quick-actions-results { display: grid; gap: 3px; max-height: min(390px, 50dvh); overflow: auto; overscroll-behavior: contain; }
.quick-action-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; min-width: 0; min-height: 56px; padding: 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink, #20232a); text-align: left; cursor: pointer; }
.quick-action-option:hover:not(:disabled), .quick-action-option[aria-selected="true"] { border-color: color-mix(in srgb, var(--blue) 38%, var(--border)); background: var(--surface-hover, #f2f8ff); }
.quick-action-option:focus-visible { outline: 2px solid var(--focus-ring, #0d99ff); outline-offset: 1px; }
.quick-action-option:disabled { color: var(--muted, #737985); cursor: default; opacity: .8; }
.quick-action-option-copy { display: grid; min-width: 0; gap: 3px; }
.quick-action-option-title { color: var(--ink, #20232a); font-size: 13px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.quick-action-option-description { color: var(--muted, #737985); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.quick-action-option-shortcut { align-self: start; padding-top: 2px; color: var(--muted, #737985); font-size: 10px; white-space: nowrap; }
.quick-actions-footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-top: 8px; border-top: 1px solid var(--border, #e5e7eb); color: var(--muted, #737985); font-size: 10px; }
.quick-actions-footer kbd { padding: 3px 5px; border: 1px solid var(--border, #e5e7eb); border-radius: 4px; background: var(--surface, #f6f7f8); font: inherit; }
.text-find-replace-dialog { position: fixed; inset: max(64px, calc(env(safe-area-inset-top) + 54px)) max(12px, calc(env(safe-area-inset-right) + 12px)) auto auto; width: min(392px, calc(100vw - 24px)); max-height: calc(100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow: auto; margin: 0; color: var(--ink, #20232a); background: var(--surface, #fff); }
.text-find-replace-content { display: grid; gap: 8px; padding: 14px; }
.text-find-replace-content .quick-actions-heading h2 { font-size: 15px; }
.text-find-replace-label { color: var(--muted, #737985); font-size: 11px; }
.text-find-replace-input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
.text-find-match-row { display: grid; grid-template-columns: auto minmax(64px, 1fr) auto; align-items: center; gap: 6px; }
.text-find-match-row > button, .text-find-replace-actions > button { min-height: 44px; padding-inline: 10px; }
.text-find-match-row output { min-width: 0; color: var(--muted, #737985); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.text-find-case-option { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--ink, #20232a); font-size: 12px; }
.text-find-case-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue, #0d99ff); }
.text-find-replace-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.text-find-replace-help, .text-find-replace-status { margin: 0; color: var(--muted, #737985); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.text-find-replace-status { min-height: 16px; }
.component-slot-dialog { width: min(560px, calc(100vw - 24px)); }
.slot-picker-count { min-height: 30px; display: flex; align-items: center; color: #777; font-size: 10px; }
.slot-picker-list { max-height: min(420px, 48dvh); overflow: auto; overscroll-behavior: contain; border: 1px solid #e5e8ed; border-radius: 8px; background: #fff; }
.slot-picker-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 42px; padding: 3px 10px; border-bottom: 1px solid #f0f1f3; cursor: pointer; }
.slot-picker-row:last-child { border-bottom: 0; }
.slot-picker-row:hover { background: #f7faff; }
.slot-picker-row input { width: 18px; height: 18px; accent-color: #0d99ff; }
.slot-picker-name { min-width: 0; overflow: hidden; color: #303641; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.slot-picker-row small { color: #818895; font-size: 9px; }
.slot-picker-empty { padding: 24px 12px; color: #808692; text-align: center; font-size: 11px; }
.design-library-dialog { width: min(720px, calc(100vw - 24px)); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; }
.design-library-content { padding: 22px; }
.version-history-dialog { width: min(720px, calc(100vw - 24px)); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; }
.version-history-content { display: grid; gap: 12px; padding: 22px; }
.version-history-content .modal-copy { margin: 0; }
.version-save-form { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); }
.version-save-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.version-save-controls .text-field { min-width: 0; }
.version-history-list { display: grid; gap: 7px; max-height: min(420px, 48dvh); overflow: auto; overscroll-behavior: contain; }
.version-history-empty { display: grid; min-height: 112px; place-items: center; padding: 18px; border: 1px dashed var(--border); border-radius: 9px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.55; }
.version-record { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 66px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); }
.version-record-details { display: grid; min-width: 0; gap: 5px; }
.version-record-name { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.version-record-date { color: var(--muted); font-size: 10px; }
.version-record .secondary-button { min-height: 34px; white-space: nowrap; }
.design-library-list { display: grid; gap: 8px; max-height: min(440px, 52dvh); overflow: auto; overscroll-behavior: contain; }
.design-library-empty { display: grid; min-height: 132px; place-items: center; padding: 18px; border: 1px dashed #d7dce3; border-radius: 9px; color: #717986; text-align: center; font-size: 12px; line-height: 1.55; }
.design-file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 72px; padding: 10px 12px; border: 1px solid #e7e9ed; border-radius: 9px; background: #fff; }
.design-file-details { display: grid; min-width: 0; gap: 5px; }
.design-file-name { overflow: hidden; color: #252a31; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.design-file-date { color: #828a96; font-size: 10px; }
.design-file-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.design-file-actions button { min-height: 32px; padding: 0 10px; border: 1px solid #e2e5e9; border-radius: 6px; background: #fff; color: #404751; font-size: 10px; }
.design-file-actions button:hover { background: #f5f7f9; }
.design-file-actions button[data-action="open"] { border-color: var(--primary-action-border); background: var(--primary-action-bg); color: #fff; }
.design-file-actions button[data-action="delete"] { color: #a13e43; }
.design-library-content > .dialog-actions { position: sticky; bottom: -22px; margin: 16px -22px -22px; padding: 12px 22px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #eceef1; background: rgba(255,255,255,.97); }
.live-collaboration-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px - env(safe-area-inset-top)); overflow: auto; }
.live-collaboration-content { padding: 22px; }
.live-collaboration-content .modal-copy { margin-bottom: 12px; }
.live-collaboration-note { margin: 0 0 16px; color: #666b75; font-size: 12px; line-height: 1.55; }
.live-share-step { margin: 12px 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-subtle, #f7f8fa); }
.live-step-label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.live-share-step .live-collaboration-note { margin-bottom: 10px; }
.live-action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.live-action-row > button { min-height: 44px; }
.live-join-actions { display: grid; grid-template-columns: minmax(0, 1fr); margin: 10px 0 14px; }
.live-join-actions > button { width: 100%; }
.live-capsule-field { display: block; width: 100%; min-height: 66px; margin: 6px 0 8px; resize: vertical; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.live-share-url { min-height: 76px; overflow-wrap: anywhere; word-break: break-all; }
.live-join-message { min-height: 104px; font: 13px/1.5 var(--ui-font, system-ui, sans-serif); }
.live-copy-button { min-height: 38px; margin: 0 0 14px; }
.live-peer-list-wrap { margin: 14px 0; padding-top: 12px; border-top: 1px solid var(--border); }
.live-peer-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; color: var(--ink); font-size: 12px; }
.live-peer-list-heading span { color: var(--muted); font-size: 10px; }
.live-add-guest-button { min-height: 44px; margin: 0 0 8px; }
.live-peer-list { display: grid; gap: 8px; margin: 4px 0 14px; }
.live-peer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-subtle, #f7f8fa); color: var(--ink); font-size: 11px; line-height: 1.45; }
.live-peer-row .secondary-button { min-height: 34px; padding: 0 10px; }
.live-advanced { margin: 12px 0; border-top: 1px solid var(--border); color: var(--ink); }
.live-advanced > summary { display: flex; min-height: 44px; align-items: center; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; list-style: none; }
.live-advanced > summary::-webkit-details-marker { display: none; }
.live-advanced > summary:focus-visible { outline: 2px solid var(--primary-action-bg); outline-offset: 2px; }
.live-advanced > summary::before { content: '＋'; display: inline-flex; width: 22px; color: var(--muted); }
.live-advanced[open] > summary::before { content: '−'; }
.live-advanced-content { display: grid; gap: 8px; padding: 0 0 10px; }
.live-advanced-content .live-collaboration-note { margin: 8px 0; }
.live-stun-option { display: flex; align-items: flex-start; gap: 9px; color: #676b74; font-size: 11px; line-height: 1.45; }
.live-stun-option input { flex: 0 0 auto; margin: 2px 0 0; accent-color: #7564f6; }
.live-status { min-height: 1.3em; margin: 10px 0 0; color: #60646e; font-size: 12px; line-height: 1.4; }
.live-reply-link-card .live-status[data-state="error"] { color: #a13e43; }
.live-reply-link-card .live-status[data-state="ready"] { color: var(--ink); }
.live-join-button { min-height: 44px; width: 100%; margin: 12px 0 18px; }
.live-collaboration-content .dialog-actions { justify-content: flex-start; flex-wrap: wrap; }
.live-collaboration-content > .live-collaboration-dismiss-actions { position: sticky; z-index: 1; bottom: -22px; justify-content: flex-end; margin: 16px -22px -22px; padding: 12px 22px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border, #e5e7eb); background: var(--panel, #fff); }
.live-view-dock { position: fixed; z-index: 60; top: calc(58px + env(safe-area-inset-top)); left: 50%; display: flex; align-items: center; justify-content: center; gap: 10px; width: max-content; max-width: calc(100vw - 24px); padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: var(--panel-shadow); transform: translateX(-50%); }
.live-view-dock[hidden] { display: none; }
.live-view-dock > strong { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.live-view-dock label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.live-view-dock .select-field { min-width: 100px; max-width: 190px; height: 32px; }
.live-view-dock input[type="checkbox"] { accent-color: #7564f6; }
.live-view-dock button { min-height: 32px; white-space: nowrap; }
@media (max-width: 600px) {
  .live-collaboration-content { padding: 16px; }
  .live-view-dock { top: calc(54px + env(safe-area-inset-top)); justify-content: space-between; gap: 6px; width: calc(100vw - 16px); max-width: none; padding: 7px; border-radius: 10px; }
  .live-view-dock > strong { max-width: 102px; overflow: hidden; text-overflow: ellipsis; }
  .live-view-dock .select-field { min-width: 84px; max-width: 120px; height: 40px; }
  .live-view-dock label, .live-view-dock button { font-size: 11px; }
  .live-view-dock button { min-height: 40px; padding: 0 8px; }
  .live-peer-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .live-peer-row .secondary-button { width: 100%; }
  .live-collaboration-content > .modal-title-row {
    position: sticky;
    z-index: 2;
    top: 0;
    align-items: center;
    margin: -16px -16px 12px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: var(--panel, #fff);
  }
  .live-collaboration-content #live-collaboration-close {
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .live-collaboration-content > .live-collaboration-dismiss-actions {
    bottom: 0;
    margin: 16px -16px -16px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  }
  .live-collaboration-dismiss-actions > button { flex: 1 1 auto; }
  #live-collaboration-close-action { width: 100%; min-height: 44px; height: 44px; }
  #recipe-dialog .recipe-update-picker { min-height: 44px; }
  #recipe-dialog .dialog-actions > button { min-height: 44px; }
}
.modal-title-row { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-eyebrow { color: #888; font-size: 9px; font-weight: 650; letter-spacing: .12em; }
.modal h2 { margin: 5px 0 0; font-size: 18px; font-weight: 600; }
.modal-copy { margin: 13px 0 17px; color: #777; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.field-label { display: block; margin-bottom: 6px; color: #555; font-size: 10px; font-weight: 550; }
.variable-type-field { display: grid; gap: 6px; margin-top: 12px; }
.variable-type-field[hidden] { display: none; }
.text-field { width: 100%; height: 34px; padding: 0 9px; border: 1px solid #dedede; border-radius: 6px; font-size: 11px; }
.recipe-update-fields { display: grid; gap: 6px; }
.recipe-update-fields[hidden] { display: none; }
.recipe-update-picker { width: 100%; min-height: 38px; }
.recipe-preview { display: flex; align-items: center; gap: 9px; min-height: 43px; margin-top: 13px; padding: 0 10px; border: 1px solid #ece7f8; border-radius: 7px; background: #faf8ff; color: #6e5a99; font-size: 10px; }
.recipe-output-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: center; margin-top: 14px; }
.recipe-output-controls .field-label { margin: 0; }
.recipe-output-controls input[type="range"] { width: 100%; accent-color: var(--accent, #7450c8); }
.recipe-output-controls output { color: var(--muted, #777); font-size: 11px; font-weight: 500; }
.recipe-preview-icon { font-size: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 20px; }
.primary-button, .secondary-button { height: 32px; padding: 0 13px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 11px; }
.secondary-button { background: #fff; }
.primary-button { border-color: var(--primary-action-border); background: var(--primary-action-bg); color: #fff; font-weight: 550; }
.primary-button:hover { background: var(--primary-action-hover); }
.mobile-scrim { display: none; }
.text-editor-overlay { position: absolute; z-index: 3; display: block; min-width: 40px; min-height: 24px; padding: 0; overflow: hidden; border: 1px solid #0d99ff; outline: 0; background: rgba(255,255,255,.85); color: #1e1e1e; white-space: pre-wrap; user-select: text; -webkit-user-select: text; touch-action: auto; transform-origin: top left; }
.text-editor-overlay[hidden] { display: none; }
.text-editor-paragraph { display: block; min-height: 1em; margin: 0; text-indent: var(--text-first-line-indent, 0px); }
.text-editor-paragraph[data-editor-list-style] { position: relative; box-sizing: border-box; text-indent: var(--text-first-line-indent, 0px); }
.text-editor-paragraph[data-editor-list-style]::before { position: absolute; left: var(--editor-list-marker-left, 0); width: 24px; color: inherit; text-align: right; white-space: nowrap; content: attr(data-editor-list-marker); }
.text-editor-paragraph-following { margin-block-start: var(--text-paragraph-spacing, 0px); }
.text-editor-paragraph-following[data-editor-list-style] + .text-editor-paragraph-following[data-editor-list-style] { margin-block-start: var(--text-list-spacing, 0px); }
.text-editor-overlay > :is(div, p, li, blockquote) ~ :is(div, p, li, blockquote),
.text-editor-paragraph > :is(div, p, li, blockquote) ~ :is(div, p, li, blockquote),
.text-editor-paragraph > span ~ :is(div, p, li, blockquote) { margin-block-start: var(--text-paragraph-spacing, 0px); }
.text-editor-overlay > :is(div, p, li, blockquote),
.text-editor-paragraph > :is(div, p, li, blockquote) { text-indent: var(--text-first-line-indent, 0px); }
.text-editor-paragraph:only-child:empty::before { content: 'Type something'; color: #999; pointer-events: none; }
.text-format-toolbar { position: absolute; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; width: max-content; max-width: calc(100% - 16px); max-height: min(420px, 55dvh); overflow-y: auto; padding: 5px; border: 1px solid #dedede; border-radius: 9px; background: rgba(255,255,255,.98); box-shadow: 0 4px 18px rgba(0,0,0,.18); color: #333; touch-action: manipulation; }
.text-underline-settings { min-width: 0; margin-block: 8px; }
.text-underline-settings > summary { cursor: pointer; min-height: 32px; align-content: center; font-size: 11px; }
.text-underline-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block: 8px; }
.text-underline-field { min-width: 0; display: grid; gap: 5px; font-size: 10px; }
.text-underline-field > input, .text-underline-field select { box-sizing: border-box; min-width: 0; width: 100%; min-height: 32px; }
.text-underline-metric { display: grid; grid-template-columns: minmax(0, 1fr) 65px; gap: 4px; min-width: 0; }
.text-underline-metric > input { min-width: 0; width: 100%; }
.text-underline-check { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 32px; font-size: 11px; }
.text-underline-range-settings { flex: 1 0 100%; grid-column: 1 / -1; width: 100%; margin-block: 0; }
.text-underline-range-settings .text-underline-controls { max-width: 500px; }
.text-format-toolbar[hidden] { display: none; }
.text-format-toolbar input[data-mixed="true"]:not([type="color"])::placeholder { color: #747985; opacity: 1; }
.text-format-toolbar input[type="color"][data-mixed="true"] { outline: 2px dashed #7b5ca6; outline-offset: -4px; }
.text-format-toolbar select[data-mixed="true"] { border-style: dashed; }
.text-format-button, .text-format-done { min-width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid #e5e5e5; border-radius: 6px; background: #fff; color: #333; font-size: 13px; }
.text-format-button[data-paragraph-align] { font-size: 0; }
.text-format-button[data-paragraph-align]::before { content: ""; width: 16px; height: 16px; background-image: linear-gradient(currentColor 0 0), linear-gradient(currentColor 0 0), linear-gradient(currentColor 0 0); background-repeat: no-repeat; }
.text-format-button[data-paragraph-align="left"]::before { background-size: 16px 1.5px, 11px 1.5px, 14px 1.5px; background-position: left top, left center, left bottom; }
.text-format-button[data-paragraph-align="center"]::before { background-size: 16px 1.5px, 11px 1.5px, 14px 1.5px; background-position: center top, center center, center bottom; }
.text-format-button[data-paragraph-align="right"]::before { background-size: 16px 1.5px, 11px 1.5px, 14px 1.5px; background-position: right top, right center, right bottom; }
.text-format-button[data-paragraph-align="justify"]::before { background-size: 16px 1.5px, 16px 1.5px, 16px 1.5px; background-position: left top, left center, left bottom; }
.text-format-button[aria-pressed="true"] { border-color: #9bcfff; background: #eaf5ff; color: #087dcc; }
.text-format-trim-label, .text-format-position-label, .text-format-size-label, .text-format-line-height-label, .text-format-color-label, .text-format-family-label, .text-format-weight-label, .text-format-spacing-label, .text-format-spacing-unit-label, .text-format-baseline-shift-label, .text-format-decoration-label { height: 32px; display: flex; align-items: center; gap: 4px; padding: 0 5px; border: 1px solid #e5e5e5; border-radius: 6px; color: #777; font-size: 9px; white-space: nowrap; }
.text-format-size-label input { width: 44px; height: 27px; padding: 0 3px; border: 0; background: transparent; color: #333; font-size: 11px; }
.text-format-line-height-label input { width: 44px; height: 27px; padding: 0 3px; border: 0; background: transparent; color: #333; font-size: 11px; }
.text-format-color-label input { width: 25px; height: 25px; padding: 1px; border: 0; background: transparent; }
.text-format-trim-label select, .text-format-position-label select, .text-format-family-label input, .text-format-weight-label select, .text-format-spacing-label input, .text-format-spacing-unit-label select, .text-format-baseline-shift-label input, .text-format-decoration-label select { min-width: 0; width: 100%; height: 27px; padding: 0 3px; border: 0; background: transparent; color: #333; font-size: 11px; }
.text-format-done { min-width: 44px; padding: 0 7px; background: #1e1e1e; color: #fff; font-size: 10px; }
.presentation-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: #333; color: #f1f3f7; }
.presentation-dialog::backdrop { background: #222; }
#present-scene, #present-overlay-canvas, #present-transition-canvas, #present-matching-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#present-scene { z-index: 0; transform-origin: center; }
#present-canvas, #present-backdrop-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#present-canvas { z-index: 0; touch-action: manipulation; }
#present-backdrop-canvas { z-index: 1; pointer-events: none; }
#present-overlay-canvas { z-index: 2; pointer-events: none; }
#present-transition-canvas { z-index: 3; display: none; pointer-events: none; }
#present-matching-canvas { z-index: 3; pointer-events: none; }
.presentation-toolbar { z-index: 3; position: absolute; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); min-width: min(340px, calc(100vw - 24px)); height: 54px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.11); border-radius: 11px; background: rgba(30,30,30,.82); color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.22); backdrop-filter: blur(12px); }
.presentation-control { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 7px; color: #fff; font-size: 17px; }
.presentation-control:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.presentation-control:disabled { opacity: .35; cursor: default; }
.presentation-title { min-width: 60px; flex: 1 1 110px; text-align: center; }
.presentation-title strong, .presentation-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presentation-title strong { font-size: 11px; font-weight: 550; }
.presentation-title span { margin-top: 3px; color: rgba(255,255,255,.6); font-size: 9px; }
.presentation-flow-picker { min-width: 0; max-width: 184px; display: flex; align-items: center; gap: 5px; color: rgba(255,255,255,.68); font-size: 10px; }
.presentation-flow-picker[hidden] { display: none; }
.presentation-flow-picker select { min-width: 0; max-width: 156px; height: 34px; padding: 0 22px 0 8px; border-color: rgba(255,255,255,.17); background-color: rgba(255,255,255,.1); color: #fff; font-size: 11px; }
.presentation-flow-picker select option { background: #252525; color: #fff; }
.presentation-help { z-index: 3; position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(15px, env(safe-area-inset-bottom)); padding: 7px 10px; border-radius: 20px; background: rgba(30,30,30,.65); color: rgba(255,255,255,.78); font-size: 9px; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 210px minmax(0,1fr) 250px; }
  .inspector-tab { padding-inline: 0; font-size: 9px; }
  .bulk-bar { grid-template-columns: minmax(160px,1fr) minmax(120px,.7fr) minmax(190px,1fr) auto; gap: 10px; }
}
@media (max-width: 820px) {
  .text-underline-settings > summary, .text-underline-check { min-height: 44px; }
  .text-underline-field > input, .text-underline-field select, .text-underline-metric > input { min-height: 40px; font-size: 16px; }
  .text-underline-check > input { width: 20px; height: 20px; flex: 0 0 20px; }
  .frame-quick-add-side { gap: 4px; padding: 4px; }
  .frame-quick-add-side button { width: 44px; height: 44px; font-size: 22px; }
  .shape-builder-bar { left: 8px; right: 8px; bottom: 8px; display: grid; gap: 8px; max-width: none; padding: 8px; transform: none; }
  .shape-builder-copy { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; }
  .shape-builder-copy span { overflow: hidden; text-overflow: ellipsis; }
  .shape-builder-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shape-builder-actions button { min-height: 44px; }
  .app-shell { grid-template-rows: 45px minmax(0, 1fr); }
  .topbar { height: 45px; padding: 0 7px; gap: 3px; }
  .topbar-leading, .topbar-trailing { flex: 0 0 auto; gap: 2px; }
  .topbar-divider, .file-menu-button, .mode-switcher, .quiet-button, .avatar-button { display: none; }
  .document-title-wrap { flex: 1 1 auto; flex-direction: row; gap: 3px; }
  .save-state { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; min-width: 34px; font-size: 9px; }
  .save-state-full { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .save-state-compact { display: inline; }
  .present-button { width: 32px; padding: 0; justify-content: center; font-size: 12px; }
  .present-button span { display: none; }
  .document-name { max-width: 180px; }
  .storage-mode-chip { display: inline-flex; align-items: center; max-width: 52px; overflow: hidden; padding: 3px 5px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 10px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-panel-toggle { display: inline-grid; }
  #sidebar-toggle, #inspector-toggle { box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; grid-template-rows: 22px 11px; align-content: center; gap: 0; padding: 1px 1px; font-size: 14px; line-height: 1; }
  #sidebar-toggle::after, #inspector-toggle::after { color: var(--muted); font-size: 7px; line-height: 10px; }
  #sidebar-toggle::after { content: 'Layers'; }
  #inspector-toggle::after { content: 'Properties'; }
  .workspace { position: relative; display: block; min-width: 0; width: 100%; }
  .canvas-region { position: absolute; inset: 0; }
  .left-panel, .right-panel { z-index: 10; position: absolute; top: 0; bottom: 0; width: min(290px, 86vw); box-shadow: 0 5px 22px rgba(0,0,0,.16); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  .left-panel { left: 0; transform: translateX(-105%); }
  .right-panel { right: 0; transform: translateX(105%); }
  .left-panel.is-open, .right-panel.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s, 0s; }
  .mobile-scrim.is-visible { z-index: 8; display: block; position: absolute; inset: 45px 0 0; background: rgba(0,0,0,.14); }
  .layer-row { position: relative; height: auto; min-height: 40px; max-width: 100%; overflow: hidden; gap: 3px; padding-left: min(var(--layer-indent), 18px) !important; }
  .layer-depth-marker { display: block; position: absolute; top: 50%; left: 0; transform: translateY(-50%); box-sizing: border-box; width: min(var(--layer-indent), 18px); padding-right: 2px; overflow: hidden; color: var(--muted, #777); font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; opacity: .72; text-align: right; pointer-events: none; }
  .layer-chevron, .layer-chevron-placeholder { width: 36px; height: 40px; flex-basis: 36px; }
  .layer-chevron { width: 36px; height: 40px; flex: 0 0 36px; display: grid; place-items: center; }
  .layer-icon { width: 18px; height: 40px; flex-basis: 18px; }
  .layer-reorder-handle { width: 32px; height: 40px; flex-basis: 32px; }
  .layer-order-control { width: 40px; height: 40px; flex-basis: 40px; }
  .layer-visibility { width: 40px; height: 40px; flex-basis: 40px; }
  .layer-row .layer-order-control, .layer-row .layer-visibility, .layer-row .layer-actions-menu { flex-shrink: 0; }
  .layer-row .layer-actions-menu { display: grid; width: 40px; height: 40px; flex: 0 0 40px; }
  .layers-heading { min-height: 44px; }
  .layers-heading .heading-actions { align-items: center; gap: 3px; }
  .layers-heading .tiny-icon-button { width: 40px; height: 40px; }
  .layer-select-mode { min-width: 96px; min-height: 40px; padding: 0 8px; font-size: 12px; }
  .layer-selection-hint { font-size: 13px; line-height: 1.45; }
  .multi-align-button { height: auto; min-height: 44px; padding-inline: 5px; font-size: 11px; }
  .add-fill { height: auto; min-height: 40px; font-size: 12px; }
  .delete-layer-button { min-height: 44px; }
  .vector-point-actions .add-fill { min-height: 44px; }
  .recipe-picker { box-sizing: border-box; min-height: 44px; font-size: 16px; }
  .frame-preset-group > summary { min-height: 44px; padding: 8px 9px; font-size: 12px; }
  .frame-preset-resize-select { min-height: 44px; font-size: 16px; }
  .frame-resize-to-fit { min-height: 44px; }
  .frame-resize-to-fit-shortcut { display: none; }
  .frame-preset-option { min-height: 46px; padding: 8px; }
  .frame-preset-option > span:first-child { font-size: 12px; }
  .frame-preset-dimensions { font-size: 10px; }
  .recipe-save-button, .recipe-apply-button { min-height: 44px; font-size: 12px; }
  .property-section .primary-button.recipe-apply-button { height: auto; min-height: 44px; }
  .recipe-management > summary { min-height: 44px; }
  .recipe-management-actions { grid-template-columns: 1fr; gap: 8px; }
  .recipe-management-actions .add-fill { min-height: 44px; }
  .component-library-list { max-height: min(35dvh, 280px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .local-library-publish, .local-library-component { min-height: 44px; padding: 8px; font-size: 12px; }
  .bottom-toolbar { bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .bottom-toolbar-viewport { justify-content: flex-start; }
  .tool-button { width: 35px; flex: 0 0 35px; }
  .zoom-controls { right: 10px; bottom: 71px; }
  .canvas-status { left: 10px; bottom: 22px; max-width: 45vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .bulk-bar { bottom: 72px; width: calc(100vw - 18px); grid-template-columns: minmax(0,1fr) auto; gap: 7px 11px; padding: 9px 10px; }
  .bulk-info { grid-column: 1; }
  .bulk-progress-wrap { grid-column: 1; grid-row: 2; }
  .speed-control { grid-column: 1 / 3; grid-row: 3; grid-template-columns: auto minmax(50px,1fr) 64px; }
  .speed-control { min-height: 40px; }
  .speed-control input { min-height: 28px; }
  .bulk-actions { grid-column: 2; grid-row: 1 / 3; }
  .bulk-info strong { font-size: 10px; }
  .bulk-info span { font-size: 9px; }
  .bar-action { min-height: 40px; padding: 0 7px; }
  .context-menu { max-width: calc(100vw - 16px); }
  .context-menu button { min-height: 44px; font-size: 13px; }
  .export-setting-row { gap: 10px; padding: 10px; }
  .layer-effect-card { gap: 10px; padding: 10px; }
  .layer-effect-heading { font-size: 12px; }
  .layer-effect-heading label, .effect-color-row label { font-size: 11px; }
  .fill-stack-card .layer-effect-heading { min-width: 0; gap: 4px; }
  .fill-stack-card .layer-effect-heading > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fill-stack-card .layer-effect-heading > label { flex: 0 0 auto; white-space: nowrap; }
  .fill-stack-card .layer-effect-heading > .tiny-icon-button { flex: 0 0 40px; }
  .stroke-stack-card .layer-effect-heading { min-width: 0; gap: 4px; }
  .stroke-stack-card .layer-effect-heading > label { flex: 0 0 auto; white-space: nowrap; }
  .stroke-stack-card .layer-effect-heading > .tiny-icon-button { width: 40px; height: 40px; flex: 0 0 40px; }
  .stroke-field-grid { gap: 8px; }
  .stroke-side-widths { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stroke-field { min-width: 0; font-size: 11px; }
  .stroke-field input, .stroke-field select { height: 40px; font-size: 12px; }
  .stroke-gradient-controls .gradient-stop-row input[type=color], .stroke-gradient-controls .gradient-stop-row input[type=number] { height: 40px; }
  .stroke-gradient-controls .gradient-stop-row .tiny-icon-button { width: 40px; height: 40px; }
  .stroke-opacity-row { grid-template-columns: 62px minmax(0, 1fr) 34px; }
  .effect-color-row input[type=color] { width: 36px; height: 34px; }
  .effect-opacity output { min-width: 36px; }
  .effect-clip { min-height: 44px; font-size: 13px; }
  .effect-clip input { width: 20px; height: 20px; }
  .prototype-controls #prototype-delay { min-height: 44px; margin-top: 0; }
  .prototype-interaction-row { min-height: 48px; gap: 5px; }
  .prototype-edit-button { min-width: 46px; min-height: 44px; font-size: 10px; }
  .prototype-interaction-row .tiny-icon-button { width: 40px; height: 40px; }
  .prototype-controls .select-field { min-height: 44px; }
  .prototype-controls #prototype-variable-expression { min-height: 44px; font-size: 16px; }
  .prototype-action-buttons .primary-button, .prototype-action-buttons .secondary-button { min-height: 44px; }
  .fill-type-row { grid-template-columns: 78px minmax(0, 1fr); font-size: 12px; }
  .fill-type-row .select-field { height: 38px; font-size: 12px; }
  .typography-font-family, [data-prop="fontWeight"], [data-prop="fontStyle"] { min-height: 40px; font-size: 12px; }
  .typography-style-row { gap: 5px; padding: 4px; }
  .typography-style-apply { min-height: 44px; }
  .typography-style-actions button { min-width: 40px; min-height: 40px; font-size: 11px; }
  .blend-mode-select { min-height: 40px; font-size: 12px; }
  .image-fill-source { grid-template-columns: 78px minmax(0, 1fr); font-size: 12px; }
  .image-fill-source .select-field { height: 38px; font-size: 12px; }
  .gradient-stop-row { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(64px, .7fr)) 38px; gap: 8px; }
  .gradient-stop-row label { font-size: 10px; }
  .gradient-stop-row input[type=color], .gradient-stop-row input[type=number] { height: 36px; font-size: 12px; }
  .text-format-toolbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: min(360px, calc(100% - 16px)); padding: 5px; overflow-y: auto; max-height: min(360px, 50dvh); overscroll-behavior: contain; }
  .text-format-button, .text-format-done { min-width: 40px; height: 44px; font-size: 14px; }
  .text-format-trim-label, .text-format-position-label, .text-format-size-label, .text-format-line-height-label, .text-format-color-label, .text-format-family-label, .text-format-weight-label, .text-format-spacing-label, .text-format-spacing-unit-label, .text-format-baseline-shift-label, .text-format-decoration-label { box-sizing: border-box; width: 100%; min-width: 40px; height: 44px; justify-content: center; padding: 0 3px; font-size: 9px; }
  .text-format-family-label { grid-column: span 4; }
  .text-format-position-label { grid-column: span 2; }
  .text-format-trim-label { grid-column: 1 / -1; }
  .text-format-trim-label select, .text-format-position-label select, .text-format-size-label input, .text-format-line-height-label input, .text-format-family-label input, .text-format-weight-label select, .text-format-spacing-label input, .text-format-spacing-unit-label select, .text-format-baseline-shift-label input, .text-format-decoration-label select { box-sizing: border-box; width: min(100%, 58px); min-width: 40px; height: 40px; font-size: 13px; }
  .text-format-family-label input { width: 100%; }
  .text-format-position-label select { width: 100%; min-width: 0; font-size: 16px; }
  .text-format-trim-label select { width: 100%; min-width: 0; font-size: 16px; }
  .text-format-color-label input { width: 40px; min-width: 40px; height: 40px; flex: 0 0 40px; }
  .text-format-done { min-width: 52px; padding: 0 5px; font-size: 11px; }
  .export-setting-row .select-field, .export-suffix input { height: 38px; font-size: 12px; }
  .export-suffix input[data-export-field="padding"] { box-sizing: border-box; min-height: 44px; height: 44px; }
  .export-setting-actions .secondary-button, .export-setting-actions .tiny-icon-button { min-height: 40px; height: 40px; }
  .export-setting-actions .tiny-icon-button { width: 40px; }
  .export-setting-actions > span { font-size: 10px; }
  .export-quality { grid-template-columns: 45px minmax(0, 1fr) 38px; }
  .export-quality input { min-height: 28px; }
  .layout-guide-card { gap: 10px; padding: 10px; }
  .layout-guide-heading select, .layout-guide-field input, .layout-guide-field select { height: 38px; font-size: 12px; }
  .layout-guide-heading select { height: 40px; }
  .layout-guide-select, .layout-guide-visibility, .layout-guide-remove { width: 40px; height: 40px; }
  .layout-guide-heading { grid-template-columns: 40px 40px minmax(0, 1fr) 40px; gap: 7px; }
  .layout-guide-adds { gap: 6px; }
  .layout-guide-adds button { height: 40px; font-size: 11px; }
  .layout-guide-appearance input[type="color"] { width: 40px; height: 38px; }
  .layout-guide-opacity { grid-template-columns: 46px minmax(0, 1fr) 38px; }
  .layout-guide-opacity input { min-height: 28px; }
  .grid-track-editor > summary { min-height: 44px; font-size: 12px; }
  .grid-track-row { grid-template-columns: minmax(0, .4fr) minmax(0, 1fr) minmax(0, .8fr) 44px 44px; gap: 3px; }
  .grid-track-name { font-size: 11px; }
  .grid-track-row .select-field, .grid-track-value { height: 42px; min-height: 42px; font-size: 12px; }
  .grid-track-delete, .grid-track-move-menu-button { width: 44px; min-width: 44px; height: 44px; }
  .grid-track-value { grid-template-columns: auto minmax(0, 1fr); padding-inline: 4px; }
  .grid-track-value input { min-height: 38px; font-size: 16px; }
  .grid-track-content { font-size: 10px; }
  .grid-track-minimum > summary { min-height: 36px; font-size: 11px; }
  .grid-track-minimum-controls .select-field, .grid-track-bound-value { height: 42px; min-height: 42px; font-size: 12px; }
  .grid-track-bound-value input { min-height: 38px; font-size: 16px; }
  .inspect-panel { gap: 10px; padding: 10px; }
  .inspector-tabs { justify-content: space-between; }
  .inspector-tab { min-width: 0; padding: 0 4px; font-size: 10px; }
  .comments-panel { gap: 11px; padding: 10px; }
  .comment-new-button, .comment-text-button { min-height: 40px; }
  .comment-compose { gap: 9px; padding: 10px; }
  .comment-compose textarea { min-height: 88px; padding: 10px; font-size: 13px; }
  .comment-compose-actions .primary-button, .comment-compose-actions .secondary-button, .comment-thread-actions .secondary-button, .comment-delete-button { min-height: 40px; }
  .comment-thread-row { min-height: 64px; padding: 10px; }
  .comment-mini-pin { width: 26px; height: 26px; flex-basis: 26px; }
  .comment-row-copy strong { font-size: 11px; }
  .comment-row-copy small { font-size: 10px; }
  .inspect-code-card > header { min-height: 56px; padding: 8px 9px; }
  .inspect-copy { min-height: 40px; padding: 0 11px; font-size: 11px; }
  .inspect-code-card pre { max-height: 280px; padding: 10px; font-size: 10px; }
  .inspect-layer-card dl > div { padding: 7px 3px; }
}

:root[data-theme="dark"] .motion-panel-heading strong,
:root[data-theme="dark"] .motion-track-card > header strong,
:root[data-theme="dark"] .motion-track-create > label { color: #e0e4eb; }
:root[data-theme="dark"] .motion-duration-field input,
:root[data-theme="dark"] .motion-keyframe-row label input,
:root[data-theme="dark"] .motion-keyframe-row label select { border-color: #454953; background: #30333a; color: #e0e4eb; }
:root[data-theme="dark"] .motion-track-card { background: #2a2d34; }
:root[data-theme="dark"] .motion-track-lane { background-color: #25272e; }
:root[data-theme="dark"] .motion-keyframe-marker::before { border-color: #2a2d34; }
@media (max-width: 420px) {
  .topbar { padding: 0 4px; }
  .topbar-leading { gap: 0; }
  .brand-button { width: 29px; }
  .brand-mark { width: 22px; height: 22px; }
  .tool-button { width: 32px; flex-basis: 32px; }
  .bottom-toolbar { gap: 0; padding: 4px; }
  .bottom-toolbar-viewport { gap: 0; }
  .toolbar-separator { margin: 0 2px; }
  .zoom-controls { bottom: 69px; }
  .zoom-divider { display: none; }
  .fit-button { display: flex; width: auto; min-width: 48px; gap: 4px; padding-inline: 6px; font-size: 11px; }
  .fit-button > span:first-child { display: none; }
  .fit-button-label { display: inline; }
  .canvas-topline { padding: 0 8px; }
  .canvas-status { bottom: 18px; }
}

/* Studio surface and control polish */
:where(button, input, select, textarea) { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.document-name:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
::selection { background: rgba(13,153,255,.22); }
* { scrollbar-color: #c9cdd4 transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: #c9cdd4; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #aeb4bd; }

.app-shell { color: var(--ink); background: #f3f4f6; }
.topbar {
  background: rgba(255,255,255,.98);
  box-shadow: 0 1px 0 rgba(25,31,42,.04), 0 2px 7px rgba(25,31,42,.035);
}
.brand-mark { background: linear-gradient(145deg, #222630, #414754); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.topbar-button, .icon-button, .canvas-action-button, .tiny-icon-button { transition: color .14s ease, background-color .14s ease, border-color .14s ease, box-shadow .14s ease; }
.icon-button, .canvas-action-button, .tiny-icon-button { color: #606672; }
.icon-button:hover, .canvas-action-button:hover, .tiny-icon-button:hover,
.topbar-button:hover, .page-row:hover, .layer-row:hover { background-color: var(--surface-hover); }
.document-name { color: #292d35; }
.document-name:hover, .document-name:focus { border-color: #e1e4e8; background: #f8f9fb; }
.save-state { color: #7b818b; }
.mode-switcher { border-color: #e4e6ea; background: #f8f9fb; }
.quiet-button { background: #272b34; }
.quiet-button:hover { background: #3b414d; }
.workspace { background: #fff; }
.left-panel, .right-panel { background: #fff; }
.left-panel { border-right-color: #e4e6eb; }
.right-panel { border-left-color: #e4e6eb; }
.sidebar-tabs, .inspector-tabs { border-color: #e8eaee; }
.sidebar-tab, .inspector-tab { color: #777e89; }
.sidebar-tab.is-active, .inspector-tab.is-active { color: #252a33; }
.sidebar-tab.is-active::after, .inspector-tab.is-active::after { background: var(--blue); }
.section-heading { color: #727985; letter-spacing: .015em; }
.pages-section { border-bottom-color: #e9ebef; }
.page-row { color: #505662; }
.page-row.is-active { color: #242a34; background: #eff6fc; box-shadow: inset 2px 0 0 var(--blue); }
.page-row.is-active .page-row-icon { color: #1685d4; }
.layer-row { color: #4d535f; }
.layer-row.is-selected { color: #076db5; background: #eaf5ff; box-shadow: inset 0 0 0 1px rgba(13,153,255,.1); }
.layer-select-mode, .layer-search-wrap input, .select-field, .color-value, .fill-opacity,
.export-suffix input, .layout-guide-heading select, .layout-guide-field input, .layout-guide-field select,
.gradient-stop-row input[type=number], .gradient-stop-row input[type=color], .text-field {
  border-color: #dfe3e9;
  border-radius: var(--control-radius);
}
.layer-search-wrap input { background: #fafbfc; }
.layer-search-wrap input:focus, .select-field:focus, .color-value:focus, .fill-opacity:focus,
.export-suffix input:focus, .gradient-stop-row input:focus, .text-field:focus {
  border-color: #8bc5f2;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(13,153,255,.13);
}
.sidebar-footer { border-top-color: #e8eaee; background: #fcfcfd; }
.empty-layer-icon { border-color: #e2e6eb; background: #fafbfd; }
.variable-collection-card, .component-card, .color-style-card, .typography-style-row,
.inspect-layer-card, .inspect-code-card, .comment-thread-row, .comment-message {
  border-color: #e5e8ed;
}
.variable-collection-card, .typography-style-row { background: #fcfcfd; }
.component-card:hover, .color-style-card:hover { border-color: #bfdcf2; background: #f7fbff; }
.property-section { border-bottom-color: #e8eaee; padding-top: 14px; padding-bottom: 15px; }
.property-heading { color: #39404b; font-weight: 600; }
.property-field, .size-limit-field { background: #f5f6f8; }
.property-field:focus-within, .size-limit-field:focus-within { border-color: #83bfee; background: #fff; box-shadow: 0 0 0 2px rgba(13,153,255,.1); }
.property-field input, .size-limit-field input, .color-value, .fill-opacity { color: #343a45; }
.select-field, .color-value, .fill-opacity, .export-suffix input, .layout-guide-heading select,
.layout-guide-field input, .layout-guide-field select, .gradient-stop-row input[type=number] { background-color: #fff; }
.add-fill { color: #66707d; }
.add-fill:hover, .variable-apply:hover { background: #f2f6fa; }
.layer-effect-card, .export-setting-row, .layout-guide-card { border-color: #e4e7ec; background: #fafbfc; }
.multi-selection-card { border-bottom-color: #e6e9ee; background: #fbfcfd; }
.multi-align-button:hover:not(:disabled) { border-color: #abd5f4; background: #f1f8fe; }
.canvas-region {
  background-color: var(--canvas-base);
  background-image: radial-gradient(rgba(255,255,255,.11) .8px, transparent .8px);
  background-position: 12px 12px;
  background-size: 24px 24px;
}
.canvas-topline { border-bottom-color: rgba(20,24,32,.09); background: rgba(250,251,253,.94); }
.canvas-breadcrumb { color: #68707d; }
.crumb-file { color: #303641; }
.canvas-action-button.is-active { color: #0872bd; background: #e8f4fd; }
.canvas-drop-overlay { border-color: #168fe0; background: rgba(231,246,255,.91); color: #0874bd; }
.zoom-controls, .bottom-toolbar {
  border-color: rgba(221,225,231,.95);
  box-shadow: var(--toolbar-shadow);
}
.zoom-controls { background: rgba(255,255,255,.98); }
.bottom-toolbar { background: rgba(255,255,255,.98); backdrop-filter: blur(12px); }
.tool-button { color: #4d5562; }
.tool-button:hover { background: #f1f3f6; }
.tool-button.is-selected { background: #e8f4fd; color: #0876c4; box-shadow: inset 0 0 0 1px rgba(13,153,255,.12); }
.canvas-status { color: rgba(245,247,250,.78); text-shadow: 0 1px 2px rgba(0,0,0,.32); }
.status-divider { border-left-color: rgba(255,255,255,.3); }
.inspector-footer { border-top-color: #e8eaee; background: #fcfcfd; }
.export-button, .secondary-button, .comment-text-button { border-color: #dfe3e9; }
.export-button:hover, .secondary-button:hover, .comment-text-button:hover { background: #f5f7f9; }
.primary-button { box-shadow: 0 1px 2px rgba(0,103,178,.18); }
.primary-button:hover { background: var(--primary-action-hover); }
.comment-compose { border-color: #e3e7ec; background: #f8fafc; }
.comment-thread-row:hover { border-color: #b9dcf4; background: #f5faff; }
.context-menu, .modal, .text-format-toolbar, .bulk-bar {
  border-color: #e0e4e9;
  box-shadow: var(--panel-shadow);
}
.context-menu { background: rgba(255,255,255,.985); backdrop-filter: blur(14px); }
.context-menu button:hover:not(:disabled) { background: #f1f5f8; }
.bulk-bar { background: rgba(255,255,255,.985); backdrop-filter: blur(14px); }
.text-format-toolbar { background: rgba(255,255,255,.985); }
.text-format-button[aria-pressed="true"] { border-color: #89c4f1; background: #eaf5ff; color: #0875bf; }
.mobile-scrim.is-visible { background: rgba(20,24,32,.32); backdrop-filter: blur(2px); }

@media (max-width: 820px) {
  #find-text-button { display: none; }
  html, body, .app-shell { height: 100dvh; }
  .app-shell { grid-template-rows: calc(45px + env(safe-area-inset-top)) minmax(0, 1fr); }
  .topbar { height: auto; min-height: 45px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
  .icon-button, .mobile-panel-toggle, .present-button { min-width: 44px; min-height: 44px; }
  .brand-button { min-width: 34px; }
  .topbar-button { min-height: 44px; }
  .canvas-action-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .quick-actions-dialog { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .quick-actions-content { gap: 8px; padding: 12px; }
  .quick-actions-results { max-height: min(52dvh, 440px); }
  .quick-action-option { min-height: 56px; }
  .quick-action-suggestion { min-height: 44px; padding-inline: 11px; }
  .quick-actions-footer { justify-content: space-between; gap: 4px; font-size: 9px; }
  .text-find-replace-dialog { inset: max(52px, calc(env(safe-area-inset-top) + 50px)) max(8px, env(safe-area-inset-right)) auto auto; width: min(392px, calc(100vw - 16px)); max-height: calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .text-find-replace-content { gap: 7px; padding: 12px; }
  .text-find-match-row > button, .text-find-replace-actions > button { min-height: 44px; }
  .left-panel, .right-panel {
    width: min(360px, 92vw);
    box-shadow: var(--panel-shadow);
    overscroll-behavior: contain;
  }
  .left-panel { border-radius: 0 12px 12px 0; }
  .right-panel { border-radius: 12px 0 0 12px; }
  .mobile-scrim.is-visible { inset: 0; }
  .layers-list, .assets-list, .inspector-content { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .bottom-toolbar {
    bottom: max(10px, env(safe-area-inset-bottom));
    min-height: 54px;
    max-width: calc(100vw - 16px);
    padding: 5px;
  }
  .bottom-toolbar-viewport { scroll-padding-inline: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .image-crop-toolbar { bottom: calc(74px + max(env(safe-area-inset-bottom), 8px)); width: calc(100% - 16px); max-width: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; border-radius: 12px; }
  .image-crop-toolbar[data-crop-mode="true"] { top: calc(8px + env(safe-area-inset-top)); bottom: auto; }
  .image-crop-toolbar-copy { flex: 1 1 auto; }
  .image-crop-toolbar-copy strong { font-size: 12px; }
  .image-crop-toolbar-copy span { max-width: none; font-size: 12px; line-height: 1.4; }
  .image-context-single { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .image-context-export:not([hidden]) { display: block; }
  .image-context-single[data-crop-mode="false"] > button { min-width: 0; padding-inline: 3px; font-size: 10px; white-space: normal; }
  .image-context-single[data-crop-mode="true"][data-crop-undo-available="true"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-context-single[data-crop-mode="true"][data-crop-undo-available="false"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-context-single[data-crop-mode="true"][data-crop-undo-available="true"][data-image-fill-context="false"] #image-crop-toolbar-done { grid-column: 1 / -1; }
  .image-context-single[data-image-fill-context="true"] #image-crop-toolbar-done { grid-column: 1 / -1; }
  .image-crop-ratio-control { box-sizing: border-box; min-width: 0; min-height: 44px; display: grid; align-content: center; gap: 3px; }
  .image-crop-ratio-control select { width: 100%; min-height: 44px; font-size: 12px; }
  .image-context-batch { display: grid; grid-template-columns: minmax(0, 1fr); }
  .image-context-adjustments, .image-context-save-recipe, .image-context-export, .image-context-undo, .image-context-recipe-picker, .image-context-apply-recipe, .image-crop-toolbar-done { box-sizing: border-box; width: 100%; min-width: 0; height: 44px; min-height: 44px; padding-inline: 5px; font-size: 12px; }
  .pen-drawing-bar { bottom: calc(74px + max(env(safe-area-inset-bottom), 8px)); width: calc(100% - 16px); max-width: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; border-radius: 12px; }
  .pen-drawing-copy strong { font-size: 12px; }
  .pen-drawing-copy span { font-size: 12px; line-height: 1.4; }
  .pen-drawing-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pen-drawing-actions button { min-height: 44px; font-size: 12px; }
  .bottom-toolbar .toolbar-more-tools:not([hidden]) {
    flex: 0 0 76px;
    display: grid;
    place-items: center;
    width: 76px;
    min-width: 76px;
    min-height: 44px;
    padding-inline: 5px;
    border-left: 1px solid var(--floating-panel-border);
    border-radius: 0 6px 6px 0;
    background: var(--floating-panel-background);
    color: #566171;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }
  .bottom-toolbar .toolbar-more-tools:not([hidden]):hover { color: var(--accent); }
  .bottom-toolbar .toolbar-more-tools:not([hidden]):focus-visible { outline-offset: -3px; }
  .bottom-toolbar-viewport::-webkit-scrollbar { display: none; }
  .tool-button { min-width: 40px; width: 40px; height: 42px; flex-basis: 40px; scroll-snap-align: start; }
  .zoom-controls { top: 50px; right: 10px; bottom: auto; height: 48px; }
  .zoom-readout { height: 40px; }
  .text-format-toolbar { z-index: 5; }
  .canvas-status { bottom: max(22px, env(safe-area-inset-bottom)); }
  .bulk-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .modal { max-height: calc(100dvh - 24px - env(safe-area-inset-top)); overflow: auto; }
  .component-slot-dialog form { padding: 16px; }
  .component-exposure-dialog form { padding: 16px; }
  .slot-picker-list { max-height: min(48dvh, 400px); }
  .component-exposure-options { max-height: min(48dvh, 400px); }
  .slot-picker-row { min-height: 44px; }
  .component-slot-value { grid-template-columns: minmax(0, 1fr) auto; }
  .component-slot-copy { grid-column: 1 / -1; }
  .component-slot-value .secondary-button { min-height: 42px; }
  .component-slot-reset { width: 42px; height: 42px; }
  .local-font-remove { width: 42px; min-width: 42px; min-height: 42px; }
  .local-font-row { grid-template-columns: 36px minmax(0, 1fr) 42px; min-height: 50px; }
  .component-slot-dialog .dialog-actions > button { min-height: 44px; }
  .component-exposure-dialog .dialog-actions > button { min-height: 44px; }
  .auto-layout-suggestion-actions .primary-button, .auto-layout-suggestion-actions .secondary-button { min-height: 44px; }
}
@media (max-width: 420px) {
  .topbar { padding-inline: max(5px, env(safe-area-inset-left)) max(5px, env(safe-area-inset-right)); }
  .brand-button { min-width: 30px; }
  #sidebar-toggle, #inspector-toggle { width: 50px; min-width: 50px; }
  .bottom-toolbar { gap: 1px; }
  .tool-button { min-width: 40px; width: 40px; flex-basis: 40px; }
  .bulk-bar { width: calc(100vw - 16px); padding: 10px; }
  .canvas-status { max-width: 42vw; }
  .select-field, .layer-search-wrap input, .property-field input, .size-limit-field input,
  .color-value, .fill-opacity, .text-field, .comment-compose textarea,
  .export-suffix input, .layout-guide-field input, .layout-guide-field select, .gradient-geometry-point input,
  .layout-guide-heading select, .gradient-stop-row input[type=number] { font-size: 16px; }
  .text-format-size-label input { font-size: 16px; }
  .design-library-content { padding: 16px; }
  .recipe-recovery-content { padding: 16px; }
  .recipe-recovery-content .dialog-actions { grid-template-columns: 1fr; }
  #recipe-recovery-resume { grid-column: auto; }
  .live-collaboration-content { padding: 16px; }
  .live-collaboration-content button { min-height: 44px; }
  .live-share-step { padding: 12px; }
  .live-join-actions { grid-template-columns: 1fr; }
  .version-history-content { padding: 16px; }
  .version-save-controls { grid-template-columns: 1fr; }
  .version-save-controls .primary-button { width: 100%; min-height: 44px; }
  .version-record { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .version-record .secondary-button { min-height: 44px; }
  .design-file-row { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 10px; }
  .design-file-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .design-file-actions button { min-height: 40px; padding: 0 6px; font-size: 11px; }
  .design-library-content > .dialog-actions { bottom: -16px; margin: 14px -16px -16px; padding-inline: 16px; }
}
@media (max-width: 820px) {
  .image-ai-tools > summary { min-height: 44px; }
  .image-ai-tools > summary > small { font-size: 11px; }
  .image-adjustment-group > summary { min-height: 48px; padding-inline: 10px; }
  .image-adjustment-group > summary > span { font-size: 11px; }
  .image-adjustment-group > summary > small { font-size: 10px; }
  .multi-selection-property-grid .property-field { min-height: 40px; height: 40px; }
  .multi-selection-property-grid .property-field input { min-height: 38px; font-size: 16px; }
  .image-transform-controls .property-field { height: auto; min-height: 44px; }
  .image-transform-controls .property-field input { box-sizing: border-box; height: 44px; min-height: 44px; font-size: 16px; }
  .image-transform-controls .property-inline .add-fill { width: auto; min-width: 0; min-height: 44px; flex: 1 1 0; text-align: center; }
  .image-transform-controls > .add-fill { min-height: 44px; text-align: center; }
  .image-erase-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-erase-actions .image-erase-mode-button { grid-column: 1 / -1; }
  .image-erase-actions .add-fill { min-height: 44px; }
  .image-erase-brush { grid-template-columns: 54px minmax(0, 1fr) 52px; }
  .object-isolation-modes, .object-isolation-actions { gap: 7px; }
  .object-isolation-actions .add-fill, .object-isolation-actions .primary-button,
  .object-isolation-modes .add-fill { min-height: 44px; font-size: 11px; }
  .image-expansion-padding-grid .property-field input { min-height: 44px; font-size: 16px; }
  .image-expansion-controls .primary-button, .image-expansion-controls .secondary-button { min-height: 44px; }
  .variable-mode-add { min-height: 40px; padding-inline: 9px; font-size: 11px; }
  .variable-apply { height: auto; min-height: 40px; }
  .variable-alias, .variable-value { height: 40px; min-height: 40px; font-size: 16px; }
  .variable-value[type="checkbox"] { width: 22px; height: 22px; }
  .variable-remove { width: 40px; height: 40px; flex: 0 0 40px; }
}
@media (max-width: 360px) {
  .layer-row { gap: 2px; padding-left: min(var(--layer-indent), 10px) !important; }
  .layer-depth-marker { width: min(var(--layer-indent), 10px); padding-right: 1px; font-size: 7px; }
  .layer-chevron, .layer-icon { width: 14px; flex-basis: 14px; }
  .layer-row .layer-order-control, .layer-row .layer-visibility, .layer-row .layer-actions-menu {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
}
@media (max-width: 820px) and (pointer: coarse) {
  .multi-selection-property-grid .property-field { height: 44px; min-height: 44px; }
  .multi-selection-property-grid .property-field input { min-height: 42px; font-size: 16px; }
  :where(.bottom-toolbar button, .zoom-controls button, .inspector-tabs button, .inspector-content button, .layer-row button) {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }
  .left-panel, .right-panel, .layers-list, .inspector-content { overscroll-behavior: contain; }
  .layer-row { min-height: 44px; }
  .inspector-content :where(button, input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-width: 44px;
    min-height: 44px;
  }
  .inspector-content .color-swatch {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex-basis: 44px;
  }
  .layer-chevron, .layer-icon { height: 44px; }
  .layer-reorder-handle { width: 44px; min-width: 44px; height: 44px; flex-basis: 44px; touch-action: none; }
  .layer-row .layer-order-control, .layer-row .layer-visibility {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 8px;
  }
  .layer-row .layer-visibility { width: 44px; height: 44px; flex: 0 0 44px; }
  .layer-row .layer-actions-menu { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; }
  .layer-row.is-selected .layer-order-control,
  .layer-row.is-selected .layer-visibility,
  .layer-row:focus-within .layer-visibility { display: grid; place-items: center; }
  .layer-row.is-selected .layer-order-control:not(:disabled), .layer-row.is-selected .layer-visibility {
    background: #fff;
    color: #0876c4;
    box-shadow: inset 0 0 0 1px rgba(13,153,255,.2);
  }
  .layer-row .layer-order-control:active:not(:disabled), .layer-row .layer-visibility:active {
    background: #dcefff;
  }
  .inspector-tabs { flex-basis: 48px; gap: 3px; padding-inline: 6px; }
  .inspector-tab { min-width: 44px; min-height: 44px; padding-inline: 1px; font-size: 9.5px; }
  .motion-section { gap: 12px; padding: 12px 10px; }
  .motion-duration-field input { min-height: 44px; font-size: 16px; }
  .motion-playback-controls { grid-template-columns: 56px minmax(54px, 1fr) auto; gap: 6px; }
  .motion-play-button, .motion-track-create .secondary-button, .motion-add-keyframe { min-height: 44px; }
  .motion-playback-controls input[type="range"] { min-height: 44px; }
  .motion-track-create .select-field { min-height: 44px; font-size: 16px; }
  .motion-lane-help { font-size: 11px; }
  .motion-keyframe-row label input, .motion-keyframe-row label select { height: 44px; min-height: 44px; font-size: 16px; }
  .motion-remove-keyframe { width: 44px; height: 44px; }
  .motion-keyframe-marker { width: 44px; height: 44px; }
  .grid-track-row .select-field, .grid-track-value { min-height: 44px; height: 44px; }
  .grid-track-delete, .grid-track-move-menu-button { box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .grid-track-value input { min-height: 42px; font-size: 16px; }
  .grid-track-minimum > summary { min-height: 44px; }
  .grid-track-minimum-controls .select-field, .grid-track-bound-value { min-height: 44px; height: 44px; }
  .grid-track-bound-value input { min-height: 42px; font-size: 16px; }
  .corner-radius-controls .property-field { height: 44px; min-height: 44px; }
  .corner-radius-controls .property-field input { min-height: 42px; font-size: 16px; }
  .corner-smoothing-field { grid-template-columns: minmax(92px, auto) minmax(80px, 1fr) auto; min-height: 44px; font-size: 12px; }
  .corner-smoothing-field input[type="range"] { min-height: 42px; }
  .property-section :where(button:not(.tiny-icon-button)) { min-height: 44px; }
  .property-section .tiny-icon-button { width: 40px; min-width: 40px; height: 40px; }
  .property-section .add-fill, .property-section .primary-button, .property-section .secondary-button { min-height: 44px; }
  .bottom-toolbar { min-height: 58px; }
  .tool-button { width: 44px; min-width: 44px; height: 44px; flex-basis: 44px; }
  .zoom-controls { height: 52px; }
  .zoom-controls > button { min-width: 44px; min-height: 44px; }
  .zoom-readout { min-width: 44px; height: 44px; }
}

/* Match the editor chrome to the device appearance while keeping the artwork
   itself untouched. The canvas remains a neutral dark work surface in both
   themes so selection colors and transparent pixels stay easy to inspect. */

  :root[data-theme="dark"] {
    color-scheme: dark;
    color: #e6e9ef;
    background: #1b1d22;
    --border: #3b3e47;
    --muted: #a2a8b3;
    --panel: #25272e;
    --surface-subtle: #2b2e35;
    --surface-hover: #343740;
    --ink: #e6e9ef;
    --focus-ring: #8bc7ff;
    --primary-action-border: #8bc7ff;
    --canvas-base: #20232a;
    --topbar-shadow: 0 1px 0 rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.18);
    --floating-panel-background: rgba(39,42,49,.98);
    --floating-panel-border: #454953;
    --toolbar-shadow: 0 12px 32px rgba(0,0,0,.38), 0 2px 7px rgba(0,0,0,.24), 0 0 1px rgba(0,0,0,.6);
    --panel-shadow: 0 16px 40px rgba(0,0,0,.5), 0 3px 10px rgba(0,0,0,.3);
  }

  :root[data-theme="dark"] body,
  :root[data-theme="dark"] .app-shell,
  :root[data-theme="dark"] .workspace { color: var(--ink); background: #1b1d22; }
  :root[data-theme="dark"] .topbar { background: rgba(36,38,45,.98); border-bottom-color: var(--border); box-shadow: var(--topbar-shadow); }
  :root[data-theme="dark"] .brand-mark { background: linear-gradient(145deg, #0d99ff, #7457df); }
  :root[data-theme="dark"] .topbar-button,
  :root[data-theme="dark"] .icon-button,
  :root[data-theme="dark"] .canvas-action-button,
  :root[data-theme="dark"] .tiny-icon-button { color: #c4c9d2; }
  :root[data-theme="dark"] .topbar-button:hover,
  :root[data-theme="dark"] .icon-button:hover,
  :root[data-theme="dark"] .canvas-action-button:hover,
  :root[data-theme="dark"] .tiny-icon-button:hover,
  :root[data-theme="dark"] .page-row:hover,
  :root[data-theme="dark"] .layer-row:hover,
  :root[data-theme="dark"] .tool-button:hover { background: var(--surface-hover); }
  :root[data-theme="dark"] .document-name { color: #f0f2f6; }
  :root[data-theme="dark"] .document-name:hover,
  :root[data-theme="dark"] .document-name:focus { border-color: #4c515d; background: #30333a; }
  :root[data-theme="dark"] .save-state,
  :root[data-theme="dark"] .chevron,
  :root[data-theme="dark"] .section-heading,
  :root[data-theme="dark"] .sidebar-tab,
  :root[data-theme="dark"] .inspector-tab,
  :root[data-theme="dark"] .prototype-placeholder,
  :root[data-theme="dark"] .prototype-hint,
  :root[data-theme="dark"] .prototype-empty-links,
  :root[data-theme="dark"] .empty-sidebar,
  :root[data-theme="dark"] .inspector-empty,
  :root[data-theme="dark"] .inspect-intro > small { color: #a3a9b3; }
  :root[data-theme="dark"] .mode-switcher { border-color: #424650; background: #30333a; }
  :root[data-theme="dark"] .workspace,
  :root[data-theme="dark"] .left-panel,
  :root[data-theme="dark"] .right-panel { background: #25272e; }
  :root[data-theme="dark"] .left-panel { border-right-color: var(--border); }
  :root[data-theme="dark"] .right-panel { border-left-color: var(--border); }
  :root[data-theme="dark"] .sidebar-tabs,
  :root[data-theme="dark"] .inspector-tabs,
  :root[data-theme="dark"] .pages-section,
  :root[data-theme="dark"] .property-section,
  :root[data-theme="dark"] .sidebar-footer,
  :root[data-theme="dark"] .inspector-footer { border-color: var(--border); }
  :root[data-theme="dark"] .sidebar-tab.is-active,
  :root[data-theme="dark"] .inspector-tab.is-active,
  :root[data-theme="dark"] .property-heading,
  :root[data-theme="dark"] .inspect-intro > strong,
  :root[data-theme="dark"] .inspect-empty strong,
  :root[data-theme="dark"] .prototype-current-frame,
  :root[data-theme="dark"] .prototype-help strong,
  :root[data-theme="dark"] .local-library-header,
  :root[data-theme="dark"] .layer-name { color: #e0e4eb; }
  :root[data-theme="dark"] .sidebar-tab.is-active::after,
  :root[data-theme="dark"] .inspector-tab.is-active::after { background: #38a8ff; }
  :root[data-theme="dark"] .page-row,
  :root[data-theme="dark"] .layer-row,
  :root[data-theme="dark"] .multi-align-button,
  :root[data-theme="dark"] .add-fill { color: #c5cad3; }
  :root[data-theme="dark"] .page-row.is-active { color: #eef7ff; background: #263b4d; box-shadow: inset 2px 0 0 #38a8ff; }
  :root[data-theme="dark"] .layer-row.is-selected { color: #a8dcff; background: #23394b; box-shadow: inset 0 0 0 1px rgba(56,168,255,.22); }
  :root[data-theme="dark"] .layer-select-mode,
  :root[data-theme="dark"] .layer-search-wrap input,
  :root[data-theme="dark"] .stroke-field input,
  :root[data-theme="dark"] .stroke-field select,
  :root[data-theme="dark"] .select-field,
  :root[data-theme="dark"] .color-value,
  :root[data-theme="dark"] .fill-opacity,
  :root[data-theme="dark"] .export-suffix input,
  :root[data-theme="dark"] .layout-guide-heading select,
  :root[data-theme="dark"] .layout-guide-field input,
  :root[data-theme="dark"] .layout-guide-field select,
  :root[data-theme="dark"] .gradient-stop-row input[type=number],
  :root[data-theme="dark"] .gradient-stop-row input[type=color],
  :root[data-theme="dark"] .text-field,
  :root[data-theme="dark"] .variable-value,
  :root[data-theme="dark"] .component-property-definition,
  :root[data-theme="dark"] .multi-align-button,
  :root[data-theme="dark"] .export-button,
  :root[data-theme="dark"] .secondary-button,
  :root[data-theme="dark"] .bar-action,
  :root[data-theme="dark"] .text-format-button,
  :root[data-theme="dark"] .text-format-size-label,
  :root[data-theme="dark"] .text-format-line-height-label,
  :root[data-theme="dark"] .text-format-family-label,
  :root[data-theme="dark"] .text-format-weight-label,
  :root[data-theme="dark"] .text-format-spacing-label, .text-format-spacing-unit-label,
  :root[data-theme="dark"] .text-format-baseline-shift-label,
  :root[data-theme="dark"] .text-format-trim-label,
  :root[data-theme="dark"] .text-format-position-label,
  :root[data-theme="dark"] .text-format-decoration-label {
    color: #e0e4eb;
    border-color: #454953;
    background-color: #30333a;
  }
  :root[data-theme="dark"] .stroke-field { color: #a6acb6; }
  :root[data-theme="dark"] .export-setting-actions .tiny-icon-button,
  :root[data-theme="dark"] .layout-guide-select,
  :root[data-theme="dark"] .layout-guide-visibility,
  :root[data-theme="dark"] .layout-guide-remove {
    color: #e0e4eb;
    border-color: #454953;
    background-color: #30333a;
  }
  :root[data-theme="dark"] .layout-guide-select[aria-pressed="true"] {
    color: #98d7ff;
    border-color: #168fe0;
    background-color: #263b4d;
  }
  :root[data-theme="dark"] .layout-guide-card.is-selected { border-color: #168fe0; }
  :root[data-theme="dark"] .layer-search-wrap input,
  :root[data-theme="dark"] .variable-value,
  :root[data-theme="dark"] .text-field,
  :root[data-theme="dark"] .comment-compose textarea,
  :root[data-theme="dark"] .property-field,
  :root[data-theme="dark"] .size-limit-field,
  :root[data-theme="dark"] .multi-selection-card,
  :root[data-theme="dark"] .local-library-card,
  :root[data-theme="dark"] .variable-collection-card,
  :root[data-theme="dark"] .component-property-definition,
  :root[data-theme="dark"] .typography-style-row,
  :root[data-theme="dark"] .layer-effect-card,
  :root[data-theme="dark"] .gradient-geometry-point,
  :root[data-theme="dark"] .export-setting-row,
  :root[data-theme="dark"] .layout-guide-card,
  :root[data-theme="dark"] .inspect-layer-card,
  :root[data-theme="dark"] .inspect-code-card,
  :root[data-theme="dark"] .comment-thread-row,
  :root[data-theme="dark"] .comment-message,
  :root[data-theme="dark"] .design-file-row,
  :root[data-theme="dark"] .slot-picker-list,
  :root[data-theme="dark"] .recipe-preview {
    color: #e0e4eb;
    border-color: #3e424b;
    background-color: #2a2d34;
  }
  :root[data-theme="dark"] .property-field,
  :root[data-theme="dark"] .size-limit-field { background: #30333a; }
  :root[data-theme="dark"] .property-field:focus-within,
  :root[data-theme="dark"] .size-limit-field:focus-within { background: #383c45; }
  :root[data-theme="dark"] .property-field input,
  :root[data-theme="dark"] .size-limit-field input,
  :root[data-theme="dark"] .color-value,
  :root[data-theme="dark"] .fill-opacity,
  :root[data-theme="dark"] .gradient-stop-row input[type=number],
  :root[data-theme="dark"] .gradient-geometry-point input,
  :root[data-theme="dark"] .text-format-size-label input,
  :root[data-theme="dark"] .text-format-line-height-label input,
  :root[data-theme="dark"] .text-format-family-label input,
  :root[data-theme="dark"] .text-format-weight-label select,
  :root[data-theme="dark"] .text-format-spacing-label input, .text-format-spacing-unit-label select,
  :root[data-theme="dark"] .text-format-baseline-shift-label input,
  :root[data-theme="dark"] .text-format-trim-label select,
  :root[data-theme="dark"] .text-format-position-label select,
  :root[data-theme="dark"] .text-format-decoration-label select { color: #edf0f5; }
  :root[data-theme="dark"] .layer-search-wrap input:focus,
  :root[data-theme="dark"] .select-field:focus,
  :root[data-theme="dark"] .color-value:focus,
  :root[data-theme="dark"] .fill-opacity:focus,
  :root[data-theme="dark"] .export-suffix input:focus,
  :root[data-theme="dark"] .gradient-stop-row input:focus,
  :root[data-theme="dark"] .text-field:focus { border-color: #55aff1; }
  :root[data-theme="dark"] .layer-select-mode:hover,
  :root[data-theme="dark"] .page-row:hover,
  :root[data-theme="dark"] .layer-row:hover,
  :root[data-theme="dark"] .component-card:hover,
  :root[data-theme="dark"] .color-style-card:hover,
  :root[data-theme="dark"] .local-library-publish:hover:not(:disabled),
  :root[data-theme="dark"] .local-library-component:hover,
  :root[data-theme="dark"] .add-fill:hover,
  :root[data-theme="dark"] .variable-apply:hover,
  :root[data-theme="dark"] .typography-style-apply:hover,
  :root[data-theme="dark"] .inspect-copy:hover,
  :root[data-theme="dark"] .context-menu button:hover:not(:disabled),
  :root[data-theme="dark"] .slot-picker-row:hover,
  :root[data-theme="dark"] .design-file-actions button:hover,
  :root[data-theme="dark"] .comment-thread-row:hover,
  :root[data-theme="dark"] .export-button:hover,
  :root[data-theme="dark"] .secondary-button:hover,
  :root[data-theme="dark"] .layout-guide-adds button:hover,
  :root[data-theme="dark"] .comment-text-button:hover,
  :root[data-theme="dark"] .bar-action:hover { background-color: #373b44; }
  :root[data-theme="dark"] .empty-layer-icon,
  :root[data-theme="dark"] .variable-type-badge,
  :root[data-theme="dark"] .component-card-icon,
  :root[data-theme="dark"] .typography-style-mark,
  :root[data-theme="dark"] .comment-compose,
  :root[data-theme="dark"] .comments-empty > span,
  :root[data-theme="dark"] .prototype-interaction-icon,
  :root[data-theme="dark"] .prototype-overlay-manual-position,
  :root[data-theme="dark"] .prototype-connect-hint,
  :root[data-theme="dark"] .property-field,
  :root[data-theme="dark"] .size-limit-field,
  :root[data-theme="dark"] .layer-effect-card,
  :root[data-theme="dark"] .export-setting-row,
  :root[data-theme="dark"] .layout-guide-card,
  :root[data-theme="dark"] .component-slot-value,
  :root[data-theme="dark"] .recipe-preview {
    background-color: #30333a;
    border-color: #424650;
  }
  :root[data-theme="dark"] .sidebar-footer,
  :root[data-theme="dark"] .inspector-footer { background: #22242a; }
  :root[data-theme="dark"] .local-library-header small,
  :root[data-theme="dark"] .local-library-component small,
  :root[data-theme="dark"] .inspect-layer-card > header span,
  :root[data-theme="dark"] .inspect-layer-card dt,
  :root[data-theme="dark"] .inspect-text-value > span,
  :root[data-theme="dark"] .inspect-code-card > header span,
  :root[data-theme="dark"] .inspect-code-card > p,
  :root[data-theme="dark"] .prototype-controls label,
  :root[data-theme="dark"] .prototype-overlay-manual-position > span,
  :root[data-theme="dark"] .prototype-help,
  :root[data-theme="dark"] .multi-selection-card span,
  :root[data-theme="dark"] .bulk-info span,
  :root[data-theme="dark"] .bulk-progress-wrap,
  :root[data-theme="dark"] .speed-control,
  :root[data-theme="dark"] .speed-control output,
  :root[data-theme="dark"] .speed-control .speed-help { color: #a6acb6; }
  :root[data-theme="dark"] .inspect-layer-card > header { border-bottom-color: #3b3e47; }
  :root[data-theme="dark"] .inspect-layer-card > header strong,
  :root[data-theme="dark"] .inspect-layer-card dd,
  :root[data-theme="dark"] .inspect-text-value p,
  :root[data-theme="dark"] .inspect-code-card > header strong,
  :root[data-theme="dark"] .inspect-copy,
  :root[data-theme="dark"] .prototype-interaction-copy strong { color: #d6dae2; }
  :root[data-theme="dark"] .inspect-copy,
  :root[data-theme="dark"] .design-file-actions button { border-color: #454953; background: #30333a; }
  :root[data-theme="dark"] .inspect-json-card details { border-top-color: #3b3e47; }
  :root[data-theme="dark"] .inspect-json-card summary { color: #b3b8c2; }
  :root[data-theme="dark"] .inspect-code-card pre { background: #17191e; color: #e2e6ee; }
  :root[data-theme="dark"] .canvas-region { background-color: var(--canvas-base); }
  :root[data-theme="dark"] .canvas-topline { color: #d8dde5; border-bottom-color: rgba(0,0,0,.45); background: rgba(35,38,45,.94); }
  :root[data-theme="dark"] .canvas-breadcrumb,
  :root[data-theme="dark"] .crumb-file { color: #c4cad4; }
  :root[data-theme="dark"] .canvas-action-button.is-active,
  :root[data-theme="dark"] .tool-button.is-selected,
  :root[data-theme="dark"] .text-format-button[aria-pressed="true"] { color: #9dd8ff; border-color: #35617f; background: #263d50; }
  :root[data-theme="dark"] .canvas-drop-overlay { border-color: #38a8ff; background: rgba(26,51,70,.93); color: #a4dcff; }
  :root[data-theme="dark"] .zoom-controls,
  :root[data-theme="dark"] .bottom-toolbar { border-color: #454953; background: rgba(39,42,49,.98); }
  :root[data-theme="dark"] .tool-button { color: #cbd0d9; }
  :root[data-theme="dark"] .canvas-ruler { color: #d4d9e2; background: rgba(45,48,56,.93); }
  :root[data-theme="dark"] .zoom-readout:hover { background: #3a3e47; }
  :root[data-theme="dark"] .context-menu,
  :root[data-theme="dark"] .bulk-bar,
  :root[data-theme="dark"] .text-format-toolbar { color: #e6e9ef; border-color: #444852; background: rgba(39,42,49,.985); }
  :root[data-theme="dark"] .context-menu .menu-separator { background: #444852; }
  :root[data-theme="dark"] .context-menu button:disabled,
  :root[data-theme="dark"] .context-menu .menu-label,
  :root[data-theme="dark"] .context-menu .recipe-option.is-empty { color: #858b96; }
  :root[data-theme="dark"] .bulk-progress-track { background: #454953; }
  :root[data-theme="dark"] .bar-action { background: #30333a; }
  :root[data-theme="dark"] .bar-action.primary,
  :root[data-theme="dark"] .primary-button,
  :root[data-theme="dark"] .comment-mini-pin { color: #fff; background: var(--primary-action-bg); }
  :root[data-theme="dark"] .modal,
  :root[data-theme="dark"] .design-library-content,
  :root[data-theme="dark"] .component-slot-dialog form,
  :root[data-theme="dark"] .component-exposure-dialog form { color: #e6e9ef; border-color: #444852; background: #272a31; }
  :root[data-theme="dark"] .live-collaboration-note,
  :root[data-theme="dark"] .live-status,
  :root[data-theme="dark"] .live-stun-option { color: #b4bac4; }
  :root[data-theme="dark"] .live-share-step { border-color: #454953; background: #30333a; }
  :root[data-theme="dark"] .live-step-label { color: #e6e9ef; }
  :root[data-theme="dark"] .recipe-recovery-card { border-color: #454953; background: #30333a; }
  :root[data-theme="dark"] .recipe-recovery-card strong { color: #e6e9ef; }
  :root[data-theme="dark"] .recipe-recovery-card span { color: #b4bac4; }
  :root[data-theme="dark"] .modal-copy,
  :root[data-theme="dark"] .field-label,
  :root[data-theme="dark"] .field-help,
  :root[data-theme="dark"] .slot-picker-count { color: #b4bac4; }
  :root[data-theme="dark"] .local-font-row { border-color: #41454e; background: #30333a; }
  :root[data-theme="dark"] .local-font-sample { background: #3b3545; color: #e3d8f2; }
  :root[data-theme="dark"] .local-font-copy strong { color: #dfe2e8; }
  :root[data-theme="dark"] .local-font-copy small,
  :root[data-theme="dark"] .local-fonts-empty { color: #a6acb6; }
  :root[data-theme="dark"] .slot-picker-list { border-color: #41454e; background: #22242a; }
  :root[data-theme="dark"] .slot-picker-row { color: #dde1e8; border-bottom-color: #393c44; }
  :root[data-theme="dark"] .design-file-actions button,
  :root[data-theme="dark"] .secondary-button,
  :root[data-theme="dark"] .comment-text-button { color: #e0e4eb; }
  :root[data-theme="dark"] .design-library-content > .dialog-actions { border-top-color: #41454e; background: rgba(39,42,49,.98); }
  :root[data-theme="dark"] .recipe-preview { color: #d5c5ff; border-color: #564574; }
  :root[data-theme="dark"] .text-editor-overlay { border-color: #55afff; background: rgba(34,36,42,.96); color: #f1f3f7; }
  :root[data-theme="dark"] .text-format-toolbar { color: #e3e6ed; }
  :root[data-theme="dark"] .mobile-scrim.is-visible { background: rgba(0,0,0,.52); }
  :root[data-theme="dark"] .layer-row.is-selected .layer-order-control:not(:disabled),
  :root[data-theme="dark"] .layer-row.is-selected .layer-visibility { color: #9dd8ff; background: #303b47; }
  :root[data-theme="dark"] * { scrollbar-color: #555a66 #272a31; }
  :root[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #555a66; }
  :root[data-theme="dark"] *::-webkit-scrollbar-thumb:hover { background-color: #707785; }

/* Phone workspace hierarchy: make navigation and canvas controls easy to reach. */
@media (max-width: 820px) {
  .zoom-controls, .bottom-toolbar {
    border-color: var(--floating-panel-border);
    background: var(--floating-panel-background);
  }
  .topbar {
    border-bottom-color: var(--border);
    box-shadow: var(--topbar-shadow);
  }
  .topbar #share-button {
    display: flex;
    min-width: 48px;
    min-height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding-inline: 6px;
  }
  .document-title-wrap { min-width: 0; padding-inline: 3px; }
  .document-name { max-width: min(42vw, 180px); }
  .sidebar-tab, .inspector-tab, .property-heading, .field-label { font-size: 12px; }

  .left-panel, .right-panel {
    border-color: var(--border);
    background: var(--panel);
  }
  .left-panel { border-radius: 0 14px 14px 0; }
  .right-panel { border-radius: 14px 0 0 14px; }
  /* Keep image and effect sliders easy to scrub in narrow mobile layouts,
     including browser previews that do not report a coarse pointer. */
  .inspector-content input[type="range"] {
    box-sizing: border-box;
    min-height: 44px;
    padding-block: 8px;
  }
  .sidebar-tabs {
    height: auto;
    flex: 0 0 52px;
    gap: 8px;
    padding-inline: 12px;
  }
  .sidebar-tab {
    min-width: 44px;
    min-height: 48px;
    flex: 1 1 0;
  }
  .pages-section { padding: 8px 10px 10px; }
  .pages-section .section-heading {
    height: auto;
    min-height: 44px;
    padding-inline: 4px;
  }
  .pages-list { gap: 4px; margin-top: 4px; }
  .page-row { min-height: 44px; gap: 4px; }
  .page-row-select { min-height: 44px; gap: 9px; }
  .page-row-menu { flex-basis: 40px; }
  .page-row-menu > summary { width: 40px; height: 40px; }
  .page-actions-menu { top: 39px; }
  .page-actions-menu button { min-height: 44px; font-size: 12px; }
  .prototype-flow-actions .secondary-button { min-height: 44px; }
  .page-row {
    height: auto;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 12px;
  }
  .page-row-icon { width: 20px; }
  .section-heading > .tiny-icon-button,
  .sidebar-footer .tiny-icon-button {
    width: 40px;
    height: 40px;
  }
  .empty-sidebar { gap: 9px; padding: 32px 20px; }
  .empty-layer-icon { width: 42px; height: 42px; font-size: 22px; }
  .empty-sidebar strong { font-size: 12px; }
  .empty-sidebar span { font-size: 11px; }
  .sidebar-footer {
    height: auto;
    min-height: 52px;
    flex: 0 0 auto;
    padding: 4px 10px max(4px, env(safe-area-inset-bottom));
    font-size: 11px;
  }
  .inspector-footer {
    height: auto;
    min-height: 56px;
    flex: 0 0 auto;
    padding: 7px 12px max(7px, env(safe-area-inset-bottom));
  }
  .export-button { min-height: 42px; }

  .canvas-topline { height: 44px; padding-inline: 10px; }
  .canvas-breadcrumb { min-width: 0; gap: 6px; font-size: 12px; }
  .crumb-file { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .canvas-top-actions { flex: 0 0 auto; gap: 1px; }
  .canvas-scroll { inset: 44px 0 0; }
  .empty-canvas-guide { padding: 12px; }
  .empty-canvas-card { gap: 9px; padding: 16px; border-radius: 12px; }
  .empty-canvas-card h2 { font-size: 17px; }
  .empty-canvas-card p { font-size: 12px; }
  .empty-canvas-crop-help ol { font-size: 12px; }
  .empty-canvas-actions > button { min-width: min(100%, 132px); min-height: 44px; }
  .prototype-connect-prompt { bottom: max(76px, calc(env(safe-area-inset-bottom) + 72px)); }
  .canvas-status {
    top: 108px;
    bottom: auto;
    left: 10px;
    right: 10px;
    z-index: 2;
    max-width: none;
    min-height: 32px;
    gap: 7px;
    padding: 6px 9px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 999px;
    background: rgba(31, 36, 45, .8);
    box-shadow: 0 3px 12px rgba(0,0,0,.14);
    color: #f2f5f9;
    font-size: 11px;
    text-shadow: none;
    backdrop-filter: blur(10px);
  }
  #selection-status { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
  .canvas-status .status-divider, .canvas-status #position-status { display: none; }
  .zoom-controls {
    top: 52px;
    right: 10px;
    bottom: auto;
    gap: 1px;
    border-color: rgba(221,225,231,.92);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(12,20,30,.14);
  }
  .bottom-toolbar {
    bottom: max(8px, env(safe-area-inset-bottom));
    border-color: rgba(216,222,230,.95);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(12,20,30,.2), 0 2px 6px rgba(12,20,30,.1);
  }
  .tool-button.is-selected { border-radius: 10px; }

  .bulk-bar {
    bottom: calc(76px + env(safe-area-inset-bottom));
    border-radius: 14px;
  }
  .bulk-actions .bar-action { min-width: 64px; min-height: 44px; }
  .speed-control { min-height: 44px; }
  .speed-control input { min-height: 32px; }

  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea) {
    font-size: 16px;
  }
  :where(button, input, select, textarea) { scroll-margin-block: 12px; }
}

@media (max-width: 420px) {
  .canvas-topline { padding-inline: 7px; }
  .canvas-breadcrumb { gap: 4px; }
  .crumb-file { max-width: 24vw; }
  .canvas-top-actions .canvas-action-button { width: 40px; min-width: 40px; }
  .canvas-status { max-width: calc(100% - 142px); }
  /* Keep storage visible while giving the editable document name room. */
  .storage-mode-chip {
    width: 36px;
    max-width: 36px;
    height: 24px;
    flex: 0 0 36px;
    justify-content: center;
    padding: 0;
    font-size: 0;
    font-weight: 700;
  }
  .storage-mode-chip::before { font-size: 8px; }
  .storage-mode-chip:not([data-mode])::before,
  .storage-mode-chip[data-mode="browser"]::before { content: "WEB"; }
  .storage-mode-chip[data-mode="folder"]::before { content: "DIR"; }
  .storage-mode-chip[data-mode="reconnect"]::before { content: "FIX"; }
  .document-title-wrap { flex: 1 1 0; }
  .document-name { flex: 1 1 0; width: 0; min-width: 28px; max-width: none; padding-inline: 2px; font-size: 11px; }
  .save-state { gap: 2px; min-width: 32px; font-size: 8px; }
}
@media (max-width: 360px) {
  .storage-mode-chip { display: none; }
  .document-title-wrap { gap: 1px; }
  .document-name { min-width: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
@media (max-width: 360px) and (pointer: coarse) {
  .layer-row .layer-visibility { display: none !important; }
  .layer-row .layer-order-control, .layer-row .layer-visibility, .layer-row .layer-actions-menu {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
}

@media (max-width: 820px) {
  :root[data-theme="dark"] .topbar { border-bottom-color: var(--border); }
  :root[data-theme="dark"] .left-panel,
  :root[data-theme="dark"] .right-panel { border-color: var(--border); background: var(--panel); }
  :root[data-theme="dark"] .zoom-controls,
  :root[data-theme="dark"] .bottom-toolbar { border-color: var(--floating-panel-border); background: var(--floating-panel-background); }
  :root[data-theme="dark"] .bottom-toolbar .toolbar-more-tools:not([hidden]) {
    background: var(--floating-panel-background);
    color: #cbd0d9;
    border-left-color: var(--floating-panel-border);
  }
  :root[data-theme="dark"] .layer-row.is-selected .layer-order-control:not(:disabled),
  :root[data-theme="dark"] .layer-row.is-selected .layer-visibility { color: #9dd8ff; background: #303b47; }
}

@media (max-width: 820px) and (pointer: coarse) {
  .mobile-panel-toggle, .present-button { min-width: 44px; min-height: 44px; }
  /* Touch devices cannot rely on hover tooltips. Keep every canvas tool named
     on landscape phones and small tablets as well as narrow portrait phones. */
  .bottom-toolbar .tool-button { width: 60px; min-width: 60px; height: 48px; flex-basis: 60px; flex-direction: column; gap: 2px; justify-content: center; }
  .bottom-toolbar .tool-button::after { content: attr(data-tool-label); display: block; max-width: 100%; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-toolbar .tool-button.is-selected::after { color: var(--accent); font-weight: 600; }
  .bottom-toolbar .tool-button kbd { display: none; }
  .present-button { width: 44px; }
  .presentation-toolbar { height: 60px; gap: 5px; padding: 6px; }
  .presentation-control { width: 44px; min-width: 44px; height: 44px; min-height: 44px; flex-basis: 44px; }
  .presentation-title { min-width: 36px; flex-basis: 60px; }
  .presentation-flow-picker { flex: 0 1 auto; gap: 0; font-size: 9px; }
  .presentation-flow-picker > span { display: none; }
  .presentation-flow-picker select { width: clamp(88px, 30vw, 128px); max-width: 128px; height: 44px; padding-left: 7px; padding-right: 18px; font-size: 16px; }
  #share-button { min-height: 44px; }
  .canvas-top-actions .canvas-action-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .page-row-menu { flex-basis: 44px; }
  .page-row-menu > summary { width: 44px; height: 44px; }
  .grid-track-delete, .grid-track-move-menu-button { box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .layers-heading .tiny-icon-button,
  .section-heading > .tiny-icon-button,
  .sidebar-footer .tiny-icon-button { width: 44px; min-width: 44px; height: 44px; }
  .layer-select-mode { min-height: 44px; }

  .component-slot-value .secondary-button,
  .export-button,
  .local-font-remove,
  .variable-mode-add,
  .variable-apply,
  .typography-style-actions button,
  .blend-mode-select,
  .prototype-interaction-row .tiny-icon-button,
  .comment-new-button,
  .comment-text-button,
  .comment-compose-actions .primary-button,
  .comment-compose-actions .secondary-button,
  .comment-thread-actions .secondary-button,
  .comment-delete-button,
  .inspect-copy,
  .export-setting-actions .secondary-button,
  .export-setting-actions .tiny-icon-button,
  .layout-guide-adds button,
  .layout-guide-style-actions .add-fill,
  .design-file-actions button { min-height: 44px; }
  .grid-track-row .select-field, .grid-track-value { min-height: 44px; height: 44px; }
  .grid-track-value input { min-height: 42px; font-size: 16px; }
  .grid-track-minimum > summary { min-height: 44px; }
  .grid-track-minimum-controls .select-field, .grid-track-bound-value { min-height: 44px; height: 44px; }
  .grid-track-bound-value input { min-height: 42px; font-size: 16px; }
  .component-slot-reset,
  .local-font-remove,
  .variable-remove,
  .layout-guide-select,
  .layout-guide-visibility,
  .layout-guide-remove { width: 44px; min-width: 44px; height: 44px; }
  .variable-remove { flex-basis: 44px; }
  .variable-scopes-editor summary { min-height: 44px; }
  .variable-scope-group label { min-height: 44px; font-size: 10px; }
  .variable-scope-group input { width: 20px; height: 20px; flex-basis: 20px; }
  .stroke-field input, .stroke-field select,
  .fill-type-row .select-field,
  .image-fill-source .select-field,
  .export-setting-row .select-field, .export-suffix input,
  .layout-guide-heading select, .layout-guide-field input, .layout-guide-field select {
    min-height: 44px;
    height: 44px;
  }
  .gradient-stop-row input[type="color"], .gradient-stop-row input[type="number"] { min-height: 44px; height: 44px; }
  .effect-color-row input[type="color"], .layout-guide-appearance input[type="color"] { min-width: 44px; width: 44px; min-height: 44px; height: 44px; }
  .speed-control input { min-height: 44px; }
  .bulk-actions .bar-action { min-height: 44px; }

  /* Checkbox labels are the touch target. Keep the native checkmark compact,
     while giving the whole setting row a reliable 44px hit area. */
  .component-property-value { min-height: 44px; }
  .prototype-controls label:has(input[type="checkbox"]) { min-height: 44px; }
  .field-caption:has(input[type="checkbox"]),
  .field-caption[for="auto-layout-auto-positioning"],
  .field-caption[for="auto-layout-wrap"] {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .field-caption:has(input[type="checkbox"]) input[type="checkbox"],
  #auto-layout-auto-positioning, #auto-layout-wrap {
    width: 24px;
    height: 24px;
    justify-self: end;
    align-self: center;
  }

  /* The inspector is dense on desktop; on touch screens give the controls
     people adjust most often a full finger target without changing desktop. */
  .inspector-content .property-field { height: 44px; min-height: 44px; }
  .inspector-content .property-field input { box-sizing: border-box; min-height: 44px; height: 44px; font-size: 16px; }
  .inspector-content :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea) {
    box-sizing: border-box;
    min-height: 44px;
    font-size: 16px;
  }
  .inspector-content input[type="range"] {
    box-sizing: border-box;
    min-height: 44px;
    padding-block: 8px;
  }
  .inspector-content input[type="color"] {
    box-sizing: border-box;
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
  }
  .inspector-content .fill-row { height: 44px; min-height: 44px; gap: 8px; }
  .inspector-content .fill-row .color-swatch { box-sizing: border-box; width: 44px; height: 44px; flex: 0 0 44px; }
  .inspector-content .fill-row .color-swatch input { inset: 0; width: 100%; height: 100%; }
  .inspector-content .color-value, .inspector-content .fill-opacity { box-sizing: border-box; height: 44px; min-height: 44px; font-size: 16px; }
  .inspector-content .image-fill-source { min-height: 44px; }
  .inspector-content .gradient-stop-row { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(52px, .7fr)) 44px; }
  .inspector-content .gradient-stop-row input[type="color"],
  .inspector-content .gradient-stop-row input[type="number"] { min-height: 44px; height: 44px; font-size: 16px; }
  .inspector-content .gradient-geometry-fields { gap: 4px; }
  .inspector-content .gradient-geometry-point { gap: 5px; padding: 6px; }
  .inspector-content .gradient-geometry-point input { min-height: 44px; height: 44px; font-size: 16px; }
  .inspector-content .gradient-stop-track { height: 44px; }
  .inspector-content .gradient-stop-handle {
    left: clamp(21px, var(--gradient-stop-position), calc(100% - 21px));
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
  }
  .inspector-content .gradient-stop-handle:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; }
  .inspector-content .gradient-stop-row .tiny-icon-button,
  .inspector-content .property-section .tiny-icon-button { box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .inspector-content .layer-effect-heading { min-height: 44px; }
  .inspector-content .layer-effect-heading label { min-width: 44px; min-height: 44px; }
  .inspector-content .effect-clip { min-height: 44px; }

  .prototype-flow-controls .select-field { min-height: 44px; }
  .prototype-current-frame > span {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .prototype-current-frame .secondary-button {
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding-inline: 6px;
    font-size: 10px;
    white-space: normal;
  }
  .prototype-controls #prototype-overlay-color { min-height: 44px; height: 44px; }
  .prototype-overlay-manual-position input { min-height: 44px; }
}

/* Landscape phones have very little canvas height. Keep the live recipe
   controls to two rows so the image remains visible while a batch runs. */
@media (max-width: 820px) and (max-height: 520px) {
  .bulk-bar {
    bottom: calc(66px + env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 1fr) minmax(130px, 1fr);
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 6px 8px;
  }
  .bulk-info { grid-column: 1; grid-row: 1; gap: 7px; }
  .bulk-info strong { font-size: 10px; }
  .bulk-info span { margin-top: 2px; font-size: 9px; }
  .bulk-spinner { width: 18px; height: 18px; flex: 0 0 18px; }
  .bulk-progress-wrap { grid-column: 2; grid-row: 1; min-width: 0; gap: 5px; font-size: 9px; }
  .bulk-actions { grid-column: 1; grid-row: 2; min-width: 0; max-width: 100%; gap: 3px; overflow-x: auto; overscroll-behavior-x: contain; }
  .bulk-actions .bar-action { min-width: 44px; min-height: 44px; padding-inline: 5px; white-space: nowrap; }
  .speed-control {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(32px, .9fr) minmax(24px, 1fr) 54px;
    gap: 3px;
    min-height: 44px;
    font-size: 9px;
  }
  .speed-control > span { white-space: normal; line-height: 1.1; }
  .speed-control input { min-width: 28px; min-height: 44px; }
  .speed-control output { font-size: 9px; }
}

/* Keep labels and helper text readable on surfaces that have their own colors
   rather than inheriting the editor's foreground. */

  :root[data-theme="dark"] .page-row.is-active .page-row-icon { color: #68bdff; }
  :root[data-theme="dark"] .layer-chevron,
  :root[data-theme="dark"] .layer-icon,
  :root[data-theme="dark"] .local-library-header small,
  :root[data-theme="dark"] .local-library-component small,
  :root[data-theme="dark"] .local-library-empty,
  :root[data-theme="dark"] .variable-collection-header,
  :root[data-theme="dark"] .variable-name,
  :root[data-theme="dark"] .variable-mode-name,
  :root[data-theme="dark"] .variable-scopes-editor summary,
  :root[data-theme="dark"] .variable-scope-group label,
  :root[data-theme="dark"] .variable-scopes-editor summary span,
  :root[data-theme="dark"] .variable-scope-group > span,
  :root[data-theme="dark"] .variables-empty,
  :root[data-theme="dark"] .components-empty,
  :root[data-theme="dark"] .component-card-name,
  :root[data-theme="dark"] .component-link-copy span,
  :root[data-theme="dark"] .component-property-heading,
  :root[data-theme="dark"] .component-property-heading span,
  :root[data-theme="dark"] .component-property-definition small,
  :root[data-theme="dark"] .component-property-value,
  :root[data-theme="dark"] .component-nested-exposure > strong,
  :root[data-theme="dark"] .component-nested-exposure > small,
  :root[data-theme="dark"] .component-property-nested-group > strong,
  :root[data-theme="dark"] .component-property-nested-group > small,
  :root[data-theme="dark"] .component-slot-copy strong,
  :root[data-theme="dark"] .component-slot-copy small,
  :root[data-theme="dark"] .component-exposure-option em,
  :root[data-theme="dark"] .component-exposure-option small,
  :root[data-theme="dark"] .component-exposure-status,
  :root[data-theme="dark"] .variant-control,
  :root[data-theme="dark"] .color-style-name,
  :root[data-theme="dark"] .color-styles-empty,
  :root[data-theme="dark"] .typography-styles-hint,
  :root[data-theme="dark"] .typography-styles-empty,
  :root[data-theme="dark"] .typography-style-name,
  :root[data-theme="dark"] .typography-style-copy small,
  :root[data-theme="dark"] .typography-style-actions button,
  :root[data-theme="dark"] .asset-card-name,
  :root[data-theme="dark"] .asset-hint,
  :root[data-theme="dark"] .crumb-separator,
  :root[data-theme="dark"] .crumb-chevron,
  :root[data-theme="dark"] .tool-button kbd,
  :root[data-theme="dark"] .comments-panel-header span,
  :root[data-theme="dark"] .comment-compose > label,
  :root[data-theme="dark"] .comment-compose-actions > span,
  :root[data-theme="dark"] .comment-row-copy small,
  :root[data-theme="dark"] .comment-row-arrow,
  :root[data-theme="dark"] .comment-list-limit,
  :root[data-theme="dark"] .comments-empty,
  :root[data-theme="dark"] .comments-empty strong,
  :root[data-theme="dark"] .comment-message time,
  :root[data-theme="dark"] .comment-message p,
  :root[data-theme="dark"] .fill-type-row,
  :root[data-theme="dark"] .image-fill-source,
  :root[data-theme="dark"] .gradient-stop-row label,
  :root[data-theme="dark"] .gradient-geometry-point > label,
  :root[data-theme="dark"] .property-field label,
  :root[data-theme="dark"] .size-limit-field span,
  :root[data-theme="dark"] .property-separator,
  :root[data-theme="dark"] .lock-ratio,
  :root[data-theme="dark"] .field-caption,
  :root[data-theme="dark"] .variable-binding-row,
  :root[data-theme="dark"] .frame-variable-mode,
  :root[data-theme="dark"] .network-face-heading,
  :root[data-theme="dark"] .network-face-heading output,
  :root[data-theme="dark"] .slider-row label,
  :root[data-theme="dark"] .image-output-field,
  :root[data-theme="dark"] .slider-row output,
  :root[data-theme="dark"] .image-properties-note,
  :root[data-theme="dark"] .layer-effect-heading,
  :root[data-theme="dark"] .layer-effect-heading label,
  :root[data-theme="dark"] .effect-clip,
  :root[data-theme="dark"] .effect-color-row label,
  :root[data-theme="dark"] .export-setting-row label,
  :root[data-theme="dark"] .export-quality output,
  :root[data-theme="dark"] .export-setting-actions > span,
  :root[data-theme="dark"] .layout-guide-field,
  :root[data-theme="dark"] .layout-guide-appearance label,
  :root[data-theme="dark"] .layout-guide-opacity output,
  :root[data-theme="dark"] .layout-guide-adds button,
  :root[data-theme="dark"] .prototype-section-label,
  :root[data-theme="dark"] .prototype-interaction-copy small,
  :root[data-theme="dark"] .prototype-overlay-manual-position small,
  :root[data-theme="dark"] .prototype-controls label,
  :root[data-theme="dark"] .prototype-help,
  :root[data-theme="dark"] .context-menu button .shortcut,
  :root[data-theme="dark"] .context-menu .menu-label,
  :root[data-theme="dark"] .bulk-info span,
  :root[data-theme="dark"] .bulk-progress-wrap,
  :root[data-theme="dark"] .speed-control,
  :root[data-theme="dark"] .speed-control output,
  :root[data-theme="dark"] .speed-control .speed-help,
  :root[data-theme="dark"] .slot-picker-count,
  :root[data-theme="dark"] .slot-picker-row small,
  :root[data-theme="dark"] .slot-picker-empty,
  :root[data-theme="dark"] .design-library-empty,
  :root[data-theme="dark"] .design-file-date,
  :root[data-theme="dark"] .modal-eyebrow,
  :root[data-theme="dark"] .modal-copy,
  :root[data-theme="dark"] .field-label,
  :root[data-theme="dark"] .empty-sidebar strong,
  :root[data-theme="dark"] .inspector-empty strong,
  :root[data-theme="dark"] .variable-type-badge,
  :root[data-theme="dark"] .text-format-size-label,
  :root[data-theme="dark"] .text-format-line-height-label,
  :root[data-theme="dark"] .text-format-color-label,
  :root[data-theme="dark"] .text-format-family-label,
  :root[data-theme="dark"] .text-format-weight-label,
  :root[data-theme="dark"] .text-format-spacing-label, .text-format-spacing-unit-label,
  :root[data-theme="dark"] .text-format-baseline-shift-label,
  :root[data-theme="dark"] .text-format-trim-label,
  :root[data-theme="dark"] .text-format-position-label,
  :root[data-theme="dark"] .text-format-decoration-label {
    color: #a6acb6;
  }
:root[data-theme="dark"] .bulk-info .bulk-rate { color: #d6dae2; }
:root[data-theme="dark"] .image-erase-mode-button[aria-pressed="true"] { border-color: #9f4b55; background: #48272c; color: #ffb1b8; }
:root[data-theme="dark"] .image-erase-hint { border-color: #70434a; background: #382328; color: #f0b2b9; }
:root[data-theme="dark"] .object-isolation-mode-choice[aria-pressed="true"] { border-color: #39775f; background: #203a31; color: #9fe1c3; }
:root[data-theme="dark"] .object-isolation-mode-choice[data-mode="2"][aria-pressed="true"] { border-color: #82414a; background: #40252a; color: #ffb1b8; }
:root[data-theme="dark"] .object-isolation-mode-choice[data-mode="3"][aria-pressed="true"] { border-color: #684d87; background: #332942; color: #d6b5ff; }
:root[data-theme="dark"] .object-isolation-draw-button[aria-pressed="true"] { border-color: #3b6488; background: #24394c; color: #b7dfff; }
:root[data-theme="dark"] .object-isolation-hint { border-color: #3e5b72; background: #202e3a; color: #bad8ed; }
  :root[data-theme="dark"] .component-card-icon,
  :root[data-theme="dark"] .typography-style-mark,
  :root[data-theme="dark"] .inspect-intro > span,
  :root[data-theme="dark"] .prototype-interaction-icon,
  :root[data-theme="dark"] .prototype-connect-hint {
    color: #c2a7ff;
  }
  :root[data-theme="dark"] .local-library-card,
  :root[data-theme="dark"] .variable-collection-card,
  :root[data-theme="dark"] .variable-row,
  :root[data-theme="dark"] .variable-scopes-editor,
  :root[data-theme="dark"] .component-card,
  :root[data-theme="dark"] .component-set-card,
  :root[data-theme="dark"] .component-set-variant,
  :root[data-theme="dark"] .color-style-card,
  :root[data-theme="dark"] .component-property-editor-wrap,
  :root[data-theme="dark"] .component-property-definition,
  :root[data-theme="dark"] .component-exposure-option,
  :root[data-theme="dark"] .component-exposure-options,
  :root[data-theme="dark"] .component-slot-value,
  :root[data-theme="dark"] .typography-style-row,
  :root[data-theme="dark"] .inspect-layer-card,
  :root[data-theme="dark"] .inspect-code-card,
  :root[data-theme="dark"] .comment-thread-row,
  :root[data-theme="dark"] .comment-message {
    border-color: #3e424b;
  }
  :root[data-theme="dark"] .component-nested-exposure,
  :root[data-theme="dark"] .component-property-nested-group { border-color: #3e424b; }
  :root[data-theme="dark"] .component-exposure-options { background: #24262c; }
  :root[data-theme="dark"] .component-exposure-option:hover { background: #302a3a; }
  :root[data-theme="dark"] .component-exposure-status.is-error { color: #ffb1b8; }
  :root[data-theme="dark"] .comment-thread-row,
  :root[data-theme="dark"] .comment-message { background-color: #2a2d34; }
  :root[data-theme="dark"] .component-set-card,
  :root[data-theme="dark"] .component-set-variant { background-color: #24262c; }
  :root[data-theme="dark"] .component-set-heading input,
  :root[data-theme="dark"] .component-set-axis-name input,
  :root[data-theme="dark"] .component-set-add-axis input,
  :root[data-theme="dark"] .component-set-variant-values input,
  :root[data-theme="dark"] .component-set-placement .select-field { border-color: #41444d; background: #24262c; color: var(--text); }
  :root[data-theme="dark"] .component-set-place-selected,
  :root[data-theme="dark"] .component-set-place-variant,
  :root[data-theme="dark"] .component-set-add-axis > button,
  :root[data-theme="dark"] .component-set-remove-axis { border-color: #4c435e; background: #302a3a; color: #d7c8f5; }
  :root[data-theme="dark"] .component-set-editor,
  :root[data-theme="dark"] .component-set-add-axis { border-color: #3e424b; }
  :root[data-theme="dark"] .comment-new-button,
  :root[data-theme="dark"] .comment-anchor-hint,
  :root[data-theme="dark"] .comment-compose-actions .secondary-button,
  :root[data-theme="dark"] .comment-delete-button {
    color: #d6dae2;
    border-color: #454953;
    background-color: #30333a;
  }
  :root[data-theme="dark"] .comment-row-copy strong,
  :root[data-theme="dark"] .inspect-intro > strong,
  :root[data-theme="dark"] .inspect-empty strong,
  :root[data-theme="dark"] .inspect-layer-card > header strong,
  :root[data-theme="dark"] .inspect-layer-card dd,
  :root[data-theme="dark"] .inspect-text-value p,
  :root[data-theme="dark"] .inspect-code-card > header strong,
  :root[data-theme="dark"] .inspect-copy,
  :root[data-theme="dark"] .inspect-json-card summary,
  :root[data-theme="dark"] .prototype-current-frame,
  :root[data-theme="dark"] .prototype-interaction-copy strong,
  :root[data-theme="dark"] .prototype-help strong,
  :root[data-theme="dark"] .component-link-copy strong,
  :root[data-theme="dark"] .color-style-name,
  :root[data-theme="dark"] .typography-style-name,
  :root[data-theme="dark"] .asset-card-name,
  :root[data-theme="dark"] .design-file-name,
  :root[data-theme="dark"] .design-file-actions button[data-action="delete"],
  :root[data-theme="dark"] .slot-picker-name,
  :root[data-theme="dark"] .comment-message p {
    color: #e0e4eb;
  }
  :root[data-theme="dark"] .zoom-readout,
  :root[data-theme="dark"] .text-field::placeholder,
  :root[data-theme="dark"] .layer-search-wrap input::placeholder,
  :root[data-theme="dark"] .comment-compose textarea::placeholder,
  :root[data-theme="dark"] .size-limit-field input::placeholder { color: #a6acb6; }
  :root[data-theme="dark"] .toolbar-separator,
  :root[data-theme="dark"] .zoom-divider { border-left-color: #454953; }
  :root[data-theme="dark"] .asset-thumb { border-color: #424650; background-color: #30333a; }
  :root[data-theme="dark"] .context-menu .recipe-option::before { color: #c2a7ff; }
  :root[data-theme="dark"] .typography-style-actions button:hover { color: #e0e4eb; }
  :root[data-theme="dark"] .comment-thread-row.is-resolved .comment-mini-pin { background: #59636f; }
  :root[data-theme="dark"] .bar-action.primary,
  :root[data-theme="dark"] .primary-button,
  :root[data-theme="dark"] .comment-mini-pin,
  :root[data-theme="dark"] .design-file-actions button[data-action="open"] {
    border-color: var(--primary-action-border);
    background: var(--primary-action-bg);
  }
  :root[data-theme="dark"] .bar-action.primary:hover,
  :root[data-theme="dark"] .primary-button:hover,
  :root[data-theme="dark"] .design-file-actions button[data-action="open"]:hover { background: var(--primary-action-hover); }
  :root[data-theme="dark"] .layer-select-mode.is-active {
    color: #a8dcff;
    border-color: #35617f;
    background: #263d50;
  }
  :root[data-theme="dark"] .layout-guide-visibility[aria-pressed="true"],
  :root[data-theme="dark"] .comment-delete-button,
  :root[data-theme="dark"] .delete-layer-button { color: #ff9b91; }
  :root[data-theme="dark"] .delete-layer-button { border-color: #704541; }
  :root[data-theme="dark"] .delete-layer-button:hover { border-color: #a55f57; background: #382321; }
  :root[data-theme="dark"] .device-icon,
  :root[data-theme="dark"] .image-engine-status { color: #50d49c; }
  :root[data-theme="dark"] .variable-type-badge,
  :root[data-theme="dark"] .empty-layer-icon,
  :root[data-theme="dark"] .comments-empty > span,
  :root[data-theme="dark"] .typography-style-mark,
  :root[data-theme="dark"] .prototype-interaction-icon,
  :root[data-theme="dark"] .prototype-connect-hint,
  :root[data-theme="dark"] .comment-compose,
  :root[data-theme="dark"] .comment-anchor-hint {
    border-color: #424650;
    background-color: #30333a;
  }
  :root[data-theme="dark"] .component-card:hover,
  :root[data-theme="dark"] .color-style-card:hover,
  :root[data-theme="dark"] .local-library-publish:hover:not(:disabled),
  :root[data-theme="dark"] .local-library-component:hover,
  :root[data-theme="dark"] .typography-style-apply:hover,
  :root[data-theme="dark"] .typography-style-actions button:hover,
  :root[data-theme="dark"] .comment-thread-row:hover,
  :root[data-theme="dark"] .comment-text-button:hover,
  :root[data-theme="dark"] .export-button:hover,
  :root[data-theme="dark"] .secondary-button:hover,
  :root[data-theme="dark"] .context-menu button:hover:not(:disabled),
  :root[data-theme="dark"] .slot-picker-row:hover {
    background-color: #373b44;
  }
:root[data-theme="dark"] .presentation-dialog { color: #e6e9ef; }

/* Reusable original image sources stay searchable without creating a large
   scrolling grid of editor-layer duplicates. The list itself is paginated in
   image-library-view.js; this scroll limit also keeps the panel compact. */
.image-library-view {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  color: var(--ink, #30343a);
}
.image-library-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.image-library-heading-copy { min-width: 0; display: grid; gap: 2px; }
.image-library-heading-copy strong { color: inherit; font-size: 11px; font-weight: 650; }
.image-library-heading-copy small { color: var(--muted, #777); font-size: 9px; }
.image-library-add,
.image-library-actions button,
.image-library-pagination button {
  min-width: 44px;
  min-height: 36px;
  border: 1px solid var(--border, #dedfe3);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.image-library-add { flex: 0 0 auto; padding: 0 9px; color: #0969b8; font-size: 10px; font-weight: 600; }
.image-library-search-label { margin-bottom: -5px; color: var(--muted, #70757d); font-size: 9px; }
.image-library-search {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border, #dedfe3);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: inherit;
  font: inherit;
  font-size: 11px;
}
.image-library-status { min-height: 1.4em; margin: -2px 0 0; color: var(--muted, #70757d); font-size: 9px; line-height: 1.4; }
.image-library-list { display: grid; gap: 6px; max-height: min(42dvh, 390px); min-height: 0; margin: 0; padding: 0 2px 2px 0; overflow: auto; list-style: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.image-library-item { min-width: 0; }
.image-library-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border, #e2e3e7);
  border-radius: 8px;
  background: var(--panel, #fff);
}
.image-library-thumb { position: relative; width: 42px; height: 40px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border, #e4e5e8); border-radius: 5px; background: var(--surface-subtle, #f2f3f5); color: var(--muted, #858a92); }
.image-library-thumb-fallback { font-size: 20px; line-height: 1; }
.image-library-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface-subtle, #f2f3f5); }
.image-library-thumb:not(.has-image) img { display: none; }
.image-library-copy { min-width: 0; display: grid; gap: 4px; }
.image-library-name { overflow: hidden; color: inherit; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.image-library-copy small { overflow: hidden; color: var(--muted, #777); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.image-library-actions { min-width: 0; display: flex; align-items: center; gap: 4px; }
.image-library-actions button { width: 30px; min-width: 30px; min-height: 30px; flex: 0 0 30px; display: grid; place-items: center; padding: 0; font-size: 15px; font-weight: 600; line-height: 1; }
.image-library-actions .image-library-place { border-color: var(--primary-action-border, #1683cf); background: var(--primary-action-bg, #1683cf); color: #fff; }
.image-library-actions .image-library-remove { color: #a33f3b; }
.image-library-actions .image-library-remove:hover:not(:disabled) { border-color: #e7c4c2; background: #fff7f6; }
.image-library-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.image-library-pagination button { padding: 0 10px; font-size: 10px; }
.image-library-pagination button:disabled { opacity: .48; cursor: default; }
.image-library-pagination span { color: var(--muted, #777); font-size: 9px; text-align: center; }
.image-library-empty { min-width: 0; display: flex; align-items: center; gap: 9px; margin: 0; padding: 9px; border: 1px solid var(--border, #e2e4e8); border-radius: 8px; background: var(--surface-subtle, #f7f8fa); color: var(--muted, #777); font-size: 10px; line-height: 1.4; }
.image-library-empty-icon { flex: 0 0 30px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #eaf4fc; color: #427ca7; font-size: 17px; }
.image-library-empty-copy { min-width: 0; display: grid; gap: 2px; }
.image-library-empty-copy strong { color: var(--ink, #30343a); font-size: 10px; font-weight: 600; }
.image-library-empty-copy small { color: var(--muted, #777); font-size: 9px; line-height: 1.4; }
.image-library-view :where(button, input):focus-visible { outline: 2px solid var(--focus-ring, #1683cf); outline-offset: 2px; }
.image-library-view button:hover:not(:disabled) { filter: brightness(.97); }
.image-library-view button:disabled { cursor: default; }

:root[data-theme="dark"] .image-library-view { color: #e0e4eb; }
:root[data-theme="dark"] .image-library-heading-copy small,
:root[data-theme="dark"] .image-library-search-label,
:root[data-theme="dark"] .image-library-status,
:root[data-theme="dark"] .image-library-copy small,
:root[data-theme="dark"] .image-library-pagination span { color: #a6acb6; }
:root[data-theme="dark"] .image-library-add,
:root[data-theme="dark"] .image-library-search,
:root[data-theme="dark"] .image-library-actions button,
:root[data-theme="dark"] .image-library-pagination button { border-color: #454953; background: #30333a; color: #e0e4eb; }
:root[data-theme="dark"] .image-library-add { color: #9dd8ff; }
:root[data-theme="dark"] .image-library-card,
:root[data-theme="dark"] .image-library-empty { border-color: #3e424b; background: #2a2d34; }
:root[data-theme="dark"] .image-library-empty-copy strong { color: #e0e4eb; }
:root[data-theme="dark"] .image-library-empty-icon { background: #283b4b; color: #9dd8ff; }
:root[data-theme="dark"] .image-library-thumb,
:root[data-theme="dark"] .image-library-thumb img { border-color: #424650; background: #30333a; }
:root[data-theme="dark"] .image-library-actions .image-library-place { border-color: #4c435e; background: #625180; color: #fff; }
:root[data-theme="dark"] .image-library-actions .image-library-remove { color: #ffaaa0; }
:root[data-theme="dark"] .image-library-actions .image-library-remove:hover:not(:disabled) { border-color: #765250; background: #3c2c2d; }

@media (max-width: 820px) {
  .image-library-view { gap: 10px; padding: 8px; }
  .image-library-add,
  .image-library-actions button,
  .image-library-pagination button { min-height: 44px; font-size: 12px; }
  .image-library-search { min-height: 44px; font-size: 16px; }
  .image-library-list { max-height: min(42dvh, 390px); }
  .image-library-card { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; padding: 8px; }
  .image-library-thumb { width: 56px; height: 52px; }
  .image-library-actions button { width: 44px; min-width: 44px; min-height: 44px; flex-basis: 44px; }
}

@media (max-width: 380px) {
  .image-library-card { grid-template-columns: 44px minmax(0, 1fr); }
  .image-library-thumb { width: 44px; height: 42px; }
  .image-library-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* The Assets panel groups related tools so image work stays visible while
   less frequent design-system controls can be opened when needed. */
.assets-section {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 8px 10px 18px;
}
.assets-group {
  min-width: 0;
  flex: 0 0 auto;
  margin: 0 0 7px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e4e8);
  border-radius: 8px;
  background: var(--panel, #fff);
}
.assets-group > summary {
  box-sizing: border-box;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 11px;
  color: var(--ink, #30343a);
  font-size: 12px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.assets-group > summary::-webkit-details-marker { display: none; }
.assets-group > summary::after { content: '⌄'; flex: 0 0 auto; color: var(--muted, #737984); font-size: 13px; }
.assets-group:not([open]) > summary::after { content: '›'; }
.assets-group[open] > summary { border-bottom: 1px solid var(--border, #e2e4e8); }
.assets-group > summary:hover { background: var(--surface-hover, #f1f3f5); }
.assets-group > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.assets-group-content {
  min-width: 0;
  padding: 8px 8px 10px;
}
.assets-group-content > .section-heading {
  box-sizing: border-box;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--ink, #30343a);
  font-size: 12px;
  font-weight: 650;
}
.assets-group-content > .section-heading:not(:first-child) {
  min-height: 36px;
  margin-top: 10px;
  padding-top: 7px;
  border-top: 1px solid var(--border, #e2e4e8);
}
.assets-group-action { width: 100%; min-height: 34px; margin-bottom: 5px; }
.local-font-add-row { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; color: var(--muted, #737984); font-size: 10px; }
.assets-section .heading-actions { align-items: center; gap: 5px; }
.assets-section .tiny-icon-button { width: 32px; height: 32px; }
.assets-section .asset-section-action {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border, #dedfe3);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: var(--ink, #30343a);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.assets-section .asset-section-action:hover { background: var(--surface-hover, #f1f3f5); }
.assets-section .asset-place-button {
  border-color: var(--primary-action-border, #1683cf);
  background: var(--primary-action-bg, #1683cf);
  color: #fff;
  white-space: nowrap;
}
.assets-section .asset-place-button:hover { filter: brightness(.96); }
.assets-section .assets-list,
.assets-section .components-list,
.assets-section .component-library-list,
.assets-section .variable-collections-list,
.assets-section .color-styles-list,
.assets-section .text-styles-list,
.assets-section .font-assets-list {
  box-sizing: border-box;
  min-height: 0;
  max-height: none;
  flex: 0 0 auto;
  overflow: visible;
  padding: 6px 2px 2px;
}
.assets-section .assets-list { gap: 10px; }
.assets-section .assets-list > .section-heading { min-height: 28px; padding-inline: 4px; color: var(--muted, #737984); font-size: 10px; font-weight: 650; }
.assets-section .placed-image-assets { gap: 8px; }
.assets-section .placed-image-assets-empty {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px;
  padding: 7px 8px;
  border: 1px solid var(--border, #e2e4e8);
  border-radius: 8px;
  background: var(--surface-subtle, #f7f8fa);
  color: var(--muted, #737984);
  font-size: 10.5px;
  line-height: 1.4;
}
.assets-section .placed-image-assets-empty > span:first-child {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border, #e2e4e8);
  border-radius: 7px;
  background: var(--panel, #fff);
  color: #427ca7;
  font-size: 13px;
}
.assets-section .image-library-root { min-height: 0; flex: 0 0 auto; }
.assets-section .component-library-list { padding-top: 4px; }
.assets-section .variable-collections-list,
.assets-section .color-styles-list,
.assets-section .text-styles-list,
.assets-section .font-assets-list { gap: 7px; }
.assets-section .color-styles-list { grid-template-columns: minmax(0, 1fr); }
.assets-section .local-library-empty,
.assets-section .variables-empty,
.assets-section .components-empty,
.assets-section .color-styles-empty,
.assets-section .typography-styles-empty,
.assets-section .local-fonts-empty {
  box-sizing: border-box;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted, #737984);
  font-size: 11px;
  line-height: 1.45;
}
.assets-section .asset-empty-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border, #e2e4e8);
  border-radius: 7px;
  background: var(--surface-subtle, #f5f6f8);
  color: #427ca7;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.assets-section .asset-empty-copy { min-width: 0; color: var(--muted, #737984); }
.assets-section .components-empty,
.assets-section .color-styles-empty { grid-column: 1 / -1; }
.assets-section .typography-styles-hint { color: var(--muted, #737984); font-size: 10px; }
.assets-section .color-style-card,
.assets-section .local-library-card,
.assets-section .variable-collection-card,
.assets-section .typography-style-row { border-color: var(--border, #e3e5e9); background: var(--panel, #fff); }
.assets-section .token-interop-note,
.assets-section .local-fonts-note { margin: 2px 4px 0; color: var(--muted, #737984); font-size: 10px; }
.assets-section .image-library-list { max-height: none; overflow: visible; }

:root[data-theme="dark"] .assets-section .asset-section-action {
  border-color: var(--border, #454953);
  background: var(--surface-subtle, #2b2e35);
  color: var(--ink, #e6e9ef);
}
:root[data-theme="dark"] .assets-section .asset-section-action:hover { background: var(--surface-hover, #343740); }
:root[data-theme="dark"] .assets-section .asset-place-button {
  border-color: var(--primary-action-border, #8bc7ff);
  background: var(--primary-action-bg, #675587);
  color: #fff;
}
:root[data-theme="dark"] .assets-section .local-library-empty,
:root[data-theme="dark"] .assets-section .variables-empty,
:root[data-theme="dark"] .assets-section .components-empty,
:root[data-theme="dark"] .assets-section .color-styles-empty,
:root[data-theme="dark"] .assets-section .typography-styles-empty,
:root[data-theme="dark"] .assets-section .local-fonts-empty {
  color: var(--muted, #a2a8b3);
}
:root[data-theme="dark"] .assets-section .placed-image-assets-empty > span:first-child,
:root[data-theme="dark"] .assets-section .asset-empty-icon {
  border-color: var(--border, #41454e);
  background: var(--panel, #252830);
  color: #a9d9ff;
}

@media (max-width: 820px) {
  .assets-section {
    padding: 8px 10px max(18px, env(safe-area-inset-bottom));
    scrollbar-gutter: auto;
  }
  .assets-section > * { box-sizing: border-box; min-width: 0; max-width: 100%; }
  .assets-group { margin-bottom: 8px; }
  .assets-group > summary { min-height: 48px; padding-inline: 12px; font-size: 13px; }
  .assets-group-content { padding: 8px 6px 10px; }
  .assets-group-content > .section-heading { min-height: 44px; font-size: 12px; }
  .assets-group-content > .section-heading:not(:first-child) { min-height: 44px; margin-top: 10px; }
  .assets-section .assets-list > .section-heading { min-height: 36px; font-size: 11px; }
  .assets-group-action { min-height: 44px; }
  .local-font-add-row { min-height: 44px; }
  .assets-section .tiny-icon-button { width: 44px; min-width: 44px; height: 44px; }
  .assets-section .asset-section-action { min-height: 44px; padding-inline: 10px; font-size: 11px; }
  .assets-section .image-library-list { max-height: none; }
  .assets-section .component-card { min-height: 48px; }
}

.fig-import-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(84dvh, 760px);
  padding: 0;
  overflow: auto;
}
.fig-import-dialog::backdrop { background: rgb(12 15 20 / 48%); backdrop-filter: blur(3px); }
.fig-import-content { display: grid; gap: 16px; padding: clamp(18px, 4vw, 28px); }
.fig-import-content h2 { margin: 2px 0 0; font-size: clamp(20px, 5vw, 26px); }
.fig-import-private-note { padding: 10px 12px; border-radius: 10px; color: var(--muted); background: var(--surface-muted, #f4f4f6); font-size: 13px; }
.fig-import-warning-block { display: grid; gap: 8px; padding: 14px; border: 1px solid #ead8ad; border-radius: 12px; background: #fffaf0; color: #493814; }
.fig-import-warning-block p { margin: 0; font-size: 13px; line-height: 1.45; }
.fig-import-warning-block ul { display: grid; gap: 8px; max-height: 220px; overflow: auto; margin: 0; padding: 0 0 0 20px; font-size: 13px; line-height: 1.4; }
.fig-import-warning-block li strong { display: block; overflow-wrap: anywhere; }
.fig-import-warning-block li span { display: block; color: #6a5734; }
.fig-import-clean { margin: 0; padding: 12px; border-radius: 10px; color: #145c3b; background: #edf8f1; font-size: 13px; }
.fig-import-content .dialog-actions { position: sticky; bottom: 0; margin: 0; padding-top: 8px; background: var(--surface, #fff); }
:root[data-theme="dark"] .fig-import-private-note { background: #30333a; }
:root[data-theme="dark"] .fig-import-warning-block { border-color: #69552f; background: #352d1e; color: #f1dbab; }
:root[data-theme="dark"] .fig-import-warning-block li span { color: #c0aa7d; }
:root[data-theme="dark"] .paint-blend-warning { border-color: #69552f; background: #352d1e; color: #f1dbab; }
:root[data-theme="dark"] .fig-import-clean { background: #1d382e; color: #a5e5c6; }
@media (max-width: 560px) {
  .fig-import-dialog { max-height: 90dvh; }
  .fig-import-content { gap: 13px; }
  .fig-import-content .dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; }
  .fig-import-content .dialog-actions button { min-height: 44px; }
}

/* Keep the edited artwork visible above the phone properties sheet. */
@media (max-width: 820px) {
  .right-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(50dvh, 500px);
    max-height: calc(100% - 64px);
    border-radius: 16px 16px 0 0;
    transform: translateY(105%);
  }
  .right-panel.is-open { transform: translateY(0); }
  .app-shell.mobile-inspector-open > .mobile-scrim.is-visible {
    top: calc(45px + env(safe-area-inset-top));
    right: 0;
    bottom: min(50dvh, 500px);
    left: 0;
    background: rgba(20, 24, 32, .08);
    backdrop-filter: none;
  }
  .app-shell.mobile-comment-canvas-interactive > .mobile-scrim.is-visible { display: none; }
}

/* Landscape phones need the inspector's full height while preserving a useful
   canvas strip. Keep the portrait bottom sheet for taller mobile viewports. */
@media (max-width: 820px) and (max-height: 560px) {
  .right-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(400px, max(280px, 54vw));
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: 14px 0 0 14px;
    transform: translateX(105%);
  }
  .right-panel.is-open { transform: translateX(0); }
  .app-shell.mobile-inspector-open > .mobile-scrim.is-visible {
    top: calc(45px + env(safe-area-inset-top));
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(20, 24, 32, .24);
    backdrop-filter: blur(1px);
  }
  :root[data-theme="dark"] .app-shell.mobile-inspector-open > .mobile-scrim.is-visible {
    background: rgba(0, 0, 0, .42);
  }
}

/* Keep saved-comment review beside the canvas instead of over its hit area.
   Component selection stays accessible while either comment review drawer is open. */
@media (max-width: 820px) {
  .app-shell.mobile-comment-canvas-open > .workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) min(38dvh, 340px);
  }
  .app-shell.mobile-comment-canvas-open > .workspace > .canvas-region {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
  }
  .app-shell.mobile-comment-canvas-open > .workspace > .left-panel.is-open,
  .app-shell.mobile-comment-canvas-open > .workspace > .right-panel.is-open {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    inset: auto;
    grid-column: 1;
    grid-row: 2;
    width: auto;
    height: auto;
    max-height: none;
    transform: none;
    border-radius: 14px 14px 0 0;
    visibility: visible;
    transition: none;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
  }
}
@media (max-width: 820px) and (max-height: 560px) {
  .app-shell.mobile-comment-canvas-open > .workspace {
    grid-template-columns: minmax(0, 1fr) min(400px, max(280px, 42vw));
    grid-template-rows: minmax(0, 1fr);
  }
  .app-shell.mobile-comment-canvas-open > .workspace > .canvas-region {
    grid-column: 1;
    grid-row: 1;
  }
  .app-shell.mobile-comment-canvas-open > .workspace > .left-panel.is-open,
  .app-shell.mobile-comment-canvas-open > .workspace > .right-panel.is-open {
    grid-column: 2;
    grid-row: 1;
    border-radius: 14px 0 0 14px;
  }
}

/* The landscape inspector is a narrow side drawer; keep all five tab names
   on one line while preserving their full touch targets. */
@media (max-width: 820px) {
  .inspector-tabs {
    display: flex;
    justify-content: space-between;
    gap: 2px;
  }
  .inspector-tab {
    width: auto;
    min-width: 44px;
    flex: 0 1 auto;
    padding-inline: 3px;
    font-size: 11px;
  }
}

@media (max-width: 820px) and (max-height: 560px) {
  .inspector-tab {
    padding-inline: 1px;
    font-size: 9.5px;
    white-space: nowrap;
  }
}

/* Respect cutouts and home indicators for floating controls, and keep the
   primary phone actions finger-sized even when a hybrid browser reports a
   fine pointer. */
@media (max-width: 820px) {
  .bottom-toolbar,
  .bulk-bar {
    left: calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2);
  }
  .bottom-toolbar {
    max-width: calc(100vw - max(8px, env(safe-area-inset-left) + 8px) - max(8px, env(safe-area-inset-right) + 8px));
  }
  .bulk-bar {
    width: calc(100vw - max(8px, env(safe-area-inset-left) + 8px) - max(8px, env(safe-area-inset-right) + 8px));
    bottom: calc(76px + max(env(safe-area-inset-bottom), 8px));
  }
  .zoom-controls { right: max(10px, env(safe-area-inset-right)); }
  .canvas-status { left: max(10px, env(safe-area-inset-left)); }
  .canvas-top-actions { padding-right: max(0px, env(safe-area-inset-right) - 8px); }
  .modal {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
    scroll-padding-block: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-bottom));
  }
  .page-pdf-dialog .select-field,
  .page-pdf-dialog .text-field,
  .page-pdf-dialog .dialog-actions > button { min-height: 44px; }
  .page-pdf-dialog .select-field,
  .page-pdf-dialog .text-field { font-size: 16px; }
  .mobile-panel-toggle,
  .present-button,
  .topbar #share-button,
  .canvas-top-actions .canvas-action-button {
    min-width: 44px;
    min-height: 44px;
  }
  .topbar #main-menu-button {
    box-sizing: border-box;
    display: inline-grid;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    grid-template-rows: 21px 10px;
    align-content: center;
    justify-items: center;
    gap: 0;
    padding: 1px;
  }
  .topbar #main-menu-button .brand-mark {
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 12px;
  }
  .topbar #main-menu-button::after {
    content: 'Menu';
    color: var(--muted);
    font-size: 7px;
    line-height: 10px;
  }
  .present-button,
  .topbar #share-button,
  .canvas-top-actions .canvas-action-button { box-sizing: border-box; }
  .mobile-panel-toggle,
  .present-button,
  .canvas-top-actions .canvas-action-button { flex-shrink: 0; }
  .page-row-menu { flex-basis: 44px; }
  .page-row-menu > summary { width: 44px; min-width: 44px; height: 44px; }
  .bottom-toolbar .tool-button { width: 60px; min-width: 60px; height: 48px; flex-basis: 60px; flex-direction: column; gap: 2px; justify-content: center; }
  .bottom-toolbar .tool-button::after { content: attr(data-tool-label); display: block; max-width: 100%; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-toolbar .tool-button.is-selected::after { color: var(--accent); font-weight: 600; }
  .bottom-toolbar .tool-button kbd { display: none; }
  /* Shape Builder has its own temporary action bar. Lift the canvas tools
     above it on phones so both bars clear the home-indicator area. */
  #shape-builder-bar { bottom: max(8px, env(safe-area-inset-bottom)); }
  #canvas-region:has(#shape-builder-bar:not([hidden])) > .bottom-toolbar {
    bottom: calc(116px + max(env(safe-area-inset-bottom), 8px));
  }
}
@media (max-width: 820px) and (max-height: 520px) {
  .bulk-bar { bottom: calc(66px + max(env(safe-area-inset-bottom), 8px)); }
}

/* Wide phones in landscape can exceed the width-based phone breakpoint while
   still needing named, paged touch controls for the overflowing tool strip. */
@media (min-width: 821px) and (max-height: 560px) and (pointer: coarse) {
  .bottom-toolbar {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-width: calc(100vw - max(8px, env(safe-area-inset-left) + 8px) - max(8px, env(safe-area-inset-right) + 8px));
  }
  .bottom-toolbar-viewport { scroll-padding-inline: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .bottom-toolbar .toolbar-more-tools:not([hidden]) {
    box-sizing: border-box;
    flex: 0 0 76px;
    display: grid;
    place-items: center;
    width: 76px;
    min-width: 76px;
    min-height: 44px;
    padding-inline: 5px;
    border-left: 1px solid var(--floating-panel-border);
    border-radius: 0 6px 6px 0;
    background: var(--floating-panel-background);
    color: #566171;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }
  .bottom-toolbar .tool-button { width: 60px; min-width: 60px; height: 48px; flex-basis: 60px; flex-direction: column; gap: 2px; justify-content: center; }
  .bottom-toolbar .tool-button::after { content: attr(data-tool-label); display: block; max-width: 100%; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-toolbar .tool-button.is-selected::after { color: var(--accent); font-weight: 600; }
  .bottom-toolbar .tool-button kbd { display: none; }
}

/* Scale-tool inspector: a compact, keyboard-accessible nine-point origin grid. */
.scale-anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 2px;
  justify-content: center;
  margin: 2px auto 12px;
  padding: 4px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-subtle, #f8fafc);
}
.scale-anchor-point {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
}
.scale-anchor-point::before {
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--surface, #fff);
  content: '';
}
.scale-anchor-point:hover,
.scale-anchor-point:focus-visible { background: var(--surface-hover, #eaf4ff); outline: none; }
.scale-anchor-point.is-selected { color: var(--accent, #0d99ff); }
.scale-anchor-point.is-selected::before { background: currentColor; box-shadow: inset 0 0 0 1px #fff; }
.scale-anchor-point:disabled { opacity: .45; cursor: default; }
