/* Duncan Made label maker. Carries its own copy of the site tokens (DIRECTION.md v2, "Call Time"). */
@font-face { font-family: "Bricolage DM"; src: url("fonts/Bricolage-75-800-96.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Atkinson DM"; src: url("fonts/AtkinsonHyperlegibleNext-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson DM"; src: url("fonts/AtkinsonHyperlegibleNext-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  /* Graphite Signal (site palette, owner pick 2026-11-12). --warn stays amber: it is a status colour, not chrome. */
  --ground: #111315; --surface: #1A1D1F; --surface-2: #232729; --key: #3a4045; --key-edge: #1d2124;
  --ink: #F2F1EC; --ink-2: #AEB5B8; --ink-3: #AEB5B8; --line: #737D82;
  --btn: #e9ecee; --btn-ink: #0f1112; --sel: #e9ecee; --sel-ink: #0f1112; --ok: #86e0a8; --warn: #ffb547; --bad: #ff6b5e; --focus: #7cc4ff;
  --scrim: rgba(15, 17, 18, .86);
  --gutter: 16px; --radius: 12px; --tap: 48px;
  --head: "Bricolage DM", system-ui, sans-serif; --body: "Atkinson DM", system-ui, sans-serif;
  color-scheme: dark;
}
/* Dark by default (DIRECTION.md). Light only when the site sets data-theme="light". */
:root[data-theme="light"] {
  --ground: #F7F6F2; --surface: #ffffff; --surface-2: #EFEEE9; --key: #474d52; --key-edge: #24282b;
  --ink: #242729; --ink-2: #41474c; --ink-3: #545b61; --line: #737A7D;
  --btn: #111416; --btn-ink: #ffffff; --sel: #111416; --sel-ink: #ffffff; --ok: #15703a; --warn: #8a5a00; --bad: #b3261e; --focus: #1c64d6;
  --scrim: rgba(229, 231, 233, .90); color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; padding-bottom: 84px; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.hidden { display: none !important; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
code { font: 700 13px/1 ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 2px 5px; border-radius: 5px; white-space: nowrap; }

.top { padding: 8px var(--gutter) 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.logo { height: 11px; width: auto; display: block; }
.light-only { display: none; }
:root[data-theme="light"] .light-only { display: block; }
:root[data-theme="light"] .dark-only { display: none; }
h1 { font: 800 18px/1 var(--head); letter-spacing: -0.01em; margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
h1 .tag { display: none; font: 400 14px/1.2 var(--body); color: var(--ink-3); letter-spacing: 0; }

.layout { display: block; }
.stage { position: sticky; top: 0; z-index: 5; background: var(--ground); padding: 6px var(--gutter) 6px; }
.tabs { display: flex; gap: 0; margin-bottom: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tabs button { flex: 1; min-height: 44px; border: 0; background: transparent; border-radius: 999px; color: var(--ink-2); font-weight: 700; font-size: 15px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--ground); }
.view { position: relative; height: 32vh; min-height: 190px; max-height: 330px; border-radius: var(--radius); overflow: hidden;
  background: var(--key-edge); touch-action: none; }
#gl { display: block; width: 100%; height: 100%; }
.view-ui { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.plate-ui { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; align-items: center; color: #e9ecee; font-weight: 700; font-size: 14px;  }
.pill { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: #111315; color: #e9ecee; font-size: 14px; cursor: pointer;  }
.pill[aria-pressed="true"] { background: #e9ecee; color: #0b0b0c; border-color: #e9ecee; font-weight: 700; }
.ruler { position: absolute; left: 12px; bottom: 8px; right: 12px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #e1e5e8;  pointer-events: none; flex-wrap: wrap; }
.ruler b { color: #fff; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: #d3d8dc; font-size: 15px; background: rgba(0,0,0,.25); }
/* toasts: a bar under the preview, never over the label */
.toast { display: flex; align-items: center; gap: 10px; max-height: 0; overflow: hidden; opacity: 0; transition: opacity 160ms;
  background: var(--surface-2); color: var(--ink); border-radius: 10px; font-size: 14px; padding: 0 12px; margin-top: 0; }
.toast.on { max-height: 80px; opacity: 1; padding: 8px 12px; margin-top: 6px; }
.toast span { flex: 1; }
.toast button { min-height: 44px; border-radius: 999px; border: 1px solid var(--ink-3); background: transparent; color: var(--ink); font-weight: 700; padding: 0 14px; cursor: pointer; }
.big-pill { position: absolute; right: 8px; bottom: 54px; }
.view.backmode .big-pill { display: none; }
/* zoomed into one label of a plate: a clear way back, bottom left, and no caption over the label */
.back-pill { position: absolute; left: 8px; bottom: 8px; font-weight: 700; background: rgba(15,17,18,.78); }
.view.zoomed .ruler { display: none; }
.view.zoomed .plate-ui { display: none; }
.view.zoomed .zoom-tag { top: 60px; }
.zoom-tag { position: absolute; left: 8px; top: 48px; max-width: calc(100% - 16px); background: #111315; color: #e9ecee; font-size: 13.5px; padding: 6px 10px; border-radius: 10px;  }
.ruler .okc { color: #9be7b4; } .ruler .warnc { color: #ffcf8a; }

/* compact preview: after scrolling, on short screens, or while the keyboard is open */
body.compact .view { height: 128px; min-height: 0; }
body.compact .tabs, body.compact .view-ui, body.compact .plate-ui { display: none; }
body.compact .stage { padding-top: 4px; }
body.compact .big-pill { display: none; }
/* a short preview is face on (set in app.js); the size readout moves under the canvas so it never covers the label */
body.compact .view { overflow: visible; margin-bottom: 22px; }
body.compact #gl { border-radius: var(--radius); }
body.compact .ruler { top: calc(100% + 3px); bottom: auto; left: 2px; right: 2px; color: var(--ink-2); text-shadow: none; font-size: 13px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; line-height: 18px; height: 18px; }
body.compact .ruler > span { overflow: hidden; text-overflow: ellipsis; }
body.compact .ruler b { color: var(--ink); }
body.compact .ruler .okc { color: var(--ok); } body.compact .ruler .warnc { color: var(--warn); }
/* keyboard open: no spec line, a slim Download button */
body.typing .spec, body.typing #dlstl, body.typing .dl-note { display: none !important; }
body.typing .dlbar { padding-top: 4px; padding-bottom: 4px; }
body.typing .btn { min-height: 44px; font-size: 15px; }

.dlbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);   border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.spec { flex: 1 1 100%; margin: 0; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.spec .s-more { display: none; }
.spec.open .s-more { display: inline; }
.s-det { margin-left: 8px; min-height: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.dl-note .inline, .note .inline, .fixes button { min-height: 44px; border-radius: 999px; border: 1px solid var(--ink-3); background: var(--surface-2); color: var(--ink); font-weight: 700; padding: 0 14px; cursor: pointer; font-size: 14px; margin: 6px 6px 0 0; }
.fixes { display: flex; flex-wrap: wrap; margin-top: 4px; }
.spec:empty { display: none; }
.btn { flex: 1 1 auto; min-height: 48px; border-radius: 999px; border: 0; background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 17px; cursor: pointer; }
.btn[disabled], .btn2[disabled] { opacity: .4; cursor: not-allowed; }
.btn2 { flex: none; min-height: 48px; min-width: 56px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.btn2.wide { width: 100%; }
.dl-note { display: none; position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(100% + 6px); margin: 0; padding: 10px 12px; font-size: 13.5px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;  }
.dl-note.err { display: block; color: var(--bad); }
.slot { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; white-space: nowrap; }
.slot i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); display: inline-block; }

.controls { padding: 4px var(--gutter) 24px; }
.field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.field.first { padding-top: 6px; }
.lab { font: 800 19px/1.1 var(--head); margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lab.small { font-size: 15px; margin: 10px 0 6px; }
.hint { font: 400 13px var(--body); color: var(--ink-3); }
textarea, select, .stepper input, .kit-save input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 20px; font-weight: 700; letter-spacing: .02em; resize: vertical; }
.textrow { display: flex; gap: 8px; align-items: stretch; }
#text { resize: none; overflow-y: hidden; min-height: 48px; line-height: 1.35; }
.idtiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-bottom: 8px; }
select { min-height: var(--tap); }
textarea:focus, select:focus, input:focus { border-color: var(--ink-3); }
.opts-row { display: flex; gap: 18px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink-2); margin-top: 4px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.note { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }
.note.syntax { line-height: 1.9; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.sugg:empty { display: none; }
.sugg button { min-height: 44px; border-radius: 999px; border: 1px dashed var(--ink-3); background: transparent; color: var(--ink); padding: 0 14px; cursor: pointer; font-size: 14px; margin-top: 8px; }
.msgs { list-style: none; margin: 0; padding: 0; }
.msgs li { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--surface); border-left: 3px solid var(--ink-3); }
.msgs li.err { border-left-color: var(--bad); color: var(--ink); }
.msgs li.warn { border-left-color: var(--warn); }
.msgs li.ok { border-left-color: var(--ok); color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 12px 0 4px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; }
.stats b { display: block; font: 800 26px/1 var(--head); }
.stats span { font-size: 13px; color: var(--ink-3); }
.stats .hot b { color: var(--warn); }
.plates-list { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13.5px; color: var(--ink-2); }
.plates-list li { padding: 4px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.strip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding: var(--gutter); }
.chips.strip::-webkit-scrollbar { display: none; }
.chips.strip > * { flex: none; }
.chip { position: relative; min-height: var(--tap); padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; }
.chip small { display: block; color: var(--ink-3); font-size: 13px; }
.chip[aria-pressed="true"] { outline: 2px solid var(--sel); border-color: transparent; }
.chip[aria-pressed="true"]::after { content: "✓"; position: absolute; top: -7px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--sel); color: var(--sel-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chip[disabled] { opacity: .38; cursor: not-allowed; }
.chips.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.styles .chip { flex-direction: column; align-items: stretch; width: auto; padding: 6px; gap: 4px; }
.styles .chip canvas { width: 100%; height: 52px; border-radius: 8px; background: #2c3135; }
.chip.static { cursor: default; }
.chip.dashed { border-style: dashed; }
.styles .chip span { font-weight: 700; font-size: 14px; padding: 0 2px; }
.dot { width: 28px; height: 28px; border-radius: 50%; flex: none; border: 1px solid rgba(255,255,255,.2); position: relative; overflow: hidden; }
.dot i { position: absolute; inset: 7px; border-radius: 50%; }
.idtile { position: relative; width: 100%; min-width: 0; height: 52px; padding: 0; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0; font: 400 26px/1 Impact, var(--head); cursor: pointer; }
.idtile[aria-pressed="true"] { outline: 2px solid var(--sel);outline-offset:2px; }
/* the selected tile also gets a check badge, so the white G tile reads as selected too */
.idtile[aria-pressed="true"]::after { content: "✓"; position: absolute; bottom: -7px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--sel); color: var(--sel-ink); font: 700 11px/18px var(--body); text-align: center;  }
/* the notches: dark cuts in the top edge, one per number, as on the printed label */
.idtile .n { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; height: 7px; }
.idtile .n b { width: 4px; height: 7px; background: var(--ground); border-radius: 0 0 2px 2px; }
.backs .chip { flex-direction: column; width: calc(33.33% - 6px); padding: 10px 4px 8px; gap: 4px; text-align: center; font-size: 15px; font-weight: 700; }
.backs .chip small { font-weight: 400; }
.backs .chip svg { width: 56px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); cursor: pointer; }
.swatches button[aria-pressed="true"] { outline: 2px solid var(--sel);outline-offset:2px; }
.seg { display: flex; gap: 6px; margin-top: 4px; }
.seg button { flex: 1; min-height: var(--tap); border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; line-height: 1.15; padding: 6px; }
.seg button small { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.seg button[aria-pressed="true"] { outline: 2px solid var(--sel); border-color: transparent; }
.seg button[disabled] { opacity: .38; cursor: not-allowed; }
.seg.mini { display: inline-flex; margin: 0 6px; }
.seg.mini button { min-height: 44px; min-width: 48px; flex: none; }
.extra { margin-top: 12px; color: var(--ink-2); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.thread { margin: 8px 0 0; width: 100%; }
.thread svg { width: 100%; max-width: 420px; height: auto; display: block; }
.thread .lbl { fill: #1a1a1a; stroke: var(--ink-3); stroke-width: 1.5; }
.thread .slit { fill: var(--ground); }
.thread .face { fill: #A0EE8C; opacity: .8; }
.thread .strap { fill: none; stroke: #A0EE8C; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.thread .arrow { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.thread text { fill: var(--ink-3); font: 12px var(--body); }
.thread figcaption { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.custom-size { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; color: var(--ink-2); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; cursor: pointer; }
.stepper input { width: 76px; text-align: center; padding: 8px; font-size: 18px; }
.batch-rows { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--line); }
.batch-rows:empty { display: none; }
.batch-rows li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-top: 1px solid var(--line); font-size: 14.5px; }
.batch-rows li:first-child { border-top: 0; }
.batch-rows li.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.batch-rows .rt { flex: 1; min-width: 0; }
.batch-rows .rt small { display: block; color: var(--ink-3); font-size: 13px; }
.batch-rows li.bad .rt small { color: var(--bad); }
.batch-rows .dot { width: 24px; height: 24px; }
.batch-rows .dot i { inset: 6px; }
.dot.flag { background: var(--bad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.stepper.small button { width: 44px; height: 44px; font-size: 18px; }
.stepper.small .n { min-width: 34px; text-align: center; font-weight: 700; }
#amsSel { width: auto; min-height: 44px; font-size: 16px; padding: 4px 10px; }
.kit-save { display: flex; gap: 8px; }
.kit-save input { font-size: 16px; font-weight: 400; }
.kit-save .btn2.wide { width: auto; }
.kit-list { list-style: none; margin: 8px 0 0; padding: 0; }
.kit-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.kit-list li span { flex: 1; min-width: 0; }
.kit-list li small { display: block; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit-list .btn2 { min-height: 44px; }
.tp-link { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; margin-top: 8px; }

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .top { padding: 22px 48px 12px; gap: 18px; }
  .logo { height: 15px; }
  h1 { font-size: 34px; }
  h1 .tag { display: inline; font-size: 16px; }
  .layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr); gap: 36px; padding: 0 48px 80px; align-items: start; }
  .stage { top: 16px; padding: 0; }
  .view { height: calc(100vh - 230px); max-height: 720px; min-height: 380px; }
  .dlbar { position: static; margin-top: 10px; border: 1px solid var(--line); border-radius: 18px; padding: 10px; flex-wrap: wrap; background: var(--surface);  }
  .dlbar .btn { flex: 1 1 auto; }
  .dl-note { display: block; position: static; flex: 1 1 100%;  border: 0; background: none; padding: 2px 6px 0; color: var(--ink-3); }
  .spec { white-space: normal; font-size: 14px; }
  .spec .s-more { display: inline; } .s-det { display: none; }
  .controls { padding: 0 0 40px; }
  .chips.strip { flex-wrap: wrap; overflow: visible; margin: 0; padding: 4px 2px 6px; }
  .styles .chip canvas { height: 62px; }
}
.chip:focus-visible,.idtile:focus-visible,.swatches button:focus-visible,.seg button:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
@media (prefers-reduced-motion: reduce) { .toast, .view { transition: none; } }

/* Shared site shell; artwork and print geometry are unchanged. */
@font-face{font-family:"Bricolage Grotesque";src:url(/assets/fonts/bricolage.woff2) format("woff2");font-weight:200 800;font-display:swap}
:root{--head:"Bricolage Grotesque",system-ui,sans-serif;--header-h:64px}
.top .brand{display:none}.top h1{letter-spacing:-.02em}
.dm-back{position:relative;z-index:6;background:var(--ground);border-bottom:1px solid var(--line)}
.dm-back-in{max-width:1280px;margin:0 auto;padding:0 16px;min-height:calc(var(--header-h) - 1px);display:flex;flex-wrap:wrap;align-items:center;gap:12px;font:600 16px/1.4 var(--body)}
.dm-back-in a{color:var(--ink);text-decoration:none;min-width:44px;min-height:44px;display:inline-flex;align-items:center}.dm-back-in a:hover{text-decoration:underline}
.dm-logo{margin-right:auto;flex:none}.dm-logo img{height:18px;width:auto}.dm-word{font:700 18px var(--head);white-space:nowrap;letter-spacing:-.03em}.dm-icon{justify-content:center}.dm-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2}
#dl3mf.btn{background:#3EF0B0;color:#10231D}
@media(max-width:899px){.dm-back-in .dm-wide{display:none}}
@media(max-width:599px){.dm-logo>img{display:none!important}}
@media(min-width:600px){.dm-word{display:none}.dm-back-in{padding-inline:24px}}
@media(min-width:900px){:root{--header-h:72px}.dm-back-in{padding-inline:32px}.dm-logo img{height:20px}}
@media(min-width:1200px){.dm-back-in{padding-inline:40px}}
@media(min-width:960px){.top{max-width:1280px;margin:0 auto;padding:24px 40px 12px}.layout{max-width:1280px;margin:0 auto;padding:0 40px 80px}}
.more-opts > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.more-opts > summary::-webkit-details-marker { display: none; }
.more-opts > summary::after { content: "+"; margin-left: auto; font-size: 20px; font-weight: 400; }
.more-opts[open] > summary::after { content: "\2212"; }
.more-opts > .field:last-child { border-bottom: 0; }
.first-tp { display: inline-block; margin: 14px 0 2px; }
