/* Packlyn Design Software — the editor: tool panel, toolbar, rulers, pages, status bar and the details panel */
#editor { grid-template-columns: auto minmax(0, 1fr) 304px; min-height: 0; }
/* fixed columns, so the page keeps its place when the tool panel floats over it on narrow windows */
#drawer { grid-column: 1; grid-row: 1; } #center { grid-column: 2; grid-row: 1; } #inspector { grid-column: 3; grid-row: 1; }

/* ---------- tool panel (left) ---------- */
#drawer { width: 344px; background: var(--panel-2); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; padding: 20px 18px 100px; transition: width .2s ease, padding .2s ease; position: relative; }
#drawer.closed { width: 0; padding: 0; border: 0; overflow: hidden; }
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dr-head h2 { margin: 0; font: 600 21px/1.2 var(--font); color: var(--ink); }
.dr-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dr-close { margin: -4px -6px 0 0; }
.dr-sec { margin: 18px 0; }
.dr-sec > h3, .dr-sec-head h3 { margin: 0 0 9px; font: 600 13px var(--font); color: var(--ink); }
.dr-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.dr-sec-head h3 { margin: 0; }
.dr-sec-head .linkish { font-size: 12px; text-decoration: none; }
.dr-note { color: var(--muted); font-size: 11.5px; margin: 8px 0; line-height: 1.45; }
.dr-search { position: relative; margin-bottom: 12px; }
.dr-search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.dr-search input { width: 100%; height: 42px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 14px 0 40px; background: var(--panel); font-size: 13px; }
.dr-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.dr-chips { margin-bottom: 14px; }
.dr-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.dr-tabs button { border: 0; background: none; padding: 8px 10px; font: 600 12.5px var(--font); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dr-tabs button.on { color: var(--ink); border-bottom-color: var(--gold); }

/* template cards */
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tpl-grid.wide { grid-template-columns: 1fr; }
.tpl { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 6px 6px 8px; display: grid; gap: 7px; text-align: center; box-shadow: var(--sh-1); transition: border-color .14s, box-shadow .14s, transform .14s; position: relative; }
.tpl:hover { border-color: var(--gold); box-shadow: var(--sh-2); transform: translateY(-1px); }
.tpl-img { display: grid; place-items: center; width: 100%; max-height: 240px; background: var(--panel-2); border-radius: 9px; overflow: hidden; position: relative; }
.tpl-img img { max-width: 100%; max-height: 240px; display: block; box-shadow: 0 1px 3px rgba(0, 0, 0, .16); }
.tpl-img.skeleton { min-height: 120px; }
.tpl-name { font: 500 12px var(--font); color: var(--ink-2); padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-fav { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .92); border: 0; display: none; place-items: center; color: #7b8790; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.tpl:hover .tpl-fav, .tpl-fav.on { display: grid; }
.tpl-fav.on { color: var(--gold); }
.tpl-fav .ico { width: 15px; height: 15px; }
.tpl-pages { position: absolute; left: 10px; top: 10px; font: 700 10px var(--font); background: rgba(11, 33, 48, .78); color: #fff; padding: 2px 7px; border-radius: 999px; }
.more-row { display: flex; justify-content: center; margin-top: 12px; }

/* element tiles */
.el-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.el-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.el-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.el-grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.el { aspect-ratio: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 9px; display: grid; place-items: center; color: var(--ink); transition: border-color .12s, transform .12s, box-shadow .12s; min-width: 0; }
.el.wide { aspect-ratio: 2; }
.el.tall { aspect-ratio: .8; }
.el.line { aspect-ratio: 2.2; }
.el svg, .el img { width: 100%; height: 100%; display: block; overflow: visible; min-width: 0; object-fit: contain; }
.el:hover { border-color: var(--gold); box-shadow: var(--sh-1); transform: translateY(-1px); }
.el-cat { display: grid; grid-template-columns: 1fr auto; align-items: center; margin: 18px 0 9px; }
.el-cat h3 { margin: 0; font: 600 13px var(--font); }
.el-cat .linkish { font-size: 12px; text-decoration: none; }
.el-strip { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 4); gap: 8px; overflow: hidden; }
.cat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.cat-tile { display: grid; gap: 6px; justify-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px 4px 8px; font: 500 11.5px var(--font); color: var(--ink-2); }
.cat-tile:hover { border-color: var(--gold); }
.cat-tile .ico { width: 24px; height: 24px; color: var(--gold-dk); }
.qr-box { display: grid; gap: 8px; }
.txt-add { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 11px 15px; margin-bottom: 8px; color: var(--ink); box-shadow: var(--sh-1); }
.txt-add:hover { border-color: var(--gold); }
.t-h { font: 800 26px/1.15 'Poppins', var(--font); }
.t-s { font: 600 18px/1.2 'Poppins', var(--font); }
.t-b { font: 400 14px/1.3 'Lato', var(--font); }
.combo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.combo { display: grid; gap: 3px; align-content: center; justify-items: center; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; color: var(--ink); overflow: hidden; min-height: 92px; box-shadow: var(--sh-1); }
.combo span { line-height: 1.12; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo:hover { border-color: var(--gold); }
.up-grid, .photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.up, .ph { position: relative; border: 1px solid var(--line); border-radius: 11px; background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--panel) 0 50%) 0 0 / 14px 14px; aspect-ratio: 1; padding: 6px; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.ph { padding: 0; background: var(--work); }
.up img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up:hover, .ph:hover { border-color: var(--gold); }
.up-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); display: none; place-items: center; padding: 3px; }
.up:hover .up-x { display: grid; }
.up-x .ico { width: 14px; height: 14px; }
.ph-src { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; background: rgba(0, 0, 0, .55); color: #fff; padding: 1px 6px; border-radius: 4px; opacity: 0; }
.ph:hover .ph-src { opacity: 1; }
.drop-zone { border: 2px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); background: var(--panel); }
.drop-zone.over { border-color: var(--gold); background: var(--gold-tint); }
.draw-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.draw-tool { display: grid; justify-items: center; gap: 4px; border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 10px 4px; font-weight: 700; font-size: 11.5px; }
.draw-tool.on { border-color: var(--gold); background: var(--gold-tint); color: var(--gold-dk); }

