:root {
  --bg: #000000;
  --card: #121212;
  --card2: #1a1a1c;
  --ink: #f5f5f7;
  --muted: #8e8e93;
  --line: #2a2a2d;
  --accent: #e08ab4;
  --accent-ink: #2a0f1c;
  --accent-soft: #3a2230;
  --blue: #6c8cff;
  --good: #34c759;
  --danger: #ff6b61;
  --warn: #f2c66d;
  --warn-soft: #3a2f14;
  --shadow: none;
  --r: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; letter-spacing: .01em; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); font-size: .9rem; }
.pre { white-space: pre-line; }
.hidden { display: none !important; }
.mt { margin-top: 12px; }
.err-text { color: var(--danger); font-size: .92rem; min-height: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* header */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--accent); color: var(--accent-ink);
}
.bar h1 { flex: 1; font-size: 1.1rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .icon-btn { color: var(--accent-ink); }
.chip-btn {
  border: 1px solid color-mix(in srgb, var(--accent-ink) 45%, transparent); background: transparent; color: var(--accent-ink);
  border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .85rem; cursor: pointer;
}
.icon-btn {
  min-width: 40px; height: 40px; border: 0; background: transparent; color: var(--ink); font-size: 1.25rem;
  border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:active { background: rgba(127, 127, 127, .2); }
.page { max-width: 640px; margin: 0 auto; padding: 14px 12px max(28px, env(safe-area-inset-bottom)); display: grid; gap: 12px; }

/* brand */
.logo {
  width: 64px; height: 64px; border-radius: 18px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font: 700 2rem/1 Georgia, serif; margin: 0 auto 8px;
}
.logo.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; margin: 0; background: var(--accent-ink); color: var(--accent); }
.brand { text-align: center; margin-bottom: 8px; }
.brand h1 { font: 700 1.8rem/1.2 Georgia, serif; }

/* layout */
.center-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 18px; }
.center-wrap > .card { width: min(420px, 100%); display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.form { display: grid; gap: 14px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; gap: 10px; }
.row.between input { flex: 1; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.item { display: flex; gap: 12px; align-items: flex-start; }
.item h3 { overflow-wrap: anywhere; }
.hello { padding: 4px 2px; }
.big-no { display: flex; justify-content: space-between; align-items: baseline; }
.big-no strong { font-size: 1.6rem; color: var(--accent); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 12px;
  display: grid; gap: 2px; justify-items: start; box-shadow: var(--shadow); min-height: 112px; align-content: start;
}
.tile:active { transform: scale(.98); background: var(--accent-soft); }
.tile .ico { font-size: 1.7rem; margin-bottom: 6px; }
.tile strong { font-size: 1rem; }

/* forms */
.field { display: grid; gap: 5px; }
.lbl { font-size: .85rem; font-weight: 600; color: var(--muted); }
.hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }
input.qty { width: 92px; flex: none; min-height: 40px; padding: 6px 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg); font-size: .95rem; user-select: none;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.part-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.part-row .muted { margin-left: auto; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill { display: inline-block; font-size: .78rem; padding: 3px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; margin-top: 6px; }

/* buttons */
.btn {
  font: inherit; font-weight: 600; border-radius: 10px; border: 1.5px solid var(--line); padding: 11px 16px; min-height: 46px;
  background: var(--card); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.loading::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; padding: 0 0 0 6px; }
.demo-note { font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }
.demo-note code { background: var(--bg); padding: 1px 6px; border-radius: 6px; }

/* photos */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.thumb.sm { width: 56px; height: 56px; flex: none; }
.thumb-wrap { position: relative; }
.thumb-x {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: var(--danger); color: #fff; font-size: .7rem; cursor: pointer;
}
.media-img { width: 100%; max-height: 360px; object-fit: contain; background: var(--bg); border-radius: 10px; margin: 10px 0 6px; }
.lotinfo { display: flex; gap: 12px; align-items: center; }

/* modal + toast */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 10, 15, .5); display: grid; align-items: end; justify-items: center; }
@media (min-width: 560px) { .overlay { align-items: center; } }
.modal {
  background: var(--card); width: min(520px, 100%); max-height: 92dvh; display: flex; flex-direction: column;
  border-radius: 18px 18px 0 0; box-shadow: 0 -6px 30px rgba(0, 0, 0, .25);
}
@media (min-width: 560px) { .modal { border-radius: 18px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 16px; }
.modal-body { padding: 8px 16px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px max(14px, env(safe-area-inset-bottom)); }
.modal-actions:empty { display: none; }
.toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  background: #2b2b2b; color: #fff; padding: 11px 16px; border-radius: 12px; max-width: min(92vw, 460px); font-size: .92rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .3); transition: opacity .3s;
}
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .btn.loading::after { animation-duration: 2s; } .toast { transition: none; } }

