/* Apple design language for the shop back end (loaded after style.css, ops.css and coupons.css).
   Follows Apple's Human Interface Guidelines: the system font, a grouped grey background with plain
   white cards, one tint colour for what you can tap, translucent bars that float over the content,
   a sidebar on computers, a floating tab bar on phones, capsule buttons and segmented controls.
   Colours come from each shop theme's tokens, so a shop's own tint still shows. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Sukhumvit Set", "Thonburi", "Noto Sans Thai", system-ui, "Leelawadee UI", "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Sukhumvit Set", "Thonburi", "Noto Sans Thai", system-ui, "Leelawadee UI", "Segoe UI", Roboto, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Sukhumvit Set", "Noto Sans Thai", system-ui, sans-serif;
  /* default theme = Apple's dark appearance with SK orange as the tint */
  --bg: #000000; --panel: #1c1c1e; --panel-2: #2c2c2e; --line: #38383a;
  --ink: #f5f5f7; --muted: #a1a1a6; --info: #4ea1ff; --focus: #4ea1ff; --field-line: #636366;
  --tint: var(--brand); --on-tint: var(--on-brand); --tint-text: #ff9f0a;
  --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.32); --sep: rgba(84,84,88,.6);
  --mat: rgba(28,28,30,.72); --mat-solid: #1c1c1e; --mat-line: rgba(255,255,255,.08);
  --radius: 16px; --btn-radius: 999px; --r-tile: 12px; --r-field: 12px;
  --shadow: none; --float: 0 8px 32px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
  --hdr-h: 60px; --side: 248px;
}
:root[data-theme="tshirt-master"] {
  /* light appearance: Apple's grouped background, near-black text, the shop's navy as the tint */
  --bg: #f2f2f7; --panel: #ffffff; --panel-2: #f2f2f7; --line: #e5e5ea;
  --ink: #1d1d1f; --muted: #6e6e73; --info: #0066cc; --focus: #0071e3; --field-line: #8e8e93;
  --tint: #15233c; --on-tint: #ffffff; --tint-text: #15233c;
  --fill: rgba(118,118,128,.12); --fill-2: rgba(118,118,128,.2); --sep: rgba(60,60,67,.16);
  --mat: rgba(255,255,255,.74); --mat-solid: #ffffff; --mat-line: rgba(0,0,0,.08);
  --shadow: none; --float: 0 8px 30px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.08);
  --hot: #c8403c;
}

/* ---- Type: the system font (SF Pro + Apple's Thai font on iPhone, iPad and Mac), Apple's sizes ---- */
html, body, :root[data-theme="tshirt-master"] body { font-family: var(--font); }
body { font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, :root[data-theme] h1, :root[data-theme] h2 { font-family: var(--font-display); color: var(--ink); }
h1, :root[data-theme] h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 700; letter-spacing: -.021em; margin: 4px 0 16px; }
h2, :root[data-theme] h2 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; letter-spacing: -.012em; }
.dashgrid h2, :root[data-theme] .dashgrid h2 { font-size: 1.125rem; }
:lang(th) h1, :lang(th) h2, :lang(th) h3 { letter-spacing: 0; line-height: 1.35; }
@media (min-width: 1100px) { h1, :root[data-theme] h1 { font-size: 2rem; } }
.hint { font-size: .875rem; }
a { color: var(--info); }

/* page titles: a large title, no coloured bar beside it */
:root[data-theme] #view > h1, :root[data-theme] #view > .pagehead:not(.dashhead) h1, :root[data-theme] #prodPage > .pagehead h1 { border-left: 0; padding-left: 0; }

