:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef2f8;
  --line: #dfe3ea;
  --line-strong: #c7cdd8;
  --text: #171920;
  --muted: #69717f;
  --primary: #111318;
  --primary-hover: #292d37;
  --primary-contrast: #ffffff;
  --blue: #2563eb;
  --danger: #c6283e;
  --success: #15835d;
  --shadow: 0 18px 45px rgba(22, 28, 45, .13);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
  color: #fff;
  background: #0b0d12;
  border-bottom: 1px solid #252936;
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand > span:last-child { min-width: 0; display: grid; }
.brand strong { font-size: 15px; line-height: 1.15; white-space: nowrap; }
.brand small { margin-top: 4px; color: #9299a8; font-size: 11px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.brand-mark i { display: block; width: 2px; background: #111; }
.brand-mark i:nth-child(1) { height: 17px; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 20px; }
.brand-mark i:nth-child(4) { height: 15px; }
.brand-mark i:nth-child(5) { height: 21px; }
.top-actions, .toolbar-actions { display: flex; align-items: center; gap: 8px; }

.button {
  min-height: 37px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 760;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button.primary { color: var(--primary-contrast); background: var(--primary); border-color: var(--primary); }
.button.primary:hover { background: var(--primary-hover); }
.button.subtle { color: var(--text); background: var(--surface); border-color: var(--line); }
.button.subtle:hover { background: #fafbfc; border-color: var(--line-strong); }
.topbar .button.subtle { color: #eef1f7; background: #171a22; border-color: #303544; }
.topbar .button.subtle:hover { background: #222631; }
.button.wide { width: 100%; }
.file-action { display: grid; place-items: center; cursor: pointer; }

.app-shell {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 370px minmax(440px, 1fr) 300px;
  min-width: 0;
}
.sidebar, .workspace { min-width: 0; }
.sidebar { overflow: auto; background: var(--surface); }
.left-panel { border-right: 1px solid var(--line); }
.right-panel { padding: 18px; border-left: 1px solid var(--line); }

.tabs {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 9px 8px 0;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
}
.tab {
  min-width: 0;
  padding: 11px 2px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 10px;
  font-weight: 800;
}
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.panel { display: none; padding: 17px; }
.panel.active { display: block; }
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.panel-heading h2 { margin: 0; font-size: 16px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.count, #selectedLayerBadge, .mini-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #4b5362;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.card {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.card + .card, .section-card + .section-card { margin-top: 12px; }
.card h3, .property-section h3 { margin: 0 0 10px; font-size: 12px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.section-card { background: #fafbfc; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: #525967; font-size: 10px; font-weight: 760; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 12px;
  font-weight: 520;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
input[type="range"] { padding: 0; border: 0; accent-color: #151820; box-shadow: none; }
input[type="color"] { height: 39px; padding: 4px; cursor: pointer; }
output { justify-self: end; margin-top: -25px; padding-right: 2px; color: var(--text); font-size: 9px; font-weight: 800; pointer-events: none; }
.helper { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.switch-row:first-of-type { margin-top: 12px; }
.switch-row > div { min-width: 0; display: grid; gap: 3px; }
.switch-row strong { font-size: 11px; }
.switch-row span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.switch { display: inline-block; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  position: relative;
  width: 45px;
  height: 25px;
  display: block;
  border-radius: 999px;
  background: #d8dde6;
  border: 1px solid #bcc3cf;
  transition: .18s ease;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  transition: .18s ease;
}
.switch input:checked + span { background: #111318; border-color: #111318; }
.switch input:checked + span::after { transform: translateX(20px); }
.asset-row { margin-top: 9px; }
.asset-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 11px;
  color: var(--muted);
  font-size: 9px;
}
.file-link { cursor: pointer; }

.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.print-actions { margin-top: 16px; }
.field-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.field-chips label { display: block; }
.field-chips input { position: absolute; opacity: 0; pointer-events: none; }
.field-chips span {
  display: block;
  padding: 8px 11px;
  color: #555d6b;
  background: #f1f3f7;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
  cursor: pointer;
}
.field-chips input:checked + span { color: #fff; background: #111318; border-color: #111318; }
.print-grid-details { padding-top: 2px; }

.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.template-card {
  min-width: 0;
  padding: 8px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.template-card:hover { transform: translateY(-1px); border-color: #aeb5c2; box-shadow: 0 8px 18px rgba(24,30,45,.08); }
.template-card.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.14); }
.template-thumb { height: 73px; display: grid; place-items: center; margin-bottom: 8px; padding: 5px; overflow: hidden; background: #eef0f4; border-radius: 8px; }
.template-thumb svg { display: block; max-width: 100%; max-height: 100%; filter: drop-shadow(0 2px 3px rgba(0,0,0,.10)); }
.template-card strong, .template-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-card strong { font-size: 11px; }
.template-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.compact .button { margin-top: 12px; }
.file-drop {
  min-height: 84px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #343a46;
  background: #fff;
  border: 1px dashed #b7beca;
  border-radius: 10px;
  cursor: pointer;
}
.file-drop span { color: var(--muted); font-size: 9px; font-weight: 500; }
.file-drop.dragover { border-color: var(--blue); background: #f3f7ff; }
.records-header { display: flex; justify-content: space-between; margin: 17px 0 8px; font-size: 11px; }
.link-button { padding: 0; color: var(--blue); background: transparent; border: 0; font-size: 10px; font-weight: 760; }
.records-list { display: grid; gap: 7px; }
.record-item { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 9px; text-align: left; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.record-item.active { border-color: var(--blue); background: #f6f9ff; }
.record-index { width: 22px; height: 22px; display: grid; place-items: center; background: #eef0f4; border-radius: 6px; font-size: 9px; font-weight: 800; }
.record-main { min-width: 0; display: grid; }
.record-main strong, .record-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-main strong { font-size: 10px; }
.record-main small, .record-item > small { color: var(--muted); font-size: 8px; }
.empty { padding: 22px 10px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 10px; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 11px; color: var(--text); }
.check-row input { width: auto; }

.workspace { display: grid; grid-template-rows: 55px minmax(0,1fr) 48px; background: #e7eaf0; overflow: hidden; }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.segmented { display: inline-grid; grid-template-columns: 32px 56px 32px; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.segmented button { height: 32px; color: var(--text); background: transparent; border: 0; font-size: 16px; }
.segmented span { text-align: center; color: var(--muted); font-size: 10px; font-weight: 760; }
.workspace-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(24,160,110,.12); }
.canvas-area {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 54px 52px 70px;
  background-color: #e8ebf1;
  background-image: radial-gradient(#c8ccd5 1px, transparent 1px);
  background-size: 18px 18px;
}
.canvas-hint { position: absolute; top: 13px; left: 50%; transform: translateX(-50%); padding: 6px 10px; color: #68707e; background: rgba(255,255,255,.82); border: 1px solid rgba(201,206,216,.8); border-radius: 999px; font-size: 9px; white-space: nowrap; pointer-events: none; }
.label-stage { transform-origin: center center; transition: transform .16s ease; }
.preview-mount { display: grid; place-items: center; filter: drop-shadow(0 18px 26px rgba(18,24,38,.20)); user-select: none; touch-action: none; }
.preview-mount svg { display: block; width: min(720px, 58vw); max-height: 62vh; background: #fff; overflow: visible; }
.preview-mount g[data-element] { cursor: grab; }
.preview-mount g[data-element]:active { cursor: grabbing; }
.preview-mount g.editor-selected { filter: drop-shadow(0 0 3px #2563eb) drop-shadow(0 0 1px #2563eb); opacity: .93; }
.preview-mount g.editor-hidden { opacity: .16; }
.bottom-strip { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 8px 15px; background: #fff; border-top: 1px solid var(--line); }
.bottom-strip > div:first-child { display: grid; }
.bottom-strip strong { font-size: 11px; }
.bottom-strip span { color: var(--muted); font-size: 9px; }
.validation { color: var(--success); font-size: 9px; font-weight: 700; text-align: right; }
.validation.invalid { color: var(--danger); }

.right-panel .panel-heading { margin-bottom: 5px; }
.property-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.property-section:last-of-type { border-bottom: 0; }
.properties { display: grid; gap: 12px; }
.selected-section > label { margin-bottom: 11px; }
#selectedTextRow { margin-top: 8px; }
.hidden { display: none !important; }
.two-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.export-card { margin-top: 14px; }
.button-stack { display: grid; gap: 8px; }

.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dialog-head h2 { margin: 0; font-size: 17px; }
.dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.icon-button { width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; font-size: 20px; }
dialog { width: min(570px, calc(100vw - 30px)); max-height: 82vh; padding: 18px; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(13,16,23,.55); backdrop-filter: blur(3px); }
.saved-list { display: grid; gap: 9px; margin-top: 16px; overflow: auto; }
.saved-item { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.saved-item > div:first-child { min-width: 0; display: grid; }
.saved-item strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.saved-item > div:last-child { display: flex; gap: 6px; }
.saved-item button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 9px; font-weight: 760; }
.sheet-dialog { width: min(1100px, calc(100vw - 24px)); max-height: 92vh; }
.sheet-preview-wrap { margin: 15px 0; overflow: auto; padding: 18px; background: #e8ebf1; border: 1px solid var(--line); border-radius: 12px; }
.sheet-preview { width: 210mm; min-height: 297mm; margin: 0 auto; padding: 10mm; display: grid; align-content: start; justify-content: start; background: #fff; box-shadow: var(--shadow); transform-origin: top center; }
.sheet-preview .sheet-label { overflow: hidden; }
.sheet-preview .sheet-label svg { display: block; width: 100%; height: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 100; transform: translate(-50%,18px); padding: 10px 14px; color: #fff; background: #101218; border: 1px solid #2c303b; border-radius: 9px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 11px; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%,0); }



/* Application theme switcher. Label artwork remains independent so print colours are never altered. */
html { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1015;
  --surface: #171a21;
  --surface-2: #1d212a;
  --surface-3: #252a35;
  --line: #303644;
  --line-strong: #454d5e;
  --text: #f2f4f8;
  --muted: #a3aab7;
  --primary: #f1f3f7;
  --primary-hover: #dce1e9;
  --primary-contrast: #111318;
  --blue: #72a7ff;
  --danger: #ff7488;
  --success: #4fd1a0;
  --shadow: 0 18px 48px rgba(0, 0, 0, .42);
}

body, .sidebar, .workspace, .workspace-toolbar, .bottom-strip, .tabs,
.card, .section-card, input, select, textarea, .template-card, .file-drop,
.record-item, .segmented, dialog, .icon-button, .saved-item button,
.sheet-preview-wrap, .canvas-hint, .theme-toggle {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.theme-toggle {
  min-width: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.theme-toggle-icon { width: 15px; font-size: 15px; line-height: 1; }
.theme-toggle-label { font-size: inherit; }

html[data-theme="dark"] .topbar {
  background: #090b0f;
  border-bottom-color: #252b37;
}
html[data-theme="dark"] .tabs { background: rgba(23, 26, 33, .94); }
html[data-theme="dark"] .section-card { background: #1a1e26; }
html[data-theme="dark"] label { color: #bac1cc; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #12151b; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { box-shadow: 0 0 0 3px rgba(114, 167, 255, .14); }
html[data-theme="dark"] .button.subtle { background: #1d212a; }
html[data-theme="dark"] .button.subtle:hover { background: #272c37; }
html[data-theme="dark"] .topbar .button.subtle { color: #f1f3f7; background: #171a22; border-color: #303644; }
html[data-theme="dark"] .topbar .button.subtle:hover { background: #252a35; }
html[data-theme="dark"] .count,
html[data-theme="dark"] #selectedLayerBadge,
html[data-theme="dark"] .mini-status { color: #c7cdd7; }
html[data-theme="dark"] .switch span { background: #3a414f; border-color: #515a6b; }
html[data-theme="dark"] .switch input:checked + span { background: #72a7ff; border-color: #72a7ff; }
html[data-theme="dark"] .switch input:checked + span::after { background: #0d1015; }
html[data-theme="dark"] .field-chips span { color: #c3c9d2; background: #242934; }
html[data-theme="dark"] .field-chips input:checked + span { color: #101319; background: #f0f3f7; border-color: #f0f3f7; }
html[data-theme="dark"] .template-card:hover { border-color: #667084; box-shadow: 0 8px 22px rgba(0,0,0,.28); }
html[data-theme="dark"] .template-thumb { background: #2a303c; }
html[data-theme="dark"] .file-drop { color: #e8ebf0; background: #14171d; border-color: #525b6c; }
html[data-theme="dark"] .file-drop.dragover { background: #17243a; }
html[data-theme="dark"] .record-item { background: #14171d; }
html[data-theme="dark"] .record-item.active { background: #19243a; }
html[data-theme="dark"] .record-index { background: #292f3a; }
html[data-theme="dark"] .workspace { background: #11141a; }
html[data-theme="dark"] .workspace-toolbar { background: rgba(23, 26, 33, .94); }
html[data-theme="dark"] .segmented { background: #12151b; }
html[data-theme="dark"] .canvas-area {
  background-color: #11141a;
  background-image: radial-gradient(#343a46 1px, transparent 1px);
}
html[data-theme="dark"] .canvas-hint { color: #bdc4cf; background: rgba(23,26,33,.86); border-color: rgba(70,78,93,.9); }
html[data-theme="dark"] .bottom-strip { background: #171a21; }
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .saved-item button { background: #12151b; }
html[data-theme="dark"] dialog { background: #171a21; color: var(--text); }
html[data-theme="dark"] .sheet-preview-wrap { background: #101319; }
html[data-theme="dark"] .sheet-preview { background: #ffffff; }
html[data-theme="dark"] .preview-mount { filter: drop-shadow(0 18px 30px rgba(0,0,0,.52)); }
html[data-theme="dark"] .preview-mount svg { background: #ffffff; }

@media (max-width: 1230px) {
  .app-shell { grid-template-columns: 335px minmax(400px,1fr) 270px; }
  .preview-mount svg { width: min(650px, 54vw); }
  .right-panel { padding: 14px; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .topbar { position: sticky; top: 0; z-index: 60; }
  .app-shell { height: auto; min-height: calc(100vh - 68px); grid-template-columns: 340px minmax(0,1fr); grid-template-areas: "left work" "right work"; }
  .left-panel { grid-area: left; max-height: calc(100vh - 68px); position: sticky; top: 68px; }
  .workspace { grid-area: work; min-height: calc(100vh - 68px); position: sticky; top: 68px; }
  .right-panel { grid-area: right; border-left: 0; border-right: 1px solid var(--line); }
  .preview-mount svg { width: min(640px, 60vw); }
}

@media (max-width: 720px) {
  .topbar { height: auto; min-height: 64px; padding: 10px 12px; align-items: flex-start; }
  .brand small { display: none; }
  .top-actions { gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .top-actions .button { min-height: 32px; padding: 6px 9px; font-size: 10px; }
  .app-shell { display: flex; flex-direction: column; }
  .left-panel, .right-panel, .workspace { position: static; width: 100%; max-height: none; min-height: auto; border: 0; }
  .workspace { order: -1; height: 520px; }
  .left-panel { border-top: 1px solid var(--line); }
  .tabs { grid-template-columns: repeat(5, minmax(68px,1fr)); overflow-x: auto; }
  .preview-mount svg { width: min(92vw, 690px); max-height: 52vh; }
  .canvas-area { padding: 50px 16px 58px; }
  .workspace-toolbar { gap: 8px; }
  .workspace-status { display: none; }
  .toolbar-actions .button:first-child { display: none; }
  .right-panel { padding: 17px; }
  .sheet-preview-wrap { padding: 8px; }
  .sheet-preview { transform: scale(.58); margin-bottom: -124mm; }
}

@media (max-width: 480px) {
  .brand strong { font-size: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .top-actions .button.subtle:nth-child(2) { display: none; }
  .theme-toggle { min-width: 34px; width: 34px; padding-inline: 0; }
  .theme-toggle-label { display: none; }
  .panel { padding: 14px; }
  .form-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .template-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .template-thumb { height: 64px; }
  .action-grid { grid-template-columns: 1fr; }
  .workspace { height: 470px; }
  .workspace-toolbar { padding: 8px; }
  .segmented { grid-template-columns: 30px 48px 30px; }
  .toolbar-actions { gap: 4px; }
  .toolbar-actions .button { min-height: 32px; padding: 6px 8px; }
  .bottom-strip { align-items: flex-start; }
  .validation { max-width: 55%; }
  .sheet-preview { transform: scale(.42); margin-bottom: -172mm; }
}

/* ========================================================================== 
   Akaora dashboard redesign — inspired by a clean retail template workspace.
   ========================================================================== */
:root {
  --akaora-orange: #f59e0b;
  --akaora-orange-strong: #e88905;
  --akaora-orange-soft: #fff4df;
  --dashboard-bg: #f7f8fa;
  --dashboard-card: #ffffff;
  --dashboard-sidebar: #ffffff;
  --dashboard-line: #e4e7ec;
  --dashboard-muted: #697386;
  --dashboard-heading: #141b2d;
  --dashboard-shadow: 0 10px 30px rgba(28, 38, 57, .07);
  --primary: var(--akaora-orange);
  --primary-hover: var(--akaora-orange-strong);
  --primary-contrast: #ffffff;
}
html[data-theme="dark"] {
  --akaora-orange: #ffac2f;
  --akaora-orange-strong: #f39a14;
  --akaora-orange-soft: #3a2a13;
  --dashboard-bg: #101318;
  --dashboard-card: #181c23;
  --dashboard-sidebar: #14171d;
  --dashboard-line: #2b313c;
  --dashboard-muted: #9ca6b5;
  --dashboard-heading: #f4f6f9;
  --dashboard-shadow: 0 14px 34px rgba(0,0,0,.28);
  --primary: var(--akaora-orange);
  --primary-hover: var(--akaora-orange-strong);
  --primary-contrast: #17110a;
}

body.dashboard-active { overflow: auto; background: var(--dashboard-bg); }
body.editor-active { overflow: hidden; }
body.dashboard-active .editor-only { display: none !important; }
body.editor-active .dashboard-view { display: none !important; }

.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  color: var(--dashboard-heading);
  background: var(--dashboard-bg);
}
.dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px 22px 18px;
  overflow-y: auto;
  background: var(--dashboard-sidebar);
  border-right: 1px solid var(--dashboard-line);
}
.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  color: inherit;
  text-decoration: none;
}
.dashboard-brand img {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  box-shadow: 0 9px 24px rgba(19,29,48,.13);
}
.dashboard-brand span { display: grid; min-width: 0; }
.dashboard-brand strong { font-size: 18px; line-height: 1; letter-spacing: .13em; }
.dashboard-brand small { margin-top: 7px; color: var(--akaora-orange-strong); font-size: 10px; font-weight: 850; letter-spacing: .19em; }
.dashboard-nav { display: grid; gap: 5px; }
.dashboard-nav-label {
  margin: 12px 4px 7px;
  color: #9aa3b2;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
}
.dashboard-nav-item,
.dashboard-category {
  position: relative;
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 26px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: var(--dashboard-muted);
  background: transparent;
  border: 0;
  border-radius: 13px;
  text-align: left;
  font-size: 13px;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.dashboard-nav-item:hover,
.dashboard-category:hover { color: var(--dashboard-heading); background: var(--surface-2); }
.dashboard-nav-item.active { color: var(--dashboard-heading); background: var(--akaora-orange-soft); font-weight: 760; }
.dashboard-nav-item.active::before {
  content: '';
  position: absolute;
  left: 10px;
  width: 3px;
  height: 28px;
  border-radius: 999px;
  background: var(--akaora-orange);
}
.dashboard-nav-item.active { padding-left: 18px; }
.nav-icon { text-align: center; font-size: 18px; }
.dashboard-category { min-height: 46px; }
.dashboard-category.active { color: var(--dashboard-heading); font-weight: 760; }
.category-dot { width: 15px; height: 15px; border: 2px solid #aab3c1; border-radius: 50%; }
.dashboard-category.active .category-dot { border-color: var(--akaora-orange); box-shadow: inset 0 0 0 3px var(--dashboard-sidebar); background: var(--akaora-orange); }
.dashboard-category b {
  min-width: 25px;
  padding: 4px 7px;
  color: var(--dashboard-muted);
  background: var(--surface-2);
  border: 1px solid var(--dashboard-line);
  border-radius: 999px;
  font-size: 10px;
  text-align: center;
}
.dashboard-sidebar-spacer { flex: 1; min-height: 28px; }
.dashboard-help-card,
.dashboard-version-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 14px;
  color: var(--dashboard-heading);
  background: var(--surface-2);
  border: 1px solid var(--dashboard-line);
  border-radius: 13px;
  text-align: left;
}
.dashboard-help-card { margin-bottom: 10px; }
.dashboard-help-card:hover { border-color: var(--akaora-orange); transform: translateY(-1px); }
.dashboard-help-card span:nth-child(2), .dashboard-version-card span { display: grid; }
.dashboard-help-card strong, .dashboard-version-card strong { font-size: 12px; }
.dashboard-help-card small, .dashboard-version-card small { margin-top: 5px; color: var(--dashboard-muted); font-size: 10px; line-height: 1.45; }
.help-icon { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #aeb6c3; border-radius: 50%; font-weight: 850; }
.help-arrow { align-self: center; color: var(--akaora-orange-strong); }
.dashboard-version-card { grid-template-columns: 38px minmax(0,1fr); }
.dashboard-version-card img { width: 38px; height: 38px; border-radius: 10px; }

.dashboard-main { min-width: 0; padding: 18px 28px 48px; }
.dashboard-header {
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 18px;
  max-width: 1460px;
}
.dashboard-search {
  width: min(475px, 48vw);
  height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  color: var(--dashboard-muted);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-line);
  border-radius: 13px;
  box-shadow: 0 7px 20px rgba(28,38,57,.06);
}
.dashboard-search > span { font-size: 28px; line-height: 1; transform: rotate(-18deg); }
.dashboard-search input {
  width: 100%;
  padding: 0;
  color: var(--dashboard-heading);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
}
.dashboard-search kbd,
.help-dialog kbd {
  padding: 4px 7px;
  color: var(--dashboard-muted);
  background: var(--surface-2);
  border: 1px solid var(--dashboard-line);
  border-radius: 6px;
  font: 10px/1.2 inherit;
  white-space: nowrap;
}
.dashboard-header-actions { display: flex; align-items: center; gap: 10px; }
.dashboard-refresh,
.dashboard-icon-button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--dashboard-muted);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-line);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 760;
}
.dashboard-refresh:hover,
.dashboard-icon-button:hover { color: var(--dashboard-heading); border-color: #c7ccd4; }
.dashboard-icon-button { width: 44px; padding: 0; border-radius: 50%; font-size: 17px; }
.dashboard-theme-button { border-radius: 12px; }

.dashboard-hero,
.quick-start-section {
  max-width: 1460px;
  margin: 0 auto 18px;
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-line);
  border-radius: 18px;
  box-shadow: var(--dashboard-shadow);
}
.dashboard-hero {
  min-height: 286px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .85fr);
  overflow: hidden;
}
.dashboard-hero-copy { padding: 54px 30px 42px; }
.eyebrow,
.dashboard-section-kicker {
  color: #7d8798;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
}
.dashboard-hero h1 { margin: 10px 0 9px; font-size: clamp(30px, 3vw, 45px); line-height: 1.02; letter-spacing: -.04em; }
.dashboard-hero p { max-width: 690px; margin: 0; color: var(--dashboard-muted); font-size: 15px; line-height: 1.65; }
.dashboard-hero-actions { display: flex; gap: 9px; margin-top: 18px; }
.dashboard-primary,
.dashboard-secondary {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 820;
}
.dashboard-primary { color: #fff; background: linear-gradient(135deg, #ffad19, #ee8b05); border: 1px solid #ed8a05; box-shadow: 0 8px 18px rgba(245,158,11,.24); }
.dashboard-primary:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(245,158,11,.32); }
.dashboard-secondary { color: var(--dashboard-heading); background: var(--dashboard-card); border: 1px solid var(--dashboard-line); }
.dashboard-secondary:hover { border-color: #bdc4ce; background: var(--surface-2); }
.dashboard-trust-row { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 22px; color: var(--dashboard-muted); font-size: 10px; font-weight: 720; }
.dashboard-trust-row span::first-letter { color: #18a66f; }

.dashboard-hero-art {
  position: relative;
  min-height: 286px;
  overflow: hidden;
  background: radial-gradient(circle at 72% 38%, rgba(255,205,117,.42), transparent 38%), linear-gradient(135deg, rgba(255,249,235,.2), #fff1d2 52%, #f2d79e);
}
html[data-theme="dark"] .dashboard-hero-art { background: radial-gradient(circle at 72% 38%, rgba(245,158,11,.27), transparent 38%), linear-gradient(135deg, #1c1c1a, #2c2418 52%, #4b3517); }
.hero-glow { position: absolute; width: 330px; height: 330px; right: 15%; top: -30px; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; box-shadow: 0 0 70px rgba(255,195,76,.34); }
.hero-printer {
  position: absolute;
  right: 12%;
  bottom: 28px;
  width: 210px;
  height: 148px;
  padding: 18px;
  background: linear-gradient(150deg, #f7f7f4, #deded9 55%, #bdbdb8);
  border: 1px solid rgba(74,63,42,.22);
  border-radius: 28px 28px 22px 22px;
  box-shadow: 0 28px 42px rgba(91,65,23,.25);
  transform: rotate(-2deg);
}
.printer-top { height: 38px; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; color: #272b32; background: #333940; border-radius: 13px 13px 7px 7px; }
.printer-top span { width: 58px; height: 13px; background: #15191d; border-radius: 4px; }
.printer-top b { color: #ffb12b; font-size: 9px; letter-spacing: .1em; }
.printer-slot { position: absolute; left: 28px; right: 28px; top: 72px; height: 9px; background: #696c6b; border-radius: 6px; box-shadow: inset 0 2px 3px rgba(0,0,0,.38); }
.printer-light { position: absolute; right: 24px; top: 56px; width: 7px; height: 7px; background: #39db8d; border-radius: 50%; box-shadow: 0 0 10px #39db8d; }
.printer-label { position: absolute; left: 35px; right: 35px; top: 78px; min-height: 103px; padding: 12px 13px; color: #15191d; background: #fff; border-radius: 2px 2px 9px 9px; box-shadow: 0 12px 18px rgba(57,43,20,.16); text-align: center; }
.printer-label strong { font-size: 8px; letter-spacing: .06em; }
.printer-label small { font: 8px monospace; }
.printer-bars { height: 37px; margin: 9px 0 5px; background: repeating-linear-gradient(90deg,#101010 0 2px,transparent 2px 4px,#101010 4px 5px,transparent 5px 8px); }
.label-ribbon { position: absolute; right: 3%; top: 32px; display: flex; gap: 3px; transform: rotate(18deg); filter: drop-shadow(0 14px 12px rgba(87,59,12,.16)); }
.mini-label { width: 87px; height: 47px; display: grid; grid-template-columns: repeat(6,1fr); align-items: end; gap: 2px; padding: 7px 7px 5px; color: #171717; background: #fffdf7; border: 1px solid #e3d2af; border-radius: 3px; }
.mini-label i { height: 23px; background: #161616; }
.mini-label i:nth-child(2), .mini-label i:nth-child(5) { height: 17px; }
.mini-label b { grid-column: 1/-1; font: 6px monospace; text-align: center; }
.scan-line { position: absolute; right: 6%; bottom: 68px; width: 280px; height: 4px; background: linear-gradient(90deg,transparent,#ff6a28,#ffe476,#3de1bd,transparent); border-radius: 99px; box-shadow: 0 0 17px rgba(255,145,52,.78); }

.quick-start-section { padding: 21px 22px 20px; }
.quick-start-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.quick-start-card {
  min-width: 0;
  min-height: 84px;
  display: grid;
  grid-template-columns: 45px minmax(0,1fr) 29px;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  color: var(--dashboard-heading);
  background: var(--surface-2);
  border: 1px solid var(--dashboard-line);
  border-radius: 14px;
  text-align: left;
}
.quick-start-card:hover { transform: translateY(-2px); border-color: #c6cbd4; box-shadow: 0 9px 18px rgba(29,38,53,.07); }
.quick-start-card > span:nth-child(2) { display: grid; min-width: 0; }
.quick-start-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.quick-start-card small { margin-top: 5px; color: var(--dashboard-muted); font-size: 10px; }
.quick-icon { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid; border-radius: 12px; font-size: 22px; font-weight: 800; }
.quick-icon.orange, .quick-icon.amber { color: #e98d00; background: #fff3dc; border-color: #ffd594; }
.quick-icon.green { color: #00a776; background: #e7fbf3; border-color: #b9ebd9; }
.quick-icon.blue { color: #2563eb; background: #eaf1ff; border-color: #c6d8ff; }
.quick-icon.violet { color: #7c3aed; background: #f2ebff; border-color: #dccbff; }
html[data-theme="dark"] .quick-icon.orange, html[data-theme="dark"] .quick-icon.amber { background:#3a2a13; border-color:#6b4a1b; }
html[data-theme="dark"] .quick-icon.green { background:#14332b; border-color:#245746; }
html[data-theme="dark"] .quick-icon.blue { background:#172640; border-color:#2e4770; }
html[data-theme="dark"] .quick-icon.violet { background:#2b2140; border-color:#4c3a6f; }
.quick-arrow { width: 29px; height: 29px; display: grid; place-items: center; color: var(--dashboard-muted); background: var(--dashboard-card); border: 1px solid var(--dashboard-line); border-radius: 8px; }

.dashboard-templates-section { max-width: 1460px; margin: 0 auto; padding-top: 8px; scroll-margin-top: 16px; }
.dashboard-templates-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 13px; }
.dashboard-templates-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.dashboard-templates-head h2 span { display: inline-grid; place-items: center; min-width: 27px; height: 23px; margin-left: 6px; color: var(--dashboard-muted); background: var(--surface-2); border: 1px solid var(--dashboard-line); border-radius: 999px; font-size: 10px; vertical-align: 2px; }
.dashboard-templates-head p { margin: 6px 0 0; color: var(--dashboard-muted); font-size: 11px; }
.dashboard-template-controls { display: flex; align-items: center; gap: 10px; color: var(--dashboard-muted); font-size: 11px; }
.sort-segmented,
.view-segmented { display: flex; padding: 4px; background: var(--surface-2); border: 1px solid var(--dashboard-line); border-radius: 11px; }
.sort-segmented button,
.view-segmented button { min-height: 33px; padding: 0 14px; color: var(--dashboard-muted); background: transparent; border: 0; border-radius: 8px; font-size: 11px; }
.sort-segmented button.active,
.view-segmented button.active { color: var(--dashboard-heading); background: var(--dashboard-card); box-shadow: 0 3px 9px rgba(22,31,46,.08); font-weight: 780; }
.view-segmented button { width: 35px; padding: 0; font-size: 17px; }
.dashboard-template-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.dashboard-template-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 146px auto;
  padding: 12px;
  color: var(--dashboard-heading);
  background: var(--dashboard-card);
  border: 1px solid var(--dashboard-line);
  border-radius: 15px;
  text-align: left;
  box-shadow: 0 5px 17px rgba(27,37,54,.04);
  overflow: hidden;
}
.dashboard-template-card:hover { transform: translateY(-3px); border-color: #c7ccd4; box-shadow: 0 13px 25px rgba(27,37,54,.09); }
.dashboard-template-thumb {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 25px 12px 13px;
  background: var(--surface-2);
  border: 1px solid var(--dashboard-line);
  border-radius: 11px;
}
.dashboard-template-thumb svg { width: 100%; max-height: 100px; filter: drop-shadow(0 7px 8px rgba(0,0,0,.11)); }
.dashboard-template-category { position: absolute; left: 10px; top: 9px; padding: 4px 8px; color: #e28700; background: #fffaf0; border: 1px solid #ffd89d; border-radius: 6px; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
html[data-theme="dark"] .dashboard-template-category { color:#ffb84d; background:#392a15; border-color:#65491e; }
.dashboard-template-info { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px 4px 2px; }
.dashboard-template-info > span:first-child { display: grid; min-width: 0; }
.dashboard-template-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.dashboard-template-info small { margin-top: 5px; color: var(--dashboard-muted); font-size: 9px; }
.template-open-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--dashboard-muted); background: var(--surface-2); border: 1px solid var(--dashboard-line); border-radius: 8px; }
.dashboard-template-grid.list-view { grid-template-columns: 1fr; gap: 10px; }
.dashboard-template-grid.list-view .dashboard-template-card { grid-template-columns: 230px minmax(0,1fr); grid-template-rows: 112px; }
.dashboard-template-grid.list-view .dashboard-template-thumb { padding-top: 25px; }
.dashboard-template-grid.list-view .dashboard-template-info { padding: 14px 16px; }
.dashboard-empty-state { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--dashboard-muted); background: var(--dashboard-card); border: 1px dashed var(--dashboard-line); border-radius: 16px; }
.dashboard-empty-state strong { color: var(--dashboard-heading); }
.dashboard-empty-state[hidden] { display: none; }

.help-dialog { width: min(700px, calc(100vw - 24px)); }
.help-dialog-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 16px 0 18px; }
.help-dialog-grid article { padding: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.help-dialog-grid strong { font-size: 12px; }
.help-dialog-grid p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

/* Bring the editor into the same clean product language. */
body.editor-active .topbar { color: var(--text); background: var(--surface); border-bottom-color: var(--line); box-shadow: 0 4px 16px rgba(25,34,49,.05); }
body.editor-active .brand small { color: var(--muted); }
body.editor-active .topbar .button.subtle { color: var(--text); background: var(--surface-2); border-color: var(--line); }
body.editor-active .topbar .button.subtle:hover { background: var(--surface-3); }
.tab.active { color: var(--akaora-orange-strong); border-bottom-color: var(--akaora-orange); }
.template-card.active { border-color: var(--akaora-orange); box-shadow: 0 0 0 2px rgba(245,158,11,.15); }
.record-item.active { border-color: var(--akaora-orange); background: var(--akaora-orange-soft); }
html[data-theme="dark"] body.editor-active .topbar { background:#12151b; border-bottom-color:#2b313c; }
html[data-theme="dark"] body.editor-active .topbar .button.subtle { color:var(--text); background:#1d212a; border-color:#303644; }

@media (max-width: 1260px) {
  .dashboard-view { grid-template-columns: 250px minmax(0,1fr); }
  .dashboard-sidebar { padding-inline: 17px; }
  .dashboard-main { padding-inline: 20px; }
  .quick-start-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dashboard-template-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .dashboard-view { display: block; }
  .dashboard-sidebar { position: relative; width: 100%; height: auto; padding: 14px 16px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--dashboard-line); }
  .dashboard-brand { margin-bottom: 12px; }
  .dashboard-brand img { width: 42px; height: 42px; border-radius: 12px; }
  .dashboard-brand strong { font-size: 15px; }
  .dashboard-brand small { margin-top: 5px; font-size: 8px; }
  .dashboard-nav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .dashboard-nav::-webkit-scrollbar { display:none; }
  .dashboard-nav-label, .dashboard-sidebar-spacer, .dashboard-help-card, .dashboard-version-card { display: none; }
  .dashboard-nav-item, .dashboard-category { flex: 0 0 auto; width: auto; min-height: 38px; grid-template-columns: auto auto; padding: 0 12px; border: 1px solid var(--dashboard-line); border-radius: 10px; white-space: nowrap; }
  .dashboard-nav-item.active { padding-left: 12px; }
  .dashboard-nav-item.active::before, .dashboard-category b { display:none; }
  .dashboard-category .category-icon { width: 12px; height: 12px; flex-basis: 12px; }
  .dashboard-main { padding: 14px 15px 38px; }
  .dashboard-header { min-height: auto; align-items: center; }
  .dashboard-search { width: min(560px, 100%); }
  .dashboard-hero { grid-template-columns: 1fr; }
  .dashboard-hero-copy { padding: 38px 28px 27px; }
  .dashboard-hero-art { min-height: 230px; }
  .quick-start-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-template-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
  .dashboard-main { padding-inline: 11px; }
  .dashboard-header { gap: 8px; }
  .dashboard-search { height: 47px; }
  .dashboard-search kbd, .dashboard-refresh { display: none; }
  .dashboard-header-actions { gap: 6px; }
  .dashboard-icon-button { width: 42px; height: 42px; }
  .dashboard-hero { border-radius: 15px; }
  .dashboard-hero-copy { padding: 31px 20px 24px; }
  .dashboard-hero h1 { font-size: 31px; }
  .dashboard-hero p { font-size: 13px; }
  .dashboard-hero-actions { display:grid; grid-template-columns:1fr 1fr; }
  .dashboard-primary, .dashboard-secondary { padding-inline:10px; }
  .dashboard-trust-row { gap:8px 12px; }
  .hero-printer { right: 50%; transform: translateX(50%) rotate(-2deg); }
  .label-ribbon { right: 5%; }
  .scan-line { right: 50%; transform:translateX(50%); }
  .quick-start-section { padding: 18px 13px; }
  .quick-start-grid { grid-template-columns: 1fr; }
  .quick-start-card { min-height: 72px; }
  .dashboard-templates-head { align-items:flex-start; flex-direction:column; }
  .dashboard-template-controls { width:100%; justify-content:space-between; flex-wrap:wrap; }
  .dashboard-template-controls > span { display:none; }
  .sort-segmented { flex:1; }
  .sort-segmented button { flex:1; padding-inline:8px; }
  .dashboard-template-grid { grid-template-columns: 1fr; gap:12px; }
  .dashboard-template-card { grid-template-rows: 156px auto; }
  .dashboard-template-grid.list-view .dashboard-template-card { grid-template-columns: 135px minmax(0,1fr); grid-template-rows: 104px; }
  .help-dialog-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================\n   Professional cursor-resizable editor layout\n   ========================================================================== */
.sr-only { position:absolute!important; width:1px!important; height:1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; }
body.editor-active { overflow:hidden; background:#ddd8cf; }
.editor-titlebar { height:42px; min-height:42px; padding:0 10px; background:#2c2924; border-bottom:1px solid #171512; color:#fff; }
.editor-title-left { min-width:0; display:flex; align-items:center; gap:8px; }
.editor-project-brand { width:25px; height:25px; display:block; border-radius:6px; overflow:hidden; flex:0 0 auto; }
.editor-project-brand img { width:100%; height:100%; object-fit:cover; display:block; }
.editor-project-title { min-width:0; display:grid; line-height:1.05; }
.editor-project-title strong { max-width:290px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.editor-project-title small { display:flex; gap:5px; align-items:center; margin-top:3px; color:#c9c3b9; font-size:9px; }
.unsaved-state { color:#f7a51a; font-weight:800; }
.unsaved-state.saved { color:#42c989; }
.title-separator { opacity:.55; }
.title-icon-button, .title-action { min-height:28px; display:inline-grid; place-items:center; color:#f7f4ee; background:transparent; border:1px solid transparent; border-radius:6px; font-size:11px; font-weight:760; }
.title-icon-button { width:31px; padding:0; font-size:17px; }
.title-action { padding:5px 10px; }
.title-icon-button:hover, .title-action:hover { background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.12); }
.title-action-strong { background:#514a40; border-color:#61594d; }
.title-action-export { color:#3b2a06; background:#f8a51b; border-color:#f8a51b; }
.editor-title-actions { gap:4px; }

body.editor-active .app-shell { height:calc(100vh - 42px); grid-template-columns:255px minmax(430px,1fr) 330px; background:#ded9d0; }
body.editor-active .left-panel { display:flex; flex-direction:column; background:#f6f3ee; border-right:1px solid #cfc9bf; }
.my-works-panel { min-height:168px; max-height:250px; display:flex; flex-direction:column; border-bottom:1px solid #cbc5bc; background:#f8f5ef; }
.my-works-heading { height:34px; flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; padding:0 9px; color:#4b4843; background:#ece8e1; border-bottom:1px solid #d2ccc2; font-size:10px; letter-spacing:.02em; }
.my-works-heading button { width:27px; height:27px; color:#777169; background:transparent; border:0; border-radius:5px; font-size:17px; }
.my-works-heading button:hover { background:#ded8ce; }
.my-works-list { min-height:0; flex:1; overflow:auto; padding:7px; display:grid; align-content:start; gap:5px; }
.my-works-empty { margin:auto; padding:24px 12px; text-align:center; color:#8d877f; font-size:10px; line-height:1.5; }
.my-work-item { width:100%; display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:8px; padding:7px; text-align:left; color:#33302c; background:#fff; border:1px solid #d9d3c9; border-radius:7px; }
.my-work-item:hover { border-color:#f0a21c; background:#fff9ee; }
.my-work-item .work-thumb { width:34px; height:26px; display:grid; place-items:center; overflow:hidden; border-radius:4px; background:#f1eee8; }
.my-work-item .work-thumb svg { width:100%; height:100%; display:block; }
.my-work-item span { min-width:0; display:grid; }
.my-work-item strong, .my-work-item small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.my-work-item strong { font-size:10px; }
.my-work-item small { margin-top:2px; color:#817b72; font-size:8px; }
body.editor-active .tabs { position:static; flex:0 0 auto; grid-template-columns:repeat(5,minmax(66px,1fr)); padding:4px; background:#ece8e1; border-bottom:1px solid #d0cac1; overflow-x:auto; }
body.editor-active .tab { min-width:66px; padding:8px 5px 7px; border-radius:6px; font-size:9px; }
body.editor-active .tab.active { color:#8f5900; background:#fff2d9; box-shadow:inset 0 0 0 1px #f5c46d; }
body.editor-active .panel { flex:1; min-height:0; overflow:auto; padding:12px; }

body.editor-active .workspace { grid-template-rows:62px minmax(0,1fr) 34px; background:#d9d4cb; }
.editor-tool-ribbon { min-width:0; height:62px; padding:4px 8px; gap:8px; background:#f7f4ee; border-bottom:1px solid #cfc8bd; }
.editor-tools-primary, .editor-tools-secondary { min-width:0; display:flex; align-items:center; gap:3px; }
.editor-tools-primary { overflow-x:auto; padding-bottom:2px; }
.editor-tools-secondary { margin-left:auto; flex:0 0 auto; }
.editor-tool { min-width:48px; height:50px; display:grid; place-items:center; align-content:center; gap:2px; padding:4px 7px; color:#35312c; background:transparent; border:1px solid transparent; border-radius:6px; }
.editor-tool span { font-size:18px; line-height:1; }
.editor-tool small { font-size:8px; font-weight:700; }
.editor-tool:hover { background:#eee9e0; }
.editor-tool.active { color:#9a5e00; background:#fff2d8; border-color:#f3a91f; }
.editor-tool.compact { min-width:45px; }
.tool-divider { width:1px; height:36px; margin:0 4px; background:#d4cec4; }
.editor-icon-tool { min-width:36px; height:36px; padding:0 7px; color:#302d28; background:#fff; border:1px solid #d4cec5; border-radius:6px; font-size:9px; font-weight:850; }
.editor-icon-tool:hover, .editor-icon-tool.active { color:#9c5d00; background:#fff4dc; border-color:#f0a51b; }
.editor-zoom { grid-template-columns:30px 55px 30px; border-color:#d2ccc2; }
.editor-zoom button, .editor-zoom span { background:#fff; }

.canvas-area { cursor:default; padding:52px 54px 64px 58px; background-color:#d7d1c8; background-image:none; }
.canvas-area.grid-enabled::before { content:""; position:absolute; inset:32px 0 0 32px; pointer-events:none; background-image:linear-gradient(rgba(80,80,80,.10) 1px,transparent 1px),linear-gradient(90deg,rgba(80,80,80,.10) 1px,transparent 1px); background-size:var(--editor-grid-size,20px) var(--editor-grid-size,20px); opacity:.55; }
.canvas-area.hand-mode { cursor:grab; }
.canvas-area.hand-mode:active { cursor:grabbing; }
.canvas-ruler { position:absolute; z-index:5; pointer-events:none; background-color:#eeeae3; border-color:#c9c3ba; }
.canvas-ruler-horizontal { top:0; left:32px; right:0; height:32px; border-bottom:1px solid #c9c3ba; background-image:repeating-linear-gradient(90deg,transparent 0 19px,#aaa39a 19px 20px,transparent 20px 99px,#7f786f 99px 100px); }
.canvas-ruler-vertical { top:32px; left:0; bottom:0; width:32px; border-right:1px solid #c9c3ba; background-image:repeating-linear-gradient(180deg,transparent 0 19px,#aaa39a 19px 20px,transparent 20px 99px,#7f786f 99px 100px); }
.canvas-hint { top:37px; z-index:6; color:#6d675f; background:rgba(255,255,255,.88); border-color:#d4cec5; }
.label-stage { position:relative; z-index:2; }
.preview-mount { filter:drop-shadow(0 15px 24px rgba(50,42,30,.22)); }
.preview-mount svg { width:min(760px,58vw); max-height:66vh; background:#fff; border:1px solid #d4d0c9; }
.preview-mount g[data-element] { cursor:move; }
.canvas-area.hand-mode .preview-mount g[data-element] { cursor:grab; }
.selection-overlay { pointer-events:none; }
.selection-overlay .selection-box { fill:none; stroke:#1769ff; stroke-width:2.5; vector-effect:non-scaling-stroke; stroke-dasharray:7 4; }
.selection-overlay .resize-handle { pointer-events:all; fill:#fff; stroke:#1769ff; stroke-width:2.5; vector-effect:non-scaling-stroke; }
.selection-overlay .resize-handle[data-handle="nw"], .selection-overlay .resize-handle[data-handle="se"] { cursor:nwse-resize; }
.selection-overlay .resize-handle[data-handle="ne"], .selection-overlay .resize-handle[data-handle="sw"] { cursor:nesw-resize; }
.selection-overlay .resize-handle[data-handle="n"], .selection-overlay .resize-handle[data-handle="s"] { cursor:ns-resize; }
.selection-overlay .resize-handle[data-handle="e"], .selection-overlay .resize-handle[data-handle="w"] { cursor:ew-resize; }
body.editor-active .bottom-strip { height:34px; padding:4px 9px; background:#f7f4ee; border-top:1px solid #c9c3ba; }
body.editor-active .bottom-strip strong { font-size:9px; }
body.editor-active .bottom-strip span, body.editor-active .validation { font-size:8px; }

body.editor-active .right-panel { padding:0; background:#f6f3ee; border-left:1px solid #cbc5bc; }
.inspector-tabs { position:sticky; top:0; z-index:8; display:grid; grid-template-columns:repeat(4,1fr); height:58px; background:#f2eee8; border-bottom:1px solid #cbc5bc; }
.inspector-tabs button { display:grid; place-items:center; align-content:center; gap:3px; color:#716b63; background:transparent; border:0; border-bottom:2px solid transparent; font-size:9px; font-weight:700; }
.inspector-tabs button span { font-size:15px; }
.inspector-tabs button.active { color:#a26100; background:#fff0d1; border-bottom-color:#f2a21b; }
.inspector-panel { display:none; padding:12px; }
.inspector-panel.active { display:block; }
.inspector-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; padding:4px 0 10px; border-bottom:1px solid #d8d2c8; }
.inspector-heading h2 { margin:0; font-size:14px; }
.inspector-heading p { margin:3px 0 0; color:#817b73; font-size:9px; }
.inspector-badge { padding:4px 7px; color:#9b5d00; background:#fff0d2; border-radius:999px; font-size:8px; font-weight:800; }
.position-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:10px; }
.position-grid label { font-size:8px; }
.position-grid input { margin-top:3px; padding:7px 6px; }
.color-field-row { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
.color-field-row label { font-size:8px; }
.color-field-row input[type="color"] { width:100%; height:32px; padding:2px; }
.advanced-sliders { margin-top:10px; }
.editor-layers-list { display:grid; gap:6px; padding-top:10px; }
.editor-layer-row { display:grid; grid-template-columns:29px minmax(0,1fr) 30px; align-items:center; gap:6px; padding:6px; background:#fff; border:1px solid #d8d2c8; border-radius:7px; }
.editor-layer-row.active { border-color:#1769ff; box-shadow:0 0 0 1px #1769ff inset; }
.editor-layer-row .layer-type { width:27px; height:27px; display:grid; place-items:center; color:#7d756b; background:#eeeae3; border-radius:5px; font-size:10px; font-weight:850; }
.editor-layer-select { min-width:0; padding:0; text-align:left; color:#35312d; background:transparent; border:0; }
.editor-layer-select strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.editor-layer-select small { color:#8b847b; font-size:8px; }
.editor-layer-eye { width:28px; height:28px; display:grid; place-items:center; color:#6f685f; background:transparent; border:0; border-radius:5px; }
.editor-layer-eye:hover { background:#eee9e1; }
.inspector-form { display:grid; gap:9px; padding-top:11px; }
.inspector-form.two-column { grid-template-columns:1fr 1fr; }
.inspector-form label { display:grid; gap:4px; color:#686159; font-size:8px; font-weight:760; text-transform:uppercase; letter-spacing:.035em; }
.inspector-form input, .inspector-form select { min-width:0; padding:9px; color:#2f2b27; background:#fff; border:1px solid #d5cfc5; border-radius:7px; font-size:10px; text-transform:none; letter-spacing:normal; }
.inspector-switch { margin-top:14px; padding:9px; border:1px solid #d8d2c8; border-radius:8px; }
.inspector-switch > span { display:grid; }
.inspector-switch small { margin-top:2px; color:#837c73; font-size:8px; }

html[data-theme="dark"] body.editor-active, html[data-theme="dark"] body.editor-active .app-shell { background:#181714; }
html[data-theme="dark"] body.editor-active .left-panel, html[data-theme="dark"] body.editor-active .right-panel, html[data-theme="dark"] .editor-tool-ribbon, html[data-theme="dark"] body.editor-active .bottom-strip { background:#22211e; border-color:#3b3934; }
html[data-theme="dark"] .my-works-panel, html[data-theme="dark"] .my-works-heading, html[data-theme="dark"] body.editor-active .tabs, html[data-theme="dark"] .inspector-tabs { background:#292824; border-color:#3d3a35; }
html[data-theme="dark"] .my-work-item, html[data-theme="dark"] .editor-layer-row, html[data-theme="dark"] .inspector-form input, html[data-theme="dark"] .inspector-form select, html[data-theme="dark"] .editor-icon-tool { color:#eee9e0; background:#171714; border-color:#3b3934; }
html[data-theme="dark"] .canvas-area { background-color:#36332d; }
html[data-theme="dark"] .canvas-ruler { background-color:#2c2a26; border-color:#46423b; }
html[data-theme="dark"] .inspector-heading, html[data-theme="dark"] .property-section { border-color:#3b3934; }
html[data-theme="dark"] .inspector-heading p, html[data-theme="dark"] .inspector-form label, html[data-theme="dark"] .my-works-empty { color:#a8a199; }

@media (max-width:1180px) {
  body.editor-active .app-shell { grid-template-columns:220px minmax(390px,1fr) 285px; }
  .preview-mount svg { width:min(690px,55vw); }
  .editor-tool { min-width:44px; padding-inline:4px; }
}
@media (max-width:900px) {
  body.editor-active { overflow:auto; }
  body.editor-active .app-shell { height:auto; min-height:calc(100vh - 42px); grid-template-columns:230px minmax(0,1fr); grid-template-areas:"left work" "right work"; }
  body.editor-active .left-panel { grid-area:left; max-height:calc(100vh - 42px); }
  body.editor-active .workspace { grid-area:work; min-height:calc(100vh - 42px); }
  body.editor-active .right-panel { grid-area:right; border-left:0; border-right:1px solid #cbc5bc; }
  .preview-mount svg { width:min(72vw,680px); }
}
@media (max-width:680px) {
  .editor-titlebar { height:auto; min-height:46px; padding:5px 7px; align-items:center; }
  .editor-project-title small { display:none; }
  .editor-title-actions { overflow-x:auto; }
  .title-action { padding:5px 7px; }
  body.editor-active .app-shell { display:flex; flex-direction:column; min-height:0; }
  body.editor-active .workspace { order:0; height:520px; min-height:520px; }
  body.editor-active .left-panel { order:1; max-height:none; }
  body.editor-active .right-panel { order:2; }
  .my-works-panel { min-height:130px; }
  .editor-tool-ribbon { overflow-x:auto; justify-content:flex-start; }
  .editor-tools-secondary { margin-left:0; }
  .editor-tool small { display:none; }
  .editor-tool { min-width:37px; height:40px; }
  .editor-tool-ribbon { height:48px; }
  body.editor-active .workspace { grid-template-rows:48px minmax(0,1fr) 34px; }
  .preview-mount svg { width:min(90vw,650px); max-height:54vh; }
  .canvas-area { padding:50px 12px 50px 42px; }
  .canvas-hint { display:none; }
  .inspector-panel { padding:12px; }
}
body.editor-active .editor-titlebar { color:#fff; background:#2c2924; border-bottom-color:#171512; box-shadow:none; }
html[data-theme="dark"] body.editor-active .editor-titlebar { background:#1f1d1a; border-bottom-color:#0f0e0c; }
body.editor-active .editor-titlebar .title-action,
body.editor-active .editor-titlebar .title-icon-button { color:#f7f4ee; }
.preview-mount svg { height:auto; }


/* Multi-layer text/image editor update */
.title-action-done {
  color:#fff;
  background:#16845b;
  border-color:#16845b;
}
.title-action-done:hover { background:#116c4a; border-color:#116c4a; }
.position-grid-five { grid-template-columns:repeat(5,minmax(0,1fr)); }
.custom-layer-note {
  margin:8px 0 0;
  color:var(--muted);
  font-size:10px;
  line-height:1.45;
}
.editor-layer-row[data-custom-layer="true"] .layer-type {
  color:#0f7b58;
  background:#dff8ec;
}
html[data-theme="dark"] .editor-layer-row[data-custom-layer="true"] .layer-type {
  color:#61d8aa;
  background:#173b30;
}
@media (max-width: 1180px) {
  .position-grid-five { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .position-grid-five { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .title-action-done { order:-1; }
}

/* ========================================================================== 
   Akaora Barcode Studio — Apple-inspired interface refresh
   ========================================================================== */
:root {
  color-scheme: light;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-indigo: #5856d6;
  --apple-green: #34c759;
  --apple-red: #ff3b30;
  --apple-orange: #ff9f0a;
  --apple-bg: #f5f5f7;
  --apple-bg-raised: rgba(255,255,255,.78);
  --apple-surface: rgba(255,255,255,.86);
  --apple-surface-solid: #ffffff;
  --apple-surface-soft: rgba(248,248,250,.9);
  --apple-line: rgba(60,60,67,.14);
  --apple-line-strong: rgba(60,60,67,.22);
  --apple-text: #1d1d1f;
  --apple-muted: #6e6e73;
  --apple-shadow-sm: 0 2px 10px rgba(0,0,0,.05);
  --apple-shadow-md: 0 14px 40px rgba(0,0,0,.09);
  --apple-shadow-lg: 0 28px 70px rgba(0,0,0,.13);
  --akaora-orange: var(--apple-blue);
  --akaora-orange-strong: var(--apple-blue-hover);
  --akaora-orange-soft: rgba(0,113,227,.10);
  --dashboard-bg: var(--apple-bg);
  --dashboard-card: var(--apple-surface-solid);
  --dashboard-sidebar: rgba(255,255,255,.72);
  --dashboard-line: var(--apple-line);
  --dashboard-muted: var(--apple-muted);
  --dashboard-heading: var(--apple-text);
  --dashboard-shadow: var(--apple-shadow-md);
  --primary: var(--apple-blue);
  --primary-hover: var(--apple-blue-hover);
  --primary-contrast: #fff;
  --bg: var(--apple-bg);
  --surface: var(--apple-surface-solid);
  --surface-2: #f7f7f9;
  --surface-3: #efeff4;
  --line: var(--apple-line);
  --line-strong: var(--apple-line-strong);
  --text: var(--apple-text);
  --muted: var(--apple-muted);
  --blue: var(--apple-blue);
  --shadow: var(--apple-shadow-md);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --apple-blue: #0a84ff;
  --apple-blue-hover: #409cff;
  --apple-indigo: #5e5ce6;
  --apple-green: #30d158;
  --apple-red: #ff453a;
  --apple-orange: #ff9f0a;
  --apple-bg: #000000;
  --apple-bg-raised: rgba(28,28,30,.78);
  --apple-surface: rgba(28,28,30,.88);
  --apple-surface-solid: #1c1c1e;
  --apple-surface-soft: rgba(44,44,46,.82);
  --apple-line: rgba(255,255,255,.12);
  --apple-line-strong: rgba(255,255,255,.2);
  --apple-text: #f5f5f7;
  --apple-muted: #a1a1a6;
  --apple-shadow-sm: 0 2px 12px rgba(0,0,0,.28);
  --apple-shadow-md: 0 16px 42px rgba(0,0,0,.38);
  --apple-shadow-lg: 0 30px 80px rgba(0,0,0,.48);
  --akaora-orange: var(--apple-blue);
  --akaora-orange-strong: var(--apple-blue-hover);
  --akaora-orange-soft: rgba(10,132,255,.17);
  --dashboard-bg: var(--apple-bg);
  --dashboard-card: var(--apple-surface-solid);
  --dashboard-sidebar: rgba(28,28,30,.72);
  --dashboard-line: var(--apple-line);
  --dashboard-muted: var(--apple-muted);
  --dashboard-heading: var(--apple-text);
  --dashboard-shadow: var(--apple-shadow-md);
  --primary: var(--apple-blue);
  --primary-hover: var(--apple-blue-hover);
  --primary-contrast: #fff;
  --bg: var(--apple-bg);
  --surface: var(--apple-surface-solid);
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --line: var(--apple-line);
  --line-strong: var(--apple-line-strong);
  --text: var(--apple-text);
  --muted: var(--apple-muted);
  --blue: var(--apple-blue);
  --shadow: var(--apple-shadow-md);
}

html, body,
button, input, select, textarea {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--apple-blue) 28%, transparent);
  outline-offset: 2px;
}

/* Dashboard */
body.dashboard-active {
  color: var(--apple-text);
  background:
    radial-gradient(circle at 78% 8%, rgba(88,86,214,.10), transparent 28%),
    radial-gradient(circle at 42% 14%, rgba(0,113,227,.08), transparent 24%),
    var(--apple-bg);
}

.dashboard-view {
  grid-template-columns: 270px minmax(0,1fr);
  background: transparent;
}

.dashboard-sidebar {
  padding: 20px 16px 16px;
  background: var(--dashboard-sidebar);
  border-right: 1px solid var(--apple-line);
  box-shadow: 1px 0 0 rgba(255,255,255,.35);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
}

.dashboard-brand {
  gap: 11px;
  margin: 0 6px 28px;
  padding: 4px;
}
.dashboard-brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.dashboard-brand strong { font-size: 17px; letter-spacing: .08em; }
.dashboard-brand small { margin-top: 5px; color: var(--apple-blue); font-size: 9px; letter-spacing: .16em; }

.dashboard-nav-label { margin: 14px 10px 6px; color: var(--apple-muted); font-size: 10px; letter-spacing: .10em; }
.dashboard-nav-item,
.dashboard-category {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13px;
}
.dashboard-nav-item:hover,
.dashboard-category:hover { color: var(--apple-text); background: rgba(120,120,128,.09); transform: none; }
.dashboard-nav-item.active,
.dashboard-category.active {
  color: var(--apple-blue);
  background: color-mix(in srgb, var(--apple-blue) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--apple-blue) 8%, transparent);
}
.dashboard-nav-item.active .nav-accent { display: none; }
.dashboard-category.active .category-dot {
  border-color: var(--apple-blue);
  background: var(--apple-blue);
  box-shadow: inset 0 0 0 3px var(--apple-surface-solid);
}
.dashboard-nav-item b,
.dashboard-category b { color: var(--apple-muted); background: rgba(120,120,128,.10); border: 0; }

.dashboard-help-card,
.dashboard-version-card {
  border: 1px solid var(--apple-line);
  border-radius: 16px;
  background: var(--apple-bg-raised);
  box-shadow: var(--apple-shadow-sm);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.dashboard-help-card:hover { transform: translateY(-1px); border-color: var(--apple-line-strong); box-shadow: var(--apple-shadow-md); }
.dashboard-help-card .help-icon { color: var(--apple-blue); background: color-mix(in srgb, var(--apple-blue) 13%, transparent); }

.dashboard-main { padding: 20px 28px 52px; }
.dashboard-header { min-height: 66px; }
.dashboard-search {
  width: min(560px, 54vw);
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--apple-line);
  border-radius: 15px;
  background: var(--apple-bg-raised);
  box-shadow: var(--apple-shadow-sm);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}
.dashboard-search:focus-within { border-color: color-mix(in srgb, var(--apple-blue) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--apple-blue) 12%, transparent), var(--apple-shadow-sm); }
.dashboard-search > span { color: var(--apple-muted); font-size: 23px; transform: none; }
.dashboard-search input { color: var(--apple-text); font-size: 15px; }
.dashboard-search input::placeholder { color: color-mix(in srgb, var(--apple-muted) 78%, transparent); }
.dashboard-search kbd { color: var(--apple-muted); background: rgba(120,120,128,.10); border: 1px solid var(--apple-line); border-radius: 7px; box-shadow: none; }

.dashboard-refresh,
.dashboard-icon-button {
  min-height: 42px;
  color: var(--apple-text);
  background: var(--apple-bg-raised);
  border: 1px solid var(--apple-line);
  border-radius: 13px;
  box-shadow: var(--apple-shadow-sm);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.dashboard-refresh:hover,
.dashboard-icon-button:hover { color: var(--apple-blue); background: var(--apple-surface-solid); border-color: var(--apple-line-strong); }

.dashboard-hero {
  min-height: 292px;
  overflow: hidden;
  border: 1px solid var(--apple-line);
  border-radius: 26px;
  background:
    linear-gradient(112deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.78) 52%, rgba(242,246,255,.76) 100%);
  box-shadow: var(--apple-shadow-md);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
}
html[data-theme="dark"] .dashboard-hero {
  background: linear-gradient(118deg, rgba(28,28,30,.96) 0%, rgba(32,32,36,.91) 55%, rgba(31,36,50,.88) 100%);
}
.dashboard-hero-copy { padding: 48px 36px 38px; }
.dashboard-hero .eyebrow { color: var(--apple-blue); letter-spacing: .12em; }
.dashboard-hero h1 { max-width: 680px; margin: 11px 0 12px; font-size: clamp(34px, 4vw, 54px); line-height: .98; letter-spacing: -.055em; }
.dashboard-hero p { max-width: 650px; font-size: 15px; line-height: 1.55; }
.dashboard-primary,
.dashboard-secondary {
  min-height: 43px;
  padding: 10px 17px;
  border-radius: 12px;
  font-size: 13px;
}
.dashboard-primary {
  color: #fff;
  background: var(--apple-blue);
  border: 1px solid var(--apple-blue);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--apple-blue) 24%, transparent);
}
.dashboard-primary:hover { transform: none; background: var(--apple-blue-hover); box-shadow: 0 10px 24px color-mix(in srgb, var(--apple-blue) 28%, transparent); }
.dashboard-secondary { color: var(--apple-text); background: rgba(120,120,128,.10); border-color: transparent; }
.dashboard-secondary:hover { color: var(--apple-blue); background: rgba(120,120,128,.15); }
.dashboard-trust-row { color: var(--apple-muted); }
.dashboard-trust-row span::first-letter { color: var(--apple-green); }

.dashboard-hero-art {
  min-height: 292px;
  background:
    radial-gradient(circle at 56% 43%, rgba(255,255,255,.82), transparent 25%),
    radial-gradient(circle at 72% 42%, rgba(0,113,227,.24), transparent 42%),
    radial-gradient(circle at 34% 80%, rgba(88,86,214,.18), transparent 34%),
    linear-gradient(145deg, #f6f9ff, #edf2ff 55%, #e9e8ff);
}
html[data-theme="dark"] .dashboard-hero-art {
  background:
    radial-gradient(circle at 58% 42%, rgba(255,255,255,.12), transparent 24%),
    radial-gradient(circle at 72% 42%, rgba(10,132,255,.34), transparent 42%),
    radial-gradient(circle at 30% 80%, rgba(94,92,230,.26), transparent 34%),
    linear-gradient(145deg, #151822, #111827 55%, #18152a);
}
.hero-printer { filter: drop-shadow(0 24px 28px rgba(0,0,0,.20)); }
.printer-light, .scan-line { background: var(--apple-blue); box-shadow: 0 0 16px color-mix(in srgb, var(--apple-blue) 60%, transparent); }

.quick-start-section,
.dashboard-templates-section { margin-top: 22px; }
.quick-start-grid { gap: 12px; }
.quick-start-card {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--apple-line);
  border-radius: 18px;
  background: var(--apple-bg-raised);
  box-shadow: var(--apple-shadow-sm);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.quick-start-card:hover { transform: translateY(-2px); border-color: var(--apple-line-strong); box-shadow: var(--apple-shadow-md); }
.quick-icon { border-radius: 13px; }
.quick-icon.orange, .quick-icon.amber { color: var(--apple-blue); background: color-mix(in srgb, var(--apple-blue) 12%, transparent); border-color: color-mix(in srgb, var(--apple-blue) 20%, transparent); }
.quick-icon.green { color: var(--apple-green); background: color-mix(in srgb, var(--apple-green) 12%, transparent); }
.quick-icon.blue { color: var(--apple-indigo); background: color-mix(in srgb, var(--apple-indigo) 12%, transparent); }
.quick-icon.violet { color: #af52de; background: rgba(175,82,222,.12); }
.quick-arrow { color: var(--apple-muted); background: rgba(120,120,128,.10); border: 0; border-radius: 50%; }

.dashboard-templates-head h2 { letter-spacing: -.025em; }
.dashboard-templates-head h2 span { color: var(--apple-muted); background: rgba(120,120,128,.10); border: 0; }
.sort-segmented,
.view-segmented {
  padding: 3px;
  border: 0;
  border-radius: 11px;
  background: rgba(120,120,128,.11);
}
.sort-segmented button,
.view-segmented button { min-height: 31px; border-radius: 8px; }
.sort-segmented button.active,
.view-segmented button.active { color: var(--apple-text); background: var(--apple-surface-solid); box-shadow: 0 1px 5px rgba(0,0,0,.10); }

.dashboard-template-grid { gap: 16px; }
.dashboard-template-card {
  overflow: hidden;
  border: 1px solid var(--apple-line);
  border-radius: 20px;
  background: var(--apple-bg-raised);
  box-shadow: var(--apple-shadow-sm);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.dashboard-template-card:hover { transform: translateY(-3px); border-color: var(--apple-line-strong); box-shadow: var(--apple-shadow-md); }
.dashboard-template-thumb { background: linear-gradient(160deg, #fafafa, #f1f1f4); }
html[data-theme="dark"] .dashboard-template-thumb { background: linear-gradient(160deg, #252527, #1c1c1e); }
.dashboard-template-card .template-category { color: var(--apple-blue); background: color-mix(in srgb, var(--apple-blue) 10%, transparent); border: 0; }

/* Editor application shell */
body.editor-active {
  color: var(--apple-text);
  background:
    radial-gradient(circle at 25% 0%, rgba(0,113,227,.07), transparent 26%),
    var(--apple-bg);
}

body.editor-active .editor-titlebar {
  height: 58px;
  min-height: 58px;
  padding: 8px 12px;
  color: var(--apple-text);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--apple-line);
  box-shadow: 0 1px 0 rgba(255,255,255,.50);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
}
html[data-theme="dark"] body.editor-active .editor-titlebar {
  color: var(--apple-text);
  background: rgba(28,28,30,.78);
  border-bottom-color: var(--apple-line);
}
.editor-title-left { gap: 9px; }
.editor-project-brand { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--apple-shadow-sm); }
.editor-project-title strong { color: var(--apple-text); font-size: 14px; letter-spacing: -.015em; }
.editor-project-title small { color: var(--apple-muted); font-size: 10px; }
.unsaved-state { color: var(--apple-orange); }
.unsaved-state.saved { color: var(--apple-green); }

body.editor-active .editor-titlebar .title-action,
body.editor-active .editor-titlebar .title-icon-button {
  min-height: 34px;
  color: var(--apple-text);
  background: rgba(120,120,128,.09);
  border: 1px solid transparent;
  border-radius: 10px;
}
body.editor-active .editor-titlebar .title-icon-button { width: 36px; }
body.editor-active .editor-titlebar .title-action { padding: 7px 12px; }
body.editor-active .editor-titlebar .title-action:hover,
body.editor-active .editor-titlebar .title-icon-button:hover { color: var(--apple-blue); background: rgba(120,120,128,.14); border-color: transparent; }
body.editor-active .editor-titlebar .title-action-strong { color: #fff; background: var(--apple-blue); }
body.editor-active .editor-titlebar .title-action-strong:hover { color: #fff; background: var(--apple-blue-hover); }
body.editor-active .editor-titlebar .title-action-done { color: #fff; background: var(--apple-green); }
body.editor-active .editor-titlebar .title-action-done:hover { color: #fff; background: color-mix(in srgb, var(--apple-green) 88%, #000); }
body.editor-active .editor-titlebar .title-action-export { color: #fff; background: var(--apple-indigo); border-color: transparent; }

body.editor-active .app-shell {
  height: calc(100vh - 58px);
  grid-template-columns: 258px minmax(440px,1fr) 340px;
  gap: 12px;
  padding: 12px;
  background: transparent;
}
body.editor-active .left-panel,
body.editor-active .right-panel,
body.editor-active .workspace {
  overflow: hidden;
  border: 1px solid var(--apple-line);
  border-radius: 18px;
  background: var(--apple-surface);
  box-shadow: var(--apple-shadow-sm);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}
body.editor-active .left-panel { border-right: 1px solid var(--apple-line); }
body.editor-active .right-panel { padding: 0; border-left: 1px solid var(--apple-line); }

.my-works-panel {
  min-height: 158px;
  max-height: 232px;
  background: transparent;
  border-bottom: 1px solid var(--apple-line);
}
.my-works-heading {
  height: 42px;
  padding: 0 12px;
  color: var(--apple-muted);
  background: rgba(120,120,128,.06);
  border-bottom: 1px solid var(--apple-line);
  font-size: 10px;
  letter-spacing: .08em;
}
.my-works-heading button { color: var(--apple-muted); border-radius: 9px; }
.my-works-heading button:hover { color: var(--apple-blue); background: rgba(120,120,128,.10); }
.my-works-list { padding: 8px; gap: 7px; }
.my-works-empty { color: var(--apple-muted); }
.my-work-item {
  padding: 8px;
  color: var(--apple-text);
  background: rgba(255,255,255,.66);
  border: 1px solid var(--apple-line);
  border-radius: 12px;
  box-shadow: none;
}
html[data-theme="dark"] .my-work-item { background: rgba(44,44,46,.62); }
.my-work-item:hover { color: var(--apple-text); border-color: color-mix(in srgb, var(--apple-blue) 35%, transparent); background: color-mix(in srgb, var(--apple-blue) 7%, var(--apple-surface-solid)); }
.my-work-item .work-thumb { border-radius: 8px; background: var(--surface-3); }
.my-work-item small { color: var(--apple-muted); }

body.editor-active .tabs {
  position: static;
  gap: 3px;
  padding: 6px;
  background: rgba(120,120,128,.08);
  border-bottom: 1px solid var(--apple-line);
}
body.editor-active .tab {
  min-width: 67px;
  padding: 8px 6px;
  color: var(--apple-muted);
  border-radius: 9px;
  font-size: 10px;
}
body.editor-active .tab:hover { color: var(--apple-text); background: rgba(120,120,128,.08); }
body.editor-active .tab.active {
  color: var(--apple-text);
  background: var(--apple-surface-solid);
  box-shadow: 0 1px 5px rgba(0,0,0,.10);
}
body.editor-active .panel { padding: 14px; }

body.editor-active .workspace {
  grid-template-rows: 66px minmax(0,1fr) 38px;
  background: var(--apple-surface);
}
.editor-tool-ribbon {
  height: 66px;
  padding: 7px 10px;
  gap: 10px;
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid var(--apple-line);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}
html[data-theme="dark"] .editor-tool-ribbon { background: rgba(28,28,30,.78); }
.editor-tools-primary, .editor-tools-secondary { gap: 5px; }
.editor-tool {
  min-width: 48px;
  height: 50px;
  padding: 5px 8px;
  color: var(--apple-muted);
  border-radius: 11px;
}
.editor-tool span { font-size: 17px; }
.editor-tool small { font-size: 9px; font-weight: 650; }
.editor-tool:hover { color: var(--apple-text); background: rgba(120,120,128,.10); }
.editor-tool.active {
  color: var(--apple-blue);
  background: color-mix(in srgb, var(--apple-blue) 12%, transparent);
  border-color: transparent;
  box-shadow: none;
}
.tool-divider { height: 32px; background: var(--apple-line); }
.editor-icon-tool {
  min-width: 37px;
  height: 37px;
  color: var(--apple-text);
  background: rgba(120,120,128,.09);
  border: 1px solid transparent;
  border-radius: 10px;
}
.editor-icon-tool:hover,
.editor-icon-tool.active { color: var(--apple-blue); background: color-mix(in srgb, var(--apple-blue) 11%, transparent); border-color: transparent; }
.editor-zoom {
  overflow: hidden;
  grid-template-columns: 31px 58px 31px;
  border: 0;
  border-radius: 10px;
  background: rgba(120,120,128,.10);
}
.editor-zoom button,
.editor-zoom span { color: var(--apple-text); background: transparent; border-color: var(--apple-line); }
.editor-live-status { color: var(--apple-muted); }
.status-dot { background: var(--apple-green); }

.canvas-area {
  padding: 58px 58px 70px;
  background-color: #e9e9ee;
  background-image:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.68), transparent 46%),
    linear-gradient(135deg, rgba(255,255,255,.30), transparent 50%);
}
html[data-theme="dark"] .canvas-area {
  background-color: #101012;
  background-image:
    radial-gradient(circle at 50% 44%, rgba(255,255,255,.055), transparent 46%),
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 50%);
}
.canvas-area.grid-enabled::before {
  inset: 0;
  background-image:
    linear-gradient(rgba(60,60,67,.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60,60,67,.075) 1px, transparent 1px);
  opacity: .72;
}
html[data-theme="dark"] .canvas-area.grid-enabled::before {
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
}
.canvas-ruler {
  background-color: rgba(255,255,255,.80);
  border-color: var(--apple-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
html[data-theme="dark"] .canvas-ruler { background-color: rgba(28,28,30,.86); border-color: var(--apple-line); }
.canvas-ruler-horizontal {
  background-image: repeating-linear-gradient(90deg, transparent 0 19px, rgba(60,60,67,.25) 19px 20px, transparent 20px 99px, rgba(60,60,67,.5) 99px 100px);
}
.canvas-ruler-vertical {
  background-image: repeating-linear-gradient(180deg, transparent 0 19px, rgba(60,60,67,.25) 19px 20px, transparent 20px 99px, rgba(60,60,67,.5) 99px 100px);
}
.canvas-hint {
  top: 39px;
  color: var(--apple-muted);
  background: var(--apple-bg-raised);
  border: 1px solid var(--apple-line);
  border-radius: 999px;
  box-shadow: var(--apple-shadow-sm);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.preview-mount { filter: drop-shadow(0 24px 38px rgba(0,0,0,.18)); }
.preview-mount svg {
  width: min(760px,57vw);
  max-height: 68vh;
  border: 1px solid rgba(60,60,67,.15);
  border-radius: 4px;
  background: #fff;
}
.selection-overlay .selection-box { stroke: var(--apple-blue); stroke-width: 2.3; stroke-dasharray: 7 4; }
.selection-overlay .resize-handle { fill: #fff; stroke: var(--apple-blue); stroke-width: 2.4; filter: drop-shadow(0 1px 2px rgba(0,0,0,.20)); }

body.editor-active .bottom-strip {
  height: 38px;
  padding: 6px 12px;
  color: var(--apple-muted);
  background: rgba(255,255,255,.72);
  border-top: 1px solid var(--apple-line);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
html[data-theme="dark"] body.editor-active .bottom-strip { background: rgba(28,28,30,.82); }
body.editor-active .bottom-strip strong { color: var(--apple-text); font-size: 10px; }
body.editor-active .bottom-strip span,
body.editor-active .validation { font-size: 9px; }

.inspector-tabs {
  position: sticky;
  top: 0;
  height: 54px;
  gap: 4px;
  padding: 6px;
  background: rgba(120,120,128,.08);
  border-bottom: 1px solid var(--apple-line);
}
.inspector-tabs button {
  color: var(--apple-muted);
  border: 0;
  border-radius: 10px;
  font-size: 9px;
}
.inspector-tabs button span { font-size: 15px; }
.inspector-tabs button:hover { color: var(--apple-text); background: rgba(120,120,128,.08); }
.inspector-tabs button.active {
  color: var(--apple-text);
  background: var(--apple-surface-solid);
  border-bottom-color: transparent;
  box-shadow: 0 1px 5px rgba(0,0,0,.10);
}
.inspector-panel { padding: 14px; }
.inspector-heading { padding: 4px 0 12px; border-bottom: 1px solid var(--apple-line); }
.inspector-heading h2 { color: var(--apple-text); font-size: 17px; letter-spacing: -.025em; }
.inspector-heading p { color: var(--apple-muted); font-size: 10px; line-height: 1.35; }
.inspector-badge { color: var(--apple-blue); background: color-mix(in srgb, var(--apple-blue) 11%, transparent); font-size: 9px; }
.property-section { border-color: var(--apple-line); }
.position-grid { gap: 7px; }
.position-grid label,
.color-field-row label,
.inspector-form label { color: var(--apple-muted); font-size: 9px; letter-spacing: .02em; }
.position-grid input,
.inspector-form input,
.inspector-form select,
body.editor-active input,
body.editor-active select,
body.editor-active textarea {
  color: var(--apple-text);
  background: rgba(120,120,128,.08);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(120,120,128,.03);
}
.position-grid input:focus,
.inspector-form input:focus,
.inspector-form select:focus,
body.editor-active input:focus,
body.editor-active select:focus,
body.editor-active textarea:focus {
  background: var(--apple-surface-solid);
  border-color: color-mix(in srgb, var(--apple-blue) 48%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--apple-blue) 12%, transparent);
  outline: 0;
}
body.editor-active input[type="range"] { accent-color: var(--apple-blue); }
body.editor-active input[type="checkbox"] { accent-color: var(--apple-blue); }
.color-field-row input[type="color"] { border-radius: 10px; background: rgba(120,120,128,.08); }
.editor-layer-row {
  padding: 8px;
  background: rgba(120,120,128,.06);
  border: 1px solid transparent;
  border-radius: 12px;
}
.editor-layer-row:hover { background: rgba(120,120,128,.10); }
.editor-layer-row.active { border-color: color-mix(in srgb, var(--apple-blue) 40%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--apple-blue) 9%, transparent); }
.editor-layer-row .layer-type { color: var(--apple-blue); background: color-mix(in srgb, var(--apple-blue) 10%, transparent); border-radius: 8px; }
.editor-layer-select { color: var(--apple-text); }
.editor-layer-select small,
.inspector-switch small { color: var(--apple-muted); }
.editor-layer-eye { color: var(--apple-muted); border-radius: 9px; }
.editor-layer-eye:hover { color: var(--apple-blue); background: rgba(120,120,128,.10); }
.inspector-switch { border-color: var(--apple-line); border-radius: 13px; background: rgba(120,120,128,.05); }

body.editor-active .card,
body.editor-active .section-card,
body.editor-active .export-card,
body.editor-active .file-drop {
  border: 1px solid var(--apple-line);
  border-radius: 14px;
  background: rgba(255,255,255,.58);
  box-shadow: none;
}
html[data-theme="dark"] body.editor-active .card,
html[data-theme="dark"] body.editor-active .section-card,
html[data-theme="dark"] body.editor-active .export-card,
html[data-theme="dark"] body.editor-active .file-drop { background: rgba(44,44,46,.55); }

.button {
  border-radius: 10px;
  font-weight: 650;
}
.button.primary { background: var(--apple-blue); border-color: var(--apple-blue); }
.button.primary:hover { background: var(--apple-blue-hover); }
.button.subtle { color: var(--apple-text); background: rgba(120,120,128,.09); border-color: transparent; }
.button.subtle:hover { color: var(--apple-blue); background: rgba(120,120,128,.14); border-color: transparent; }
.switch span { background: rgba(120,120,128,.25); }
.switch input:checked + span { background: var(--apple-green); }

/* Dialogs */
dialog {
  color: var(--apple-text);
  background: var(--apple-bg-raised);
  border: 1px solid var(--apple-line);
  border-radius: 22px;
  box-shadow: var(--apple-shadow-lg);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
}
dialog::backdrop { background: rgba(0,0,0,.28); backdrop-filter: blur(8px); }
.dialog-head { border-bottom-color: var(--apple-line); }
.icon-button { color: var(--apple-muted); background: rgba(120,120,128,.10); border-radius: 50%; }
.icon-button:hover { color: var(--apple-text); background: rgba(120,120,128,.16); }

/* Responsive refinements */
@media (max-width: 1240px) {
  .dashboard-view { grid-template-columns: 244px minmax(0,1fr); }
  .dashboard-main { padding-inline: 20px; }
  body.editor-active .app-shell { grid-template-columns: 224px minmax(390px,1fr) 302px; gap: 9px; padding: 9px; }
}

@media (max-width: 980px) {
  .dashboard-view { display: block; }
  .dashboard-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--apple-line);
  }
  .dashboard-brand { margin: 0; }
  .dashboard-nav { display: flex; overflow-x: auto; gap: 5px; margin-left: 10px; }
  .dashboard-nav-item, .dashboard-category { width: auto; min-width: max-content; padding-inline: 12px; }
  .dashboard-main { padding: 14px 15px 38px; }
  .dashboard-header { min-height: 58px; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .dashboard-hero-art { min-height: 230px; }

  body.editor-active .app-shell {
    height: auto;
    min-height: calc(100vh - 58px);
    grid-template-columns: 224px minmax(0,1fr);
    grid-template-areas: "left work" "right work";
    align-items: start;
    overflow: auto;
  }
  body.editor-active .left-panel { grid-area: left; max-height: calc(100vh - 76px); }
  body.editor-active .workspace { grid-area: work; min-height: calc(100vh - 76px); }
  body.editor-active .right-panel { grid-area: right; max-height: 720px; }
}

@media (max-width: 720px) {
  body.editor-active { overflow: auto; }
  body.editor-active .editor-titlebar {
    position: sticky;
    top: 0;
    z-index: 80;
    height: auto;
    min-height: 58px;
    padding: 7px 8px;
    gap: 7px;
    flex-wrap: nowrap;
  }
  .editor-project-title small { display: none; }
  .editor-title-actions { min-width: 0; overflow-x: auto; padding-bottom: 2px; }
  body.editor-active .editor-titlebar .title-action { min-width: max-content; padding-inline: 10px; }
  body.editor-active .app-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    min-height: 0;
  }
  body.editor-active .workspace {
    order: 0;
    width: 100%;
    height: 540px;
    min-height: 540px;
    grid-template-rows: 56px minmax(0,1fr) 36px;
  }
  body.editor-active .left-panel { order: 1; width: 100%; max-height: none; }
  body.editor-active .right-panel { order: 2; width: 100%; max-height: none; }
  .editor-tool-ribbon { height: 56px; overflow-x: auto; justify-content: flex-start; }
  .editor-tools-primary { flex: 0 0 auto; }
  .editor-tools-secondary { flex: 0 0 auto; margin-left: 0; }
  .editor-tool { min-width: 42px; height: 42px; }
  .editor-tool small { display: none; }
  .canvas-area { padding: 48px 12px 48px 34px; }
  .preview-mount svg { width: min(760px, 82vw); max-height: 64vh; }

  .dashboard-main { padding-inline: 10px; }
  .dashboard-header { gap: 8px; }
  .dashboard-search { width: 100%; }
  .dashboard-refresh { display: none; }
  .dashboard-hero { border-radius: 22px; }
  .dashboard-hero-copy { padding: 32px 22px 26px; }
  .dashboard-hero h1 { font-size: 34px; }
  .dashboard-hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .quick-start-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .dashboard-hero h1 { font-size: 31px; }
  .dashboard-hero p { font-size: 13px; }
  .dashboard-hero-actions { grid-template-columns: 1fr; }
  .dashboard-template-grid { grid-template-columns: 1fr; }
  .dashboard-template-controls > span { display: none; }
  .sort-segmented button { padding-inline: 9px; }
  .editor-project-brand { width: 30px; height: 30px; }
  .editor-project-title strong { max-width: 120px; font-size: 12px; }
  body.editor-active .workspace { height: 500px; min-height: 500px; }
  .canvas-hint { display: none; }
  .position-grid-five { grid-template-columns: repeat(2,1fr); }
  .inspector-form.two-column { grid-template-columns: 1fr; }
}


/* ===== Advanced project, menu, multi-select and settings update ===== */
svg { vector-effect: non-scaling-stroke; }
.title-icon-button svg, .title-action svg, .dashboard-icon-button svg, .dashboard-refresh svg,
.editor-tool svg, .canvas-drop-overlay svg, .project-dialog-toolbar svg, .layer-action svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.title-action-export { display:flex; align-items:center; gap:6px; }
.dashboard-refresh { display:flex; align-items:center; gap:7px; }
.dashboard-refresh svg { width:16px; height:16px; }
.dashboard-icon-button svg { width:19px; height:19px; }
.editor-tool span > svg { width:21px; height:21px; }

.editor-menubar {
  position: relative; z-index: 75; height: 34px; min-height: 34px; display:flex; align-items:center;
  gap:2px; padding:0 12px; color:var(--apple-text); background:rgba(255,255,255,.82);
  border-bottom:1px solid var(--apple-line); -webkit-backdrop-filter:blur(24px); backdrop-filter:blur(24px);
}
html[data-theme="dark"] .editor-menubar { background:rgba(28,28,30,.84); }
.app-menu { position:relative; height:100%; display:flex; align-items:center; }
.app-menu-button { height:28px; padding:0 10px; color:inherit; background:transparent; border:0; border-radius:8px; font-size:12px; font-weight:600; }
.app-menu-button:hover, .app-menu.open .app-menu-button { color:var(--apple-blue); background:rgba(120,120,128,.13); }
.app-menu-popover {
  position:absolute; left:0; top:31px; z-index:200; display:none; width:230px; padding:6px;
  color:var(--apple-text); background:var(--apple-bg-raised); border:1px solid var(--apple-line);
  border-radius:13px; box-shadow:var(--apple-shadow-lg); -webkit-backdrop-filter:blur(28px); backdrop-filter:blur(28px);
}
.app-menu.open .app-menu-popover { display:grid; }
.app-menu-popover button { display:flex; justify-content:space-between; align-items:center; gap:18px; width:100%; padding:8px 9px; color:inherit; background:transparent; border:0; border-radius:8px; font-size:12px; text-align:left; }
.app-menu-popover button:hover { color:#fff; background:var(--apple-blue); }
.app-menu-popover kbd { color:var(--apple-muted); font:10px ui-monospace,monospace; }
.app-menu-popover button:hover kbd { color:rgba(255,255,255,.75); }
.menu-separator { height:1px; margin:4px 6px; background:var(--apple-line); }
body.editor-active .app-shell { height:calc(100vh - 92px); }

.canvas-drop-overlay { position:absolute; inset:18px; z-index:40; display:none; place-content:center; justify-items:center; gap:8px; padding:24px; color:var(--apple-blue); background:color-mix(in srgb,var(--apple-blue) 10%,var(--apple-bg-raised)); border:2px dashed var(--apple-blue); border-radius:18px; text-align:center; pointer-events:none; }
.canvas-drop-overlay svg { width:34px; height:34px; }
.canvas-drop-overlay span { max-width:420px; color:var(--apple-muted); font-size:12px; }
.canvas-area.drop-active .canvas-drop-overlay { display:grid; }

.selection-box.multi { stroke-dasharray:8 6; }
.multi-selection-box { fill:rgba(0,113,227,.05); stroke:var(--apple-blue); stroke-width:2; stroke-dasharray:8 6; pointer-events:none; }
.marquee-selection { fill:rgba(0,113,227,.12); stroke:var(--apple-blue); stroke-width:1.5; stroke-dasharray:6 4; pointer-events:none; }
g.editor-selected > * { filter:none; }

.editor-layer-row { grid-template-columns:28px minmax(0,1fr) auto; }
.layer-actions { display:flex; align-items:center; gap:2px; }
.layer-action { width:28px; height:28px; display:grid; place-items:center; padding:0; color:var(--apple-muted); background:transparent; border:0; border-radius:8px; }
.layer-action:hover { color:var(--apple-blue); background:rgba(120,120,128,.12); }
.layer-action.delete:hover { color:var(--danger); }
.layer-action svg { width:15px; height:15px; }
.editor-layer-row.active { box-shadow:inset 3px 0 0 var(--apple-blue); }
.editor-layer-row.multi-active { background:color-mix(in srgb,var(--apple-blue) 8%,transparent); }

.custom-barcode-editor { display:grid; gap:9px; margin:10px 0; padding:12px; background:rgba(120,120,128,.07); border:1px solid var(--apple-line); border-radius:13px; }
.custom-barcode-editor.hidden { display:none; }

.projects-dialog { width:min(1040px,94vw); max-width:none; max-height:88vh; }
.project-dialog-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; border-bottom:1px solid var(--apple-line); }
.project-dialog-toolbar label { flex:1; max-width:460px; display:flex; align-items:center; gap:8px; padding:0 11px; background:rgba(120,120,128,.09); border:1px solid transparent; border-radius:11px; }
.project-dialog-toolbar label:focus-within { border-color:color-mix(in srgb,var(--apple-blue) 45%,transparent); box-shadow:0 0 0 3px color-mix(in srgb,var(--apple-blue) 14%,transparent); }
.project-dialog-toolbar input { width:100%; min-height:38px; color:inherit; background:transparent; border:0; outline:0; }
.project-library { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; max-height:65vh; padding:16px; overflow:auto; }
.project-card { display:grid; overflow:hidden; color:var(--apple-text); background:rgba(120,120,128,.06); border:1px solid var(--apple-line); border-radius:16px; }
.project-card.active { border-color:var(--apple-blue); box-shadow:0 0 0 3px color-mix(in srgb,var(--apple-blue) 12%,transparent); }
.project-thumb { height:132px; display:grid; place-items:center; padding:12px; background:linear-gradient(145deg,#f7f7f8,#ececf0); }
html[data-theme="dark"] .project-thumb { background:linear-gradient(145deg,#28282b,#1e1e20); }
.project-thumb svg { max-width:100%; max-height:100%; }
.project-meta { display:grid; gap:4px; padding:12px 13px 8px; }
.project-meta strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-meta small { color:var(--apple-muted); }
.project-actions { display:flex; justify-content:flex-end; gap:5px; padding:0 9px 10px; }
.project-actions button { display:grid; place-items:center; min-width:34px; height:32px; padding:0 9px; color:var(--apple-muted); background:rgba(120,120,128,.09); border:0; border-radius:9px; }
.project-actions button.primary-action { width:auto; color:#fff; background:var(--apple-blue); }
.project-actions button:hover { color:var(--apple-blue); background:rgba(120,120,128,.14); }
.project-actions button.danger:hover { color:var(--danger); }
.project-actions svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.settings-dialog { width:min(760px,94vw); max-width:none; }
.settings-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:16px 18px; }
.settings-grid section { display:grid; align-content:start; gap:11px; padding:14px; background:rgba(120,120,128,.06); border:1px solid var(--apple-line); border-radius:15px; }
.settings-grid h3 { margin:0 0 3px; font-size:14px; }
.settings-grid label { display:grid; gap:6px; color:var(--apple-muted); font-size:11px; }
.settings-grid select, .settings-grid input[type="number"] { min-height:38px; padding:8px 10px; color:var(--apple-text); background:var(--apple-surface-solid); border:1px solid var(--apple-line); border-radius:10px; }
.setting-switch { grid-template-columns:1fr auto !important; align-items:center; }
.setting-switch span { display:grid; gap:2px; }
.setting-switch strong { color:var(--apple-text); font-size:12px; }
.setting-switch small { color:var(--apple-muted); font-size:10px; }
.setting-switch input { width:40px; height:23px; accent-color:var(--apple-green); }

@media (max-width:980px) {
  body.editor-active .app-shell { min-height:calc(100vh - 92px); }
  .project-library { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .settings-grid { grid-template-columns:1fr; }
}
@media (max-width:720px) {
  .editor-menubar { position:sticky; top:58px; overflow-x:auto; z-index:79; }
  .app-menu { flex:0 0 auto; }
  .app-menu-popover { position:fixed; left:10px; right:10px; top:94px; width:auto; }
  .project-library { grid-template-columns:1fr; }
  .project-dialog-toolbar { align-items:stretch; flex-direction:column; }
  .project-dialog-toolbar label { max-width:none; }
  body.editor-active .app-shell { min-height:0; }
}


/* Restored professional selection appearance */
.preview-mount g.editor-selected {
  filter: none !important;
  opacity: 1 !important;
}
.selection-overlay {
  pointer-events: none;
}
.selection-overlay .selection-box.single-selection {
  fill: none;
  stroke: #0a84ff;
  stroke-width: 2.5;
  stroke-dasharray: none;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.selection-overlay .resize-handle {
  pointer-events: all;
  fill: #ffffff;
  stroke: #0a84ff;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.20));
}
.selection-box.item-selection {
  fill: rgba(10,132,255,.025);
  stroke: #0a84ff;
  stroke-width: 2;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.multi-selection-box {
  fill: rgba(10,132,255,.045);
  stroke: #0a84ff;
  stroke-width: 2.25;
  stroke-dasharray: 9 6;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
html[data-theme="dark"] .selection-overlay .resize-handle {
  fill: #f5f5f7;
}


/* Data menu, touch gestures, support contacts and custom canvas */
.icon-menu { min-width: 285px; }
.icon-menu > button { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:10px; padding:9px 12px; }
.icon-menu > button > span:last-child { display:grid; text-align:left; }
.icon-menu > button strong { font-size:12px; color:inherit; }
.icon-menu > button small { margin-top:2px; color:var(--muted); font-size:10px; font-weight:550; }
.menu-item-icon { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; color:#0a84ff; background:rgba(10,132,255,.1); }
.menu-item-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.label-stage { touch-action:none; }
.canvas-area.gesture-active .canvas-hint { opacity:1; border-color:#0a84ff; color:#0a84ff; }

.support-contact-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:18px 0 4px; }
.support-contact-grid > a { min-width:0; display:flex; align-items:center; gap:11px; padding:13px; border:1px solid var(--line); border-radius:15px; color:var(--text); background:var(--surface-2); text-decoration:none; transition:transform .15s ease,border-color .15s ease,background .15s ease; }
.support-contact-grid > a:hover { transform:translateY(-1px); border-color:#0a84ff; background:rgba(10,132,255,.06); }
.support-contact-grid > a > span:last-child { min-width:0; display:grid; }
.support-contact-grid strong { font-size:12px; }
.support-contact-grid small { overflow:hidden; margin-top:3px; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.support-contact-icon { width:34px; height:34px; flex:0 0 auto; display:grid; place-items:center; border-radius:11px; color:#0a84ff; background:rgba(10,132,255,.1); }
.support-contact-icon svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.data-view-dialog { width:min(1180px,calc(100vw - 30px)); max-width:none; }
.data-view-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.data-view-toolbar .button { display:flex; align-items:center; gap:6px; }
.data-view-toolbar .button svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#dataViewCount { margin-left:auto; color:var(--muted); font-size:11px; font-weight:700; }
.data-table-wrap { max-height:min(58vh,560px); overflow:auto; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.data-view-table { width:100%; min-width:960px; border-collapse:separate; border-spacing:0; }
.data-view-table th { position:sticky; top:0; z-index:2; padding:10px 8px; color:var(--muted); background:var(--surface-2); border-bottom:1px solid var(--line); font-size:10px; text-align:left; text-transform:uppercase; letter-spacing:.05em; }
.data-view-table td { padding:6px; border-bottom:1px solid var(--line); }
.data-view-table tr:last-child td { border-bottom:0; }
.data-view-table input,.data-view-table select { width:100%; min-height:34px; padding:6px 8px; border:1px solid transparent; border-radius:8px; color:var(--text); background:transparent; font-size:11px; }
.data-view-table input:focus,.data-view-table select:focus { outline:0; border-color:#0a84ff; background:var(--surface-2); box-shadow:0 0 0 3px rgba(10,132,255,.1); }
.data-row-number { width:38px; color:var(--muted); text-align:center; font-size:11px; font-weight:700; }
.data-row-delete { width:32px; height:32px; display:grid; place-items:center; border:0; border-radius:8px; color:#ff453a; background:transparent; }
.data-row-delete:hover { background:rgba(255,69,58,.1); }
.data-row-delete svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.data-view-empty { padding:38px!important; color:var(--muted); text-align:center; }

.custom-canvas-dialog { width:min(820px,calc(100vw - 30px)); max-width:none; }
.custom-canvas-layout { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(240px,.85fr); gap:20px; }
.custom-canvas-form { display:grid; gap:13px; }
.custom-canvas-form label { display:grid; gap:6px; color:var(--muted); font-size:11px; font-weight:700; }
.custom-canvas-form input,.custom-canvas-form select { min-height:40px; padding:8px 10px; border:1px solid var(--line); border-radius:11px; color:var(--text); background:var(--surface-2); }
.custom-canvas-form fieldset { margin:0; padding:0; border:0; }
.custom-canvas-form legend { margin-bottom:7px; color:var(--muted); font-size:11px; font-weight:700; }
.orientation-options { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.orientation-options label { position:relative; }
.orientation-options input { position:absolute; opacity:0; pointer-events:none; }
.orientation-options span { min-height:72px; display:grid; place-items:center; gap:5px; padding:10px; border:1px solid var(--line); border-radius:12px; color:var(--muted); background:var(--surface-2); cursor:pointer; }
.orientation-options svg { width:34px; height:25px; fill:none; stroke:currentColor; stroke-width:1.8; }
.orientation-options input:checked + span { color:#0a84ff; border-color:#0a84ff; background:rgba(10,132,255,.08); box-shadow:0 0 0 3px rgba(10,132,255,.08); }
.custom-canvas-form .two-column { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.custom-canvas-preview { min-height:310px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:13px; padding:20px; border:1px solid var(--line); border-radius:16px; background:radial-gradient(circle at 1px 1px,var(--line) 1px,transparent 0) 0 0/18px 18px,var(--surface-2); }
.custom-canvas-preview > span { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
#customCanvasPreviewShape { width:210px; height:120px; border:2px solid #111; border-radius:10px; background:#fff; box-shadow:0 16px 36px rgba(0,0,0,.12); transition:width .2s ease,height .2s ease,background .2s ease,border-color .2s ease; }
#customCanvasPreviewSize { color:var(--muted); font-size:11px; font-weight:700; }

@media (max-width:760px) {
  .support-contact-grid { grid-template-columns:1fr; }
  .custom-canvas-layout { grid-template-columns:1fr; }
  .custom-canvas-preview { min-height:220px; }
  .data-view-dialog { width:calc(100vw - 12px); }
}
.custom-canvas-form .setting-switch { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.custom-canvas-form .setting-switch > span { display:grid; gap:3px; }
.custom-canvas-form .setting-switch input[type="checkbox"] { width:22px; height:22px; min-height:0; padding:0; accent-color:#0a84ff; }


/* Menubar quick controls moved to top */
.editor-menubar {
  position: relative;
  z-index: 75;
  min-height: 58px;
  height: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: nowrap;
}
.editor-menubar-spacer { flex: 1 1 auto; min-width: 8px; }
.editor-menubar-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.editor-menubar .editor-tools-primary.top-inline,
.editor-menubar .editor-tools-secondary.top-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.editor-menubar .editor-tools-primary.top-inline {
  padding: 4px 8px;
  background: rgba(120,120,128,.08);
  border: 1px solid var(--apple-line);
  border-radius: 14px;
}
.editor-menubar .editor-tools-secondary.top-inline {
  padding: 4px 8px;
  background: rgba(120,120,128,.08);
  border: 1px solid var(--apple-line);
  border-radius: 14px;
}
.editor-menubar .editor-tool {
  min-width: 56px;
  height: 52px;
  border-radius: 14px;
}
.editor-menubar .editor-tool.compact { min-width: 52px; }
.editor-menubar .workspace-status.editor-live-status {
  margin: 0;
  padding: 0 2px;
  white-space: nowrap;
}
.editor-menubar .editor-icon-tool { height: 44px; min-width: 44px; }
.editor-menubar .editor-zoom { height: 44px; }
.editor-menubar .tool-divider { height: 34px; }
body.editor-active .app-shell { height: calc(100vh - 116px); }

@media (max-width: 1320px) {
  .editor-menubar {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 8px;
  }
  .editor-menubar-spacer { display:none; }
  .editor-menubar-tools {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}
@media (max-width: 720px) {
  .editor-menubar {
    position: sticky;
    top: 58px;
    padding: 8px 10px;
    overflow-x: visible;
  }
  .editor-menubar-tools {
    gap: 8px;
    justify-content: flex-start;
  }
  .editor-menubar .editor-tools-primary.top-inline,
  .editor-menubar .editor-tools-secondary.top-inline {
    overflow-x: auto;
    max-width: 100%;
  }
  body.editor-active .app-shell { min-height: calc(100vh - 138px); }
}


/* Fix editor workspace after moving toolbar to menubar */
body.editor-active .workspace {
  grid-template-rows: minmax(0,1fr) 48px;
}

/* Remove dock look from top inline controls and make them icon-first */
.editor-menubar {
  min-height: 48px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.editor-menubar-tools {
  gap: 12px;
}
.editor-menubar .editor-tools-primary.top-inline,
.editor-menubar .editor-tools-secondary.top-inline {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.editor-menubar .editor-tool {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  gap: 0;
}
.editor-menubar .editor-tool small {
  display: none;
}
.editor-menubar .editor-tool span {
  font-size: 18px;
  line-height: 1;
}
.editor-menubar .editor-tool.compact {
  min-width: 42px;
  width: 42px;
}
.editor-menubar .editor-tool:hover,
.editor-menubar .editor-tool.active,
.editor-menubar .editor-icon-tool:hover,
.editor-menubar .editor-icon-tool.active {
  background: rgba(120,120,128,.14);
  border-color: rgba(120,120,128,.18);
}
.editor-menubar .editor-live-status {
  padding: 0;
  font-size: 12px;
}
.editor-menubar .editor-icon-tool {
  min-width: 42px;
  width: auto;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
}
.editor-menubar .editor-zoom {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(120,120,128,.08);
  border: 1px solid var(--apple-line);
}
.editor-menubar .editor-zoom button,
.editor-menubar .editor-zoom span {
  height: 42px;
  display: grid;
  place-items: center;
}
.editor-menubar .editor-zoom span {
  min-width: 60px;
}
.editor-menubar .tool-divider {
  height: 26px;
  opacity: .55;
}

@media (max-width: 1320px) {
  .editor-menubar { min-height: auto; }
  body.editor-active .workspace { grid-template-rows: minmax(0,1fr) 48px; }
}
@media (max-width: 720px) {
  .editor-menubar .editor-tool,
  .editor-menubar .editor-tool.compact,
  .editor-menubar .editor-icon-tool { min-width: 38px; width: 38px; height: 38px; }
  .editor-menubar .editor-zoom button,
  .editor-menubar .editor-zoom span { height: 38px; }
  .editor-menubar .editor-zoom span { min-width: 52px; }
}


/* =========================================================
   Theme-aware application scrollbars
   ========================================================= */
:root {
  --scrollbar-size: 10px;
  --scrollbar-track: rgba(120, 120, 128, .08);
  --scrollbar-thumb: rgba(110, 110, 115, .46);
  --scrollbar-thumb-hover: rgba(84, 84, 88, .68);
  --scrollbar-thumb-active: var(--apple-blue, #0071e3);
  --scrollbar-corner: transparent;
}

html[data-theme="dark"] {
  --scrollbar-track: rgba(255, 255, 255, .045);
  --scrollbar-thumb: rgba(174, 174, 178, .38);
  --scrollbar-thumb-hover: rgba(209, 209, 214, .58);
  --scrollbar-thumb-active: var(--apple-blue, #0a84ff);
  --scrollbar-corner: transparent;
}

/* Firefox */
html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Chromium, Edge, Safari */
::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  min-width: 38px;
  min-height: 38px;
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
  transition: background-color .18s ease, border-color .18s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: var(--scrollbar-corner);
}

::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}

/* Keep hidden navigation strips hidden where explicitly designed */
.dashboard-nav {
  scrollbar-width: none;
}
.dashboard-nav::-webkit-scrollbar {
  display: none;
}

/* Slightly slimmer scrollbars inside dense editor panels */
.sidebar,
.my-works-list,
.records-list,
.inspector-panel,
.project-library,
.saved-list,
.template-grid,
.canvas-area,
.sheet-preview-wrap,
dialog {
  --scrollbar-size: 9px;
}

@media (pointer: coarse) {
  :root { --scrollbar-size: 7px; }
}


/* Clean, single-scroll editor sidebar */
body.editor-active .app-shell {
  grid-template-columns: 310px minmax(440px,1fr) 330px;
}
body.editor-active .left-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr);
  overflow: hidden;
  min-width: 0;
}
.my-works-panel {
  min-height: 0;
  max-height: none;
  overflow: hidden;
  background: transparent;
}
.my-works-heading {
  height: 40px;
  padding: 0 13px;
}
.my-works-list {
  display: grid;
  gap: 7px;
  padding: 8px 10px 10px;
  overflow: visible;
}
.my-work-item {
  min-height: 48px;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 9px;
  padding: 7px 9px;
  border-radius: 12px;
}
.my-work-item .work-thumb {
  width: 38px;
  height: 32px;
  border-radius: 7px;
}
.my-work-item strong {
  font-size: 11px;
  line-height: 1.25;
}
.my-work-item small {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.25;
}
.my-works-view-all {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--apple-blue);
  background: transparent;
  border: 1px solid var(--apple-line);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}
.my-works-view-all:hover {
  background: color-mix(in srgb,var(--apple-blue) 8%,transparent);
  border-color: color-mix(in srgb,var(--apple-blue) 35%,var(--apple-line));
}
body.editor-active .tabs {
  position: static;
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 4px;
  padding: 7px;
  overflow: hidden;
  background: rgba(120,120,128,.06);
}
body.editor-active .tab {
  min-width: 0;
  padding: 9px 3px;
  border-radius: 10px;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.editor-active .left-panel .panel {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  scrollbar-gutter: stable;
}
body.editor-active .left-panel .panel-heading {
  margin-bottom: 10px;
  align-items: flex-start;
}
body.editor-active .left-panel .panel-heading h2 {
  font-size: 15px;
}
body.editor-active .left-panel .panel-heading p {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.45;
}
body.editor-active .left-panel .count,
body.editor-active .left-panel .mini-status {
  flex: 0 0 auto;
  border-radius: 999px;
}
body.editor-active .left-panel .card,
body.editor-active .left-panel .section-card {
  padding: 12px;
  border-radius: 14px;
}
body.editor-active .left-panel .card + .card,
body.editor-active .left-panel .section-card + .section-card {
  margin-top: 10px;
}
body.editor-active .left-panel .form-grid,
body.editor-active .left-panel .form-grid.two,
body.editor-active .left-panel .form-grid.three {
  grid-template-columns: 1fr;
  gap: 9px;
}
body.editor-active .left-panel .form-grid .full {
  grid-column: auto;
}
body.editor-active .left-panel label {
  min-width: 0;
}
body.editor-active .left-panel input,
body.editor-active .left-panel select,
body.editor-active .left-panel textarea {
  width: 100%;
  min-width: 0;
}
body.editor-active .left-panel textarea {
  min-height: 112px;
  resize: vertical;
}
body.editor-active .left-panel .switch-row {
  padding: 9px 0;
}
body.editor-active .left-panel .switch-row strong {
  font-size: 10px;
}
body.editor-active .left-panel .switch-row span,
body.editor-active .left-panel .helper {
  font-size: 9px;
}
body.editor-active .left-panel .action-grid {
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
}
body.editor-active .left-panel .action-grid .button,
body.editor-active .left-panel .action-grid .file-action {
  min-height: 38px;
  display: grid;
  place-items: center;
  text-align: center;
}
body.editor-active .left-panel .template-grid {
  grid-template-columns: 1fr;
  gap: 9px;
}
body.editor-active .left-panel .template-card {
  display: grid;
  grid-template-columns: 82px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
}
body.editor-active .left-panel .template-thumb {
  height: 62px;
  margin: 0;
}
body.editor-active .left-panel .template-card strong {
  font-size: 11px;
}
body.editor-active .left-panel .template-card small {
  margin-top: 3px;
  font-size: 9px;
  white-space: normal;
  line-height: 1.3;
}

@media (max-width: 1280px) {
  body.editor-active .app-shell {
    grid-template-columns: 280px minmax(390px,1fr) 300px;
  }
}
@media (max-width: 980px) {
  body.editor-active .app-shell {
    grid-template-columns: 270px minmax(0,1fr);
  }
  body.editor-active .left-panel {
    max-height: calc(100vh - 92px);
  }
}
@media (max-width: 720px) {
  body.editor-active .left-panel {
    display: grid;
    grid-template-rows: auto auto minmax(320px,auto);
    width: 100%;
    max-height: none;
    border-radius: 18px;
  }
  .my-works-list {
    grid-template-columns: 1fr;
  }
  body.editor-active .left-panel .panel-heading p {
    display: none;
  }
  body.editor-active .left-panel .panel {
    max-height: 560px;
  }
}
@media (max-width: 420px) {
  .my-works-panel {
    display: none;
  }
  body.editor-active .left-panel {
    grid-template-rows: auto minmax(360px,auto);
  }
  body.editor-active .tabs {
    padding: 6px;
    gap: 3px;
  }
  body.editor-active .tab {
    padding: 8px 2px;
    font-size: 8px;
  }
  body.editor-active .left-panel .panel {
    padding: 10px;
  }
  body.editor-active .left-panel .template-card {
    grid-template-columns: 72px minmax(0,1fr);
  }
}


/* Project dialog alignment and card cleanup */
.projects-dialog {
  width: min(1120px, 95vw);
  max-height: 90vh;
}
.project-dialog-toolbar {
  padding: 14px 18px;
  gap: 14px;
}
.project-dialog-toolbar label {
  min-height: 46px;
  border-radius: 14px;
}
.project-library {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-height: 66vh;
  padding: 18px;
  align-items: start;
}
.project-card {
  display: grid;
  grid-template-rows: 156px minmax(82px, auto) 48px;
  min-height: 286px;
  overflow: hidden;
  border-radius: 18px;
  background: color-mix(in srgb, var(--apple-surface-solid) 92%, transparent);
  border: 1px solid var(--apple-line);
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.project-card.active {
  border-color: color-mix(in srgb, var(--apple-blue) 55%, var(--apple-line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--apple-blue) 13%, transparent), 0 8px 18px rgba(0,0,0,.06);
}
.project-thumb {
  position: relative;
  display: grid;
  place-items: center;
  height: 156px;
  padding: 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--apple-line);
  background: linear-gradient(180deg, rgba(120,120,128,.07), rgba(120,120,128,.03));
}
.project-thumb::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 22px;
  background: linear-gradient(to top, rgba(255,255,255,.86), rgba(255,255,255,0));
  pointer-events: none;
}
html[data-theme="dark"] .project-thumb::after {
  background: linear-gradient(to top, rgba(28,28,30,.88), rgba(28,28,30,0));
}
.project-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  transform: scale(.96);
  transform-origin: center center;
  pointer-events: none;
}
.project-meta {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 82px;
  padding: 12px 14px 8px;
}
.project-meta strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.25;
  font-size: 14px;
  min-height: 35px;
}
.project-meta small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  font-size: 11px;
  word-break: break-word;
}
.project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding: 0 14px 14px;
}
.project-actions button {
  min-width: 36px;
  height: 36px;
  border-radius: 11px;
}
.project-actions .primary-action {
  min-width: 78px;
  padding-inline: 14px;
  font-weight: 700;
}
.project-actions button:not(.primary-action) {
  background: rgba(120,120,128,.10);
}
.project-actions button:hover:not(.primary-action) {
  background: rgba(120,120,128,.16);
}
@media (max-width: 980px) {
  .project-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
  }
  .project-card {
    grid-template-rows: 146px minmax(80px, auto) 46px;
    min-height: 276px;
  }
  .project-thumb {
    height: 146px;
  }
}
@media (max-width: 720px) {
  .projects-dialog {
    width: min(100vw - 16px, 720px);
    max-height: 92vh;
    padding: 0;
    border-radius: 18px;
  }
  .project-dialog-toolbar {
    padding: 14px;
  }
  .project-library {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    max-height: 68vh;
  }
  .project-card {
    grid-template-columns: 104px minmax(0,1fr);
    grid-template-rows: auto auto;
    min-height: 0;
  }
  .project-thumb {
    grid-row: 1 / span 2;
    height: 100%;
    min-height: 124px;
    border-bottom: 0;
    border-right: 1px solid var(--apple-line);
  }
  .project-thumb::after {
    display: none;
  }
  .project-meta {
    min-height: 0;
    padding: 12px 12px 8px;
  }
  .project-meta strong {
    min-height: 0;
    font-size: 13px;
  }
  .project-actions {
    padding: 0 12px 12px;
  }
}
@media (max-width: 480px) {
  .project-card {
    grid-template-columns: 90px minmax(0,1fr);
  }
  .project-thumb {
    min-height: 110px;
    padding: 10px;
  }
  .project-actions .primary-action {
    min-width: 70px;
    padding-inline: 12px;
  }
}


/* Flat editor UI: remove card-style panels */
body.editor-active .app-shell {
  gap: 0;
  padding: 0;
  background: var(--apple-surface-solid);
  grid-template-columns: 300px minmax(440px,1fr) 370px;
}
body.editor-active .left-panel,
body.editor-active .right-panel,
body.editor-active .workspace {
  border-radius: 0;
  box-shadow: none;
  border: 0;
  background: var(--apple-surface-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.editor-active .left-panel {
  border-right: 1px solid var(--apple-line);
}
body.editor-active .right-panel {
  border-left: 1px solid var(--apple-line);
}
body.editor-active .workspace {
  border-left: 1px solid var(--apple-line);
  border-right: 1px solid var(--apple-line);
  background: var(--apple-surface);
}
.my-works-panel {
  min-height: 0;
  max-height: 248px;
  border-bottom: 1px solid var(--apple-line);
}
.my-works-heading {
  height: 48px;
  padding: 0 14px;
  background: transparent;
}
.my-works-list {
  padding: 0;
  gap: 0;
}
.my-work-item {
  border: 0;
  border-bottom: 1px solid var(--apple-line);
  border-radius: 0;
  background: transparent;
  padding: 12px 14px;
}
.my-work-item:hover {
  background: rgba(120,120,128,.08);
  border-color: var(--apple-line);
}
.my-work-item .work-thumb {
  border-radius: 6px;
  background: rgba(120,120,128,.08);
}
body.editor-active .tabs {
  gap: 0;
  padding: 0 10px;
  background: transparent;
  border-bottom: 1px solid var(--apple-line);
}
body.editor-active .tab {
  min-width: 0;
  padding: 14px 12px 12px;
  border-radius: 0;
  color: var(--apple-muted);
  background: transparent;
  border-bottom: 2px solid transparent;
  font-size: 12px;
}
body.editor-active .tab:hover {
  background: transparent;
  color: var(--apple-text);
}
body.editor-active .tab.active {
  background: transparent;
  color: var(--apple-text);
  box-shadow: none;
  border-bottom-color: var(--apple-blue);
}
body.editor-active .panel {
  padding: 16px;
}
body.editor-active .panel-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--apple-line);
}
body.editor-active .workspace {
  grid-template-rows: minmax(0,1fr) 40px;
}
.canvas-area {
  padding: 24px 24px 36px;
  background-color: #f6f7f9;
}
html[data-theme="dark"] .canvas-area {
  background-color: #111214;
}
body.editor-active .bottom-strip {
  height: 40px;
  border-top: 1px solid var(--apple-line);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.inspector-tabs {
  position: static;
  height: 52px;
  gap: 0;
  padding: 0 10px;
  background: transparent;
  border-bottom: 1px solid var(--apple-line);
}
.inspector-tabs button {
  border-radius: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  font-size: 11px;
}
.inspector-tabs button.active {
  background: transparent;
  color: var(--apple-text);
  box-shadow: none;
  border-bottom-color: var(--apple-blue);
}
.inspector-panel {
  padding: 16px;
}
body.editor-active .card,
body.editor-active .section-card,
body.editor-active .export-card,
body.editor-active .file-drop,
body.editor-active .switch-row,
body.editor-active .inspector-switch,
body.editor-active .editor-layer-row,
body.editor-active .custom-barcode-editor {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.editor-active .card,
body.editor-active .section-card,
body.editor-active .export-card,
body.editor-active .file-drop,
body.editor-active .custom-barcode-editor,
body.editor-active .property-section,
body.editor-active .editor-layer-row {
  border-top: 1px solid var(--apple-line);
}
body.editor-active .section-card,
body.editor-active .export-card,
body.editor-active .card {
  padding: 14px 0;
}
body.editor-active .property-section {
  padding-top: 12px;
}
body.editor-active .switch-row,
body.editor-active .inspector-switch {
  padding: 10px 0;
}
body.editor-active .editor-layer-row {
  padding: 10px 0;
}
body.editor-active .action-grid {
  position: static;
  padding-top: 12px;
  background: transparent;
}
body.editor-active .template-grid {
  grid-template-columns: 1fr;
  gap: 0;
}
body.editor-active .template-card {
  grid-template-columns: 84px minmax(0,1fr);
  gap: 10px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--apple-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.editor-active .template-card:hover,
body.editor-active .template-card.active {
  background: transparent;
  border-color: var(--apple-line);
  box-shadow: none;
}
body.editor-active .template-thumb {
  height: 68px;
  border: 1px solid var(--apple-line);
  border-radius: 6px;
  background: rgba(120,120,128,.04);
}
body.editor-active .position-grid input,
body.editor-active .inspector-form input,
body.editor-active .inspector-form select,
body.editor-active input,
body.editor-active select,
body.editor-active textarea {
  border-radius: 8px;
  background: rgba(120,120,128,.06);
}
@media (max-width: 1240px) {
  body.editor-active .app-shell {
    grid-template-columns: 260px minmax(360px,1fr) 320px;
  }
}
@media (max-width: 980px) {
  body.editor-active .app-shell {
    grid-template-columns: 240px minmax(0,1fr) 290px;
  }
}
@media (max-width: 720px) {
  body.editor-active .app-shell {
    grid-template-columns: 1fr;
  }
  body.editor-active .left-panel,
  body.editor-active .workspace,
  body.editor-active .right-panel {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--apple-line);
  }
  body.editor-active .tabs,
  .inspector-tabs {
    overflow-x: auto;
  }
}


/* Center the quick editor controls in the open menubar space */
@media (min-width: 1421px) {
  .editor-menubar {
    position: relative;
  }
  .editor-menubar-spacer {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
  }
  .editor-menubar-tools {
    position: absolute;
    left: 52%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    z-index: 2;
    width: max-content;
    max-width: calc(100% - 560px);
    justify-content: center;
  }
}

@media (min-width: 1121px) and (max-width: 1420px) {
  .editor-menubar-spacer {
    flex: 0 0 36px;
  }
  .editor-menubar-tools {
    margin-left: 20px;
    margin-right: auto;
    transform: none;
  }
  .editor-menubar .editor-live-status {
    display: none;
  }
}

@media (max-width: 1120px) {
  .editor-menubar-tools {
    position: static;
    transform: none;
    margin: 0;
  }
}


/* Final structural editor command row — matches the provided basic representation */
body.editor-active .editor-menubar {
  position: relative !important;
  z-index: 75;
  display: grid !important;
  grid-template-columns: 300px minmax(440px, 1fr) 370px;
  align-items: stretch;
  gap: 0;
  width: 100%;
  height: 60px;
  min-height: 60px;
  padding: 0 !important;
  overflow: visible;
  background: var(--apple-surface-solid);
  border-bottom: 1px solid var(--apple-line);
}
.editor-menubar-left,
.editor-menubar-center,
.editor-menubar-right {
  min-width: 0;
  display: flex;
  align-items: center;
}
.editor-menubar-left {
  justify-content: flex-start;
  gap: 2px;
  padding: 0 14px;
  border-right: 1px solid var(--apple-line);
}
.editor-menubar-center {
  justify-content: center;
  padding: 0 14px;
}
.editor-menubar-right {
  border-left: 1px solid var(--apple-line);
}
body.editor-active .editor-menubar .editor-menubar-tools {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
}
body.editor-active .editor-menubar .editor-tools-primary.top-inline,
body.editor-active .editor-menubar .editor-tools-secondary.top-inline {
  flex: 0 0 auto;
}
body.editor-active .app-shell {
  height: calc(100vh - 118px) !important;
  min-height: 0;
  grid-template-columns: 300px minmax(440px, 1fr) 370px;
}
body.editor-active .workspace {
  min-height: 0;
}
body.editor-active .workspace .canvas-area {
  padding-top: 24px;
}

@media (max-width: 1240px) and (min-width: 981px) {
  body.editor-active .editor-menubar,
  body.editor-active .app-shell {
    grid-template-columns: 260px minmax(360px, 1fr) 320px;
  }
  body.editor-active .editor-menubar .editor-menubar-tools {
    gap: 8px;
  }
  body.editor-active .editor-menubar .editor-live-status {
    display: none;
  }
}

@media (max-width: 980px) {
  body.editor-active .editor-menubar {
    height: auto;
    min-height: 104px;
    grid-template-columns: 1fr;
    grid-template-rows: 44px 60px;
  }
  .editor-menubar-left {
    grid-row: 1;
    padding: 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--apple-line);
    overflow-x: auto;
  }
  .editor-menubar-center {
    grid-row: 2;
    padding: 0 10px;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .editor-menubar-right { display: none; }
  body.editor-active .editor-menubar .editor-menubar-tools {
    justify-content: flex-start;
    overflow: visible;
  }
  body.editor-active .app-shell {
    height: auto !important;
    min-height: calc(100vh - 162px);
  }
}


/* Replace left tabs text with svg icons */
body.editor-active .tabs {
  grid-template-columns: repeat(5, minmax(0,1fr));
}
body.editor-active .tab.icon-tab {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 10px 6px;
}
body.editor-active .tab.icon-tab svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.editor-active .tab.icon-tab.active svg {
  stroke: currentColor;
}
@media (max-width: 720px) {
  body.editor-active .tab.icon-tab {
    min-height: 42px;
    padding: 8px 4px;
  }
  body.editor-active .tab.icon-tab svg {
    width: 18px;
    height: 18px;
  }
}


/* Final editor menubar layout fix: prevent overlap */
body.editor-active .editor-menubar {
  display: grid;
  grid-template-columns: 380px minmax(420px, 1fr) 370px;
  align-items: center;
  min-height: 60px;
  height: 60px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--apple-line);
}
body.editor-active .editor-menubar-left,
body.editor-active .editor-menubar-center,
body.editor-active .editor-menubar-right {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}
body.editor-active .editor-menubar-left {
  padding: 0 16px;
  border-right: 1px solid var(--apple-line);
}
body.editor-active .editor-menubar-center {
  justify-content: center;
  padding: 0 18px;
}
body.editor-active .editor-menubar-right {
  border-left: 1px solid var(--apple-line);
}
body.editor-active .editor-menubar .app-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
body.editor-active .editor-menubar .app-menu::-webkit-scrollbar { display: none; }
body.editor-active .editor-menubar .app-menu-button {
  white-space: nowrap;
  flex: 0 0 auto;
}
body.editor-active .editor-menubar .editor-menubar-tools {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  width: auto !important;
  max-width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: auto;
}
body.editor-active .editor-menubar .editor-tools-primary.top-inline,
body.editor-active .editor-menubar .editor-tools-secondary.top-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.editor-active .editor-menubar .workspace-status.editor-live-status {
  flex: 0 0 auto;
  white-space: nowrap;
}
body.editor-active .editor-menubar .editor-tool,
body.editor-active .editor-menubar .editor-icon-tool,
body.editor-active .editor-menubar .editor-zoom {
  flex: 0 0 auto;
}
body.editor-active .editor-menubar .editor-tool small { display: none; }
body.editor-active .editor-menubar .editor-tool {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
}
body.editor-active .editor-menubar .editor-tool.compact { width: 40px; min-width: 40px; }
body.editor-active .editor-menubar .editor-icon-tool {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
}
body.editor-active .editor-menubar .editor-zoom { height: 40px; }
body.editor-active .editor-menubar .editor-zoom button,
body.editor-active .editor-menubar .editor-zoom span { height: 40px; }
body.editor-active .editor-menubar .editor-zoom span { min-width: 56px; }
body.editor-active .editor-menubar .tool-divider { height: 24px; }

@media (max-width: 1400px) {
  body.editor-active .editor-menubar {
    grid-template-columns: 340px minmax(360px, 1fr) 320px;
  }
}
@media (max-width: 1120px) {
  body.editor-active .editor-menubar {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  body.editor-active .editor-menubar-left,
  body.editor-active .editor-menubar-center,
  body.editor-active .editor-menubar-right {
    border: 0;
    padding: 8px 12px;
  }
  body.editor-active .editor-menubar-center {
    justify-content: flex-start;
    border-top: 1px solid var(--apple-line);
  }
  body.editor-active .editor-menubar-right { display: none; }
  body.editor-active .editor-menubar .editor-menubar-tools {
    justify-content: flex-start;
    overflow-x: auto;
  }
}


/* Random-generation viewport stability fix */
@media (min-width: 981px) {
  html,
  body.editor-active {
    height: 100%;
    min-height: 100%;
  }

  body.editor-active {
    min-height: 100dvh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  body.editor-active .editor-titlebar,
  body.editor-active .editor-menubar {
    min-width: 0;
  }

  body.editor-active .app-shell {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    align-self: stretch;
    align-items: stretch !important;
    overflow: hidden;
  }

  body.editor-active .left-panel,
  body.editor-active .workspace,
  body.editor-active .right-panel {
    min-height: 0 !important;
    height: 100%;
    max-height: none !important;
    align-self: stretch;
  }

  body.editor-active .left-panel {
    overflow: hidden;
  }

  body.editor-active .left-panel .panel,
  body.editor-active .right-panel .inspector-panel,
  body.editor-active .canvas-area {
    min-height: 0;
  }
}

@media (max-width: 980px) and (min-width: 721px) {
  body.editor-active {
    min-height: 100dvh;
    overflow-x: hidden;
  }

  body.editor-active .app-shell {
    min-height: calc(100dvh - 162px) !important;
    align-items: stretch !important;
  }

  body.editor-active .workspace {
    min-height: calc(100dvh - 162px) !important;
  }
}


/* Home dashboard search — compact, aligned and free of double focus rings */
.dashboard-header {
  align-items: center;
}
.dashboard-search {
  width: clamp(300px, 38vw, 480px);
  max-width: 100%;
  height: 46px;
  min-height: 46px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 0 11px 0 14px;
  border: 1px solid var(--apple-line);
  border-radius: 14px;
  background: var(--apple-surface-solid);
  box-shadow: 0 2px 10px rgba(0,0,0,.045);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.dashboard-search:hover {
  border-color: var(--apple-line-strong);
}
.dashboard-search:focus-within {
  border-color: color-mix(in srgb, var(--apple-blue) 60%, var(--apple-line));
  background: var(--apple-surface-solid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--apple-blue) 12%, transparent), 0 4px 14px rgba(0,0,0,.055);
}
.dashboard-search-icon {
  width: 18px;
  height: 18px;
  display: block;
  color: var(--apple-muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.dashboard-search input,
.dashboard-search input:hover,
.dashboard-search input:focus,
.dashboard-search input:focus-visible {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  margin: 0;
  color: var(--apple-text);
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  font-size: 14px;
  line-height: 1;
}
.dashboard-search input::-webkit-search-decoration,
.dashboard-search input::-webkit-search-cancel-button,
.dashboard-search input::-webkit-search-results-button,
.dashboard-search input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}
.dashboard-search input::placeholder {
  color: color-mix(in srgb, var(--apple-muted) 80%, transparent);
  opacity: 1;
}
.dashboard-search kbd {
  min-width: 62px;
  padding: 5px 8px;
  border: 1px solid var(--apple-line);
  border-radius: 8px;
  background: rgba(120,120,128,.08);
  box-shadow: none;
  color: var(--apple-muted);
  font: 600 10px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}
html[data-theme="dark"] .dashboard-search {
  background: rgba(44,44,46,.92);
  box-shadow: 0 2px 12px rgba(0,0,0,.20);
}
@media (max-width: 980px) {
  .dashboard-header {
    align-items: center;
  }
  .dashboard-search {
    width: min(480px, 100%);
  }
}
@media (max-width: 720px) {
  .dashboard-search {
    width: 100%;
    height: 44px;
    min-height: 44px;
    grid-template-columns: 18px minmax(0,1fr);
    padding-inline: 13px;
  }
  .dashboard-search kbd {
    display: none;
  }
  .dashboard-search input,
  .dashboard-search input:focus {
    font-size: 14px;
  }
}


/* Direct on-canvas text editing */
.inline-canvas-text-editor {
  position: fixed;
  z-index: 10000;
  min-width: 96px;
  margin: 0;
  padding: 3px 8px;
  color: #111111;
  background: rgba(255,255,255,.96);
  border: 2px solid var(--apple-blue, #0a84ff);
  border-radius: 7px;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(10,132,255,.18), 0 10px 30px rgba(0,0,0,.16);
  line-height: 1;
  caret-color: var(--apple-blue, #0a84ff);
  box-sizing: border-box;
  transform: translateZ(0);
}
.inline-canvas-text-editor::selection {
  color: #ffffff;
  background: var(--apple-blue, #0a84ff);
}
html[data-theme="dark"] .inline-canvas-text-editor {
  background: rgba(32,32,34,.97);
  box-shadow: 0 0 0 4px rgba(10,132,255,.22), 0 12px 34px rgba(0,0,0,.45);
}
.preview-mount g[data-element] text {
  cursor: text;
}
.preview-mount g[data-element]:has(image),
.preview-mount g[data-element]:has(rect):not(:has(text)) {
  cursor: grab;
}


/* Definitive editor menubar fix */
body.editor-active .editor-menubar {
  display: grid !important;
  grid-template-columns: minmax(290px, 340px) minmax(420px, 1fr) minmax(250px, 320px) !important;
  align-items: center;
  gap: 0;
  min-height: 62px !important;
  height: 62px !important;
  padding: 0 !important;
  overflow: visible !important;
  border-bottom: 1px solid var(--apple-line);
}
body.editor-active .editor-menubar-left,
body.editor-active .editor-menubar-center,
body.editor-active .editor-menubar-right {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}
body.editor-active .editor-menubar-left {
  padding: 0 14px;
  border-right: 1px solid var(--apple-line);
}
body.editor-active .editor-menubar-center {
  justify-content: center;
  padding: 0 14px;
}
body.editor-active .editor-menubar-right {
  border-left: 1px solid var(--apple-line);
}
body.editor-active .editor-menubar .app-menu {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  flex-wrap: nowrap;
  overflow: visible;
  width: 100%;
}
body.editor-active .editor-menubar .app-menu-button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  white-space: nowrap;
}
body.editor-active .editor-menubar .editor-menubar-tools {
  position: static !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0;
}
body.editor-active .editor-menubar .editor-tools-primary.top-inline,
body.editor-active .editor-menubar .editor-tools-secondary.top-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.editor-active .editor-menubar .workspace-status.editor-live-status {
  white-space: nowrap;
  flex: 0 0 auto;
}
body.editor-active .editor-menubar .editor-tool,
body.editor-active .editor-menubar .editor-icon-tool,
body.editor-active .editor-menubar .editor-zoom { flex: 0 0 auto; }
body.editor-active .editor-menubar .editor-tool,
body.editor-active .editor-menubar .editor-tool.compact,
body.editor-active .editor-menubar .editor-icon-tool {
  width: 40px;
  min-width: 40px;
  height: 40px;
}
body.editor-active .editor-menubar .editor-tool small { display: none; }
body.editor-active .editor-menubar .editor-zoom {
  height: 40px;
}
body.editor-active .editor-menubar .editor-zoom button,
body.editor-active .editor-menubar .editor-zoom span { height: 40px; }
body.editor-active .editor-menubar .editor-zoom span { min-width: 58px; }
body.editor-active .editor-menubar .tool-divider { height: 24px; }
body.editor-active .app-menu-popover {
  top: calc(100% + 6px);
}

@media (max-width: 1280px) {
  body.editor-active .editor-menubar {
    grid-template-columns: minmax(250px, 290px) minmax(360px, 1fr) minmax(220px, 280px) !important;
  }
  body.editor-active .editor-menubar .app-menu-button {
    padding: 0 9px;
    font-size: 11px;
  }
}
@media (max-width: 1120px) {
  body.editor-active .editor-menubar {
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 0 !important;
  }
  body.editor-active .editor-menubar-left,
  body.editor-active .editor-menubar-center,
  body.editor-active .editor-menubar-right {
    padding: 8px 12px;
    border: 0;
    height: auto;
  }
  body.editor-active .editor-menubar-left {
    border-bottom: 1px solid var(--apple-line);
  }
  body.editor-active .editor-menubar-center {
    justify-content: flex-start;
  }
  body.editor-active .editor-menubar-right { display: none; }
  body.editor-active .editor-menubar .app-menu {
    overflow-x: auto;
    scrollbar-width: none;
  }
  body.editor-active .editor-menubar .app-menu::-webkit-scrollbar { display: none; }
  body.editor-active .editor-menubar .editor-menubar-tools {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body.editor-active .editor-menubar .editor-menubar-tools::-webkit-scrollbar { display: none; }
}


/* Full Excel-compatible Data View */
.data-view-dialog {
  width: min(1540px, calc(100vw - 24px));
  max-height: 92vh;
}
.data-view-dialog .dialog-head p {
  max-width: 980px;
}
.data-view-toolbar .qr-row-button {
  color: #fff;
  background: #34c759;
  border-color: #34c759;
}
.data-view-toolbar .qr-row-button:hover {
  color: #fff;
  background: #2fb350;
  border-color: #2fb350;
}
.data-table-wrap {
  max-height: min(62vh, 650px);
  overflow: auto;
}
.data-view-table {
  width: max-content;
  min-width: 2240px;
  table-layout: fixed;
}
.data-view-table th,
.data-view-table td {
  box-sizing: border-box;
}
.data-view-table th:nth-child(1), .data-view-table td:nth-child(1) { width: 46px; min-width: 46px; max-width: 46px; }
.data-view-table th:nth-child(2), .data-view-table td:nth-child(2) { width: 190px; min-width: 190px; }
.data-view-table th:nth-child(3), .data-view-table td:nth-child(3) { width: 260px; min-width: 260px; }
.data-view-table th:nth-child(4), .data-view-table td:nth-child(4) { width: 128px; min-width: 128px; }
.data-view-table th:nth-child(5), .data-view-table td:nth-child(5) { width: 145px; min-width: 145px; }
.data-view-table th:nth-child(6), .data-view-table td:nth-child(6) { width: 125px; min-width: 125px; }
.data-view-table th:nth-child(7), .data-view-table td:nth-child(7) { width: 170px; min-width: 170px; }
.data-view-table th:nth-child(8), .data-view-table td:nth-child(8) { width: 140px; min-width: 140px; }
.data-view-table th:nth-child(9), .data-view-table td:nth-child(9) { width: 150px; min-width: 150px; }
.data-view-table th:nth-child(10), .data-view-table td:nth-child(10) { width: 95px; min-width: 95px; }
.data-view-table th:nth-child(11), .data-view-table td:nth-child(11) { width: 125px; min-width: 125px; }
.data-view-table th:nth-child(12), .data-view-table td:nth-child(12) { width: 160px; min-width: 160px; }
.data-view-table th:nth-child(13), .data-view-table td:nth-child(13) { width: 135px; min-width: 135px; }
.data-view-table th:nth-child(14), .data-view-table td:nth-child(14) { width: 220px; min-width: 220px; }
.data-view-table th:nth-child(15), .data-view-table td:nth-child(15) { width: 230px; min-width: 230px; }
.data-view-table th:nth-child(16), .data-view-table td:nth-child(16) { width: 50px; min-width: 50px; max-width: 50px; }
.data-view-table th:first-child,
.data-view-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--surface);
}
.data-view-table th:first-child { z-index: 7; background: var(--surface-2); }
.data-view-table th:nth-child(2),
.data-view-table td:nth-child(2) {
  position: sticky;
  left: 46px;
  z-index: 3;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
.data-view-table th:nth-child(2) { z-index: 6; background: var(--surface-2); }
.data-view-table tr[data-record-type="qr"] .data-field-type select,
.data-view-table tr[data-record-type="qr"] .data-field-value input {
  color: #087a32;
  background: rgba(52,199,89,.09);
  border-color: rgba(52,199,89,.22);
}
.data-view-table input,
.data-view-table select {
  min-height: 38px;
}
.data-actions-cell {
  text-align: center;
}
@media (max-width: 760px) {
  .data-view-dialog {
    width: calc(100vw - 8px);
    max-height: 96vh;
    padding: 14px;
    border-radius: 16px;
  }
  .data-view-dialog .dialog-head p {
    max-width: 88vw;
  }
  .data-view-toolbar {
    align-items: stretch;
  }
  #dataViewCount {
    width: 100%;
    margin-left: 0;
  }
}


/* Data View: barcode + QR per product */
.data-view-table { min-width: 2940px; }
.data-view-table th:nth-child(1), .data-view-table td:nth-child(1) { width:46px; min-width:46px; max-width:46px; }
.data-view-table th:nth-child(2), .data-view-table td:nth-child(2) { width:190px; min-width:190px; }
.data-view-table th:nth-child(3), .data-view-table td:nth-child(3) { width:145px; min-width:145px; }
.data-view-table th:nth-child(4), .data-view-table td:nth-child(4) { width:220px; min-width:220px; }
.data-view-table th:nth-child(5), .data-view-table td:nth-child(5) { width:135px; min-width:135px; }
.data-view-table th:nth-child(6), .data-view-table td:nth-child(6) { width:280px; min-width:280px; }
.data-view-table th:nth-child(7), .data-view-table td:nth-child(7) { width:145px; min-width:145px; }
.data-view-table th:nth-child(8), .data-view-table td:nth-child(8) { width:125px; min-width:125px; }
.data-view-table th:nth-child(9), .data-view-table td:nth-child(9) { width:170px; min-width:170px; }
.data-view-table th:nth-child(10), .data-view-table td:nth-child(10) { width:140px; min-width:140px; }
.data-view-table th:nth-child(11), .data-view-table td:nth-child(11) { width:150px; min-width:150px; }
.data-view-table th:nth-child(12), .data-view-table td:nth-child(12) { width:95px; min-width:95px; }
.data-view-table th:nth-child(13), .data-view-table td:nth-child(13) { width:125px; min-width:125px; }
.data-view-table th:nth-child(14), .data-view-table td:nth-child(14) { width:160px; min-width:160px; }
.data-view-table th:nth-child(15), .data-view-table td:nth-child(15) { width:135px; min-width:135px; }
.data-view-table th:nth-child(16), .data-view-table td:nth-child(16) { width:220px; min-width:220px; }
.data-view-table th:nth-child(17), .data-view-table td:nth-child(17) { width:230px; min-width:230px; }
.data-view-table th:nth-child(18), .data-view-table td:nth-child(18) { width:50px; min-width:50px; max-width:50px; }
.data-view-table tr[data-record-mode="both"] .data-field-codeMode select,
.data-view-table tr[data-record-mode="both"] .data-field-barcodeValue input,
.data-view-table tr[data-record-mode="both"] .data-field-qrValue input {
  border-color: color-mix(in srgb, #0a84ff 42%, transparent);
  background: color-mix(in srgb, #0a84ff 7%, transparent);
}
.data-view-table tr[data-record-mode="qr"] .data-field-codeMode select,
.data-view-table tr[data-record-mode="qr"] .data-field-qrValue input {
  border-color: color-mix(in srgb, #8b5cf6 42%, transparent);
  background: color-mix(in srgb, #8b5cf6 7%, transparent);
}
.data-view-table tr[data-record-mode="barcode"] .data-field-codeMode select,
.data-view-table tr[data-record-mode="barcode"] .data-field-barcodeValue input {
  border-color: color-mix(in srgb, #10b981 38%, transparent);
  background: color-mix(in srgb, #10b981 6%, transparent);
}
.data-view-toolbar .both-row-button { color:#fff; background:#5e5ce6; border-color:#5e5ce6; }
.data-view-toolbar .both-row-button:hover { background:#4f46d8; border-color:#4f46d8; }


/* Layer organizer */
.layer-organizer-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--apple-line);
}
.layer-organizer-toolbar button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--apple-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
}
.layer-organizer-toolbar button:hover {
  color: var(--apple-text);
  background: rgba(120,120,128,.10);
  border-color: var(--apple-line);
}
.layer-organizer-toolbar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.layer-toolbar-separator {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--apple-line);
}
.layer-organizer-hint {
  padding: 8px 0 10px;
  color: var(--apple-muted);
  font-size: 10px;
  line-height: 1.35;
}
.organized-layers {
  display: grid;
  gap: 2px;
}
.editor-layer-row.organized-row {
  grid-template-columns: 24px 26px minmax(0,1fr) auto;
  gap: 6px;
  min-height: 48px;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.layer-drag-handle {
  width: 24px;
  height: 34px;
  padding: 0;
  color: var(--apple-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: grab;
  font-size: 12px;
  letter-spacing: -3px;
}
.layer-drag-handle:active { cursor: grabbing; }
.editor-layer-row.organized-row.dragging { opacity: .42; }
.editor-layer-row.organized-row.drag-over {
  box-shadow: inset 0 2px 0 var(--apple-blue);
  background: color-mix(in srgb, var(--apple-blue) 8%, transparent);
}
.editor-layer-row.organized-row.locked .editor-layer-select strong::after {
  content: ' • Locked';
  color: var(--apple-muted);
  font-size: 9px;
  font-weight: 600;
}
.editor-layer-row.organized-row.locked .layer-type { opacity: .55; }
@media (max-width:720px) {
  .layer-organizer-toolbar { overflow-x:auto; }
  .layer-organizer-toolbar button { flex:0 0 34px; }
}


/* Inspector panel own scrollbar only (not full page) */
body.editor-active .right-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
body.editor-active .right-panel .inspector-tabs {
  flex: 0 0 auto;
}
body.editor-active .right-panel .inspector-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
body.editor-active .right-panel .inspector-panel.active {
  display: block;
}
@media (max-width: 720px) {
  body.editor-active .right-panel {
    max-height: 62vh;
  }
}


/* Export card refinement inside right inspector only */
body.editor-active .right-panel .export-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--apple-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--apple-surface-solid) 92%, transparent);
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}
html[data-theme="dark"] body.editor-active .right-panel .export-card {
  background: rgba(36,36,38,.9);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
body.editor-active .right-panel .export-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
  color: var(--apple-text);
}
body.editor-active .right-panel .export-card p {
  margin: 0 0 14px;
  color: var(--apple-muted);
  font-size: 12px;
  line-height: 1.45;
}
body.editor-active .right-panel .export-card .button-stack {
  display: grid;
  gap: 10px;
}
body.editor-active .right-panel .export-card .button-stack .button {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
}
body.editor-active .right-panel .export-card .button-stack .button.subtle {
  background: rgba(10,132,255,.08);
  border: 1px solid color-mix(in srgb, var(--apple-blue) 18%, var(--apple-line));
}
html[data-theme="dark"] body.editor-active .right-panel .export-card .button-stack .button.subtle {
  background: rgba(10,132,255,.12);
}


/* Action buttons with proper card design and SVG icons */
.action-card-grid {
  gap: 10px;
}
.action-card-button {
  display: grid !important;
  grid-template-columns: 40px minmax(0,1fr);
  align-items: center;
  justify-items: start;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px !important;
  text-align: left !important;
  border-radius: 16px !important;
  border: 1px solid var(--apple-line) !important;
  background: color-mix(in srgb, var(--apple-surface-solid) 90%, transparent) !important;
  color: var(--apple-text) !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.04);
}
.action-card-button:hover {
  border-color: color-mix(in srgb, var(--apple-blue) 25%, var(--apple-line));
  background: color-mix(in srgb, var(--apple-blue) 6%, var(--apple-surface-solid));
  transform: translateY(-1px);
}
.action-card-button:focus-visible {
  outline: 2px solid var(--apple-blue);
  outline-offset: 2px;
}
.action-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--apple-blue) 10%, transparent);
  color: var(--apple-blue);
  flex-shrink: 0;
}
.action-card-icon svg {
  width: 20px;
  height: 20px;
}
.action-card-content {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.action-card-content strong {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--apple-text);
}
.action-card-content small {
  font-size: 11px;
  line-height: 1.35;
  color: var(--apple-muted);
}
html[data-theme="dark"] .action-card-button {
  background: rgba(28,28,30,.92) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.2);
}
html[data-theme="dark"] .action-card-button:hover {
  background: rgba(32,36,44,.98) !important;
}
body.editor-active .left-panel .action-grid.action-card-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
body.editor-active .left-panel .action-card-button {
  min-height: 64px;
  place-items: start;
}
@media (max-width: 540px) {
  .action-card-button {
    grid-template-columns: 36px minmax(0,1fr);
    gap: 10px;
    min-height: 60px;
    padding: 10px 12px !important;
  }
  .action-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .action-card-content strong { font-size: 13px; }
  .action-card-content small { font-size: 10px; }
}


/* Relevant SVG icons for inspector tabs */
.inspector-tabs button .tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.inspector-tabs button .tab-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.inspector-tabs button span:not(.tab-icon) {
  font-size: inherit;
}


/* Uploaded Akaora Barcode Studio logo */
.dashboard-brand img,
.dashboard-version-card img,
.editor-project-brand img {
  object-fit: contain !important;
  object-position: center;
  background: transparent !important;
  box-shadow: none !important;
}
.dashboard-brand img {
  width: 64px;
  height: 48px;
  border-radius: 0;
}
.dashboard-version-card {
  grid-template-columns: 46px minmax(0,1fr);
}
.dashboard-version-card img {
  width: 46px;
  height: 34px;
  border-radius: 0;
}
.editor-project-brand {
  width: 42px;
  height: 34px;
  border-radius: 8px;
  box-shadow: none;
}
@media (max-width: 980px) {
  .dashboard-brand img { width: 54px; height: 40px; }
  .editor-project-brand { width: 36px; height: 30px; }
}


/* Collapsible left editor sidebar */
body.editor-active .app-shell {
  transition: grid-template-columns .22s ease;
}
body.editor-active .left-panel {
  transition: opacity .18s ease, transform .22s ease;
}
body.editor-active.editor-sidebar-hidden .app-shell {
  grid-template-columns: minmax(440px, 1fr) 370px !important;
}
body.editor-active.editor-sidebar-hidden .left-panel {
  display: none !important;
}
.sidebar-toggle-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.editor-sidebar-hidden .sidebar-toggle-button {
  color: var(--apple-blue);
  background: color-mix(in srgb, var(--apple-blue) 10%, transparent);
}
body.editor-sidebar-hidden .sidebar-toggle-button .sidebar-toggle-arrow {
  transform: scaleX(-1);
  transform-origin: 13.5px 12px;
}
@media (max-width: 1240px) and (min-width: 981px) {
  body.editor-active.editor-sidebar-hidden .app-shell {
    grid-template-columns: minmax(360px, 1fr) 320px !important;
  }
}
@media (max-width: 980px) {
  body.editor-active.editor-sidebar-hidden .app-shell {
    grid-template-columns: 1fr !important;
    grid-template-areas: "work" "right" !important;
  }
  body.editor-active.editor-sidebar-hidden .workspace { grid-area: work !important; }
  body.editor-active.editor-sidebar-hidden .right-panel { grid-area: right !important; }
}
@media (max-width: 720px) {
  body.editor-active.editor-sidebar-hidden .app-shell {
    display: flex !important;
  }
}


/* True portrait templates */
.template-card[data-orientation="portrait"] .template-thumb{min-height:112px}
.template-card[data-orientation="portrait"] .template-thumb svg{width:auto;height:100%;max-width:72%;max-height:100%}
.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb{position:relative;min-height:170px;padding:14px 24px}
.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb svg{width:auto;height:145px;max-width:82%;max-height:145px}
.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb::after{content:'PORTRAIT';position:absolute;top:10px;right:10px;padding:4px 7px;border-radius:999px;color:var(--apple-blue);background:color-mix(in srgb,var(--apple-blue) 10%,var(--apple-surface-solid));border:1px solid color-mix(in srgb,var(--apple-blue) 20%,var(--apple-line));font-size:8px;font-weight:800;letter-spacing:.08em}
@media(max-width:720px){.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb{min-height:145px}.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb svg{height:122px}}


/* Proper SVG icons for Quick Start cards */
.quick-icon svg,
.quick-arrow svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.quick-icon svg {
  width: 22px;
  height: 22px;
}
.quick-arrow svg {
  width: 15px;
  height: 15px;
}
.quick-start-card:hover .quick-arrow {
  color: var(--apple-blue);
  transform: translateX(2px);
}


/* Landscape and portrait template filter */
.orientation-segmented {
  display: flex;
  align-items: center;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--dashboard-line);
  border-radius: 11px;
}
.orientation-segmented button {
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  color: var(--dashboard-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}
.orientation-segmented button:hover {
  color: var(--dashboard-heading);
  background: color-mix(in srgb, var(--dashboard-card) 70%, transparent);
}
.orientation-segmented button.active {
  color: var(--dashboard-heading);
  background: var(--dashboard-card);
  box-shadow: 0 3px 9px rgba(22,31,46,.08);
  font-weight: 780;
}
.orientation-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.orientation-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 820px) {
  .orientation-segmented {
    order: 3;
    width: 100%;
  }
  .orientation-segmented button {
    flex: 1;
  }
}
@media (max-width: 520px) {
  .orientation-segmented button {
    padding-inline: 8px;
  }
  .orientation-segmented button span:last-child {
    font-size: 10px;
  }
}


/* Relevant SVG icons in editor title actions */
body.editor-active .editor-titlebar .title-action-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
body.editor-active .editor-titlebar .title-action-with-icon svg,
body.editor-active .editor-titlebar .theme-toggle-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.editor-active .editor-titlebar .theme-toggle-icon {
  display: grid;
  place-items: center;
}

/* Prevent portrait badge/preview from overlapping template name */
.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb {
  position: relative;
  overflow: hidden;
  padding: 18px 24px 14px;
}
.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb::after {
  top: auto;
  bottom: 9px;
  right: 9px;
  z-index: 3;
}
.dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb svg {
  position: relative;
  z-index: 1;
  height: 138px;
  max-height: calc(100% - 4px);
}
.dashboard-template-card .dashboard-template-info {
  position: relative;
  z-index: 5;
  min-height: 58px;
  background: var(--dashboard-card);
}
.dashboard-template-card .dashboard-template-info strong,
.dashboard-template-card .dashboard-template-info small {
  position: relative;
  z-index: 6;
}
@media (max-width:720px) {
  .dashboard-template-card[data-orientation="portrait"] .dashboard-template-thumb svg {
    height: 116px;
  }
}


/* Sidebar SVG icons */
.nav-icon,
.category-icon,
.help-icon,
.help-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-icon {
  width: 18px;
  height: 18px;
  font-size: 0;
}
.nav-icon svg,
.category-icon svg,
.help-icon svg,
.help-arrow svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.category-icon {
  width: 16px;
  height: 16px;
  color: #aab3c1;
  flex: 0 0 16px;
}
.dashboard-category.active .category-icon,
.dashboard-nav-item.active .nav-icon {
  color: var(--apple-blue);
}
.dashboard-nav-item:not(.active) .nav-icon,
.dashboard-category:not(.active) .category-icon {
  color: var(--dashboard-muted);
}
.dashboard-nav-item:hover .nav-icon,
.dashboard-category:hover .category-icon {
  color: var(--dashboard-heading);
}
.category-dot { display:none; }
.help-icon {
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  padding: 4px;
  font-weight: normal;
}
.help-arrow {
  width: 16px;
  height: 16px;
}
.help-arrow svg { stroke-width: 2.1; }


/* Locked spreadsheet-style Data View keyboard workflow */
.data-view-head {
  align-items: flex-start;
}
.data-view-keyboard-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--apple-muted);
  font-size: 11px;
}
.data-view-keyboard-hint kbd {
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  color: var(--apple-text);
  background: rgba(120,120,128,.12);
  border: 1px solid var(--apple-line);
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.data-view-actions {
  justify-content: space-between;
  align-items: center;
}
.data-view-locked-note {
  color: var(--apple-muted);
  font-size: 11px;
}
.data-view-dialog [data-data-field]:focus {
  position: relative;
  z-index: 2;
  outline: 2px solid var(--apple-blue);
  outline-offset: -2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--apple-blue) 18%, transparent);
}
@media (max-width: 720px) {
  .data-view-actions {
    align-items: stretch;
    gap: 10px;
  }
  .data-view-locked-note {
    max-width: 62%;
  }
}


/* Four-direction Data View keyboard navigation */
.data-view-keyboard-hint .shortcut-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .data-view-keyboard-hint {
    align-items: flex-start;
  }
  .data-view-keyboard-hint > span:not(.shortcut-group) {
    display: none;
  }
}


/* Typography controls and Drag & Drop Assets module */
.inspector-tabs { grid-template-columns: repeat(5,minmax(0,1fr)) !important; }
.inspector-tabs button { min-width:0; padding-inline:3px; }
.custom-text-editor,.custom-asset-editor { display:grid; gap:10px; margin-top:10px; padding-top:12px; border-top:1px solid var(--apple-line); }
.typography-section-title { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.typography-section-title span { color:var(--apple-text); font-size:12px; font-weight:750; }
.typography-section-title small { color:var(--apple-muted); font-size:9px; }
.typography-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.typography-grid label { min-width:0; }
.text-style-buttons { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; }
.text-style-buttons button { height:38px; display:grid; place-items:center; color:var(--apple-text); background:rgba(120,120,128,.08); border:1px solid var(--apple-line); border-radius:10px; }
.text-style-buttons button:hover,.text-style-buttons button.active { color:var(--apple-blue); background:color-mix(in srgb,var(--apple-blue) 11%,transparent); border-color:color-mix(in srgb,var(--apple-blue) 25%,var(--apple-line)); }
.text-style-buttons svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.asset-search { height:40px; margin:12px 0; padding:0 11px; display:grid; grid-template-columns:18px minmax(0,1fr); align-items:center; gap:8px; color:var(--apple-muted); background:rgba(120,120,128,.06); border:1px solid var(--apple-line); border-radius:11px; }
.asset-search svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.asset-search input { width:100%; height:100%; padding:0 !important; border:0 !important; background:transparent !important; box-shadow:none !important; }
.asset-library-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.asset-library-card { position:relative; min-width:0; padding:8px; display:grid; gap:7px; text-align:left; color:var(--apple-text); background:rgba(120,120,128,.055); border:1px solid var(--apple-line); border-radius:13px; cursor:grab; transition:.16s ease; }
.asset-library-card:hover { transform:translateY(-1px); border-color:color-mix(in srgb,var(--apple-blue) 30%,var(--apple-line)); background:color-mix(in srgb,var(--apple-blue) 6%,transparent); }
.asset-library-card:active,.asset-library-card.dragging { cursor:grabbing; opacity:.7; transform:scale(.98); }
.asset-preview { height:74px; display:grid; place-items:center; overflow:hidden; background:var(--apple-surface-solid); border:1px solid var(--apple-line); border-radius:9px; }
.asset-preview svg { width:100%; height:100%; }
.asset-library-card > span:nth-child(2) { min-width:0; display:grid; gap:2px; }
.asset-library-card strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.asset-library-card small { color:var(--apple-muted); font-size:8px; }
.asset-drag-icon { position:absolute; right:8px; bottom:8px; width:15px; height:15px; fill:currentColor; color:var(--apple-muted); }
.asset-library-help { margin:12px 0 0; color:var(--apple-muted); font-size:9px; line-height:1.45; }
#inspector-assets { padding-bottom:22px; }
@media(max-width:1180px){.asset-library-grid{grid-template-columns:1fr}.inspector-tabs button{font-size:9px}}
@media(max-width:720px){.asset-library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.typography-grid{grid-template-columns:1fr}}


/* Show the exact predefined asset geometry in library thumbnails */
.asset-preview {
  padding: 4px;
}
.asset-preview svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}


/* Editor sidebar without the My Works block */
body.editor-active .left-panel {
  grid-template-rows: auto minmax(0, 1fr) !important;
}
body.editor-active .left-panel > .tabs {
  grid-row: 1;
}
body.editor-active .left-panel > .panel {
  grid-row: 2;
}


/* Reliable, state-independent template thumbnails */
body.editor-active .left-panel .template-card {
  grid-template-columns: 88px minmax(0,1fr);
}
body.editor-active .left-panel .template-thumb,
body.editor-active .template-thumb {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 68px;
  min-height: 68px;
  padding: 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--apple-surface-solid) 82%, transparent);
  border: 1px solid var(--apple-line);
  border-radius: 8px;
}
body.editor-active .template-thumb > svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 1px;
  min-height: 1px;
  max-width: 100% !important;
  max-height: 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.12));
}
body.editor-active .template-card[data-orientation="portrait"] .template-thumb {
  height: 92px;
  min-height: 92px;
}
body.editor-active .template-card[data-orientation="portrait"] .template-thumb > svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}
.template-card-copy {
  display: grid;
  min-width: 0;
  align-content: center;
}
.template-card-copy strong,
.template-card-copy small {
  min-width: 0;
}
html[data-theme="dark"] body.editor-active .template-thumb {
  background: rgba(255,255,255,.035);
}


/* Portrait canvas sizing fix + thermal printer compatibility */
.preview-mount svg[data-orientation="portrait"] {
  width: min(420px, 32vw);
  max-width: min(420px, 100%);
  max-height: 76vh;
  height: auto;
}
.preview-mount svg[data-orientation="landscape"] {
  width: min(760px, 58vw);
  max-height: 66vh;
  height: auto;
}
@media (max-width: 1100px) {
  .preview-mount svg[data-orientation="portrait"] {
    width: min(380px, 40vw);
    max-width: min(380px, 100%);
    max-height: 72vh;
  }
}
@media (max-width: 820px) {
  .preview-mount svg[data-orientation="portrait"] {
    width: min(84vw, 430px);
    max-width: 100%;
    max-height: 68vh;
  }
}
#customCanvasPreset option[value^="58x"],
#customCanvasPreset option[value^="88x"] {
  font-weight: 600;
}
