/* =========================================================
 *  Zing Ops — Kitchen tagging module styles (tg-*)
 *  Loaded after styles.css + ops.css. Tokens from platform.css.
 * ========================================================= */

/* ---- page head ---- */
.tg-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.tg-head .sub { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.tg-headacts { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.tg-outlet { font-weight:600; color:var(--text); }
.tg-outsel { border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); padding:6px 30px 6px 10px; font:inherit; font-size:13.5px; font-weight:600; color:var(--text);
  appearance:none; -webkit-appearance:none; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat:no-repeat; background-position:right 10px center; }

/* ---- search ---- */
.tg-search { position:relative; margin-bottom:12px; }
.tg-search .tg-sic { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-faint); font-size:16px; pointer-events:none; }
.tg-search input { width:100%; box-sizing:border-box; height:42px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); padding:0 12px 0 34px; font:inherit; font-size:15px; color:var(--text); }
.tg-search input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }

/* ---- section chips ---- */
.tg-chips { display:flex; gap:6px; overflow-x:auto; -webkit-overflow-scrolling:touch; margin:0 -4px 12px; padding:2px 4px 6px; scrollbar-width:none; }
.tg-chips::-webkit-scrollbar { display:none; }
.tg-chip { flex:none; font:inherit; font-size:12.5px; font-weight:600; padding:7px 13px; border-radius:999px; border:1px solid var(--border); background:var(--surface); color:var(--text-soft); cursor:pointer; min-height:34px; transition:background .12s, border-color .12s; }
.tg-chip:hover { background:var(--surface-2); border-color:#c9cfdd; }
.tg-chip.on { background:var(--primary); color:#fff; border-color:var(--primary); }
.tg-chip:focus-visible { outline:none; box-shadow:0 0 0 3px var(--primary-soft); }

/* ---- bucket tiles ---- */
.tg-sect { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); margin:8px 0 8px; }
.tg-tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:10px; margin-bottom:16px; }
.tg-tile { text-align:left; font:inherit; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px; min-height:76px; display:flex; align-items:center; gap:12px; cursor:pointer; color:var(--text); position:relative; transition:border-color .12s, box-shadow .12s, background .12s; }
.tg-tile-t { flex:1; min-width:0; }
.tg-n { position:absolute; top:8px; right:10px; font-size:11px; font-weight:700; color:var(--text-faint); background:var(--surface-2); border-radius:999px; padding:1px 7px; }
.tg-tile b { font-size:13.5px; font-weight:600; line-height:1.3; }
.tg-tile .r { font-size:12px; color:var(--text-soft); margin-top:3px; }
.tg-tile .c { font-size:11px; color:var(--text-faint); margin-top:2px; }
.tg-tile:hover { border-color:#c9cfdd; background:var(--surface-2); }
.tg-tile:active { transform:translateY(.5px); }
.tg-tile:focus-visible { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }

/* ---- item list ---- */
.tg-back { font:inherit; font-size:13px; font-weight:600; color:var(--text-soft); background:none; border:none; padding:6px 0; cursor:pointer; margin-bottom:6px; }
.tg-back:hover { color:var(--text); }
.tg-bhead { margin-bottom:10px; }
.tg-bhead b { font-size:17px; font-weight:650; display:block; }
.tg-bhead small { font-size:12.5px; color:var(--text-soft); }
.tg-list { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.tg-li { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px; border-top:1px solid var(--border); cursor:pointer; transition:background .12s; min-height:52px; }
.tg-li:first-child { border-top:none; }
.tg-li:hover { background:var(--surface-2); }
.tg-li b { font-weight:500; font-size:14.5px; display:block; }
.tg-li small { display:block; font-size:12px; color:var(--text-soft); margin-top:1px; }
.tg-li.generic { background:var(--surface-2); }
.tg-li.generic b { color:var(--text-soft); font-style:italic; }
.tg-go { color:var(--text-faint); font-size:20px; line-height:1; }

/* ---- preview card (in the drawer) ---- */
.tg-card { }
.tg-item { font-size:21px; font-weight:700; letter-spacing:-.01em; line-height:1.2; }
.tg-bucket { font-size:12.5px; color:var(--text-soft); margin-top:3px; }
.tg-remark { margin-top:12px; background:var(--amber-bg); color:var(--amber-fg); border:1px solid #f2e3b8; border-radius:var(--radius-sm); padding:8px 11px; font-size:12.5px; font-weight:500; }
.tg-times { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.tg-tbox { border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 12px; background:var(--surface-2); position:relative; }
.tg-tbox .k { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); display:flex; justify-content:space-between; align-items:center; }
.tg-tbox .v { font-size:16px; font-weight:600; margin-top:3px; font-variant-numeric:tabular-nums; }
.tg-tbox .d { font-size:12px; color:var(--text-soft); }
.tg-tbox.out { grid-column:1/-1; background:var(--surface); border-color:var(--primary); }
.tg-tbox.out .v { font-size:30px; font-weight:800; color:var(--primary); letter-spacing:-.01em; line-height:1.1; }
.tg-tbox.out .d { font-size:13px; }
.tg-tbox.out.wait { border-color:var(--border); }
.tg-tbox.out.wait .v { color:var(--text-faint); }
.tg-tbox input[type="datetime-local"] { margin-top:8px; width:100%; box-sizing:border-box; border:1px solid var(--border); border-radius:8px; padding:8px 10px; font:inherit; font-size:15px; }
.tg-edit { font:inherit; font-size:11.5px; font-weight:600; color:var(--blue-fg); background:none; border:none; cursor:pointer; text-transform:none; letter-spacing:0; padding:0; }
.tg-frow { display:flex; gap:10px; margin-top:14px; }
.tg-step { height:42px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); display:flex; align-items:center; justify-content:space-between; padding:0 4px; }
.tg-step button { width:34px; height:34px; border:none; border-radius:8px; background:var(--surface-2); color:var(--text-soft); font:inherit; font-size:18px; font-weight:700; cursor:pointer; }
.tg-step button:hover { background:#eceff5; }
.tg-step b { font-size:16px; }
.tg-actions { display:flex; gap:10px; margin-top:18px; }
.tg-actions .btn { flex:1; min-height:46px; justify-content:center; font-size:15px; }
.tg-actions .btn-primary { flex:2; }
.tg-subacts { display:flex; gap:14px; justify-content:center; margin-top:10px; }
.tg-frow .field select { min-height:42px; }

/* ---- board ---- */
.tg-kpis { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin-bottom:12px; }
.tg-kpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 12px 10px 14px; position:relative; overflow:hidden; }
.tg-kpi .ac { position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--primary); }
.tg-kpi.bad .ac { background:var(--red-fg); } .tg-kpi.warn .ac { background:var(--amber-fg); } .tg-kpi.ok .ac { background:var(--green-fg); }
.tg-kpi .k { font-size:10.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); }
.tg-kpi .v { font-size:24px; font-weight:700; margin-top:3px; font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
.tg-kpi .s { font-size:12px; color:var(--text-faint); }
.tg-brow { display:flex; align-items:center; gap:12px; padding:12px 14px 12px 12px; border-top:1px solid var(--border); cursor:pointer; transition:background .12s; min-height:56px; }
.tg-brow:first-child { border-top:none; }
.tg-brow:hover { background:var(--surface-2); }
.tg-brow .bar { width:4px; align-self:stretch; border-radius:2px; background:var(--green-fg); flex:none; }
.tg-brow.due .bar { background:var(--amber-fg); }
.tg-brow.exp .bar { background:var(--red-fg); }
.tg-brow .t { flex:1; min-width:0; }
.tg-brow b { font-weight:500; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tg-brow small { font-size:12px; color:var(--text-soft); display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tg-brow .when { text-align:right; font-variant-numeric:tabular-nums; flex:none; }
.tg-brow .when b { font-size:14.5px; font-weight:700; }
.tg-brow.exp .when b { color:var(--red-fg); }
.tg-brow.due .when b { color:var(--amber-fg); }
.tg-brow .when small { display:block; }

/* ---- log & master tables ---- */
.tg-filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:12px; }
.tg-filters select, .tg-filters input { height:34px; border:1px solid var(--border); border-radius:8px; background:var(--surface); padding:0 10px; font:inherit; font-size:13px; color:var(--text); }
.tg-filters input[type="search"] { min-width:180px; flex:1; }
.tg-filters select:focus, .tg-filters input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.tg-to { font-size:12.5px; color:var(--text-faint); }
.tg-chk { display:inline-flex; align-items:center; gap:8px; font-size:13.5px; cursor:pointer; }
.tg-chk input { width:auto !important; min-height:0 !important; margin:0; }
.tg-table th.num, .tg-table td.num { text-align:right; font-variant-numeric:tabular-nums; }
.tg-table td.mono { font-family:var(--mono); font-size:12.5px; }
.tg-table tr.grp td { background:var(--surface-2); font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); padding:8px 14px; }
.tg-table tr.dim td { opacity:.55; }
.tg-src { font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:2px 7px; border-radius:999px; }
.tg-src.p { background:var(--purple-bg); color:var(--purple-fg); }
.tg-src.m { background:var(--blue-bg); color:var(--blue-fg); }
.tg-src.o { background:var(--surface-2); color:var(--text-soft); border:1px solid var(--border); }
.tg-tabs { display:flex; gap:18px; border-bottom:1px solid var(--border); margin-bottom:16px; }
.tg-tabs span { font-size:13.5px; font-weight:600; color:var(--text-soft); padding:0 2px 10px; position:relative; cursor:pointer; }
.tg-tabs span.on { color:var(--text); }
.tg-tabs span.on::after { content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; background:var(--primary); }

/* ---- editors ---- */
.tg-kinds { display:grid; grid-template-columns:repeat(4, 1fr); gap:4px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:3px; }
.tg-kinds button { font:inherit; font-size:12.5px; font-weight:600; padding:8px 4px; border-radius:7px; border:none; background:none; color:var(--text-soft); cursor:pointer; }
.tg-kinds button.on { background:var(--surface); color:var(--primary-dark); box-shadow:0 1px 2px rgba(20,25,50,.08); }
.tg-sentence { margin-top:12px; background:var(--blue-bg); color:var(--blue-fg); border-radius:var(--radius-sm); padding:10px 12px; font-size:13px; font-weight:500; line-height:1.5; }
.tg-brands { display:flex; flex-wrap:wrap; gap:8px 16px; }
.tg-pick { border:1px solid var(--border); border-radius:var(--radius-sm); overflow:auto; max-height:320px; margin-top:12px; }
.tg-pr { display:flex; align-items:center; gap:10px; padding:9px 12px; border-top:1px solid var(--border); font-size:13.5px; cursor:pointer; }
.tg-pr:first-child { border-top:none; }
.tg-pr input { width:auto !important; min-height:0 !important; margin:0; }
.tg-pr small { color:var(--text-faint); margin-left:auto; font-size:12px; }
.tg-pr.done { opacity:.5; cursor:default; }
.tg-inline { display:flex; align-items:center; gap:10px; }

/* ---- skeleton ---- */
.tg-skel .sk { background:var(--surface-2); border-radius:8px; height:16px; position:relative; overflow:hidden; }
.tg-skel .sk::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation:tgsh 1.2s infinite; }
.tg-skel .w40 { width:40%; margin:8px 0 14px; }
.tg-skel .sk-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:10px; }
.tg-skel .tile { height:88px; border-radius:var(--radius-sm); }
@keyframes tgsh { from { transform:translateX(-100%); } to { transform:translateX(100%); } }

