/* Huesmith controls, after Material Design 3 (m3.material.io, Apache 2.0): shapes, color roles and state layers.
   Loaded after each page's own styles, so every control in both apps looks and behaves the same.
   Sizes stay Huesmith's (denser than stock M3): 38 px buttons, 32 px small ones, 30-32 px chips and segments.

   Color roles (M3 -> Huesmith tokens):
     primary            --accent           filled buttons, selected tab, focus, links
     on-primary         --accent-ink
     secondary-container --accent-soft     selected segment, tonal chips
     on-secondary-cont. --on-soft
     outline            --outline          outlined buttons, segments, chips, fields
     outline-variant    --line             dividers, cards
   State layers: hover 8 %, pressed 12 % of the content color, laid over any fill. Disabled: 38 %. */
:root{--outline:#8A8A94;--on-soft:#05333D}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--outline:#6E6E78;--on-soft:#B8EAF3}}
:root[data-theme="dark"]{--outline:#6E6E78;--on-soft:#B8EAF3}

/* state layer shared by every pressable control */
.btn,.seg button,.tab,.ptabs button,.chipbtn,.chipwrap .x,.linkbtn,.swpick,.info{transition:box-shadow .15s,background-color .15s,border-color .15s,color .15s}
.btn:hover,.seg button:hover,.tab:hover,.ptabs button:hover,.chipbtn:hover,.chipwrap .x:hover,.linkbtn:hover,.swpick:hover{box-shadow:inset 0 0 0 100px color-mix(in srgb,currentColor 8%,transparent)}
.btn:active,.seg button:active,.tab:active,.ptabs button:active,.chipbtn:active,.linkbtn:active,.swpick:active{box-shadow:inset 0 0 0 100px color-mix(in srgb,currentColor 12%,transparent)}

/* buttons: filled (primary) and outlined (everything else), fully rounded */
.btn{border-radius:999px;font-weight:500;border:1px solid var(--outline);background:transparent;color:var(--ink);padding:0 16px;filter:none}
.btn:hover{border-color:var(--outline)}
.btn.small{padding:0 13px}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.btn.primary:hover{filter:none}
.btn:disabled,.btn:disabled:hover{opacity:.38;box-shadow:none;cursor:not-allowed}
/* text button: links that act */
.linkbtn{color:var(--accent);text-decoration:none;font-weight:500;border-radius:999px;padding:4px 10px}
.linkbtn:hover{color:var(--accent)}

/* segmented buttons: one outlined, fully rounded group; the chosen option is filled and ticked */
.seg{background:transparent;border:1px solid var(--outline);border-radius:999px;padding:0;gap:0;overflow:hidden}
.seg button{border-radius:0;min-height:32px;padding:6px 12px;color:var(--ink);font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:5px}
.seg button+button{border-left:1px solid var(--outline)}
.seg button[aria-pressed="true"],.seg button[aria-selected="true"]{background:var(--accent-soft);color:var(--on-soft);box-shadow:none}
.seg button[aria-pressed="true"]:hover,.seg button[aria-selected="true"]:hover{box-shadow:inset 0 0 0 100px color-mix(in srgb,currentColor 8%,transparent)}

/* tabs: label in the primary color when selected, with a 3 px indicator rounded on top */
.tab,.ptabs button{font-weight:500;border-bottom:0;position:relative;border-radius:8px 8px 0 0}
.tab[aria-selected="true"],.ptabs button[aria-selected="true"]{color:var(--accent)}
.tab[aria-selected="true"]::after,.ptabs button[aria-selected="true"]::after{content:"";position:absolute;left:12px;right:12px;bottom:0;height:3px;border-radius:3px 3px 0 0;background:var(--accent)}
.tab .count{font-family:var(--f-body);font-weight:500;border-radius:999px;padding:1px 7px}

/* chips: 8 px corners, outlined; spool chips keep their remove button inside */
.chipwrap{border-radius:8px;border-color:var(--outline)}
.chipwrap:hover{border-color:var(--outline)}
.chipwrap .chipbtn,.chipwrap .chipbtn:hover{box-shadow:none}
.chipwrap:hover{box-shadow:inset 0 0 0 100px color-mix(in srgb,var(--ink) 6%,transparent)}
.chipwrap .x{border-radius:0 8px 8px 0}
.chipbtn{border-radius:8px}
.chipbtn.add,.chipbtn.addpill{border-style:solid;border-color:var(--outline);color:var(--accent);background:transparent}
.chipbtn.add:hover,.chipbtn.addpill:hover{border-color:var(--outline);background:transparent}
.swpick{border-radius:8px}
.swpick:hover{border-color:var(--outline)}

/* status pills and badges: small tonal labels with 8 px corners */
.pill,.de{border-radius:8px}
.est{display:inline-block;text-transform:none;letter-spacing:0;font-size:11.5px;font-weight:500;padding:0 7px;border-radius:6px;line-height:18px;background:color-mix(in srgb,var(--warn) 14%,transparent)}
.est.ok,.est.cal{background:color-mix(in srgb,var(--good) 14%,transparent)}

/* fields: outlined, 4 px corners, primary outline on focus */
select,.sel,.field,.hexin,.savebar input,.presetform input,.numin input{border-radius:4px;border-color:var(--outline)}
input[type=color]{border-radius:8px}
select:focus-visible,.sel:focus-visible,.field:focus,.hexin:focus,.savebar input:focus,.presetform input:focus,.numin input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}

/* checkboxes: 16 px, 2 px corners, filled with the primary color when ticked */
.check input[type=checkbox]{-webkit-appearance:none;appearance:none;width:16px;height:16px;margin:0;border:2px solid var(--muted);border-radius:3px;display:inline-grid;place-items:center;background:transparent;cursor:pointer;flex:none}
.check input[type=checkbox]:checked{background:var(--accent);border-color:var(--accent)}
.check input[type=checkbox]:checked::after{content:"";width:10px;height:10px;background:var(--accent-ink);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27%3E%3Cpath d=%27M2 6.3l2.6 2.6L10 3.4%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27%3E%3Cpath d=%27M2 6.3l2.6 2.6L10 3.4%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E") center/contain no-repeat}
.check input[type=checkbox]:disabled{opacity:.38;cursor:not-allowed}

/* notices and cards: 12 px corners (M3 medium shape) */
.note{border-radius:12px}

/* info: an outlined icon button */
.info{border-color:var(--outline)}
.info:hover,.info:focus-visible{background:color-mix(in srgb,var(--accent) 8%,var(--panel))}

/* narrow screens: a segmented group shares the width evenly and its labels may wrap, instead of running off the edge */
@media (max-width:560px){
  .seg:not(.chips){display:grid;grid-auto-flow:column;grid-auto-columns:1fr;max-width:100%}
  .seg:not(.chips) button{white-space:normal;line-height:1.2;text-align:center;padding:6px 8px;min-width:0}
}

/* choice chips: for four or more options, or labels too long for one row. Each option is its own chip and the row
   wraps, instead of a pill split into a grid */
.seg.chips{display:flex;flex-wrap:wrap;gap:6px;border:0;border-radius:0;overflow:visible;background:none;padding:0}
.seg.chips button,.seg.chips button+button{border:1px solid var(--outline);border-radius:8px;min-height:32px;padding:4px 12px;white-space:nowrap}
.seg.chips button[aria-pressed="true"]{border-color:transparent}

/* toasts (shared/toast.js): stacked cards, bottom right; bottom center on phones, above Paint's action bar */
.toasts{position:fixed;right:16px;bottom:16px;width:min(360px,calc(100vw - 32px));z-index:80;transition:height .25s}
.toastitem{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:10px;padding:11px 10px 11px 12px;background:var(--panel);color:var(--ink);
  border:1px solid var(--line);border-radius:12px;box-shadow:0 6px 20px rgba(0,0,0,.12),0 1px 3px rgba(0,0,0,.06);font-size:13.5px;line-height:1.35;
  transform-origin:center bottom;transition:transform .32s cubic-bezier(.2,.8,.2,1),opacity .25s}
.toastitem.enter{transform:translateY(120%)!important;opacity:0!important}
.toastitem.leave{transform:translateY(40%) scale(.96)!important;opacity:0!important}
.toastitem .ticon{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;flex:none;color:#fff;background:var(--accent)}
.toastitem .ticon svg{width:13px;height:13px}
.toastitem.t-ok .ticon{background:var(--good)}
.toastitem.t-err .ticon{background:var(--bad)}
.toastitem.t-busy .ticon{background:none}
.toastitem .spin{width:16px;height:16px;border-radius:50%;border:2px solid color-mix(in srgb,var(--accent) 25%,transparent);border-top-color:var(--accent);animation:tspin .8s linear infinite}
@keyframes tspin{to{transform:rotate(360deg)}}
.toastitem .ttext{flex:1;min-width:0}
.toastitem .tsub{font-size:12px;color:var(--muted);margin-top:1px}
.toastitem .tact{border:1px solid var(--outline);background:transparent;color:var(--ink);border-radius:999px;min-height:28px;padding:0 12px;font-weight:500;font-size:12.5px;cursor:pointer;flex:none}
.toastitem .tact:hover{box-shadow:inset 0 0 0 100px color-mix(in srgb,currentColor 8%,transparent)}
.toastitem .thint{font:500 11px var(--f-mono);color:var(--muted);flex:none}
.toastitem .tclose{border:0;background:none;color:var(--muted);width:24px;height:24px;border-radius:50%;cursor:pointer;font-size:16px;line-height:1;flex:none;padding:0}
.toastitem .tclose:hover{color:var(--ink);background:color-mix(in srgb,var(--ink) 8%,transparent)}
@media (max-width:600px){.toasts{left:50%;right:auto;transform:translateX(-50%)}.toastitem .thint{display:none}}
body.hasbar .toasts{bottom:84px}
@media (prefers-reduced-motion:reduce){.toastitem,.toasts{transition:none}.toastitem .spin{animation-duration:2s}}

/* tooltips become M3 rich tooltips: a light card with a bold title line, for (i) buttons and option tiles */
.tipbox{background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:10px 13px;font-size:13px;line-height:1.5;
  box-shadow:0 6px 24px rgba(0,0,0,.14),0 1px 3px rgba(0,0,0,.06);max-width:min(310px,calc(100vw - 24px))}
.tipbox b{font-weight:600;color:var(--ink)}

/* Cyan, magenta, yellow (and black): options and steps take the brand's process colors by position, so a row of
   three reads C, M, Y. Selected segments and chips get the soft tint, tabs the colored indicator. */
:root{--c-bg:#DDF3F8;--c-ink:#075261;--c-line:#14B8D4;--m-bg:#FBE4EE;--m-ink:#8A1F50;--m-line:#E8478B;--y-bg:#FDF2CF;--y-ink:#6E5200;--y-line:#E3B21C;--k-bg:#E7E7EA;--k-ink:#18181B;--k-line:#3F3F46}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--c-bg:#0F3138;--c-ink:#8EE3F2;--m-bg:#3A1828;--m-ink:#F7A8C9;--y-bg:#3A2F0E;--y-ink:#F7D77A;--k-bg:#2A2A2F;--k-ink:#EDEDEF;--k-line:#A0A0AB}}
:root[data-theme="dark"]{--c-bg:#0F3138;--c-ink:#8EE3F2;--m-bg:#3A1828;--m-ink:#F7A8C9;--y-bg:#3A2F0E;--y-ink:#F7D77A;--k-bg:#2A2A2F;--k-ink:#EDEDEF;--k-line:#A0A0AB}
.seg button:nth-child(4n+1),.tabs .tab:nth-child(4n+1),.ptabs button:nth-child(4n+1){--sb:var(--c-bg);--si:var(--c-ink);--sl:var(--c-line)}
.seg button:nth-child(4n+2),.tabs .tab:nth-child(4n+2),.ptabs button:nth-child(4n+2){--sb:var(--m-bg);--si:var(--m-ink);--sl:var(--m-line)}
.seg button:nth-child(4n+3),.tabs .tab:nth-child(4n+3),.ptabs button:nth-child(4n+3){--sb:var(--y-bg);--si:var(--y-ink);--sl:var(--y-line)}
.seg button:nth-child(4n+4),.tabs .tab:nth-child(4n+4),.ptabs button:nth-child(4n+4){--sb:var(--k-bg);--si:var(--k-ink);--sl:var(--k-line)}
.seg button[aria-pressed="true"],.seg button[aria-selected="true"]{background:var(--sb);color:var(--si)}
.tab[aria-selected="true"],.ptabs button[aria-selected="true"]{color:var(--si)}
.tab[aria-selected="true"]::after,.ptabs button[aria-selected="true"]::after{background:var(--sl)}
/* numbered sections and steps: 1 cyan, 2 magenta, 3 yellow, 4 black */
.num.c{background:var(--c-bg);color:var(--c-ink)}
.num.m{background:var(--m-bg);color:var(--m-ink)}
.num.y{background:var(--y-bg);color:var(--y-ink)}
.num.k{background:var(--k-bg);color:var(--k-ink)}
.steps{list-style:none;padding-left:0;counter-reset:st}
.steps li{counter-increment:st;display:flex;gap:8px;align-items:baseline}
.steps li::before{content:counter(st);flex:none;width:18px;height:18px;border-radius:50%;display:inline-grid;place-items:center;font:600 11px/1 var(--f-mono);background:var(--c-bg);color:var(--c-ink);transform:translateY(-1px)}
.steps li:nth-child(2)::before{background:var(--m-bg);color:var(--m-ink)}
.steps li:nth-child(3)::before{background:var(--y-bg);color:var(--y-ink)}
.stp{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;font:600 11px/1 var(--f-mono);margin:0 3px 0 6px;vertical-align:1px}
.stp.c{background:var(--c-bg);color:var(--c-ink)}.stp.m{background:var(--m-bg);color:var(--m-ink)}.stp.y{background:var(--y-bg);color:var(--y-ink)}
/* info notes: tinted with the accent, so the (i) reads as information, not as a gray placeholder */
.note.is-info{--nc:var(--accent);--nb:color-mix(in srgb,var(--accent) 28%,var(--line));--nbg:color-mix(in srgb,var(--accent) 6%,var(--panel))}
/* notice icons: 18 px, the drawn i optically centered (its dot sits high, so nudge the glyph down a hair) */
.note .nic{width:18px;height:18px;margin-top:1px;line-height:18px}
/* the drawn i is centered absolutely: the hidden letter in the element would otherwise form a second grid row
   (18 px tall) and push the drawing to the top of the circle */
.note.is-info .nic{position:relative;display:block;line-height:0;color:transparent}
.note.is-info .nic::before{position:absolute;inset:0;margin:auto;width:10px;height:10px;transform:none;background:var(--panel)}

/* spool rack: reset button beside the preset switch, and a dot marking the preset you changed */
.setwrap{display:inline-flex;align-items:center;gap:6px;flex:none;max-width:100%}
.resetbtn{width:32px;height:32px;border-radius:50%;border:1px solid var(--outline);background:transparent;color:var(--ink);display:inline-grid;place-items:center;cursor:pointer;flex:none;padding:0;transition:box-shadow .15s}
.resetbtn svg{width:15px;height:15px}
.resetbtn:hover{box-shadow:inset 0 0 0 100px color-mix(in srgb,currentColor 8%,transparent)}
.resetbtn.off{visibility:hidden}
.seg button.edited{position:relative}
.seg button.edited::after{content:"";position:absolute;top:5px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--m-line)}
@media (max-width:560px){.setwrap{width:100%}.setwrap .seg{flex:1}}

/* the closing notice (demo / not affiliated): centered under the page, the same in both apps */
.foot{font-size:12.5px;line-height:1.55;color:var(--muted);max-width:80ch;margin-left:auto;margin-right:auto;text-align:center;text-wrap:balance}

/* every spool the same material: the material is named once in the rack summary, not on each chip */
.samemat .spoolchip .mat{display:none}

/* header: icon-only buttons (theme switch, More) and the phone row they open */
.hbtn{width:32px;padding:0!important;justify-content:center;flex:none}
.hbtn svg{width:16px;height:16px}
.moremenu{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;align-items:center;margin-top:10px}
.moremenu .btn{min-width:0!important}
@media (max-width:600px){.apphead .exportrow{flex-wrap:nowrap;width:100%;justify-content:flex-end}.apphead .applink{min-width:0}}

/* a term with an explanation on hover or tap (ΔE in the closing notice) */
.term{text-decoration:underline dotted;text-underline-offset:3px;cursor:help;color:inherit}
.term:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}
.foot .info{width:16px;height:16px;vertical-align:-3px}
.foot .info::before{width:9px;height:9px}
.rackfull{align-self:center}
