/*
 * css/designer-menu.css - the optional Basic-mode side menus (js/designer-menu.js).
 * Everything is scoped to body.dm-on / .dm-root, so with the menu off (Classic,
 * or Advanced mode) this file changes nothing on the page.
 */
body.dm-on {
    --dm-bg: var(--light-panel, #f7f7f9);
    --dm-card: #ffffff;
    --dm-ink: var(--light-hi, #10151c);
    --dm-muted: var(--light-muted, #5b667a);
    --dm-line: #dfe2e7;
    --dm-soft: #eef1f5;
    --dm-hover: #f2f7fa;
    --dm-accent: #0a8cc8;
    --dm-accent-ink: #ffffff;
    --dm-accent-soft: #e3f2fa;
    --dm-ok: #2f9e57;
    --dm-rail: #1d2430;
    --dm-rail-ink: #c9d2de;
    --dm-rail-on: #2b3545;
}
body.dm-on.dark-mode {
    --dm-bg: var(--panel, #10151c);
    --dm-card: #151c26;
    --dm-ink: var(--hi, #f7fbff);
    --dm-muted: var(--muted, #9aa3b2);
    --dm-line: #262f3c;
    --dm-soft: #1d2531;
    --dm-hover: #1a2330;
    --dm-accent: #69d0ff;
    --dm-accent-ink: #0b0e12;
    --dm-accent-soft: #12303f;
    --dm-rail: #0b0f15;
    --dm-rail-ink: #aab4c2;
    --dm-rail-on: #1d2735;
}

/* The classic sections stay in the page (their controls are moved from them,
   and the tool buttons are clicked through), just not shown. */
body.dm-on aside.left > .section { display: none !important; }

.dm-root {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: var(--dm-bg);
    color: var(--dm-ink);
}
.dm-root .dm-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* Only the menu's own buttons - the moved classic controls keep their own look. */
.dm-root :is(.dm-row, .dm-tile, .dm-btn, .dm-back, .dm-done, .dm-next, .dm-step-h, .dm-rail-b) { font: inherit; color: inherit; }
.dm-root :is(.dm-row, .dm-tile, .dm-btn, .dm-back, .dm-done, .dm-next, .dm-step-h, .dm-rail-b):focus-visible { outline: 2px solid var(--dm-accent); outline-offset: -2px; }
.dm-root :is(.dm-park, .dm-drill, .dm-v-x, .dm-row, .dm-step, .dm-part, .dm-rail-b)[hidden] { display: none !important; }

/* header strip: title + "Show me the tour" (moved here from the Tools heading) */
.dm-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 8px; border-bottom: 1px solid var(--dm-line); }
.dm-top-t { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dm-muted); }
.dm-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; background: #fff4e5; color: #7a4a00; font-size: 12px; font-weight: 600; border-bottom: 1px solid #f3d5a6; }
.dm-preview button { border: 1px solid #d99a3d; background: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 12px; color: #7a4a00; }
body.dark-mode .dm-preview { background: #33260f; color: #ffd79a; border-color: #5a4219; }
body.dark-mode .dm-preview button { background: #1d160a; color: #ffd79a; border-color: #8a6420; }

/* shared panel pieces */
.dm-sub { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--dm-muted); }
.dm-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--dm-muted); }
.dm-body, .dm-part-b { display: flex; flex-direction: column; gap: 12px; }
.dm-body .row, .dm-part-b .row { margin: 0; }
.dm-body .row > label, .dm-part-b .row > label { min-width: 72px; }
.dm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dm-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dm-tile { border: 1px solid var(--dm-line); background: var(--dm-card); border-radius: 8px; padding: 11px 4px 9px; display: grid; justify-items: center; gap: 5px; cursor: pointer; font-size: 12px; line-height: 1.2; text-align: center; }
.dm-tile:hover { border-color: var(--dm-accent); }
.dm-tile.on { border-color: var(--dm-accent); background: var(--dm-accent-soft); }
.dm-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 1px solid var(--dm-line); background: var(--dm-card); border-radius: 8px; padding: 9px 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.dm-btn:hover { border-color: var(--dm-accent); }
.dm-btn-big { padding: 14px 10px; }
.dm-stop { font-weight: 500; }
.dm-choice { display: grid; gap: 6px; }
.dm-choice-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--dm-line); background: var(--dm-card); border-radius: 8px; padding: 9px 10px; }
.dm-choice-item.on { border-color: var(--dm-accent); box-shadow: inset 0 0 0 1px var(--dm-accent); }
.dm-choice-item > div { flex: 1; min-width: 0; }
.dm-choice-item b { display: block; font-size: 13px; }
.dm-choice-item small { display: block; font-size: 11.5px; color: var(--dm-muted); }
.dm-tick { color: var(--dm-accent); }
/* Text panel: one entry box per text on the plate (6 Oct 2026). minmax(0, 1fr)
   and min-width: 0 keep a long line inside the card - before, one long text
   pushed the whole panel wider than the menu and it scrolled sideways. */
.dm-textlist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.dm-textline { display: flex; align-items: flex-start; gap: 4px; min-width: 0; border: 1px solid var(--dm-line); background: var(--dm-card); border-radius: 6px; font-size: 13px; transition: border-color .12s, box-shadow .12s; }
.dm-textline:hover { border-color: var(--dm-muted); }
.dm-textline.on { border-color: var(--dm-accent); }
.dm-textline:focus-within { border-color: var(--dm-accent); box-shadow: 0 0 0 2px var(--dm-accent-soft); }
.dm-root .dm-tl-in { flex: 1; min-width: 0; width: 100%; height: 30px; min-height: 30px; max-height: 132px; margin: 0; padding: 6px 2px 5px 9px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; line-height: 1.35; resize: none; overflow-x: hidden; overflow-y: auto; outline: 0; box-shadow: none; box-sizing: border-box; }
.dm-root .dm-tl-in::placeholder { color: var(--dm-muted); opacity: .8; }
.dm-tl-s { color: var(--dm-muted); font-size: 11.5px; flex: none; font-variant-numeric: tabular-nums; padding: 8px 8px 0 0; white-space: nowrap; }
/* Personalise designs: a box that still holds the store's sample wording. */
.dm-textline.dm-tl-sample { border-color: #d98a0b; border-left-width: 4px; background: color-mix(in srgb, #f5a623 11%, var(--dm-card)); }
.dm-textline.dm-tl-sample .dm-tl-in { padding-left: 6px; }
.dm-hint.dm-tl-legend { color: #a86400; font-weight: 600; }
body.dm-on.dark-mode .dm-hint.dm-tl-legend { color: #f0b84a; }
.dm-root .dm-tl-legend[hidden] { display: none !important; }
.dm-empty { font-size: 12px; color: var(--dm-muted); }
/* moved classic sections: their own heading is replaced by the menu's title */
.dm-root #symbolSection { padding: 0; border: 0; margin: 0; }
.dm-root #symbolSection > h3 { display: none; }
.dm-root .plate-panel { margin: 0; }
/* the symbol browser needs the full height of whatever holds it */
.dm-fill { flex: 1; min-height: 0; }
.dm-fill > #symbolSection { flex: 1; min-height: 0; }

/* value text under a name: "60 x 20 mm", "MAIN SWITCH +1" */
.dm-v { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--dm-muted); }
.dm-v-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-v-x { flex: none; font-size: 11px; background: var(--dm-soft); color: var(--dm-ink); border-radius: 4px; padding: 0 5px; }

/* ── A. LIST ─────────────────────────────────────────────────────────── */
.dm-list { flex: 1; min-height: 0; overflow-y: auto; }
.dm-group { padding: 12px 14px 6px; }
.dm-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 14px; background: var(--dm-card); border: 0; border-bottom: 1px solid var(--dm-line); text-align: left; cursor: pointer; }
.dm-row:hover { background: var(--dm-hover); }
.dm-row-ic { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--dm-soft); flex: none; }
.dm-row-t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.dm-row-t b { font-size: 14px; font-weight: 600; }
.dm-chev { width: 18px; height: 18px; color: var(--dm-muted); }
.dm-drill { position: absolute; inset: 0; z-index: 2; background: var(--dm-card); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease; }
.dm-drill.open { transform: none; }
.dm-drill-h { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--dm-line); }
.dm-drill-h b { font-size: 15px; }
.dm-back { border: 0; background: none; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.dm-back:hover { background: var(--dm-soft); }
.dm-drill .dm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.dm-drill .dm-body.dm-fill { overflow: hidden; }
.dm-drill-f { padding: 10px 14px; border-top: 1px solid var(--dm-line); }
.dm-done { width: 100%; border: 0; border-radius: 8px; background: var(--dm-accent); color: var(--dm-accent-ink) !important; font-weight: 600; padding: 9px; cursor: pointer; }

/* ── B. STEPS ────────────────────────────────────────────────────────── */
.dm-prog { padding: 10px 14px 6px; font-size: 12px; color: var(--dm-muted); }
.dm-bar { height: 5px; background: var(--dm-soft); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.dm-bar i { display: block; height: 100%; background: var(--dm-ok); border-radius: 99px; transition: width .2s; }
.dm-steps { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dm-step { background: var(--dm-card); border: 1px solid var(--dm-line); border-radius: 10px; }
.dm-step.open { border-color: var(--dm-accent); }
.dm-step-h { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.dm-step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--dm-soft); flex: none; }
.dm-step.done .dm-step-n { background: var(--dm-ok); color: #fff; }
.dm-step.open .dm-step-n { background: var(--dm-accent); color: var(--dm-accent-ink); }
.dm-step-t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.dm-step-t b { font-size: 14px; }
.dm-step-e { font-size: 12px; color: var(--dm-accent); font-weight: 600; }
.dm-step.open .dm-step-e { display: none; }
.dm-step-b { display: none; padding: 2px 12px 12px; flex-direction: column; gap: 12px; }
.dm-step.open .dm-step-b { display: flex; }
.dm-part { display: flex; flex-direction: column; gap: 8px; }
.dm-next { align-self: flex-start; border: 0; border-radius: 7px; background: var(--dm-accent); color: var(--dm-accent-ink) !important; font-weight: 600; padding: 7px 16px; cursor: pointer; }
.dm-subpanel { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--dm-line); padding-top: 10px; }
.dm-subpanel.dm-fill { height: 420px; max-height: 60vh; }
.dm-subpanel.dm-fill > .dm-part-b { flex: 1; min-height: 0; }

/* ── C. ICON RAIL ────────────────────────────────────────────────────── */
.dm-rail-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 70px minmax(0, 1fr); }
/* The --dm-rail-* colours below are set by Admin > Settings > Designer > Icon rail
   colours (js/rail-schemes.js). Every fallback is the colour used before that
   setting existed, so with nothing saved the rail looks exactly as it did. */
.dm-rail { background: var(--dm-rail-bg, var(--dm-rail)); color: var(--dm-rail-ink); overflow-y: auto; padding-block: 4px; border-right: var(--dm-rail-border, 0); }
.dm-rail-sep { height: 1px; background: var(--dm-rail-sep, rgba(255,255,255,.12)); margin: 5px 10px; }
.dm-rail-b { width: 100%; border: 0; background: none; padding: 8px 2px 7px; display: grid; justify-items: center; gap: 3px; font-size: 10.5px; line-height: 1.15; cursor: pointer; color: inherit !important; position: relative; }
.dm-rail-b:hover { color: var(--dm-rail-hover, #fff) !important; }
.dm-rail-b > span { letter-spacing: var(--dm-rail-track, normal); text-transform: var(--dm-rail-case, none); font-size: var(--dm-rail-size, inherit); }
.dm-rail-b.on { color: var(--dm-rail-on-ink, #fff) !important; background: var(--dm-rail-on); border-radius: var(--dm-rail-on-radius, 0); box-shadow: var(--dm-rail-on-shadow, none); margin-inline: var(--dm-rail-on-inset, 0px); width: calc(100% - 2 * var(--dm-rail-on-inset, 0px)); }
.dm-rail-b.on::before { content: ""; position: absolute; left: calc(-1 * var(--dm-rail-on-inset, 0px)); top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--dm-rail-marker, #45b8ec); }
.dm-card { display: flex; flex-direction: column; min-height: 0; background: var(--dm-card); }
.dm-card-h { padding: 12px 12px 9px; border-bottom: 1px solid var(--dm-line); display: grid; gap: 1px; }
.dm-card-h b { font-size: 15px; }
.dm-card .dm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.dm-card.dm-card-fill .dm-body { overflow: hidden; }
.dm-card .dm-body .row > label { min-width: 58px; }
.dm-card-sum { border-top: 1px solid var(--dm-line); padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px; }
.dm-card-sum span { font-size: 11px; background: var(--dm-soft); border-radius: 4px; padding: 1px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .dm-drill, .dm-bar i { transition: none; } }
