/* ==========================================================================
   Census counting ("Ghi nhận & đếm") and the counting-mode chooser – phone first, one-hand use.
   Tokens and base classes come from app.css; team cards / zone chips from inventory-campaign.css.
   ========================================================================== */

/* ---------- Mode chooser (/inventory/:id/start) ---------- */
.im-body {
  max-width: 640px;
  gap: 12px;
}
.im-lead {
  margin: 0;
  font-size: 14px;
}
.im-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 20px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 112px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    border-color 0.12s,
    transform 0.08s ease-out;
}
.im-card:hover:not(:disabled) {
  border-color: var(--line-2);
}
.im-card.last {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.im-card:disabled {
  cursor: not-allowed;
  background: var(--surface-2);
}
.im-card:disabled .im-ic,
.im-card:disabled .im-t,
.im-card:disabled .im-d {
  opacity: 0.55;
}
.im-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.im-ic {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.im-ic .icon {
  width: 26px;
  height: 26px;
}
.im-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.im-t {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.im-t b {
  font-size: 17px;
  line-height: 1.3;
}
.im-d {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.im-m {
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.im-m.off {
  color: var(--warn);
  font-weight: 600;
}
.im-m .icon {
  width: 14px;
  height: 14px;
}
.im-go {
  color: var(--muted);
}
.im-card:disabled .im-go {
  visibility: hidden;
}

/* ---------- Census screen ---------- */
.cs-body {
  max-width: 760px;
  gap: 12px;
}
.cs-head {
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-t));
  z-index: 20;
  margin: -12px -16px 0;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.5) blur(8px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.cs-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.cs-tools .search {
  flex: 1;
  min-width: 0;
  height: 44px;
}
.cs-tools .search input[type='search']::-webkit-search-cancel-button {
  display: none;
}
.cs-pick-title {
  flex: 1;
  font-size: 15px;
}
.cs-tools .cnt-team {
  height: 44px;
  flex-shrink: 0;
}
.cs-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--info);
  white-space: nowrap;
  flex-shrink: 0;
}
.cs-sync .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1s ease-in-out infinite;
}
.cs-zones .chip {
  min-height: 38px;
}
.cs-failed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: var(--r);
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13px;
}
.cs-failed .icon {
  width: 18px;
  height: 18px;
}
.cs-failed .btn {
  height: 36px;
  flex-shrink: 0;
}

/* Zone picker */
.cs-zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cs-zone-card {
  display: grid;
  gap: 2px;
  align-content: start;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.cs-zone-card:hover {
  border-color: var(--line-2);
}
.cs-zone-card b {
  font-size: 18px;
  color: var(--brand);
}
.cs-zone-card span {
  font-weight: 600;
  line-height: 1.3;
}
.cs-zone-card small {
  color: var(--muted);
  font-size: 12px;
}

/* Zone list */
.cs-zone-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 0 2px;
}
.cs-zone-h b {
  font-size: 16px;
}
.cs-sec {
  display: grid;
  gap: 8px;
}
.cs-sec + .cs-sec {
  margin-top: 6px;
}
.cs-sec-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cs-sec-h .n {
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 99px;
  padding: 0 7px;
  letter-spacing: 0;
}
.cs-hint {
  margin: 0;
  padding: 4px 2px;
}
.cs-list {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.cs-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 170px;
}
.cs-row:last-child {
  border-bottom: 0;
}
.cs-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 9px 6px 9px 14px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.cs-main:hover {
  background: var(--surface-2);
}
.cs-main:active {
  background: var(--surface-3);
}
.cs-main:focus-visible,
.cs-info:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.cs-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.cs-name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.cs-meta > span + span::before {
  content: '·';
  margin-right: 10px;
  color: var(--line-2);
}
.cs-meta > .cs-tag::before,
.cs-meta > .cs-other::before {
  display: none;
}
.cs-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--info-soft);
  color: var(--info);
}
.cs-other {
  font-family: var(--f-mono);
  font-size: 11.5px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
}
.cs-qty {
  display: grid;
  justify-items: end;
  min-width: 56px;
  line-height: 1.15;
}
.cs-qty b {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cs-qty.none b {
  color: var(--line-2);
  font-weight: 500;
}
.cs-qty small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--warn);
  white-space: nowrap;
}
.cs-row.counted .cs-main {
  box-shadow: inset 3px 0 0 var(--ok);
}
.cs-dot {
  position: absolute;
  top: 8px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--info);
}
.cs-dot.wait {
  animation: pulse 1s ease-in-out infinite;
}
.cs-dot.failed {
  background: var(--bad);
}
.cs-info,
.cs-info-gap {
  flex: 0 0 44px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cs-info-gap {
  border-left-color: transparent;
  cursor: default;
}
.cs-info:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.cs-add {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cs-add:hover {
  border-color: var(--primary);
}
.cs-add small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.cs-add.big {
  min-height: 64px;
  border-style: solid;
  border-color: var(--primary);
}
.cs-more {
  height: 48px;
}

/* Undo snackbar: above the bottom bars; at the top while the keypad covers the bottom of the screen */
.cs-snack {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar-h) + var(--bar-pad-b) + var(--vv-bottom) + 12px);
  z-index: 150;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 6px 6px 14px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: fade 0.15s ease-out;
}
body.no-tabbar .cs-snack {
  bottom: calc(var(--vv-bottom) + var(--bar-pad-b) + 12px);
}
.cs-snack.top {
  top: calc(var(--safe-t) + 10px);
  bottom: auto;
}
.cs-snack .icon {
  width: 18px;
  height: 18px;
  color: #6fd394;
}
.cs-snack button {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface) 14%, transparent);
  color: var(--surface);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Keypad sheet ---------- */
