/* Label Designer — dock panels (properties, objects, variables, data) and app dialogs */
.sec { margin: 0 0 12px; }
.sec-h { display: flex; align-items: center; gap: 6px; margin: 0 0 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.sec-h .grow { flex: 1; }
.row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 6px; margin-bottom: 6px; }
.row > span:first-child { color: var(--text-dim); overflow-wrap: break-word; }   /* wraps rather than cut: "Storlek (mm)" */
.row.wide { grid-template-columns: minmax(0, 1fr); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.num { position: relative; display: flex; align-items: center; min-width: 0; }
.num > b { position: absolute; left: 6px; font-size: 10px; font-weight: 600; color: var(--text-faint); pointer-events: none; }
.num input { padding-left: 18px; }
.inp, .dock-body select, .dock-body textarea, .dlg-form .inp { width: 100%; min-width: 0; height: 26px; padding: 3px 7px; background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--bevel-in); }
textarea.inp { height: auto; min-height: 56px; resize: vertical; font-family: var(--mono); font-size: 11.5px; line-height: 1.4; }
.inp:focus { border-color: var(--accent-line); outline: none; }
.inp.bad { border-color: var(--danger); }
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); white-space: nowrap; }
.chk input { margin: 0; accent-color: var(--accent-line); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--bevel-in); }
.seg button { height: 24px; min-width: 28px; padding: 0 7px; border: 0; background: var(--bg-input); color: var(--text-dim); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-soft); color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent-line); }
.hint { color: var(--text-faint); font-size: var(--fs-s); margin: 2px 0 8px; }
.msg { padding: 6px 8px; border-radius: var(--radius); font-size: var(--fs-s); margin: 0 0 8px; }
.msg.err { background: rgba(229, 72, 77, .14); color: var(--danger); border: 1px solid rgba(229, 72, 77, .4); }
.msg.warn { background: rgba(245, 165, 36, .12); color: var(--warn); border: 1px solid rgba(245, 165, 36, .35); }
.btnrow { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.btnrow .btn { height: 24px; padding: 0 8px; font-size: var(--fs-s); }
.iconrow { display: flex; flex-wrap: wrap; gap: 2px; }
.iconrow .btn { width: 28px; padding: 0; font-size: 13px; }

/* lists: objects, variables */
.list { display: flex; flex-direction: column; gap: 1px; margin: 0 0 8px; }
.li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 28px; padding: 2px 4px 2px 6px; border-radius: var(--radius-s); color: var(--text); cursor: pointer; border: 1px solid transparent; background: none; text-align: left; width: 100%; }
.li:hover { background: var(--bg-hover); }
.li.on { background: var(--sel-row); border-color: var(--accent-line); }
:root[data-theme="classic"] .li:hover, :root[data-theme="classic"] .li.on { color: var(--sl-on-accent, #fff); }
.li .ic { font-size: 11px; color: var(--text-faint); text-align: center; font-family: var(--mono); }
.li .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .sub { display: block; font-size: 10.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .acts { display: flex; gap: 1px; opacity: .55; }
.li:hover .acts, .li.on .acts { opacity: 1; }
.li .acts button { width: 22px; height: 22px; border: 0; background: none; color: inherit; border-radius: 3px; padding: 0; font-size: 12px; }
.li .acts button:hover { background: var(--bg-active); }
.li.hiddenobj .nm { opacity: .5; text-decoration: line-through; }
.empty { color: var(--text-faint); padding: 10px 4px; text-align: center; }

/* data table */
.tbl-wrap { overflow: auto; max-height: 300px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input); }
.tbl { border-collapse: collapse; font-size: 11px; width: max-content; min-width: 100%; }
.tbl th, .tbl td { padding: 3px 7px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.tbl th { position: sticky; top: 0; background: var(--bg-panel-2); font-weight: 600; color: var(--text-dim); }
.tbl tr.on td { background: var(--sel-row); }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--bg-hover); }
:root[data-theme="classic"] .tbl tr.on td, :root[data-theme="classic"] .tbl tbody tr:hover td { color: var(--sl-on-accent, #fff); }

/* dialogs (built on TlbxUI) */
.dlg-form { display: grid; gap: 8px; }
.dlg-form .row { margin: 0; grid-template-columns: 110px minmax(0, 1fr); }
.dlg-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.dlg-cols > div { min-width: 0; }
.stock-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input); }
.stock-list .grp { padding: 5px 8px 3px; font-size: 10.5px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; background: var(--bg-input); }
.stock-list button { display: block; width: 100%; text-align: left; padding: 4px 10px; border: 0; background: none; color: var(--text); }
.stock-list button:hover { background: var(--bg-hover); }
.stock-list button.on { background: var(--sel-row); font-weight: 600; }
:root[data-theme="classic"] .stock-list button:hover, :root[data-theme="classic"] .stock-list button.on { color: var(--sl-on-accent, #fff); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tpl { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-panel-2); color: var(--text); text-align: left; }
.tpl:hover { border-color: var(--accent-line); }
.tpl .tp { display: grid; place-items: center; height: 120px; background: var(--pasteboard); border-radius: 5px; overflow: hidden; }
.tpl .tp canvas { max-width: 92%; max-height: 108px; background: #fff; box-shadow: 0 1px 5px var(--label-shadow); }
.tpl b { font-size: 12px; }
.tpl small { color: var(--text-faint); font-size: 10.5px; }
.pd { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.pd-prev { display: grid; gap: 6px; align-content: start; }
.pd-canvas { display: grid; place-items: center; min-height: 280px; max-height: 56vh; overflow: auto; background: var(--pasteboard); border-radius: 6px; padding: 12px; }
.pd-canvas canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 2px 10px var(--label-shadow); }
.pd-nav { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-dim); }
.pd-out { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pd-out .btn { height: 30px; }
.pd-out .btn.primary { grid-column: 1 / -1; height: 34px; }
.code-view { width: 100%; height: 220px; font: 11px/1.4 var(--mono); background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; white-space: pre; resize: vertical; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); gap: 6px 8px; align-items: center; }
.map-grid .arrow { color: var(--text-faint); text-align: center; }
.sui-dlg.sl-wide { width: min(980px, 100%); }