/* AI tools and print-ready cards */
.ai-hero { border-radius: 16px; padding: 16px; color: #fff; background: radial-gradient(120% 140% at 100% 0, rgba(240, 178, 50, .35), transparent 55%), linear-gradient(135deg, #0e2a3a, #0b5446); margin-bottom: 14px; }
.ai-hero h3 { margin: 0 0 4px; font: 600 15px var(--font); }
.ai-hero p { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .82); line-height: 1.45; }
.ai-list { display: grid; gap: 8px; }
.ai-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 11px 12px; box-shadow: var(--sh-1); transition: border-color .12s, transform .12s; }
.ai-card:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.ai-card .ai-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #fff3d6, #ffe2a3); color: #8a5a00; }
:root[data-theme="dark"] .ai-card .ai-ic { background: linear-gradient(135deg, #3a2f14, #4a3a12); color: var(--gold-hi); }
.ai-card .ai-ic .ico { width: 22px; height: 22px; }
.ai-card b { display: block; font: 600 13px var(--font); }
.ai-card small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.4; margin-top: 1px; }
.ai-card > .ico { width: 18px; height: 18px; color: var(--muted); }
.health { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.health-ring { width: 92px; height: 92px; position: relative; }
.health-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.health-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 24px var(--font); }
.health-ring b small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; margin-top: -4px; }
.health h3 { margin: 0 0 3px; font: 600 14px var(--font); }
.health p { margin: 0; color: var(--muted); font-size: 12px; }
.hc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hc { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 9px 10px; font-size: 12px; }
.hc .ico { width: 18px; height: 18px; margin-top: 1px; }
.hc.pass .ico { color: var(--ok); } .hc.warn .ico { color: var(--warn); } .hc.fail .ico { color: var(--danger); }
.hc b { display: block; font: 600 12.5px var(--font); }
.hc span { color: var(--muted); }