.kp {
  display: grid;
  gap: 10px;
}
.kp-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 8px;
}
.kp-field {
  display: grid;
  align-content: end;
  justify-items: end;
  gap: 0;
  min-height: 84px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: right;
  min-width: 0;
}
.kp-field small {
  justify-self: start;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.kp-field.on {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--primary);
}
.kp-field.dmg.on {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px var(--warn);
}
.kp-field.dmg.has .kp-val {
  color: var(--warn);
}
.kp-expr {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Long expressions keep their end (the latest keys) visible */
  direction: rtl;
}
.kp-expr bdi {
  direction: ltr;
  unicode-bidi: isolate;
}
.kp-val {
  font-family: var(--f-mono);
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kp-field.dmg .kp-val {
  font-size: 26px;
}
.kp-val.is-empty {
  color: var(--line-2);
}
/* A prefilled value is replaced by the first digit: show it as selected */
.kp-field.fresh.on .kp-val {
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 0 4px;
}
.kp-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kp-post {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
}
.kp-post.wide {
  width: 100%;
  border-radius: var(--r);
  text-align: left;
}
.kp-post:disabled {
  cursor: default;
  opacity: 0.7;
}
.kp-post .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.kp-post .kp-caret {
  width: 15px;
  height: 15px;
}
.kp-def {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.kp-pos {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.kp-err {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--bad);
}
.kp-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.kp-key {
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.08s,
    transform 0.06s;
}
.kp-key:hover {
  background: var(--surface-2);
}
.kp-key:active {
  background: var(--surface-3);
}
.kp-key.op {
  background: var(--surface-3);
  color: var(--text-2);
}
.kp-key.clear {
  color: var(--bad);
  font-family: var(--f-body);
  font-size: 18px;
}
.kp-key.zero {
  grid-column: span 2;
}
.kp-key:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.sheet-f .kp-done,
.sheet-f .kp-next {
  height: 52px;
  font-size: 15.5px;
}
.sheet-f .kp-done {
  flex: 1;
}
.sheet-f .kp-next {
  flex: 2;
}
.kp-next .icon {
  width: 18px;
  height: 18px;
}

/* Post picker / add item / detail */
.cs-posts {
  display: grid;
  gap: 14px;
}
.cs-posts section {
  display: grid;
  gap: 6px;
}
.cs-post-list {
  display: grid;
  gap: 6px;
}
.cs-post-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.cs-post-opt:hover {
  background: var(--surface-2);
}
.cs-post-opt.on {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  font-weight: 700;
}
.cs-post-opt .icon {
  width: 18px;
  height: 18px;
}
.cs-units {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.cs-units .chip {
  min-height: 40px;
  padding-inline: 14px;
  font-size: 14px;
}
.cs-emp-picked {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--field-h);
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}
.cs-emp-picked .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.cs-emp-picked small {
  color: var(--muted);
}
.cs-cells {
  display: grid;
  gap: 4px;
}
.cs-cell {
  display: grid;
  grid-template-columns: 52px 76px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.cs-cell.here {
  box-shadow: inset 3px 0 0 var(--brand);
}
.cs-cell-q {
  text-align: right;
  font-weight: 700;
}
.cs-cell-q small {
  font-weight: 600;
  color: var(--warn);
}
.cs-cell-by {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Responsive ---------- */
/* Phones: no page header (the title sits in the top bar) – the room goes to the list */
@media (max-width: 1023px) {
  .page-header:has(+ .cs-body) {
    display: none;
  }
}
@media (max-width: 380px) {
  .kp-display {
    grid-template-columns: minmax(0, 1fr) 92px;
  }
  .kp-key {
    height: 52px;
  }
  .cs-sync {
    font-size: 0;
    gap: 0;
  }
}
/* Short phones (keypad must fit with the header and the footer) */
@media (max-height: 700px) {
  .kp-field {
    min-height: 70px;
  }
  .kp-val {
    font-size: 30px;
  }
  .kp-key {
    height: 50px;
  }
  .kp {
    gap: 8px;
  }
}
@media (min-width: 640px) {
  .cs-head {
    margin-inline: -24px;
    padding-inline: 24px;
  }
  .cs-zone-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cs-zones {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .sheet-f .kp-done,
  .sheet-f .kp-next {
    height: 48px;
  }
  .sheet-f .kp-done {
    flex: 1 1 0;
  }
  .sheet-f .kp-next {
    flex: 2 1 0;
  }
  .cs-snack.top {
    top: auto;
    bottom: calc(var(--vv-bottom) + 20px);
  }
}
@media (min-width: 1024px) {
  .cs-head {
    margin: -16px -28px 0;
    padding: 12px 28px;
  }
  .cs-zone-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .cs-snack {
    bottom: 24px;
  }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .cs-head {
    margin-inline: -20px;
    padding-inline: 20px;
  }
}
@media (hover: none) {
  .im-card:active:not(:disabled),
  .cs-zone-card:active,
  .kp-key:active {
    transform: scale(0.97);
  }
}

/* Zone suggestions ("Gợi ý cho khu này") and who entered a number */
.cs-sub-h {
  margin: 2px 0 0;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.cs-sub-h .n {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 99px;
  padding: 0 7px;
}
.cs-meta > .cs-why::before,
.cs-meta > .cs-by::before {
  display: none;
}
.cs-why {
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--ok-soft);
  color: var(--ok);
}
.cs-why.type {
  background: var(--surface-3);
  color: var(--text-2);
}
.cs-by {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.cs-by .icon {
  width: 12px;
  height: 12px;
}
.kp-by {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.35;
}
.kp-by .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--warn);
}

/* ---------- Person responsible + way of managing (keypad) ---------- */
.kp-who {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.kp-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.kp-pick:hover {
  background: var(--surface-2);
}
.kp-pick:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.kp-pick > .icon {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.kp-pick > .kp-caret {
  width: 14px;
  height: 14px;
}
.kp-pick-t {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.kp-pick-t small {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kp-pick-t b {
  font-size: 14px;
  font-weight: 600;
}
.kp-pick-t b.unset {
  color: var(--muted);
  font-weight: 500;
}
.kp-track {
  flex: 1;
  min-width: 0;
}
.kp-track button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  white-space: nowrap;
}
.kp-track button .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.kp-track button small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.kp-lot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}
.kp-lot .icon {
  width: 14px;
  height: 14px;
}

/* Person picker */
.cs-emps {
  display: grid;
  gap: 8px;
}
.sheet-b .search.cs-emp-search {
  position: sticky;
  top: -14px;
  z-index: 1;
  margin: -14px calc(-1 * var(--sheet-px)) 0;
  padding: 0 12px;
  border-width: 0 0 1px;
  border-radius: 0;
  height: 48px;
}
.cs-emp-search:focus-within {
  box-shadow: none;
}
.cs-emp-opt .grow {
  display: grid;
  line-height: 1.3;
  padding: 6px 0;
}
.cs-emp-opt small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* Row markers: person responsible in this zone, item that gets one code per piece */
.cs-meta > .cs-emp::before,
.cs-meta > .cs-code::before {
  display: none;
}
.cs-emp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.cs-emp .icon {
  width: 12px;
  height: 12px;
}
.cs-code {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}
.cs-code .icon {
  width: 11px;
  height: 11px;
}
.cs-cell-emp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--text-2);
}
.cs-cell-emp .icon {
  width: 12px;
  height: 12px;
}

/* Zone marked done: read-only */
.cs-done {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--ok-soft);
  color: var(--ok);
}
.cs-done .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.cs-done .grow {
  display: grid;
  gap: 1px;
  font-size: 14px;
}
.cs-done small {
  font-size: 12.5px;
  color: var(--text-2);
}
.cs-zone-card.done {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface));
}
.cs-zone-card.done small {
  color: var(--ok);
  font-weight: 600;
}

/* "Chọn từ danh mục" */
.cs-cat-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-cat-groups .chip {
  min-height: 38px;
  padding-inline: 13px;
  font-size: 13.5px;
}
.cs-cat-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.cs-cat-bar .search {
  flex: 1 1 220px;
  min-width: 0;
  height: 44px;
}
.cs-cat-bar .search input[type='search']::-webkit-search-cancel-button {
  display: none;
}
.cs-cat-n {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 2px;
}
.cs-cat-n b {
  color: var(--ink);
}
@media (max-width: 380px) {
  .kp-track button small {
    display: none;
  }
}
@media (max-height: 700px) {
  .kp-pick {
    min-height: 44px;
    padding-block: 3px;
  }
}

/* Zone actions in the zone header: Xong khu / In tem QR / Mở lại khu */
.cs-zone-acts {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
.cs-zone-acts .btn {
  min-height: 34px;
}
@media (pointer: coarse) {
  .cs-zone-acts .btn {
    min-height: 40px;
  }
}