.static { min-height: 46px; display: flex; align-items: center; padding: 0 12px; border: 1.5px dashed var(--line); border-radius: 10px; font-weight: 600; }

.dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--ink); vertical-align: -2px; margin-right: 8px; }
input.colorpick { padding: 2px; height: 46px; cursor: pointer; }

.colourpicker { display: flex; gap: 8px; align-items: center; }
.colourpicker input[type=color] { width: 64px; flex: none; }
.colourpicker .hexin { flex: 1; min-width: 0; text-transform: uppercase; font-variant-numeric: tabular-nums; letter-spacing: .05em; }

/* roles */
.roles { display: grid; gap: 8px; }
.role-opt {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; min-height: 52px;
}
.role-opt.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 12%, var(--card)); }
.role-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.role-txt { display: grid; flex: 1; min-width: 0; }
.role-txt small { color: var(--muted); font-size: .8rem; }
.role-check { width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; font-weight: 700; flex: none; }
.role-opt.on .role-check { background: var(--rc); border-color: var(--rc); color: #fff; }
.role-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.role-badge .role-dot { width: 9px; height: 9px; }

/* ---- smoother feel ---- */
.page { padding-bottom: max(28px, env(safe-area-inset-bottom)); animation: rise .18s ease-out; }
body.has-tabs .page { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tile, .btn, .card.item, .icon-btn, .chip-btn { transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease; }
.tile:active, .btn:active { transform: scale(.97); }
.btn { touch-action: manipulation; }
.card.item { content-visibility: auto; contain-intrinsic-size: auto 120px; }   /* long lists scroll smoothly */
.pill.warn { margin-top: 0; }
.bar { box-shadow: 0 1px 8px rgba(0, 0, 0, .12); }

/* loading placeholder */
.skel { display: grid; gap: 12px; }
.skel-card {
  height: 96px; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--card) 25%, color-mix(in srgb, var(--line) 55%, var(--card)) 50%, var(--card) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.skel-card.short { height: 64px; width: 70%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px max(6px, env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
}
.tabbar a {
  flex: 1; max-width: 140px; display: grid; justify-items: center; gap: 1px; padding: 6px 4px; border-radius: 12px;
  font-size: .72rem; font-weight: 600; color: var(--muted); transition: background-color .15s ease, color .15s ease;
}
.tabbar a .ti { font-size: 1.3rem; line-height: 1.2; }
.tabbar a.on { color: var(--accent); background: var(--accent-soft); }
.tabbar a:active { transform: scale(.95); }
@media (min-width: 900px) { .tabbar { display: none; } body.has-tabs .page { padding-bottom: 28px; } }
@media print { .tabbar, .bar { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.tile { min-height: 92px; padding: 12px; }
.tile .ico { font-size: 1.5rem; margin-bottom: 2px; }

/* ================= dark "clean" theme ================= */
body { background: #000; }
.bar { background: transparent; color: var(--ink); box-shadow: none; padding: 10px 14px; padding-top: max(12px, env(safe-area-inset-top)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(0, 0, 0, .72); }
.bar h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; }
.bar .icon-btn { color: var(--ink); background: var(--card2); border: 1px solid var(--line); border-radius: 999px; width: 40px; }
.chip-btn { color: var(--muted); border-color: var(--line); background: var(--card2); }
.logo.sm { display: none; }
.card, .tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card { padding: 16px; }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=search], select, textarea {
  background: var(--card2); border: 1px solid var(--line); border-radius: 16px; min-height: 48px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); border-color: transparent; }
.btn { border-radius: 999px; background: var(--card2); border: 1px solid var(--line); min-height: 48px; padding: 11px 20px; }
.btn.sm { min-height: 40px; padding: 6px 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip span { background: var(--card2); border-color: var(--line); }
.pill { background: var(--card2); border-color: var(--line); }
.modal { background: #151517; border-radius: 28px 28px 0 0; border: 1px solid var(--line); }
@media (min-width: 560px) { .modal { border-radius: 28px; } }
.overlay { background: rgba(0, 0, 0, .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.toast { background: #2a2a2d; border: 1px solid var(--line); border-radius: 999px; }
.role-opt, .role-badge { background: var(--card2); }
.link { color: var(--blue); }

/* pill tabs on top */
.ptabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab {
  flex: none; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 1.12rem;
  padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.ptab.on { background: var(--card2); border-color: var(--line); color: var(--ink); }
.ptab .dot-badge { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: 6px; }

/* home header */
.hhead { display: flex; align-items: center; gap: 12px; padding: 8px 0 2px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font: 700 1.5rem/1 system-ui; color: var(--accent-ink);
  background: linear-gradient(135deg, #f3b3d1, #b86a93); border: 2px solid var(--line); flex: none; }
.hhead .who { flex: 1; min-width: 0; display: grid; }
.hhead .who strong { font-size: 1.1rem; letter-spacing: .03em; }
.hhead .who a { color: var(--blue); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hpill { display: flex; align-items: center; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px; }
.hpill button { background: none; border: 0; color: var(--ink); font-size: 1.15rem; width: 44px; height: 40px; border-radius: 999px; cursor: pointer; position: relative; }
.hpill button:active { background: rgba(255, 255, 255, .08); }
.hpill .ping { position: absolute; top: 6px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card2); }

/* section card: title row + inner stat card */
.sec { background: #050505; border: 1px solid var(--line); border-radius: 30px; padding: 6px; display: grid; gap: 6px; }
.sec-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px 6px; color: var(--muted); font-weight: 600; font-size: 1.02rem; }
.sec-head .ico { width: 26px; height: 26px; border-radius: 8px; background: var(--card2); display: grid; place-items: center; font-size: .95rem; }
.sec-head .more { margin-left: auto; color: var(--blue); font-weight: 800; letter-spacing: .12em; text-decoration: none; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 16px 18px; display: grid; gap: 12px; }
.stat .st-top { color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.stat .st-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.stat .num { font: 700 2.6rem/1 system-ui; letter-spacing: -.01em; }
.stat .num small { font-size: 1.1rem; color: var(--muted); margin-right: 2px; font-weight: 600; }
.stat .sub { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.spark { width: 42%; height: 58px; flex: none; }
a.stat { color: inherit; }
a.stat:active { transform: scale(.985); }
.good { color: var(--good); }
.warnc { color: var(--warn); }

/* tiles, quieter */
.tiles { gap: 12px; }
.tile { min-height: 104px; padding: 16px; gap: 4px; background: var(--card); }
.tile .ico { width: 42px; height: 42px; border-radius: 14px; background: var(--card2); display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 8px; }
.tile:active { background: var(--card2); }
.tile .muted { font-size: .82rem; }

/* floating pill nav */
.tabbar {
  left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); padding: 8px; gap: 4px; border-radius: 34px; max-width: 520px; margin: 0 auto;
  background: rgba(28, 22, 26, .74); border: 1px solid rgba(255, 255, 255, .09);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 10px 34px rgba(0, 0, 0, .6);
}
.tabbar a { max-width: none; flex: 1; height: 56px; border-radius: 28px; align-content: center; color: #cfc6cb; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .9rem; }
.tabbar a span:not(.ti) { display: none; }
.tabbar a .ti { font-size: 1.55rem; filter: grayscale(.2); }
.tabbar a.on { flex: 1.9; background: rgba(0, 0, 0, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .06); }
.tabbar a.on span:not(.ti) { display: inline; font-weight: 700; }
body.has-tabs .page { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.skel-card { background: linear-gradient(90deg, #101010 25%, #1b1b1d 50%, #101010 75%); background-size: 200% 100%; border-radius: 24px; }
.ptab { font-size: 1rem; padding: 8px 14px; }
.hint.good { color: var(--good); }
.hint:empty { display: none; }

/* Printing from the Android app: only the slip is printed */
#print-root { display: none; }
@media print {
  body > :not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
}

/* Receive: one card per chalan of the chosen type */
.chalan-pick { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--card2, #1c1c1e); border: 1px solid transparent; cursor: pointer; position: relative; }
.chalan-pick input { position: absolute; opacity: 0; pointer-events: none; }
.chalan-pick:has(input:checked) { border-color: var(--accent, #e08ab4); }
.chalan-pick .cp-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Track */
.tk-search { padding: 10px; }
.tk-q { width: 100%; box-sizing: border-box; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); }
.tk-h { margin: 6px 2px 0; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tk-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; text-align: left; color: var(--ink); width: 100%; box-sizing: border-box; font: inherit; }
.tk-card.flat { cursor: pointer; }
.tk-head { all: unset; display: flex; gap: 12px; align-items: center; cursor: pointer; width: 100%; }
.tk-photo { width: 56px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--card2); flex: none; }
.tk-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tk-lot { display: flex; gap: 8px; align-items: center; font-size: 18px; }
.tk-sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.tk-type { display: inline-block; padding: 2px 9px; border-radius: 999px; color: #111; font-size: 12px; font-weight: 700; flex: none; }
.tk-where { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--card2); font-size: 14px; }
.tk-where.done { color: var(--good); }
.tk-where.idle { color: var(--muted); }
.tk-at { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tk-body { display: flex; flex-direction: column; gap: 8px; }
.tk-row { all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); width: 100%; }
.tk-row.link { cursor: pointer; }
.tk-main { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 14px; }
.tk-main .muted { font-size: 12px; }
.tk-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.tk-st { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--card2); }
.tk-st.done { color: var(--good); }
.tk-st.part { color: var(--warn); }
.tk-st.run { color: var(--accent); }
.tk-fact { margin: 0; font-size: 13px; }
.tk-stats, .tk-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tk-stat, .tk-win { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--card2); font-size: 12px; }
.tk-stat strong, .tk-win strong { font-size: 20px; }
.tk-tot { font-size: 12px; color: var(--ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.acc-row { display: flex; flex-direction: column; gap: 8px; }
.acc-top { display: flex; gap: 8px; }
.acc-top input { flex: 1; min-width: 0; }
.acc-need { margin: 0; font-size: 14px; }

/* Print tags */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tag-prev { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 8px; display: flex; justify-content: center; min-height: 0; }
.tag-prev:empty { display: none; }
.tag-cv { width: 100%; max-width: 220px; height: auto; image-rendering: auto; }
.tag-cv.wide { max-width: 100%; }
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 55vh; overflow: auto; }
.gal button { border: 2px solid transparent; border-radius: 8px; padding: 0; background: var(--card, #fff); text-align: center; font-size: 11px; }
.gal button.on { border-color: var(--accent, #2563eb); }
.gal img { width: 100%; aspect-ratio: 1 / 1.4; object-fit: cover; border-radius: 6px; display: block; }

.tag-set summary { cursor: pointer; font-weight: 700; }
.tag-set .stack { margin-top: 10px; }
.chk { display: flex; align-items: center; gap: 8px; }
.btn.small { padding: 6px 12px; font-size: .85rem; }

/* type-to-search picker */
.ss { position: relative; flex: 1; min-width: 0; }
.ss-in { width: 100%; }
.ss-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 46vh; overflow-y: auto; background: #1a1a1d; border: 1px solid #333; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.6); padding: 4px; }
.ss-opt { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 12px 10px; border-radius: 8px; }
.ss-opt:active, .ss-opt:hover { background: rgba(255,255,255,.08); }
.ss-none { padding: 8px 10px; margin: 0; }

.logo-img { width: 84px; height: 84px; border-radius: 22px; display: block; margin: 0 auto 8px; }
.logo-img.sm { width: 34px; height: 34px; border-radius: 10px; margin: 0; }

.lotinfo.wide { display: block; }
.lot-photos { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.lot-photo { height: 220px; max-width: 100%; object-fit: contain; background: var(--bg); border-radius: 10px; cursor: zoom-in; }
@media (max-width: 600px) { .lot-photo { height: 170px; } }

.cam { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; align-items: center; justify-content: center; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: relative; height: min(78vh, calc(92vw * 2.6)); border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; display: flex; justify-content: center; gap: 14px; background: rgba(0,0,0,.5); }
.cam-hint { position: absolute; top: 10px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px #000; }

.date-wrap { position: relative; }
.date-wrap .date-show { width: 100%; }
.date-wrap .date-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.color-pill { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); display: inline-block; }

.zoomable { cursor: zoom-in; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: pan-y; }
.zoom-ov { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.zoom-ov img { max-width: 98vw; max-height: 96vh; object-fit: contain; border-radius: 6px; }

/* track: cleaner lot card */
.tk-lot2 { display: flex; align-items: baseline; gap: 8px; }
.tk-lot2 strong { font-size: 26px; line-height: 1; letter-spacing: -.01em; }
.tk-lotlbl { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.tk-meta { color: var(--muted); font-size: 13px; line-height: 1.35; }
.tk-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.tk-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--card2); font-size: 13px; }
.tk-now.idle { color: var(--muted); }
.tk-now.done { color: #4ade80; background: #1e3a2b66; }
.tk-now.run { background: #3a2f1466; }
.tk-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.tk-now.run .tk-dot { background: var(--warn); }
.tk-nowl { color: var(--muted); }
.tk-nowv { color: var(--ink); font-weight: 600; }
.tk-more { color: var(--muted); }
.tk-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; flex: none; }
.tk-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.75fr) minmax(0,1.25fr) 78px; gap: 10px; align-items: center; }
.tk-gh { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 2px 0; }
.tk-gr { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.tk-c1 { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.tk-c1 strong { font-size: 13px; overflow-wrap: anywhere; }
.tk-c2, .tk-c3 { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-c2 span, .tk-c3 span { color: var(--muted); font-size: 12px; }
.tk-c3 span { white-space: nowrap; font-size: 11.5px; }
.tk-c3 span:first-child { color: var(--ink); }
.tk-c4 { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tk-c4 strong { font-size: 15px; }
.tk-st2 { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.tk-st2.done { background: #1e3a2b; color: #4ade80; }
.tk-st2.run { background: #3a2f14; color: #f2c66d; }
.tk-st2.part { background: #1e2f4a; color: #7db4ff; }
.tk-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.tk-fact2 { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.tk-fact2 span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 440px) { .tk-grid { grid-template-columns: minmax(0,1.05fr) minmax(0,.7fr) minmax(0,1.3fr) 74px; gap: 6px; } .tk-c3 span { font-size: 11px; } .tk-st2 { font-size: 10.5px; padding: 2px 6px; } }

/* round 2 */
.tk-search { border-radius: 16px; }
.tk-photo { width: 64px; height: 64px; border-radius: 8px; border: 1px solid #2a2a2e; object-fit: cover; background: #151517; }
.tk-photo.ph { display: grid; place-items: center; font-size: 24px; color: #4b4b52; }
.tk-head { gap: 14px; align-items: flex-start; }
.tk-title { gap: 4px; }
.tk-meta { margin-top: -1px; }
.tk-chip { font-size: 11px; padding: 1px 8px; background: rgba(255,255,255,.05); color: #9CA3AF; opacity: .9; }
.tk-now { background: transparent; border: 1px solid var(--line); border-left: 3px solid #4ade80; border-radius: 10px; padding: 8px 12px; gap: 10px; }
.tk-now.run .tk-dot, .tk-now.done .tk-dot { background: #4ade80; box-shadow: 0 0 0 3px #4ade8026, 0 0 10px #4ade80aa; }
.tk-now.done { background: transparent; color: #9CA3AF; }
.tk-nowv { color: #9CA3AF; font-weight: 500; }
.tk-gh { font-size: 11px; letter-spacing: .05em; color: #6B7280; }
.tk-c1 { display: block; line-height: 1.5; }
.tk-c1 .tk-badge { margin-right: 4px; vertical-align: 1px; }
.tk-range { color: var(--ink); font-size: 12px; white-space: nowrap; }
.tk-arr { color: #4b4b52; }
.tk-wait { color: #6B7280; }
.tk-c3 span.tk-range { color: var(--ink); }
.tk-foot { border-top: 1px solid #26262a; }
.tk-fact2 { background: rgba(255,255,255,.04); border-radius: 10px; padding: 8px 10px; }
.tabbar a .ti { display: grid; place-items: center; line-height: 0; }
.tabbar a .ti svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a { color: #9a9299; }
.tabbar a.on { color: var(--accent); background: var(--accent-soft); }
.tk-c1 { display: flex; gap: 6px; align-items: flex-start; }
.tk-c1 .tk-badge { min-width: 42px; text-align: center; margin: 1px 0 0; }
.tk-c1 strong { line-height: 1.3; }
@media (max-width: 440px) { .tk-grid { grid-template-columns: minmax(0,1.4fr) minmax(0,.62fr) minmax(0,1.25fr) 72px; } .tk-range { white-space: normal; } .tk-range .tk-arr { white-space: nowrap; } }

/* round 3 */
.tk-search { padding: 14px; }
.tk-card { padding: 14px; }
.tk-photo { border: 1px solid rgba(255,255,255,.08); border-radius: 8px; }
.tk-meta { color: #9CA3AF; }
.tk-now, .tk-now.run, .tk-now.done { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); border-left: 1px solid rgba(16,185,129,.3); border-radius: 12px; }
.tk-now.idle { background: transparent; border-color: var(--line); }
.tk-gh { font-size: 11px; letter-spacing: .08em; color: #6B7280; }
.tk-yr { color: #6B7280; }
.tk-range { white-space: nowrap; }
/* desktop: one line per row, badge before the name */
.tk-c1 { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.tk-c1 strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* phone: line 1 = [badge] name + status, line 2 = chalan and dates */
@media (max-width: 520px) {
  .tk-gh { display: none; }
  .tk-grid.tk-gr { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "c1 c4" "c2 c3"; row-gap: 6px; column-gap: 10px; }
  .tk-c1 { grid-area: c1; } .tk-c4 { grid-area: c4; flex-direction: row; align-items: center; gap: 8px; }
  .tk-c2 { grid-area: c2; flex-direction: row; gap: 8px; align-items: baseline; }
  .tk-c3 { grid-area: c3; text-align: right; }
  .tk-c4 strong { font-size: 14px; }
}
@media (min-width: 521px) { .tk-grid { grid-template-columns: minmax(0,2.1fr) minmax(0,1fr) minmax(0,1.25fr) 90px; } }

.tk-khata { all: unset; cursor: pointer; font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--ink); text-decoration: underline; text-decoration-color: #4b4b52; text-underline-offset: 3px; min-width: 0; overflow-wrap: anywhere; }
.tk-khata:hover, .tk-khata:active { color: var(--accent); text-decoration-color: var(--accent); }
.tk-rcv { display: flex; flex-direction: column; gap: 6px; padding: 0 0 10px; }
.tk-rcvl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6B7280; }
.tk-rcvp { display: flex; gap: 8px; overflow-x: auto; }
.tk-rcvi { display: flex; flex-direction: column; gap: 3px; align-items: center; flex: none; font-size: 10.5px; color: #6B7280; }
.tk-rthumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255,255,255,.08); }

.lb { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.94); display: grid; place-items: center; overflow: hidden; touch-action: none; }
.lb-img { max-width: 100vw; max-height: 100vh; object-fit: contain; transform-origin: center; touch-action: none; user-select: none; -webkit-user-drag: none; }
.lb-x { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; z-index: 2; }
.lb-hint { position: fixed; bottom: 28px; left: 0; right: 0; text-align: center; color: #9CA3AF; font-size: 13px; transition: opacity .6s; pointer-events: none; }

/* ---- home screen polish ---- */
.si { display: inline-grid; place-items: center; }
.si svg { width: 20px; height: 20px; }
.hhead { gap: 14px; padding: 6px 2px 0; }
.avatar { width: 48px; height: 48px; font-size: 1.25rem; background: var(--accent-soft, rgba(240,150,200,.14)); color: var(--accent, #f3b3d1);
  border: 1.5px solid var(--accent, #f3b3d1); box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.hhead .who strong { font-size: 1.08rem; letter-spacing: .02em; }
.hhead .who .role { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hpill button { display: grid; place-items: center; color: var(--muted); }
.hpill button .si svg { width: 19px; height: 19px; }
.hsearch { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.hsearch .si { color: var(--muted); flex: none; }
.hsearch .tk-q { border: 0; background: transparent; padding: 15px 0; font-size: 16px; outline: none; min-width: 0; flex: 1; }
.hsearch:focus-within { border-color: var(--accent, #f3b3d1); }
.kbd { display: none; flex: none; font: 600 .72rem/1 system-ui; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--card2); }
@media (hover: hover) and (pointer: fine) { .kbd { display: inline-block; } }
.sec { border-radius: 24px; }
.sec-head .ico { background: none; width: auto; height: auto; color: var(--accent, #f3b3d1); }
.sec-head .si svg { width: 16px; height: 16px; }
.tile { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; min-height: 0; padding: 14px; border-radius: 18px; }
.tile .ico { width: 36px; height: 36px; border-radius: 10px; margin: 0; font-size: 0; color: var(--accent, #f3b3d1);
  background: color-mix(in srgb, var(--accent, #f3b3d1) 12%, var(--card2)); }
.tile .tt { display: grid; gap: 2px; min-width: 0; }
.tile .tt strong { font-size: .95rem; }
.tile .tt .muted { font-size: .74rem; line-height: 1.25; }
.tiles.quick { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tiles.quick .tile { grid-template-columns: 1fr; row-gap: 10px; align-content: start; padding: 14px; min-height: 108px; }
.tiles.quick .tile:nth-child(odd):last-child { grid-column: 1 / -1; }
.tile .cnt { position: absolute; top: 12px; right: 12px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center;
  font: 800 .8rem/1 system-ui; color: #1a1020; background: var(--accent, #f3b3d1); }
.tile.alert { border-color: color-mix(in srgb, var(--accent, #f3b3d1) 45%, var(--line)); }

.page { padding-left: 16px; padding-right: 16px; }
.tile .tt .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tiles.quick .tile { min-height: 104px; }

/* packing entry */
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.pk-size { display: grid; gap: 4px; }
.pk-size span { font-weight: 700; color: var(--muted); font-size: .85rem; }
.pk-size input { text-align: center; font-size: 1.1rem; }
.sub-h { margin: 14px 2px 4px; font-size: 1rem; color: var(--muted); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.lot-photo-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.lot-photo-btn .si svg { width: 16px; height: 16px; }

.pk-entry { display: block !important; }
.pk-entry > * + * { margin-top: 8px; }

/* packing dashboard */
.pd-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pd-stat { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 14px; background: var(--card, #17171a); border: 1px solid var(--line, #26262b); text-align: center; }
.pd-stat strong { font-size: 24px; line-height: 1.1; }
.pd-stat span { font-size: 12px; }
.pd-card { display: block !important; }
.pd-big { text-align: right; white-space: nowrap; }
.pd-big strong { font-size: 26px; }