/* ---------- centre ---------- */
#center { display: grid; grid-template-rows: 58px minmax(0, 1fr) 54px; min-width: 0; min-height: 0; background: var(--work); }
/* The design toolbar: three groups that never overlap. Details step back one at a time as the window narrows
   (see ui.buildEdbar in 20-ui-shell.js); what doesn't fit moves into the More menu. */
#edbar { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; z-index: 4; overflow: hidden; }
.eb-group { display: flex; align-items: center; gap: 6px; flex: none; }
.eb-mid { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; }
.eb-right { gap: 8px; }
.eb-sep { width: 1px; height: 24px; background: var(--line); margin: 0 2px; flex: none; }
.eb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font: 500 13px var(--font); color: var(--ink); white-space: nowrap; flex: none; transition: border-color .12s, background .12s, color .12s; }
.eb-btn:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-2); }
.eb-btn[aria-expanded="true"], .eb-btn.on { border-color: var(--sel); background: var(--teal-tint); color: var(--teal); }
.eb-btn:disabled { opacity: .4; cursor: default; }
.eb-btn .ico { width: 18px; height: 18px; flex: none; }
.eb-btn.icon { width: 38px; padding: 0; border-color: transparent; }
.eb-btn.icon:hover:not(:disabled) { border-color: transparent; background: var(--hover); }
.eb-title { min-width: 120px; flex: 1 1 240px; width: 0; max-width: 300px; height: 38px; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 0 10px; font: 600 13.5px var(--font); color: var(--ink); text-overflow: ellipsis; }
.eb-title:hover { border-color: var(--line); }
.eb-title:focus { outline: none; border-color: var(--sel); background: var(--panel); box-shadow: 0 0 0 3px var(--teal-tint); }
.eb-size { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font: 500 12.5px var(--font); color: var(--ink-2); white-space: nowrap; flex: 0 1 auto; min-width: 0; max-width: 280px; overflow: hidden; }
.eb-size span { overflow: hidden; text-overflow: ellipsis; }
.eb-size:hover { border-color: var(--line-2); }
.eb-size .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.eb-saved { font-size: 11.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; flex: none; }
.eb-saved .ico { width: 17px; height: 17px; }
.split { display: inline-flex; border-radius: 11px; box-shadow: 0 2px 8px rgba(232, 160, 30, .25); flex: none; }
.split .btn { height: 38px; min-height: 38px; border-radius: 11px 0 0 11px; box-shadow: none; }
.split .btn + .btn { border-radius: 0 11px 11px 0; padding: 0 9px; border-left: 1px solid rgba(120, 70, 0, .22); }
#edbar .btn { height: 38px; min-height: 38px; flex: none; }
.btn.print-cta { background: var(--navy); color: var(--on-navy); }
.btn.print-cta:hover:not(:disabled) { background: var(--navy-hi); }
.lbl-short { display: none; }
/* the steps, in order */
#edbar.c-spec .eb-size { display: none; }
#edbar.c-saved .eb-saved span { display: none; }
#edbar.c-long #tb-print .lbl-long { display: none; }
#edbar.c-long #tb-print .lbl-short { display: inline; }
#edbar.c-file #tb-file .lbl { display: none; }
#edbar.c-file #tb-file { padding: 0 9px; }
#edbar.c-resize-lbl #tb-resize .lbl { display: none; }
#edbar.c-resize-lbl #tb-resize { width: 38px; padding: 0; }
#edbar.c-dl #tb-download .lbl { display: none; }
#edbar.c-dl #tb-download { padding: 0 11px; }
#edbar.c-print #tb-print .lbl { display: none; }
#edbar.c-print #tb-print { padding: 0 11px; }
#edbar.c-resize #tb-resize, #edbar.c-history #tb-history, #edbar.c-title .eb-title, #edbar.c-title .eb-saved { display: none; }

#stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.ruler { position: absolute; z-index: 3; background: var(--panel); display: block; }
#ruler-x { left: 22px; top: 0; width: calc(100% - 22px); height: 22px; border-bottom: 1px solid var(--line); }
#ruler-y { left: 0; top: 22px; width: 22px; height: calc(100% - 22px); border-right: 1px solid var(--line); }
#ruler-corner { position: absolute; left: 0; top: 0; width: 22px; height: 22px; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); z-index: 3; }
body.no-rulers .ruler, body.no-rulers #ruler-corner { display: none; }
#workspace { position: absolute; left: 22px; top: 22px; right: 0; bottom: 0; overflow: auto; background: var(--work); }
body.no-rulers #workspace { left: 0; top: 0; }
#workspace.pan-ready, #workspace.pan-ready * { cursor: grab !important; }
#workspace.panning, #workspace.panning * { cursor: grabbing !important; }
body.tool-hand #workspace, body.tool-hand #workspace * { cursor: grab !important; }
#toolstrip { position: absolute; left: 34px; top: 50%; transform: translateY(-50%); z-index: 6; display: grid; gap: 4px; padding: 8px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-2); }
body.no-rulers #toolstrip { left: 12px; }
.ts-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 11px; background: transparent; color: var(--ink); transition: background .12s; }
.ts-btn .ico { width: 23px; height: 23px; }
.ts-btn:hover { background: var(--hover); }
.ts-btn.on { background: var(--gold-tint); color: var(--gold-dk); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent); }
.ts-sep { height: 1px; background: var(--line); margin: 3px 6px; }
#pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 72px 150px 104px; min-width: max-content; min-height: 100%; }
.page { display: flex; flex-direction: column; align-items: stretch; }
.page-head { display: flex; align-items: center; gap: 8px; padding: 0 44px; height: 32px; opacity: .6; transition: opacity .15s; }
.page.active .page-head, .page:hover .page-head { opacity: 1; }
#pages.single .page-head .page-tools button:nth-child(-n+2) { display: none; }
.page-num { font: 700 12px var(--font); color: var(--muted); min-width: 16px; }
.page-label { border: 1px solid transparent; background: transparent; font: 600 12.5px var(--font); color: var(--ink-2); border-radius: 6px; padding: 3px 6px; width: 170px; }
.page-label:hover { border-color: var(--line-2); }
.page-label:focus { outline: none; border-color: var(--sel); background: var(--panel); }
.page-tools { margin-left: auto; display: flex; gap: 2px; }
.page-tools .icon-btn { color: var(--muted); }
.page-stage { position: relative; }
.page-stage .canvas-container { position: absolute !important; left: 0; top: 0; }
.page-paper { position: absolute; background: #ffffff; box-shadow: 0 1px 2px rgba(11, 33, 48, .1), 0 12px 34px rgba(11, 33, 48, .16); }
.page.active .page-paper { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 70%, transparent), 0 12px 34px rgba(11, 33, 48, .18); }
.page-paper.transparent { background: repeating-conic-gradient(#e6ebe9 0 25%, #ffffff 0 50%) 0 0 / 18px 18px; }
body.drawing .page-stage { cursor: crosshair; }
body.tool-text .page-stage, body.tool-shape .page-stage, body.tool-line .page-stage { cursor: crosshair; }

#statusbar { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--panel); border-top: 1px solid var(--line); min-width: 0; z-index: 4; container-type: inline-size; container-name: status; }
#statusbar > * { flex: none; }
#statusbar .st-mid { flex: 1 1 auto; min-width: 0; }
@container status (max-width: 860px) { .st-add span:not(.ico) { display: none; } #zoom-range { width: 90px !important; } }
@container status (max-width: 700px) { #zoom-range { display: none; } .st-right .toggle:not(#tg-guides) { display: none; } }
.st-pages { display: inline-flex; align-items: center; gap: 4px; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 4px 0 12px; font: 600 12.5px var(--font); white-space: nowrap; }
.st-pages .icon-btn { width: 28px; height: 28px; }
.st-mid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.st-right { display: flex; align-items: center; gap: 4px; }
#zoom-range { width: 160px; min-width: 0; }
.zoom-label { border: 1px solid var(--line); background: var(--panel); font: 600 12px var(--font); width: 62px; border-radius: 9px; padding: 6px 0; color: var(--ink-2); }
.zoom-label:hover { border-color: var(--line-2); }
.legend { display: inline-block; width: 16px; height: 10px; border-radius: 2px; flex: none; vertical-align: middle; }
.legend.trim { border: 1.5px solid var(--rose); background: transparent; }
.legend.bleed { background: color-mix(in srgb, var(--rose) 22%, transparent); }
.legend.safe { border: 1.5px dashed var(--sel); background: transparent; }
.legend.hole { border: 1.5px dashed var(--rose); border-radius: 50%; width: 11px; height: 11px; background: rgba(40, 40, 40, .15); }
.legend.fold { border-top: 2px dashed var(--blue); height: 0; }

/* ---------- details panel (right) ---------- */
#inspector { background: var(--panel); border-left: 1px solid var(--line); display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.in-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 12px 0; border-bottom: 1px solid var(--line); }
.in-tabs button { border: 0; background: none; padding: 13px 6px 12px; font: 500 14px var(--font); color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.in-tabs button:hover { color: var(--ink); }
.in-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }
.in-body { overflow-y: auto; padding: 6px 16px 120px; }
.in-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 6px; }
.in-head h2 { margin: 0; font: 600 16px/1.25 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-kind { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.acc { border-bottom: 1px solid var(--line); }
.acc-h { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; background: none; padding: 14px 0; font: 600 14px var(--font); color: var(--ink); }
.acc-h .ico { width: 18px; height: 18px; color: var(--muted); transition: transform .18s; }
.acc.closed .acc-h .ico { transform: rotate(-90deg); }
.acc-b { padding: 0 0 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.acc-b > * { min-width: 0; }
.acc.closed .acc-b { display: none; }
.in-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.in-row.nowrap { flex-wrap: nowrap; }
.in-sel { flex: 1; min-width: 0; height: 40px; display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 10px; padding: 0 10px 0 12px; font-size: 14px; text-align: left; }
.in-sel span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-sel .ico { width: 16px; height: 16px; color: var(--muted); }
.in-sel:hover { border-color: var(--ink-2); }
.in-size { width: 84px; height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); overflow: hidden; }
.in-size input { width: 100%; min-width: 0; border: 0; background: transparent; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.in-size input::-webkit-inner-spin-button { -webkit-appearance: none; }
.in-size input:focus { outline: none; }
.in-size button { border: 0; background: transparent; width: 22px; height: 100%; color: var(--muted); display: grid; place-items: center; }
.in-size button:hover { background: var(--hover); }
.in-size button .ico { width: 13px; height: 13px; }
.tgl-grp { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--panel); }
.tgl-grp button { width: 38px; height: 38px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.tgl-grp button + button { border-left: 1px solid var(--line); }
.tgl-grp button:hover { background: var(--hover); }
.tgl-grp button.on { background: var(--gold-tint); color: var(--gold-dk); }
.tgl-grp button .ico { width: 18px; height: 18px; }
.in-colors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.in-colors .lab { font: 600 13px var(--font); margin-right: 4px; }
.in-colors .sw { width: 36px; height: 36px; border-radius: 10px; }
.in-colors .sw.cur { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--gold); }
.fx-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fx-tile { display: grid; gap: 5px; justify-items: center; border: 0; background: none; padding: 0; font: 500 11.5px var(--font); color: var(--ink-2); }
.fx-tile i { width: 100%; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; font: 600 22px/1 'Poppins', sans-serif; font-style: normal; color: var(--ink); transition: border-color .12s; }
.fx-tile:hover i { border-color: var(--line-2); }
.fx-tile { position: relative; }
.fx-tile.locked i { opacity: .55; }
.fx-tile .fx-pro { position: absolute; top: -5px; right: -4px; margin: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.fx-tile.on i { border-color: var(--gold); background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold); }
.opac { display: grid; grid-template-columns: 1fr 70px; gap: 10px; align-items: center; }
.opac input[type=range] { width: 100%; }
.opac .pct { height: 38px; border: 1px solid var(--line-2); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--panel); }
.opac .pct input { width: 34px; border: 0; background: transparent; text-align: right; font-weight: 700; -moz-appearance: textfield; }
.opac .pct input::-webkit-inner-spin-button { -webkit-appearance: none; }
.opac .pct input:focus { outline: none; }
.num-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.num { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 9px; height: 36px; background: var(--panel); }
.num span { font-size: 11px; font-weight: 800; color: var(--muted); }
.num em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.num input { border: 0; width: 100%; min-width: 0; background: transparent; font-weight: 700; text-align: right; -moz-appearance: textfield; }
.num input::-webkit-inner-spin-button { -webkit-appearance: none; }
.num input:focus { outline: none; }
.num:focus-within { border-color: var(--sel); }
.btn-row { display: flex; flex-wrap: wrap; gap: 4px; }
.btn-row .icon-btn { border: 1px solid var(--line); width: 38px; height: 38px; }
.btn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.btn-grid .btn { justify-content: flex-start; font-weight: 500; }
.spec-list { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 0; font-size: 12.5px; }
.spec-list dt { color: var(--muted); font-weight: 600; }
.spec-list dd { margin: 0; font-weight: 700; text-align: right; }
.guide-key p { margin: 7px 0; font-size: 12px; line-height: 1.45; }
.guide-key .legend { margin: 0 6px 0 0; position: relative; top: -1px; }
.in-note { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin: 0; }
.dpi-meter { display: grid; gap: 6px; }
.dpi-bar { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.dpi-bar i { display: block; height: 100%; border-radius: 999px; }
.color-list { display: grid; gap: 6px; }
.color-list .clr { display: flex; align-items: center; gap: 8px; }

/* layers & pages tabs */
.layers { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.ly { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 5px 6px 5px 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); cursor: grab; }
.ly-thumb { width: 34px; height: 34px; border-radius: 7px; background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--panel) 0 50%) 0 0 / 8px 8px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.ly-thumb img { max-width: 100%; max-height: 100%; display: block; }
.ly-thumb .ico { width: 18px; height: 18px; color: var(--muted); }
.ly.on { border-color: var(--gold); background: var(--gold-tint); }
.ly.hidden .ly-name { opacity: .45; text-decoration: line-through; }
.ly.locked .ly-name::after { content: ' · locked'; color: var(--muted); font-size: 11px; }
.ly.drop { border-top: 3px solid var(--gold); }
.ly.dragging { opacity: .4; }
.ly-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; font-weight: 600; }
.ly-input { min-width: 0; border: 1px solid var(--sel); border-radius: 6px; padding: 2px 6px; }
.ly.bgrow { grid-template-columns: 34px 1fr auto; background: var(--panel-2); cursor: default; }
.ly.empty { display: block; border-style: dashed; color: var(--muted); cursor: default; padding: 14px; }
.ly .icon-btn { width: 28px; height: 28px; }
.ly .icon-btn .ico { width: 16px; height: 16px; }
.ly-tools { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.pg-list { display: grid; gap: 10px; margin-top: 10px; }
.pg { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; cursor: grab; }
.pg-n { font: 700 12px var(--font); color: var(--muted); padding-top: 6px; text-align: right; }
.pg-card { border: 2px solid transparent; border-radius: 12px; background: var(--panel-2); padding: 6px; display: grid; gap: 6px; }
.pg.on .pg-card { border-color: var(--gold); }
.pg-img { display: grid; place-items: center; background: var(--work); border-radius: 8px; min-height: 80px; overflow: hidden; }
.pg-img img { max-width: 100%; max-height: 170px; display: block; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.pg-foot { display: flex; align-items: center; gap: 4px; }
.pg-foot span { flex: 1; font: 600 12px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.pg.drop .pg-card { border-top-color: var(--gold); }

@media (max-width: 1500px) { #drawer { width: 320px; } #editor { grid-template-columns: auto minmax(0, 1fr) 292px; } }
@media (max-width: 1320px) { #drawer { width: 296px; } #editor { grid-template-columns: auto minmax(0, 1fr) 276px; } }
@media (max-width: 1100px) { #drawer:not(.closed) { position: absolute; left: 0; top: 58px; bottom: 0; z-index: 30; box-shadow: var(--pop); } /* below the toolbar, so its buttons stay reachable */ #editor { grid-template-columns: 0 minmax(0, 1fr) 270px; } }
@media (max-width: 860px) { #inspector { position: absolute; right: 0; top: 0; bottom: 0; width: 280px; z-index: 25; box-shadow: var(--pop); transform: translateX(100%); transition: transform .2s; } body.show-inspector #inspector { transform: none; } #editor { grid-template-columns: 0 minmax(0, 1fr) 0; } #toolstrip { left: 30px; } }

/* ---------- panel extras ---------- */
.dr-toolrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 12px; }
.dr-select { height: 32px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); padding: 0 8px; font-size: 12px; }
.dr-count { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.el.art { padding: 4px; background: #ffffff; }
:root[data-theme="dark"] .el.art { background: #f3f5f6; }
.el-img { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 7px; }
.el-img img { width: 100%; height: 100%; object-fit: contain; }
.el.chart, .el.table-tile { aspect-ratio: auto; display: grid; gap: 4px; padding: 10px 8px 8px; }
.el.chart span svg { width: 100%; height: 44px; }
.el.chart small, .el.table-tile small { font: 600 11px var(--font); color: var(--ink-2); }
.tbl-mini { display: grid; grid-template-rows: repeat(4, 10px); border-radius: 5px; overflow: hidden; border: 1px solid var(--tl); background: var(--bg); }
.tbl-mini i { border-top: 1px solid var(--tl); }
.tbl-mini i:first-child { background: var(--th); border-top: 0; }
.tbl-mini i:nth-child(3) { background: var(--tb); }
.el.mine { position: relative; padding: 6px; }
.el.mine img { object-fit: contain; }
.el.mine:hover .up-x { display: grid; }
.el-pals { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.el-pal { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line-2); padding: 0; }
.el-pal.on { box-shadow: 0 0 0 2px var(--gold); }
.btn.back { margin: 4px 0 6px -8px; }
.el-cat-title { margin: 0 0 10px; font: 600 16px var(--font); }
.mini-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.font-list.compact { max-height: 360px; margin-top: 8px; }
.drop-zone { display: grid; justify-items: center; gap: 4px; margin: 12px 0 0; }
.drop-zone .ico { width: 30px; height: 30px; color: var(--muted); }
.drop-zone p { margin: 0; font-weight: 700; color: var(--ink-2); }
.btn.outline.on { border-color: var(--gold); background: var(--gold-tint); }
#drawer .btn.large { margin-bottom: 4px; }

/* ---------- inspector extras ---------- */
.in-head-acts { display: flex; gap: 2px; margin-left: auto; }
.in-head { flex-wrap: nowrap; }
.in-head h2 { min-width: 0; }
.lockednote { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--panel-2); border-radius: 10px; margin: 4px 0 8px; }
.lockednote .ico { width: 16px; height: 16px; }
.in-lbl { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: auto; }
.in-unit { font-size: 12px; font-weight: 700; color: var(--muted); }
.in-select { flex: 1; height: 38px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); padding: 0 8px; }
.in-row.between { justify-content: space-between; }
.tgl-grp.wide { display: flex; } .tgl-grp.wide button { flex: 1; }
.unit-sel { height: 30px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); padding: 0 6px; font-size: 12px; }
.dpi-meter b { font: 700 12.5px var(--font); }
.dpi-meter b.good { color: var(--ok); } .dpi-meter b.ok { color: var(--warn); } .dpi-meter b.bad { color: var(--danger); }
.fx-tile i.fx-demo { font: 800 22px/1 'Poppins', sans-serif; }
.fx-tile i.fx-none { color: var(--ink); }
.fx-tile i.fx-neon { background: #1a1040; }
.data-rows { display: grid; gap: 6px; }
.data-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 6px; align-items: center; }
.data-row.head span { font: 700 11px var(--font-ui); color: var(--muted); }
.tbl-scroll { overflow: auto; max-height: 52vh; }
.tbl-edit { display: grid; gap: 4px; align-items: center; }
.tbl-edit .field { min-height: 32px; padding: 4px 8px; font-size: 12.5px; }
.tbl-edit .field.head { font-weight: 700; background: var(--panel-2); }
.tbl-edit .btn { font-size: 11px; }

/* ---------- rulers and guides ---------- */
#ruler-corner { display: grid; place-items: center; font: 700 9px var(--font-ui); color: var(--muted); cursor: pointer; user-select: none; }
.ruler { cursor: default; }
#ruler-x { cursor: ns-resize; } #ruler-y { cursor: ew-resize; }
.guide-line { position: absolute; z-index: 5; }
.guide-line.h { left: 0; right: 0; height: 7px; margin-top: -3px; cursor: ns-resize; background: linear-gradient(transparent 3px, #00a3e0 3px, #00a3e0 4px, transparent 4px); }
.guide-line.v { top: 0; bottom: 0; width: 7px; margin-left: -3px; cursor: ew-resize; background: linear-gradient(90deg, transparent 3px, #00a3e0 3px, #00a3e0 4px, transparent 4px); }
.guide-line:hover { filter: drop-shadow(0 0 2px #00a3e0); }
.guide-line.ghost { position: fixed; pointer-events: none; z-index: 2000; }
.guide-line.ghost.h { left: 0; right: 0; } .guide-line.ghost.v { top: 0; bottom: 0; }

/* ---------- print previews ---------- */
.mat-overlay { position: absolute; pointer-events: none; z-index: 2; border-radius: 1px; }
.mat-matte { background: linear-gradient(rgba(255, 255, 255, .05), rgba(255, 255, 255, .05)), repeating-radial-gradient(circle at 30% 30%, rgba(0, 0, 0, .025) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.mat-gloss { background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .38) 45%, rgba(255, 255, 255, 0) 60%), linear-gradient(200deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 40%); }
.mat-kraft { background: #b98a52; mix-blend-mode: multiply; opacity: .55; }
.mat-linen { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .045) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .04) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.mat-vinyl { background: linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .25) 35%, rgba(255, 255, 255, 0) 50%), repeating-linear-gradient(45deg, rgba(0, 0, 0, .03) 0 2px, transparent 2px 5px); }
.mat-canvas { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 4px); mix-blend-mode: multiply; }
body.soft-proof .page-stage .canvas-container canvas.lower-canvas { filter: saturate(.84) contrast(.96) brightness(.985); }
.cal { display: grid; gap: 16px; justify-items: center; padding: 10px 0; }
.cal-card { border: 2px dashed var(--teal); border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-weight: 700; background: var(--teal-tint); }
.cal input { width: 100%; }

/* colour picker extras */
.cp-mode { margin-left: auto; }
.cp-mode button { padding: 4px 8px; font-size: 11px; }
.cp-more summary { cursor: pointer; font: 700 11px var(--font-ui); color: var(--muted); padding: 2px 0; }
.cp-note { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

/* buttons keep their own text colour (the .lbl helper class is also used for form labels) */
.btn .lbl, .eb-btn .lbl { color: inherit; font-size: inherit; font-weight: inherit; }
/* effect previews are always shown on paper, so they read the same in light and dark mode */
.fx-tile i { background: #ffffff; color: #1b2a26; }
.fx-tile i.fx-neon { background: #1a1040; }
:root[data-theme="dark"] .fx-tile i { border-color: var(--line-2); }
.combo { background: var(--panel); }