/* ---- phone bottom tab bar ---- */
.ktabs { display:none; }
@media (max-width: 820px){
  .ktabs { position:fixed; left:0; right:0; bottom:0; z-index:40; display:flex; background:var(--surface); border-top:1px solid var(--border); padding:6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .ktabs button { flex:1; background:none; border:none; font:inherit; font-size:11px; font-weight:600; color:var(--text-faint); padding:4px 0; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:3px; min-height:48px; }
  .ktabs svg { width:22px; height:22px; }
  .ktabs button.on { color:var(--primary); }
  body.has-ktabs .main-pane { padding-bottom:calc(72px + env(safe-area-inset-bottom)); }
  body.has-ktabs .sticky-actions { bottom:calc(60px + env(safe-area-inset-bottom)); }
  .tg-tiles { grid-template-columns:1fr 1fr; }
  .tg-kpis { gap:8px; }
  .tg-kpi .v { font-size:22px; }
  .tg-tbox.out .v { font-size:28px; }
  .tg-filters input[type="search"] { min-width:0; width:100%; }
  .tg-filters select, .tg-filters input { min-height:40px; font-size:16px; }
}

/* ---- master tables: section rows + row actions ---- */
.tg-master tr.sec td { background:var(--surface-2); padding:9px 14px; border-top:1px solid var(--border); }
.tg-master tr.sec.warn td { background:var(--amber-bg); }
.tg-secname { font-size:12px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:var(--text-soft); }
.tg-master tr.empty-sec td { font-size:12.5px; padding:9px 14px 9px 28px; }
.tg-rowacts { text-align:right; white-space:nowrap; }
.tg-rb { font:inherit; font-size:12px; font-weight:600; color:var(--text-soft); background:var(--surface); border:1px solid var(--border); border-radius:7px; padding:4px 9px; margin-left:4px; cursor:pointer; min-width:30px; transition:background .12s, border-color .12s, color .12s; }
.tg-rb:hover { background:var(--surface-2); border-color:#c9cfdd; color:var(--text); }
.tg-rb.ghost { visibility:hidden; display:inline-block; padding:4px 9px; min-width:30px; }
.tfoot-hint { padding:10px 14px; font-size:12.5px; color:var(--text-soft); border-top:1px solid var(--border); }

/* ---- Access → Outlets: module switches ---- */
.acc-tg { width:40px; height:24px; border-radius:999px; border:none; background:#cfd5e1; position:relative; cursor:pointer; padding:0; transition:background .15s; vertical-align:middle; }
.acc-tg span { position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(20,25,50,.25); transition:left .15s; }
.acc-tg.on { background:var(--green-fg); }
.acc-tg.on span { left:18px; }
.acc-tg:focus-visible { outline:none; box-shadow:0 0 0 3px var(--primary-soft); }
.acc-outlets td { vertical-align:middle; }

/* ---- section icons + colours ---- */
.tg-svg { width:20px; height:20px; display:block; }
.tg-svg.sm { width:14px; height:14px; display:inline-block; vertical-align:-2px; margin-right:6px; }
.tg-ico { width:40px; height:40px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; flex:none; }
.tg-ico.xs { width:28px; height:28px; border-radius:8px; }
.tg-ico.xs .tg-svg { width:15px; height:15px; }
.tg-ico.lg { width:48px; height:48px; border-radius:14px; }
.tg-ico.lg .tg-svg { width:24px; height:24px; }
.ic-red    { background:#fdecea; color:#b42318; }
.ic-orange { background:#fff1e6; color:#c2410c; }
.ic-amber  { background:#fdf3d9; color:#9a6700; }
.ic-green  { background:#e8f5ee; color:#177245; }
.ic-teal   { background:#e6f4f2; color:#0f766e; }
.ic-blue   { background:#eaf1fd; color:#175cd3; }
.ic-purple { background:#eeedfe; color:#3c3489; }
.ic-pink   { background:#fdeaf1; color:#b3266c; }
.ic-grey   { background:#eef1f6; color:#5b6478; }
.tg-sect { display:flex; align-items:center; gap:8px; }
.tg-sect .tg-ico.xs { width:22px; height:22px; border-radius:6px; }
.tg-sect .tg-ico.xs .tg-svg { width:12px; height:12px; }
.tg-bhead { display:flex; align-items:center; gap:12px; }
.tg-titlerow { display:flex; align-items:center; gap:12px; }
.tg-li .tg-ico.xs { margin-right:2px; }
.tg-brow .tg-ico.xs { margin-left:2px; }
.tg-master tr.sec .tg-ico.xs { width:22px; height:22px; border-radius:6px; vertical-align:middle; margin-right:8px; }
.tg-master tr.sec .tg-ico.xs .tg-svg { width:12px; height:12px; }
/* pickers in the section editor */
.tg-icons { display:grid; grid-template-columns:repeat(8, 1fr); gap:6px; }
.tg-icons button { height:40px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text-soft); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.tg-icons button:hover { border-color:#c9cfdd; background:var(--surface-2); }
.tg-icons button.on { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); color:var(--text); }
.tg-swatches { display:flex; gap:8px; flex-wrap:wrap; }
.tg-swatches button { width:32px; height:32px; border-radius:50%; border:2px solid transparent; cursor:pointer; position:relative; }
.tg-swatches button::after { content:""; position:absolute; inset:9px; border-radius:50%; background:currentColor; opacity:.9; }
.tg-swatches button.on { border-color:var(--text); }
.tg-preview { margin-top:16px; display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px dashed var(--border); border-radius:var(--radius-sm); }
.tg-preview b { font-size:15px; }
.tg-preview .muted { margin-left:auto; font-size:12px; }
@media (max-width:820px){ .tg-icons { grid-template-columns:repeat(6, 1fr); } .tg-tiles { grid-template-columns:1fr; } .tg-tile { min-height:64px; } }

/* ---- Tidy names banner + preview ---- */
.tg-banner { display:flex; align-items:center; justify-content:space-between; gap:14px; background:var(--amber-bg); border:1px solid #f2e3b8; color:var(--amber-fg); border-radius:var(--radius-sm); padding:10px 14px; margin-bottom:12px; font-size:13px; }
.tg-tidylist { border:1px solid var(--border); border-radius:var(--radius-sm); max-height:50vh; overflow:auto; }
.tg-tidy { display:grid; grid-template-columns:70px 1fr 20px 1fr; gap:10px; align-items:center; padding:8px 12px; border-top:1px solid var(--border); font-size:13px; }
.tg-tidy:first-child { border-top:none; }
.tg-tidy .from { color:var(--text-faint); text-decoration:line-through; }
.tg-tidy .arr { color:var(--text-faint); text-align:center; }

/* ---- collapsible groups in the master ---- */
.tg-master tr.tg-fold td:first-child { cursor:pointer; }
.tg-chev { display:inline-flex; width:18px; height:18px; align-items:center; justify-content:center; color:var(--text-faint); margin-right:6px; vertical-align:middle; transition:transform .15s; }
.tg-chev svg { width:14px; height:14px; }
.tg-chev.open { transform:rotate(90deg); }
.tg-foldbar { display:flex; gap:8px; align-items:center; justify-content:flex-end; margin:0 0 8px; font-size:12.5px; }
.tg-link { font:inherit; font-size:12.5px; font-weight:600; color:var(--text-soft); background:none; border:none; cursor:pointer; padding:2px 4px; }
.tg-link:hover { color:var(--text); text-decoration:underline; }

/* ---- brand scope + the kitchen's own items ---- */
.tg-bpill { display:inline-block; font-size:11.5px; font-weight:600; padding:1px 8px; border-radius:999px; background:var(--surface-2); color:var(--text-soft); border:1px solid var(--border); margin:2px 4px 0 0; }
.tg-bpill.all { background:var(--surface-2); color:var(--text-faint); border:1px solid var(--border); }
.tg-ours { font-size:11px; font-weight:600; color:var(--blue-fg); background:var(--blue-bg); padding:1px 7px; border-radius:999px; margin-left:6px; vertical-align:middle; }
.tg-li.add { background:var(--surface-2); border-top:1px dashed var(--border); }
.tg-li.add b { color:var(--primary); font-weight:600; }
.tg-pcat { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); background:var(--surface-2); padding:6px 12px; border-top:1px solid var(--border); }
.tg-tile.add { border-style:dashed; background:var(--surface-2); }
.tg-tile.add b { color:var(--primary); }
.tg-li.univ .tg-go { color:var(--primary); font-weight:700; }
.tg-bhead .btn { flex:none; }
.tg-plan { padding-left:20px; font-size:14px; line-height:1.55; }
.tg-plan li { margin-bottom:10px; }
.tg-plan ul { margin:6px 0 6px 16px; font-size:13px; color:var(--text-soft); }

/* ---- Tag master v2: brand switcher, section cards, rows ---- */
.tg-brandsw { display:inline-flex; gap:2px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:3px; margin-bottom:14px; }
.tg-brandsw button { font:inherit; font-size:13px; font-weight:600; padding:7px 14px; border-radius:8px; border:none; background:none; color:var(--text-soft); cursor:pointer; }
.tg-brandsw button.on { background:var(--surface); color:var(--text); box-shadow:0 1px 2px rgba(20,25,50,.08); }
.tg-seccard { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:14px; }
.tg-sechead { border-radius:var(--radius) var(--radius) 0 0; }
.tg-seccard > .tg-sechead:last-child { border-radius:var(--radius); border-bottom:none; }
.tg-rows > .tg-row:last-child { border-radius:0 0 var(--radius) var(--radius); }
.tg-seccard.warn { border-color:#f2e3b8; }
.tg-seccard.warn .tg-sechead { background:var(--amber-bg); }
.tg-sechead { display:flex; align-items:center; gap:10px; padding:12px 14px; background:var(--surface-2); border-bottom:1px solid var(--border); cursor:pointer; }
.tg-sechead b { font-size:14.5px; font-weight:650; }
.tg-sechead .muted { font-size:12.5px; }
.tg-sechead .sp { flex:1; }
.tg-sechead .tg-ico.xs { width:26px; height:26px; border-radius:7px; }
.tg-sechead .tg-ico.xs .tg-svg { width:14px; height:14px; }
.tg-rows { }
.tg-row { display:grid; grid-template-columns:1fr 150px 110px 36px 36px; align-items:center; gap:12px; padding:12px 14px; border-top:1px solid var(--border); cursor:pointer; transition:background .12s; }
.tg-row:first-child { border-top:none; }
.tg-row:hover { background:var(--surface-2); }
.tg-row.dim { opacity:.55; }
.tg-row.empty { grid-template-columns:1fr; cursor:default; font-size:13px; }
.tg-row .nm { min-width:0; }
.tg-row .nm b { font-weight:600; font-size:14px; }
.tg-row .nm small { display:block; font-size:12.5px; color:var(--text-soft); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tg-row .cnt { font-size:12.5px; color:var(--text-soft); font-variant-numeric:tabular-nums; }
.tg-kt { font:inherit; text-align:left; border:1px solid var(--border); background:var(--surface); border-radius:10px; padding:6px 10px; cursor:pointer; line-height:1.15; min-width:130px; transition:border-color .12s, background .12s; }
.tg-kt b { display:block; font-size:14px; font-weight:700; color:var(--text); }
.tg-kt small { display:block; font-size:11px; color:var(--text-faint); margin-top:1px; }
.tg-kt:hover { border-color:var(--primary); background:var(--primary-soft); }
.tg-kt.inherit { cursor:default; background:var(--surface-2); border-style:dashed; }
.tg-kt.inherit:hover { border-color:var(--border); background:var(--surface-2); }
.tg-pen { width:34px; height:34px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text-soft); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.tg-pen:hover { color:var(--text); background:var(--surface-2); border-color:#c9cfdd; }
.tg-pen .tg-svg.sm { margin:0; width:15px; height:15px; }
.tg-chipx { display:inline-block; font-size:11.5px; font-weight:600; padding:1px 8px; border-radius:999px; background:var(--surface-2); color:var(--text-soft); border:1px solid var(--border); margin-left:6px; vertical-align:middle; }
.tg-note { font-size:12.5px; font-weight:400; color:var(--text-faint); margin-left:8px; }
.tg-sechead .tg-note { margin-left:2px; }
.tg-more { position:relative; }
.tg-moreb { width:34px; height:34px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text-soft); font-size:16px; font-weight:700; cursor:pointer; line-height:1; }
.tg-moreb:hover { background:var(--surface-2); color:var(--text); }
.tg-menu { display:none; position:absolute; right:0; top:38px; z-index:20; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); box-shadow:var(--shadow-lg); min-width:170px; padding:4px; }
.tg-menu.open { display:block; }
.tg-menu.up { top:auto; bottom:38px; }
.tg-menu button { display:block; width:100%; text-align:left; font:inherit; font-size:13.5px; padding:8px 12px; border:none; background:none; border-radius:7px; cursor:pointer; color:var(--text); }
.tg-menu button:hover { background:var(--surface-2); }
.tg-menu button.danger { color:var(--red-fg); }
@media (max-width:820px){ .tg-row { grid-template-columns:1fr auto; } .tg-row .cnt, .tg-row .tg-more { display:none; } .tg-row .tg-pen { grid-column:2; } .tg-kt { min-width:0; } }
.tg-lblprev { margin-top:12px; }
.tg-lblprev canvas { border:1px solid var(--border); border-radius:6px; box-shadow:var(--shadow); background:#fff; image-rendering:auto; }

/* ---- Printer screen + status chip ---- */
.tg-prcard { }
.tg-prstatus { display:flex; align-items:center; gap:14px; }
.tg-prstatus b { font-size:17px; font-weight:650; display:block; }
.tg-prstatus small { font-size:13px; color:var(--text-soft); }
/* the outlet's designated printer, and the warning when this phone is on a different one */
.tg-prout { display:flex; align-items:center; gap:12px; margin-top:14px; padding:11px 13px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); }
.tg-prout .nm { flex:1; min-width:0; }
.tg-prout small { display:block; font-size:11.5px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--text-faint); }
.tg-prout b { display:block; font-size:14.5px; font-weight:600; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tg-prwarn { margin-top:8px; padding:9px 12px; background:var(--amber-bg); color:var(--amber-fg); border:1px solid #f2e3b8; border-radius:var(--radius-sm); font-size:12.5px; line-height:1.45; }
.linkbtn { background:none; border:0; padding:0; font:inherit; font-weight:700; color:inherit; text-decoration:underline; cursor:pointer; }
.linkbtn:disabled { opacity:.5; cursor:not-allowed; }
.form-grid.three { grid-template-columns:repeat(3,1fr); }
.tg-prsteps { margin-top:10px; display:flex; flex-direction:column; gap:12px; }
.tg-prsteps .st { display:flex; gap:11px; align-items:flex-start; }
.tg-prsteps .n { flex:none; width:22px; height:22px; border-radius:999px; background:var(--primary-soft); color:var(--primary); font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; margin-top:1px; }
.tg-prsteps b { display:block; font-size:14px; font-weight:600; }
.tg-prsteps small { display:block; font-size:12.5px; color:var(--text-soft); line-height:1.5; margin-top:2px; }
@media (max-width:420px){ .form-grid.three { grid-template-columns:repeat(3,1fr); gap:8px; } }
.tg-prchip { font:inherit; font-size:12.5px; font-weight:600; display:inline-flex; align-items:center; gap:6px; padding:6px 11px; border-radius:999px; border:1px solid var(--border); background:var(--surface); color:var(--text-soft); cursor:pointer; }
.tg-prchip .tg-svg.sm { margin:0; }
.tg-prchip.ok { background:var(--green-bg); color:var(--green-fg); border-color:transparent; }
.tg-prchip.warn { background:var(--amber-bg); color:var(--amber-fg); border-color:transparent; }
.tg-adv { margin-top:16px; }
.tg-adv summary { font-size:13px; font-weight:600; color:var(--text-soft); cursor:pointer; }
@media (max-width:820px){ .tg-prcard .tg-actions .btn { min-height:48px; } .tg-head .tg-headacts { width:100%; justify-content:space-between; } }

/* ---- Tags module sub-nav ---- */
.tg-subnav { display:flex; gap:2px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:3px; margin-bottom:14px; }
.tg-subnav button { flex:1; font:inherit; font-size:13px; font-weight:600; padding:8px 6px; border-radius:8px; border:none; background:none; color:var(--text-soft); cursor:pointer; min-height:36px; white-space:nowrap; }
.tg-subnav button.on { background:var(--surface); color:var(--text); box-shadow:0 1px 2px rgba(20,25,50,.08); }
.tg-setup .tg-row { grid-template-columns:1fr 150px 36px; }
@media (max-width:820px){ .tg-subnav { position:sticky; top:0; z-index:5; } .tg-subnav button { min-height:40px; } .tg-setup .tg-row { grid-template-columns:1fr auto 36px; } }

/* ---- mobile pass (22 Sep): compact headers under the sub-nav, tidy rows ---- */
.tg-copies { display:flex; align-items:center; justify-content:space-between; margin-top:14px; }
.tg-copies label { font-size:13px; font-weight:600; color:var(--text-soft); }
.tg-copies .tg-step { width:132px; }
.tg-row.two { grid-template-columns:1fr 36px; }
.tg-setup .tg-row.two { grid-template-columns:1fr 36px; }
@media (max-width:820px){
  .tg-subnav + .tg-head .section-title { display:none; }
  .tg-subnav + .tg-head { align-items:center; flex-wrap:nowrap; margin-bottom:10px; }
  .tg-subnav + .tg-head .sub { font-size:15px; font-weight:600; color:var(--text); }
  .tg-subnav + .tg-head .tg-headacts { width:auto; flex:none; }
  .tg-search { margin-bottom:10px; }
  .tg-setup .tg-row { grid-template-columns:1fr auto 36px; }
  .tg-setup .tg-row.two { grid-template-columns:1fr 36px; }
  .tg-prchip { max-width:46vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}

/* No accidental pull-to-refresh on the phone — a reload drops the Bluetooth link. */
@media (max-width:820px){ html, body { overscroll-behavior-y: contain; } }
.tg-freq .tg-tile { border-color:#f2e3b8; background:#fffdf7; }
.tg-sect .tg-svg.sm { color:var(--amber-fg); }
@media (max-width:820px){ .tg-subnav + .tg-head > div:first-child { flex:1; min-width:0; } .tg-subnav + .tg-head .sub { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; } }
.tg-clrows { margin-top:12px; border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.tg-clrow { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 12px; border-top:1px solid var(--border); font-size:13.5px; }
.tg-clrow:first-child { border-top:none; }
.tg-clrow input { height:34px; border:1px solid var(--border); border-radius:8px; padding:0 8px; font:inherit; font-size:13px; }
.tg-row .nm b .tg-ico.xs { width:20px; height:20px; border-radius:6px; margin-right:7px; vertical-align:-5px; }
.tg-row .nm b .tg-ico.xs .tg-svg { width:11px; height:11px; }
.tg-kinds2 { grid-template-columns:1fr; }
.tg-kinds2 .tg-tile { min-height:84px; }
.tg-tile .c { font-size:11.5px; color:var(--text-faint); margin-top:3px; }
.tg-li.bucket { background:var(--surface-2); }
.tg-li.bucket b { font-weight:600; }
.tg-sect .tg-svg.sm { color:var(--text-faint); }
.tg-tile.empty { opacity:.7; }
.tg-tile.empty .c { color:var(--text-faint); }
#moKinds button { font-size:13px; }

/* ---- bulk runs ---- */
.tg-li.sel { cursor:pointer; }
.tg-li.sel.on { background:var(--primary-soft); }
.tg-cb { width:22px; height:22px; border-radius:6px; border:1.6px solid #c9cfdd; background:#fff; flex:none; position:relative; }
.tg-cb.on { background:var(--primary); border-color:var(--primary); }
.tg-cb.on::after { content:"✓"; position:absolute; inset:0; color:#fff; font-size:13px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.tg-step2 { margin-left:auto; display:inline-flex; align-items:center; border:1px solid var(--border); border-radius:9px; background:#fff; height:34px; flex:none; }
.tg-step2 button { width:32px; height:32px; border:none; background:none; font:inherit; font-size:17px; font-weight:700; color:var(--text-soft); cursor:pointer; }
.tg-step2 b { width:26px; text-align:center; font-size:14px; }
.tg-qty { margin-left:auto; font-size:12.5px; font-weight:700; color:var(--text-soft); background:var(--surface-2); border:1px solid var(--border); border-radius:999px; padding:2px 9px; }
.tg-selbar { position:sticky; bottom:0; margin:14px -16px 0; padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:var(--surface); border-top:1px solid var(--border); box-shadow:0 -6px 18px rgba(20,25,50,.07); display:flex; align-items:center; gap:10px; z-index:6; }
.tg-selbar .t { font-size:14px; font-weight:700; }
.tg-selbar .t small { display:block; font-weight:400; font-size:12px; color:var(--text-soft); }
.tg-selbar .btn-primary { margin-left:auto; }
.tg-prog { height:9px; border-radius:999px; background:var(--surface-2); border:1px solid var(--border); overflow:hidden; }
.tg-prog i { display:block; height:100%; background:var(--primary); transition:width .25s; }
.tg-ok { margin-left:auto; color:var(--green-fg); font-weight:800; }
.btn.on { background:var(--primary); color:#fff; border-color:var(--primary); }
body.has-ktabs .tg-selbar { bottom:calc(60px + env(safe-area-inset-bottom)); }

/* ---- back control ---- */
.tg-backbtn { display:inline-flex; align-items:center; gap:6px; font:inherit; font-size:13.5px; font-weight:600; color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:999px; padding:0 14px 0 10px; height:38px; min-height:38px; cursor:pointer; margin-bottom:12px; box-shadow:0 1px 2px rgba(20,25,50,.05); transition:background .12s, border-color .12s; }
.tg-backbtn svg { width:17px; height:17px; color:var(--text-soft); }
.tg-backbtn:hover { background:var(--surface-2); border-color:#c9cfdd; }
.tg-backbtn:active { transform:translateY(.5px); }
.tg-backbtn:focus-visible { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
@media (max-width:820px){ .tg-backbtn { height:42px; min-height:42px; } }