/* ---- Bars: translucent material over the content, a hairline under them ---- */
header.top, :root[data-theme] header.top {
  min-height: var(--hdr-h); padding: 8px 16px; background: var(--mat); border-bottom: .5px solid var(--sep); box-shadow: none;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { header.top, :root[data-theme] header.top { background: var(--mat-solid); } }
.whoami .shopname { font-weight: 600; }
.linkbtn { border: 0; background: var(--fill); border-radius: 999px; padding: 7px 12px; font-weight: 600; min-height: 32px; }
.linkbtn:hover { background: var(--fill-2); }

/* round toolbar buttons (search, bell, help): a soft fill, no outline */
.obtn, :root[data-theme] .obtn { border: 0; background: var(--fill); color: var(--ink); transition: background-color .28s var(--m-spring), transform .28s var(--m-spring); }
.obtn:hover { background: var(--fill-2); }
.skh-btn, :root[data-theme] .skh-btn { border: 0; background: var(--fill); }
.skh-btn:hover { border-color: transparent; background: var(--fill-2); }

/* EN / ไทย: Apple's segmented control */
.lang, :root[data-theme] .lang { border: 0; background: var(--fill); padding: 2px; gap: 2px; border-radius: 999px; }
.lang button, :root[data-theme] .lang button { border-radius: 999px; padding: 6px 12px; min-height: 32px; color: var(--ink); font-weight: 500; transition: background-color .28s var(--m-spring), box-shadow .28s var(--m-spring); }
.lang button.active, :root[data-theme] .lang button.active { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
:root:not([data-theme="tshirt-master"]) .lang button.active { background: #636366; }
/* phones: the whole control is 44 px tall, and the SK mark stands alone so the header fits at 360 px */
@media (max-width: 600px) { .lang button, :root[data-theme] .lang button { min-height: 40px; padding: 6px 10px; } }
@media (max-width: 480px) { header.top .logo .pfname { display: none; } }
/* a tablet (820 px) with a long shop name: the names shorten with "…", the buttons keep their size and one line */
header.top .lang, header.top .obtn, header.top .skh-btn, .whoami .linkbtn { flex: none; }
.whoami .linkbtn { white-space: nowrap; }
@media (max-width: 960px) { .whoami .uname { display: none; } }

/* ---- Menu on a computer between 761 and 1099 px: a light bar of pills under the header ---- */
nav.tabs, :root[data-theme] nav.tabs {
  top: var(--hdr-h); gap: 4px; padding: 8px 12px; background: var(--mat); border-bottom: .5px solid var(--sep); box-shadow: none;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
nav.tabs a, :root[data-theme] nav.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .9375rem; transition: background-color .28s var(--m-spring), color .28s var(--m-spring); }
nav.tabs a:hover, :root[data-theme] nav.tabs a:hover { background: var(--fill); color: var(--ink); }
nav.tabs a.active, :root[data-theme] nav.tabs a.active { background: var(--tint); color: var(--on-tint); box-shadow: none; font-weight: 600; }
nav.tabs svg { display: none; width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.navsep, :root[data-theme] .navsep { background: var(--sep); }
:root[data-theme] nav.tabs .tabarrow { color: var(--ink); }
:root[data-theme] nav.tabs .tabarrow.l { background: linear-gradient(to left, transparent, var(--mat-solid) 45%); }
:root[data-theme] nav.tabs .tabarrow.r { background: linear-gradient(to right, transparent, var(--mat-solid) 45%); }
:root[data-theme="tshirt-master"] :is(nav.tabs) :focus-visible { outline-color: var(--focus); }

/* ---- Computers 1100 px and wider: a sidebar, like Mail or Finder ---- */
@media (min-width: 1100px) {
  body:has(> #tabs) { padding-left: var(--side); }
  body:has(> #tabs) > header.top { margin-left: calc(-1 * var(--side)); }
  nav.tabs, :root[data-theme] nav.tabs {
    position: fixed; top: var(--hdr-h); left: 0; bottom: 0; width: var(--side); z-index: 19;
    flex-direction: column; gap: 2px; padding: 12px 10px 24px; overflow-x: hidden; overflow-y: auto;
    border-bottom: 0; border-right: .5px solid var(--sep); }
  nav.tabs a, :root[data-theme] nav.tabs a { display: flex; gap: 12px; padding: 8px 12px; min-height: 40px; border-radius: 10px; font-size: .9375rem; white-space: nowrap; }
  nav.tabs svg { display: block; color: var(--tint-text); }
  nav.tabs a.active svg { color: currentColor; }
  nav.tabs .navcount { margin-left: auto; }
  .navsep, :root[data-theme] .navsep { flex: none; width: auto; height: .5px; margin: 8px 12px; }
  nav.tabs .tabarrow { display: none !important; }
  main, .tipbar { max-width: 1120px; }
}

/* ---- Phones: a floating tab bar (iOS 26 style) and an Apple sheet for "More" ---- */
@media (max-width: 760px) {
  header.top, :root[data-theme] header.top { padding: 6px 12px; min-height: 56px; }
  body:has(> #bottombar) { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .bottombar, :root[data-theme="tshirt-master"] .bottombar {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 4px; border-radius: 32px;
    background: var(--mat); border: .5px solid var(--mat-line); box-shadow: var(--float);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); }
  .bottombar a, .bottombar button, :root[data-theme="tshirt-master"] .bottombar a, :root[data-theme="tshirt-master"] .bottombar button {
    min-height: 56px; gap: 2px; padding: 4px 0; border-radius: 28px; color: var(--ink); font-size: .6875rem; font-weight: 500; letter-spacing: .01em;
    transition: background-color .28s var(--m-spring), color .28s var(--m-spring); }
  :lang(th) .bottombar a, :lang(th) .bottombar button { font-size: .75rem; letter-spacing: 0; }
  .bottombar b { width: 30px; height: 26px; border-radius: 0; }
  .bottombar svg { width: 24px; height: 24px; stroke-width: 1.8; }
  .bottombar .active, :root[data-theme="tshirt-master"] .bottombar .active { color: var(--tint-text); background: var(--fill); font-weight: 600; }
  .bottombar .active b, :root[data-theme="tshirt-master"] .bottombar .active b { background: none; }
  /* Scan stays the one prominent action: a filled circle in the tint colour, inside the bar */
  .bottombar .scanbtn b, .bottombar .scanbtn.active b, :root[data-theme="tshirt-master"] .bottombar .scanbtn b, :root[data-theme="tshirt-master"] .bottombar .scanbtn.active b {
    width: 40px; height: 32px; margin: 0; border: 0; border-radius: 16px; background: var(--hot, var(--tint)); color: #fff; box-shadow: none; }
  .bottombar .scanbtn svg { width: 22px; height: 22px; }
  .bottombar .scanbtn.active { background: none; }
  :root[data-theme="tshirt-master"] :is(.bottombar) :focus-visible { outline-color: var(--focus); }
}
.sheet { background: rgba(0,0,0,.32); }
.sheetbody { position: relative; padding: 22px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--bg); box-shadow: 0 -8px 40px rgba(0,0,0,.2); animation: hig-up .42s var(--m-in); }
.sheetbody::before { content: ''; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill-2); }
.sheethead { margin-bottom: 14px; font-size: 1.0625rem; font-weight: 600; }
.sheetlinks { grid-template-columns: 1fr; gap: 0; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.sheetlinks a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; border-radius: 0; background: none; color: var(--ink); font-weight: 400; position: relative; }
.sheetlinks a + a::before { content: ''; position: absolute; top: 0; left: 50px; right: 0; height: .5px; background: var(--sep); }
.sheetlinks a::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); opacity: .6; flex: none; }
.sheetlinks a .navcount { margin-left: auto; }
.sheetlinks a .navcount + ::after, .sheetlinks a:has(.navcount)::after { margin-left: 8px; }
.sheetlinks a.active { box-shadow: none; background: var(--fill); font-weight: 600; }
.sheetlinks svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--tint-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sheetfoot { border-top: 0; margin-top: 16px; padding: 0 4px; }
@keyframes hig-up { from { transform: translateY(100%); } to { transform: none; } }
/* closing: the sheet slides back down and the dim goes, both easing in (public/motion.css) */
.sheet.leaving { animation: hig-undim .26s var(--m-out) forwards; pointer-events: none; }
.sheet.leaving .sheetbody { animation: hig-down .26s var(--m-out) forwards; }
@keyframes hig-down { to { transform: translateY(100%); } }
@keyframes hig-undim { to { background-color: transparent; } }

/* ---- Cards and grouped content: plain white on the grey background, no outlines or heavy shadows ---- */
.card, :root[data-theme] .card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
:root:not([data-theme="tshirt-master"]) .card { border: 0; }
.station, .minis > *, .stations .station { border-radius: var(--r-tile); }
.alertbar, :root[data-theme] .alertbar { border: 0; border-radius: var(--radius); box-shadow: none; }
.skh-tip, :root[data-theme] .skh-tip { border: 0; border-radius: var(--radius); box-shadow: none; background: var(--panel); padding: 10px 12px; font-size: .9375rem; }
.skh-tip > .skh-i { color: var(--tint-text); }
@media (min-width: 641px) {
  #view > table.resp, :root[data-theme] #view > table.resp { border-radius: var(--radius); box-shadow: none; }
  #view > table.resp th { background: var(--panel); color: var(--muted); font-size: .8125rem; font-weight: 600; border-bottom: .5px solid var(--sep); }
  #view > table.resp td { border-bottom: .5px solid var(--sep); }
}
th, td { border-bottom-color: var(--sep); }

/* ---- Buttons: capsules; filled tint for the main action, a soft grey fill for the rest ---- */
.btn, :root[data-theme] .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: var(--btn-radius); background: var(--tint); color: var(--on-tint); box-shadow: none;
  font-weight: 600; font-size: 1rem; letter-spacing: -.01em; line-height: 1.25;
  transition: background-color .28s var(--m-spring), filter .28s var(--m-spring), transform .28s var(--m-spring), opacity .28s var(--m-spring); }
:lang(th) .btn { letter-spacing: 0; }
.btn:hover, :root[data-theme] .btn:hover { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: scale(.97); opacity: .85; }
.btn.ghost, :root[data-theme] .btn.ghost { background: var(--fill); color: var(--tint-text); border: 0; box-shadow: none; }
.btn.ghost:hover, :root[data-theme] .btn.ghost:hover { filter: none; background: var(--fill-2); border-color: transparent; }
.btn.hot, :root[data-theme] .btn.hot { background: var(--hot); color: #fff; box-shadow: none; }
.btn.small, .headacts .btn { min-height: 36px; padding: 7px 14px; font-size: .9375rem; }
@media (max-width: 600px) { .btn.small, .headacts .btn { min-height: 44px; } }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; filter: none; cursor: default; }
.fchip, :root[data-theme] .fchip { border: 0; background: var(--panel); color: var(--ink); font-weight: 500; min-height: 34px; }
.fchip.on, :root[data-theme] .fchip.on { background: var(--tint); color: var(--on-tint); font-weight: 600; }
.fchip.alert span, :root[data-theme] .fchip.alert span { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; line-height: 20px; text-align: center; opacity: 1; font-variant-numeric: tabular-nums; }
.chip { border: 0; background: var(--fill); }
td.when { font-variant-numeric: tabular-nums; }
/* iPad portrait, narrow tablets and laptops with the sidebar: long customer and design names take two lines so the
   order list fits the screen instead of pushing the whole page sideways */
@media (min-width: 641px) and (max-width: 1439px) { td.clip { white-space: normal; overflow-wrap: anywhere; min-width: 96px; }
  #view > table.resp th, #view > table.resp td { padding-inline: 8px; } }

/* ---- Fields: rounded, white, a quiet edge that still shows where to type, the tint ring on focus ---- */
input, select, textarea, :root[data-theme] input, :root[data-theme] select, :root[data-theme] textarea { border-radius: var(--r-field); border: 1px solid var(--field-line); background: var(--panel); transition: border-color .28s var(--m-spring), box-shadow .28s var(--m-spring); }
input:focus, select:focus, textarea:focus, :root[data-theme] input:focus, :root[data-theme] select:focus, :root[data-theme] textarea:focus {
  outline: 2px solid transparent; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 28%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--tint); }
label { font-weight: 500; }

/* ---- Dashboard: a large title instead of the dark banner; tiles like the Health app ---- */
.dashhead, :root[data-theme] .dashhead { background: none; color: var(--ink); box-shadow: none; padding: 4px 0; border-radius: 0; }
.dashhead::after { display: none; }
.dashhead h1, :root[data-theme] .dashhead h1 { color: var(--ink); }
.dashhead .muted { color: var(--muted); }
.dashhead .hello { color: var(--tint-text); font-weight: 600; letter-spacing: 0; }
:root .dashhead .btn.ghost, :root[data-theme] .dashhead .btn.ghost { background: var(--panel); color: var(--tint-text); border: 0; }
:root[data-theme] .dashhead .btn.ghost:hover { background: var(--fill-2); }
:root[data-theme="tshirt-master"] :is(.dashhead) :focus-visible { outline-color: var(--focus); }
.kpi { padding: 14px 16px; }
.kpi::before { display: none; }
.kpi .ki { width: 32px; height: 32px; border-radius: 10px; top: 12px; right: 12px; }
.kpi .n { font-family: var(--font-rounded); font-weight: 700; letter-spacing: -.02em; }

/* ---- Small things ---- */
.toast, :root[data-theme] .toast { border: 0; border-radius: 999px; padding: 12px 20px; background: rgba(30,30,32,.9); color: #fff; font-weight: 600; box-shadow: var(--float);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: hig-pop .36s var(--m-in); }
@keyframes hig-pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }
.omenu, .odialog { border: 0; border-radius: 14px; }
.pill { font-weight: 700; }
::selection { background: color-mix(in srgb, var(--focus) 28%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .sheetbody, .toast { animation: none; }
  .btn:active:not(:disabled) { transform: none; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  header.top, nav.tabs, .bottombar, :root[data-theme] header.top, :root[data-theme] nav.tabs, :root[data-theme="tshirt-master"] .bottombar {
    background: var(--mat-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---- Feedback and arrival (2026-10-29, "Enhance the whole experience") ---- */
/* messages: an icon says which kind; one or two lines, never wider than the screen; a tap closes it */
.toast, :root[data-theme] .toast { display: flex; align-items: center; gap: 8px; width: max-content; max-width: min(560px, calc(100vw - 32px));
  border-radius: 22px; line-height: 1.4; z-index: 60; cursor: default; }
.toast .ic { flex: none; }
.toast.ok .ic { color: #30d158; }
.toast.bad .ic { color: #ff6961; }
/* no internet: a bar under the header until the connection is back */
.netbar { position: fixed; z-index: 45; top: calc(var(--hdr-h) + 8px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 16px; background: #8a5300; color: #fff; font-weight: 600; line-height: 1.4;
  box-shadow: var(--float); animation: sk-in 380ms var(--m-in) both; }
.netbar[hidden] { display: none; }
.netbar .ic { flex: none; }
/* a screen that takes a moment: grey shapes where it will be (it appears after 180 ms, so a quick screen never flashes) */
.vskel { display: grid; gap: 14px; padding-top: 6px; animation: sk-fade 240ms var(--m-in) both; }
.sk-b { border-radius: 12px; background: var(--fill); animation: sk-pulse 1.2s var(--m-loop) infinite alternate; }
.sk-h { height: 36px; width: min(340px, 64%); }
.sk-s { height: 14px; width: min(560px, 88%); }
.sk-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sk-tile { height: 88px; border-radius: var(--radius); }
.sk-card { height: 190px; border-radius: var(--radius); }
.sk-card.short { height: 120px; }
@keyframes sk-pulse { from { opacity: .5; } to { opacity: 1; } }
.vsr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* a screen that did not load (or an order that does not exist): what happened, and the way on */
.verr { display: flex; gap: 18px; align-items: flex-start; max-width: 640px; margin: 20px 0; padding: 24px; border-radius: var(--radius); background: var(--panel); }
.verr > .ic { flex: none; margin-top: 2px; color: var(--muted); }
.verr h1, :root[data-theme] .verr h1 { font-size: 1.375rem; margin: 0 0 6px; }
.verr p { margin: 0 0 16px; line-height: 1.5; }
.verr-btns { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) { .verr { flex-direction: column; gap: 10px; padding: 20px; } .verr-btns > * { flex: 1 1 auto; } }
/* the title takes focus on a new screen (for screen readers and Tab); it is not a control, so no ring */
#view h1[tabindex="-1"]:focus { outline: none; }
/* ticks in forms: one size everywhere (20 px), in the shop's tint */
.check input[type="checkbox"], .check input[type="radio"] { width: 20px; height: 20px; flex: none; margin: 0; }
@media (prefers-reduced-motion: reduce) { .sk-b, .vskel, .netbar { animation: none; } }
.emptyacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.oempty[hidden] { display: none; }
@media (max-width: 600px) { .oempty:has(.emptyacts) { flex-direction: column; align-items: flex-start; } .emptyacts > * { flex: 1 1 auto; } }
.cukpis .kpi .n.xs { white-space: nowrap; font-size: 1.125rem; }
@media (max-width: 760px) { html:not(:has(.savebar)) { scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom)); } }
/* working: the pressed button spins (after 250 ms) and takes no second press; a thin bar runs along the top while saving */
.sk-busy { pointer-events: none; }
.btn.sk-busy, .linkbtn.sk-busy, button.sk-busy:not(.btn):not(.linkbtn) { position: relative; }
.btn.sk-busy::after, .linkbtn.sk-busy::after { content: ''; width: 14px; height: 14px; flex: none; margin-left: 2px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: sk-fade 200ms var(--m-in) 250ms both, sk-spin 800ms var(--m-loop) infinite; }
@keyframes sk-spin { to { rotate: 360deg; } }
html.sk-working::before { content: ''; position: fixed; z-index: 70; top: 0; left: 0; right: 0; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--focus) 40%, var(--focus) 60%, transparent) 0 0 / 40% 100% no-repeat;
  animation: sk-fade 200ms var(--m-in) both, sk-bar 1.1s var(--m-loop) infinite; }
@keyframes sk-bar { from { background-position: -60% 0; } to { background-position: 160% 0; } }
html.sk-working body { cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  .btn.sk-busy::after, .linkbtn.sk-busy::after { animation: sk-fade 200ms var(--m-in) 250ms both; border-right-color: currentColor; opacity: .6; }
  html.sk-working::before { animation: sk-fade 200ms var(--m-in) both; background: var(--focus); opacity: .5; }
}

/* System test 2026-10-31 (phones and tablets): 44 px tap targets, labels of 12 px or more, text at 4.5:1. */
:root[data-theme="tshirt-master"] { --muted: #636368; }
:root[data-theme="tshirt-master"] .prodphoto .addph { color: #0058b0; }
.bottombar a, .bottombar button { font-size: max(12px, .75rem); }
.optag { font-size: max(12px, .72rem); }
@media (hover: none) and (pointer: coarse) {
  .fchip, :root[data-theme] .fchip, .linkbtn, .lang button, :root[data-theme] .lang button { min-height: 44px; }
  #view select, #view .btn, #view input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]) { min-height: 44px; }
  #view a.ocode { display: inline-flex; align-items: center; min-height: 44px; }
  button.skh-btn, nav.tabs a, :root[data-theme] nav.tabs a { min-height: 44px; }
  #view select, #view input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]) { font-size: max(16px, 1em); }
}

/* Station lock (TSM 2026-11-11): a device locked to one station shows only its station screen. */
body.stlocked #tabs, body.stlocked #bottombar, body.stlocked #whoami, body.stlocked #sheet, body.stlocked #tipbar { display: none !important; }
body.stlocked:has(> #tabs) { padding-left: 0; }
body.stlocked:has(> #tabs) > header.top { margin-left: 0; }
body.stlocked:has(> #bottombar) { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.sc-lockbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 12px; }
.sc-lockbar .linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
.sc-lockbar.on { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft, #e8f1fd); border: 1px solid color-mix(in srgb, var(--accent, #0068d6) 35%, transparent); }
.sc-lockbar.on > div { display: grid; flex: 1; min-width: 180px; gap: 2px; }
.sc-lockbar.on .ic { color: var(--accent, #0068d6); flex: none; }
.sc-lockbar.on .btn { min-height: 44px; }
dialog.stpin { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 22px; background: var(--panel, #fff); color: var(--text, #111); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.stpin::backdrop { background: rgba(10, 15, 25, .45); }
dialog.stpin h2 { margin: 0 0 6px; font-size: 1.15rem; }
dialog.stpin form { display: grid; gap: 12px; }
dialog.stpin label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
dialog.stpin input { min-height: 48px; font-size: 22px; letter-spacing: .3em; text-align: center; border-radius: 12px; border: 1px solid var(--line, #d6d9de); background: var(--bg, #fff); color: inherit; }
dialog.stpin .stpin-err { margin: 0; min-height: 1.2em; color: var(--bad, #c0392b); font-size: .9rem; }
dialog.stpin .stpin-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
dialog.stpin .stpin-btns .btn { min-height: 44px; }
