/* Turn Board — loaded after styles.css (reuses its colors + the picker styles). */
.board-page { --tap: 52px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.bhead {
  max-width: 640px; margin: 0 auto;
  padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.calc-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); text-decoration: none; font-weight: 700;
}
.calc-link small, .mode small { display: inline; }
.lockbtn small { display: block; }
.lang-toggle { display: inline-flex; gap: 0; margin-left: 8px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.lang-btn { min-height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 12px; letter-spacing: .02em; }
.lang-btn.on, .lang-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.est-note { margin: 0 4px 12px; padding: 8px 10px; border-radius: 10px; background: #f7f3ee; color: #5b4f49; font-size: 13px; line-height: 1.4; font-weight: 600; }
.ring-stop { width: 100%; max-width: 360px; min-height: 56px; margin-top: 8px; border: 2px solid #fff; border-radius: 16px; background: rgba(0,0,0,.4); color: #fff; font-weight: 800; font-size: 18px; }
.live { margin-left: auto; font-size: 14px; font-weight: 700; color: #1d7a3a; white-space: nowrap; }
.live.off { color: var(--muted); }
.mode {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; font-weight: 800; font-size: 15px;
}
.mode.view { background: #eef0f3; color: #3c4450; }
.mode.edit { background: #e2f4e7; color: #155d2c; }
.mode.edit small { color: #3f7a52; }
.lockbtn {
  margin-left: auto; min-height: 48px; padding: 2px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 15px; line-height: 1.15;
}

.dateline { display: flex; align-items: center; gap: 8px; }
.dbtn {
  width: 52px; height: 48px; flex: none; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); font-size: 28px; font-weight: 800; line-height: 1;
}
.dbtn:disabled { opacity: .35; }
.dlabel { flex: 1; text-align: center; font-weight: 800; font-size: 17px; }
.dlabel small { display: block; }
.dlabel.past { color: #8a4b00; }

.nexts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.nx { border-radius: 14px; padding: 8px 12px; min-width: 0; }
.nx b { display: block; font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx.up { background: var(--accent-soft); color: var(--accent); }
.nx.bon { background: var(--gold-soft); color: #7a5300; }
.msg {
  /* Overlay — must not grow #stick or push the turn list when a toast appears (Save, etc.). */
  position: absolute;
  left: max(14px, env(safe-area-inset-left, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  top: 100%;
  margin-top: 6px;
  z-index: 16;
  padding: 10px 12px; border-radius: 12px; background: #fdecec; color: #8b1b1b;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 8px 20px rgba(40, 24, 8, .12);
  pointer-events: none;
}
.msg.ok { background: #e2f4e7; color: #155d2c; }

/* ---------- main ---------- */
.board-page main.bmain { max-width: 640px; margin: 0 auto; padding: 12px 14px 80px; }
.addtech { display: flex; gap: 10px; margin-bottom: 8px; }
.addtech input { flex: 1; min-width: 0; }
.add small, .ghost small { display: block; color: inherit; opacity: .8; font-size: 11px; }
.sec {
  margin: 18px 4px 8px; font-size: 14px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.sec .cnt { color: var(--ink); }
.empty-note { color: var(--muted); text-align: center; margin: 8px 0; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.trow { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.trow.is-next { border-color: var(--accent); }
.trow.out, .trow.not { background: #faf8f5; }
.tmain {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 72px; padding: 8px 12px;
  border: 0; background: transparent; text-align: left;
}
.tpos {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--bg);
  display: grid; place-items: center; font-weight: 800; color: var(--muted);
}
.trow.is-next .tpos { background: var(--accent); color: #fff; }
.tinfo { flex: 1; min-width: 0; }
.tname { font-weight: 800; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta { font-size: 14px; color: var(--muted); font-weight: 600; }
.tmeta .badge { color: var(--accent); font-weight: 800; }
.tturns { flex: none; text-align: right; line-height: 1; }
.tturns b { display: block; font-size: 38px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.tturns small { font-size: 12px; }
.tcounts { font-size: 14px; color: var(--ink); font-weight: 700; margin-top: 2px; }

.tact { display: flex; gap: 8px; padding: 0 12px 12px; flex-wrap: wrap; }
.tact button {
  min-height: 48px; min-width: 48px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); font-weight: 700; font-size: 15px; padding: 0 12px;
}
.tact .plus { flex: 1 1 140px; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 18px; font-weight: 800; }
.tact .mv { font-size: 18px; width: 52px; padding: 0; }
.tact .mv:disabled { opacity: .35; }
.tact .cin { flex: 1 1 140px; background: #1d7a3a; border-color: #1d7a3a; color: #fff; font-weight: 800; }
.tact .warn { color: #8b1b1b; }

.tickets { list-style: none; margin: 0; border-top: 1px solid var(--line); padding: 8px 12px 12px; display: grid; gap: 8px; }
.tk { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--bg); }
.tk-top { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.tk-top .res { margin-left: auto; font-size: 20px; font-weight: 800; color: var(--accent); }
.tk-top .res.bonus { color: var(--gold); }
.tk-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.tk-chips span { font-size: 13px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.tk-reason { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tk-act { display: flex; gap: 8px; margin-top: 8px; }
.tk-act button { flex: 1; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 700; }
.tk-act .warn { color: #8b1b1b; }
.tact button small, .tk-act button small { display: block; color: inherit; opacity: .75; font-size: 11px; }
.tk-act { list-style: none; }
.tk-empty { color: var(--muted); font-size: 14px; text-align: center; }

/* Ticket details: closed after save; open only when the name card is tapped. */
.tdetail {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  visibility: hidden;
  transition: grid-template-rows .28s ease, visibility .28s;
}
.trow.is-open .tdetail {
  grid-template-rows: 1fr;
  visibility: visible;
}
.tdetail-inner { overflow: hidden; min-height: 0; }
.trow.just-saved { animation: save-flash .4s ease; }
@keyframes save-flash {
  0% { box-shadow: 0 0 0 0 rgba(29, 122, 58, 0); }
  40% { box-shadow: 0 0 0 3px rgba(29, 122, 58, .35); }
  100% { box-shadow: none; }
}

/* ---------- dialogs ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 30; background: rgba(43, 29, 31, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.overlay.is-in {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.overlay .dialog {
  transform: translateY(10px);
  transition: transform .22s ease;
}
.overlay.is-in .dialog { transform: none; }
.dialog { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; padding: 18px; display: grid; gap: 12px; }

.confirm-dialog { max-width: 400px; gap: 14px; }
.confirm-dialog h2 { font-size: 22px; line-height: 1.3; }
.confirm-dialog .reset-txt { font-size: 16px; }
.confirm-dialog .reset-txt small { display: block; margin-top: 6px; color: var(--muted); font-weight: 600; }
.confirm-dialog .drow { gap: 12px; margin-top: 4px; }
.confirm-dialog .drow button { min-height: 56px; font-size: 17px; }
.confirm-dialog #confirmOk.add { background: var(--accent, #c42d62); color: #fff; }

.dialog h2 { margin: 0; font-size: 20px; }
.dialog input[type="password"] {
  width: 100%; min-height: 60px; border: 2px solid var(--line); border-radius: 14px; background: var(--card);
  padding: 0 14px; font-size: 28px; letter-spacing: .3em; text-align: center;
}
.drow { display: flex; gap: 10px; }
.drow > * { flex: 1; }
.ghost { min-height: var(--tap); border: 1px solid var(--line); border-radius: 14px; background: var(--card); font-weight: 700; }
.err { color: #8b1b1b; font-weight: 700; font-size: 15px; }
.skip-dialog { max-width: 420px; }
.skip-hint { margin: 0; font-size: 15px; font-weight: 650; color: var(--text); line-height: 1.35; }
.skip-hint small { display: block; margin-top: 6px; color: var(--muted); font-weight: 600; font-size: 13px; }
.skip-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skip-n {
  min-height: 64px; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  font-weight: 900; font-size: 28px; line-height: 1;
}
.skip-n small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.skip-n:active { transform: scale(.97); background: #fde8ef; border-color: #c42d62; }
.skip-custom-lbl { font-weight: 700; font-size: 14px; }
.dialog input[type="number"] {
  width: 100%; min-height: 56px; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  padding: 0 14px; font-size: 22px; font-weight: 800; text-align: center;
}
.skip-left, .emp-skip {
  font-weight: 800; color: #241500; background: #ffc93c;
  border-radius: 999px; padding: 2px 8px; line-height: 1.2;
}
.skip-left { margin-left: 6px; font-size: 13px; display: inline-block; }
.skip-left small { display: inline; margin-left: 4px; font-size: 11px; color: inherit; opacity: .9; }
.emp-skip {
  display: inline-block; font-size: 13px; margin-top: 3px; white-space: normal;
}
.emp-skip small { display: inline; margin-left: 4px; font-size: 11px; font-weight: 700; }



/* full-screen ticket sheet */
.sheet {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  display: flex; flex-direction: column; max-width: 640px; margin: 0 auto;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.sheet.is-in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.sheet-top {
  padding: max(10px, env(safe-area-inset-top)) 14px 6px; border-bottom: 1px solid var(--line); flex: none;
  max-height: 48vh; max-height: 48dvh; overflow-y: auto; /* a long ticket must not squeeze the service list away */
}
.sheet-title { font-weight: 800; font-size: 17px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet .big { font-size: clamp(48px, 16vw, 64px); }
.sheet .big.bonus { font-size: clamp(40px, 13vw, 56px); }
.sheet-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 14px 20px; -webkit-overflow-scrolling: touch; }
.sheet-foot { flex: none; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.sheet-foot .err { margin-bottom: 8px; }
body.locked { overflow: hidden; }
.tinfo > span { display: block; }

/* ---------- sticky Next up / Next bonus ---------- */
.stick {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; max-width: 640px; margin: 0 auto;
  padding: 8px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 10px rgba(251, 247, 240, .9);
}
.stick .nexts { margin-top: 0; }
/* styles.css sets overflow-x:hidden on html+body, which turns body into a scroll box and breaks
   position:sticky. clip hides overflow without that side effect (older Safari: visible). */
html.board, html.board body { overflow-x: visible; overflow-x: clip; }
.hint-note { color: var(--muted); font-size: 14px; margin: -4px 4px 8px; }

/* ---------- Not-in name grid (manager unlocked only) ---------- */
#notGrid { margin-bottom: 12px; }
.ngrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nbtn {
  min-height: 64px; min-width: 0; padding: 8px 10px; border-radius: 14px;
  border: 2px solid #1d7a3a; background: #effaf2; color: #155d2c;
  font-weight: 800; font-size: 19px; line-height: 1.15; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.nbtn .nn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbtn small { font-size: 12px; color: inherit; opacity: .8; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbtn.out { border-style: dashed; }
.nbtn:active:not(:disabled) { transform: scale(.97); }
.nbtn:disabled, .nbtn.busy { opacity: 1; border-color: var(--line); background: #f3f0eb; color: #6f6560; cursor: default; }
.nbtn.busy { opacity: .6; }

/* ---------- staff list (roster) ---------- */
.roster-toggle {
  width: 100%; min-height: 52px; margin-top: 18px; border: 1px dashed var(--muted); border-radius: 14px;
  background: transparent; font-weight: 700; font-size: 16px;
}
.roster-panel { margin-top: 10px; }
.rlist { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.rlist li {
  display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 4px 4px 12px; min-width: 0;
}
.rlist .rn { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlist .rs { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rlist button {
  flex: none; min-height: 48px; min-width: 48px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-weight: 700; font-size: 14px; padding: 0 10px;
}
.rlist button small { display: block; font-size: 11px; color: inherit; opacity: .75; }
.rlist .warn { color: #8b1b1b; }
.rlist button:disabled { opacity: .35; }

/* ---------- Bonus line (both layouts) ---------- */
.bl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bl-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 14px; background: var(--card); border: 2px solid var(--line);
}
.bl-pos { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: center; }
.bl-nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-ct { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bl-row.first { background: var(--gold-soft); border-color: var(--gold); color: #5c3d00; }
.bl-row.first .bl-pos { color: #5c3d00; }
/* edit layout: compact numbered chips, still always visible */
.bl-list.compact { display: flex; flex-wrap: wrap; gap: 6px; }
.bl-list.compact .bl-row { display: inline-flex; gap: 6px; padding: 6px 10px; border-width: 1px; font-size: 15px; max-width: 100%; }
.bl-list.compact .bl-row.first { border-width: 2px; font-size: 17px; }

/* ---------- Reset today / Undo ---------- */
.reset-sec { margin-top: 32px; padding-top: 16px; border-top: 1px dashed var(--line); }
.reset-btn {
  width: 100%; min-height: 52px; border: 2px solid #b3261e; border-radius: 14px; background: #fff;
  color: #8b1b1b; font-weight: 800; font-size: 16px;
}
.reset-btn:disabled { opacity: .5; }
.reset-sec .hint-note { margin-top: 8px; }
.reset-txt { margin: 0; font-size: 15px; line-height: 1.4; }
.reset-txt small { display: block; color: var(--muted); margin-top: 4px; }
.danger {
  min-height: var(--tap); border: 0; border-radius: 14px; background: #b3261e; color: #fff; font-weight: 800;
}
.danger small { display: block; font-size: 11px; opacity: .85; }
.undo-btn {
  display: block; width: 100%; min-height: 48px; margin-top: 8px; border: 2px solid #1d7a3a; border-radius: 14px;
  background: #e2f4e7; color: #155d2c; font-weight: 800; font-size: 16px;
}
.undo-btn small { font-weight: 700; }

/* =====================================================================
   EMPLOYEE VIEW (body.view-mode): big, high contrast, readable across the room.
   Phone: one column. Landscape tablet / TV: banners side by side, order | bonus line.
   ===================================================================== */
body.view-mode { background: #faf6f0; color: #1a1412; --emp-card: #ffffff; --emp-line: #e4d8ce; --emp-muted: #5c524c; }
html.board:has(body.view-mode) { background: #faf6f0; }
body.view-mode .bhead {
  max-width: none; background: transparent; border-bottom: 1px solid var(--emp-line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px;
}
body.view-mode .brow { display: contents; }
body.view-mode .calc-link {
  order: 1; min-height: 44px; padding: 0 12px; background: var(--emp-card); border-color: var(--emp-line); color: #1a1412; font-size: 14px;
}
body.view-mode .calc-link small { display: none; }
body.view-mode .dateline { order: 2; flex: 1 1 200px; min-width: 0; }
body.view-mode .dbtn { width: 44px; height: 44px; font-size: 22px; background: var(--emp-card); border-color: var(--emp-line); color: #1a1412; }
body.view-mode .dlabel { font-size: 15px; color: #1a1412; }
body.view-mode .dlabel small { color: var(--emp-muted); font-size: 12px; }
body.view-mode .dlabel.past { color: #8a4b00; }
body.view-mode .live { order: 3; margin-left: 0; color: #1d7a3a; }
body.view-mode .live.off { color: var(--emp-muted); }
body.view-mode .mode { order: 4; min-height: 32px; font-size: 13px; background: #eef0f3; color: #3c4450; }
body.view-mode .lockbtn {
  order: 5; margin-left: auto; min-height: 44px; min-width: 44px; padding: 0 10px; font-size: 14px;
  background: transparent; border-color: var(--emp-line); color: var(--emp-muted);
}
body.view-mode .lockbtn small, body.view-mode .lockbtn .ul-txt { display: none; }
body.view-mode .stick { background: #faf6f0; border-bottom: 0; box-shadow: none; max-width: none; }

.emp { padding: 12px 14px 40px; max-width: 760px; margin: 0 auto; }
.emp-top { display: grid; gap: 10px; }
.emp-up, .emp-bon { border-radius: 20px; padding: 12px 16px 14px; min-width: 0; }
.emp-up { background: #8b1b3d; color: #fff; box-shadow: inset 0 0 0 3px #d14a74; }
.emp-bon { background: #ffc93c; color: #241500; box-shadow: inset 0 0 0 3px #e0a00a; }
.emp-lbl { font-weight: 900; letter-spacing: .08em; font-size: 16px; }
.emp-lbl small { display: inline; color: inherit; font-weight: 700; letter-spacing: 0; opacity: .9; font-size: 14px; margin-left: 6px; }
.emp-name {
  font-weight: 900; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: clamp(48px, 15vw, 76px);
}
.emp-up .emp-name::before { content: '▶ '; font-size: .6em; vertical-align: .15em; }
.emp-bon .emp-name { font-size: clamp(36px, 11vw, 56px); }
.emp-none {
  display: grid; gap: 6px; text-align: center; padding: 28px 16px; border-radius: 20px;
  background: var(--emp-card); border: 2px dashed var(--emp-line);
}
.emp-none b { font-size: clamp(28px, 8vw, 44px); font-weight: 900; }
.emp-none small { font-size: 16px; color: var(--emp-muted); }
.emp-past { text-align: center; color: #8a4b00; font-weight: 800; margin: 4px 0 0; }
.emp-cols { display: grid; gap: 4px; }
.emp-h { margin: 18px 4px 8px; font-size: 18px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #1a1412; }
.emp-h small { display: inline; text-transform: none; letter-spacing: 0; color: var(--emp-muted); font-weight: 700; margin-left: 4px; }
.emp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.emp-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 16px; background: var(--emp-card); border: 2px solid var(--emp-line);
}
.emp-pos {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #efe7e0; font-weight: 900; font-size: 20px; color: #1a1412;
}
.emp-who { min-width: 0; }
.emp-nm { display: block; font-weight: 900; font-size: clamp(26px, 8vw, 36px); line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-meta { display: block; font-size: 17px; font-weight: 800; color: var(--emp-muted); margin-top: 2px; }
.emp-bn { color: #8a4b00; }
.emp-tk { font-size: 14px; font-weight: 700; margin-left: 6px; }
.emp-turns { text-align: right; line-height: 1; }
.emp-turns b { display: block; font-size: clamp(40px, 13vw, 60px); font-weight: 900; font-variant-numeric: tabular-nums; color: #1a1412; }
.emp-turns small { font-size: 13px; color: var(--emp-muted); font-weight: 700; }
.emp-row.is-next { background: #fde8ef; border-color: #c42d62; }
.emp-row.is-next .emp-pos { background: #c42d62; color: #fff; }
.emp-row.out { opacity: .5; border-style: dashed; }
.emp-row.out .emp-pos { font-size: 13px; background: transparent; border: 1px solid var(--emp-line); }

/* bonus war: big on the employee view */
.emp .bl-list { gap: 8px; }
.emp .bl-row { background: var(--emp-card); border-color: var(--emp-line); color: #1a1412; padding: 10px 14px; }
.emp .bl-pos { color: var(--emp-muted); font-size: 22px; }
.emp .bl-nm { font-size: clamp(24px, 7vw, 32px); }
.emp .bl-ct { font-size: clamp(22px, 6vw, 28px); color: #8a4b00; }
.emp .bl-row.first { background: #ffc93c; border-color: #ffe39a; color: #241500; box-shadow: 0 0 0 3px rgba(255, 201, 60, .35); }
.emp .bl-row.first .bl-pos, .emp .bl-row.first .bl-ct { color: #241500; }
.emp .bl-row.first .bl-nm { font-size: clamp(30px, 9vw, 42px); }
.emp .bl-row.first .bl-nm::after { content: ' 🎁'; }

/* Landscape tablet / TV (1280×720, 1920×1080 …) */
@media (min-width: 900px) and (orientation: landscape) {
  body.view-mode .bhead { padding: 10px 2.5vw; }
  body.view-mode .dateline { flex: 0 1 360px; margin: 0 auto; }
  .emp { max-width: none; padding: 1.6vh 2.5vw 3vh; }
  .emp-top { grid-template-columns: 3fr 2fr; gap: 1.6vw; }
  .emp-up, .emp-bon { padding: 1.4vh 1.6vw 1.8vh; border-radius: 24px; }
  .emp-lbl { font-size: clamp(16px, 1.6vw, 34px); }
  .emp-lbl small { font-size: .8em; }
  .emp-name { font-size: clamp(64px, 8.5vw, 190px); }
  .emp-bon .emp-name { font-size: clamp(48px, 6vw, 130px); }
  .emp-cols { grid-template-columns: 3fr 2fr; gap: 1.6vw; align-items: start; }
  .emp-h { font-size: clamp(18px, 1.5vw, 32px); margin: 1.8vh 4px 1vh; }
  .emp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1vh 1vw; }
  .emp-row { padding: .9vh 1vw; }
  .emp-pos { width: clamp(36px, 2.8vw, 60px); height: clamp(36px, 2.8vw, 60px); font-size: clamp(18px, 1.5vw, 32px); }
  .emp-nm { font-size: clamp(26px, 2.6vw, 56px); }
  .emp-meta { font-size: clamp(15px, 1.3vw, 28px); }
  .emp-tk { font-size: .8em; }
  .emp-turns b { font-size: clamp(36px, 3.6vw, 80px); }
  .emp .bl-row { padding: .9vh 1vw; }
  .emp .bl-nm { font-size: clamp(24px, 2.3vw, 50px); }
  .emp .bl-ct, .emp .bl-pos { font-size: clamp(20px, 2vw, 44px); }
  .emp .bl-row.first .bl-nm { font-size: clamp(30px, 3vw, 64px); }
}

/* ---------- manual adjust (±0.25) + skip + activity (edit only) ---------- */
.skip-next {
  display: block; width: 100%; min-height: 48px; margin-top: 6px; border: 2px solid var(--accent); border-radius: 12px;
  background: #fff; color: var(--accent); font-weight: 800; font-size: 15px;
}
.skip-next:disabled { opacity: .45; }
.tact.tadj { padding-top: 6px; gap: 8px; }
.tact .adj { flex: 1 1 72px; min-height: 48px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; background: #fff7e8; border: 2px solid #8a4b00; color: #8a4b00; }
.tact .adj:not(:disabled):active, .tact .adj:not(:disabled):hover { background: #ffe3a3; }
.tact .adj:disabled, .tact .skip:disabled { opacity: .4; }
.tact .skip { flex: 1 1 96px; font-weight: 800; color: var(--accent); border-color: var(--accent); }
.tact .unskip { flex: 1 1 96px; font-weight: 700; border-style: dashed; }
.tturns .adjl { display: block; font-size: 11px; font-weight: 800; color: #8a4b00; white-space: nowrap; }
.skipped {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 700;
  line-height: 17px; background: #eee6dc; color: var(--muted); letter-spacing: .02em; vertical-align: 1px;
}
body.view-mode .skipped { background: transparent; border: 1px solid var(--emp-line); color: var(--emp-muted); }
.log-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.log-list .ev { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 15px; }
.log-list .ev:first-child { border-top: 0; }
.ev-t { flex: none; width: 72px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.ev-n { flex: none; font-weight: 800; }
.ev-w { color: var(--ink); }
.ev-w small { color: var(--muted); }
.ev.skip .ev-w, .ev.undoSkip .ev-w { color: var(--accent); }

/* ---------- manager Bonus view (edit only) ---------- */
.bonus-tab { margin-left: auto; }
.bonus-view { max-width: 640px; margin: 0 auto; padding: 8px 14px 28px; }
.bv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.bv-back { min-height: 48px; min-width: 48px; padding: 8px 14px; }
.bv-h { flex: 1 1 auto; margin: 0; font-size: 22px; }
.bv-h small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.bv-counts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bv-counts li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.bv-counts .bv-nm { font-weight: 800; font-size: 18px; }
.bv-counts .bv-n { font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; color: var(--accent); }
.bv-tix { list-style: none; margin: 0; padding: 0; }
.bv-tix .bv-tk { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.bv-tix .bv-meta { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.bv-tix .bv-who { font-weight: 800; font-size: 18px; color: var(--text); }
.bv-tix .bv-svcs { margin: 6px 0; font-size: 15px; }
.bv-tix .bv-svcs b { font-variant-numeric: tabular-nums; }
.bv-tix .bv-reason { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.bv-tix .bv-act { display: flex; gap: 8px; }
.bv-tix .bv-act button { flex: 1; min-height: 48px; font-weight: 800; }
#reassignTo { width: 100%; min-height: 48px; font-size: 16px; margin: 8px 0 12px; border-radius: 10px; border: 1px solid var(--line); padding: 8px; background: #fff; }
body.view-mode #bonusViewBtn, body.view-mode #bonusView { display: none !important; }

/* Force a bright cream theme in every board mode, at every width.
   Windows / Edge / Chrome dark mode must not invert this page. */
html.board, html.board body, body.board-page,
body.view-mode, body.editing, html.board:has(body.view-mode), html.board:has(body.editing) {
  color-scheme: light only;
  supported-color-schemes: light;
  background: #fbf7f0;
  color: #1a1412;
}
@media (prefers-color-scheme: dark) {
  html.board, html.board body, body.board-page,
  body.view-mode, body.editing,
  html.board:has(body.view-mode), html.board:has(body.editing),
  body.view-mode .stick, body.view-mode .bhead {
    color-scheme: light only;
    background: #fbf7f0 !important;
    color: #1a1412;
  }
}

/* Table columns are phone-hidden; desktop (1280–1920) shows them. */
.emp-thead, .emp-bn-col, .emp-st { display: none; }
.emp-st small { display: block; font-size: .7em; }

/* ---------- Desktop / Windows board (1280–1920, also 1366×768) ----------
   Use the width: big banners on top, turn list as a table, bonus line beside it. */
@media (min-width: 1200px) {
  html.board, html.board body { background: #fbf7f0; color-scheme: light only; }

  /* Employee / TV / view-only */
  body.view-mode .bhead,
  body.view-mode .stick,
  body.view-mode .emp { max-width: 1760px; margin-left: auto; margin-right: auto; }
  body.view-mode .emp { padding: 1.2vh 2.2vw 3vh; }
  body.view-mode .emp-top { grid-template-columns: 3fr 2fr; gap: 1.4vw; margin-bottom: 1.4vh; }
  body.view-mode .emp-up, body.view-mode .emp-bon { padding: 1.2vh 1.5vw 1.5vh; border-radius: 24px; }
  body.view-mode .emp-lbl { font-size: clamp(18px, 1.5vw, 32px); }
  body.view-mode .emp-name { font-size: clamp(72px, 8.5vw, 160px); }
  body.view-mode .emp-bon .emp-name { font-size: clamp(56px, 6vw, 130px); }
  body.view-mode .emp-cols { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 2vw; align-items: start; }
  body.view-mode .emp-h { font-size: clamp(20px, 1.4vw, 32px); color: #1a1412; margin: 0 0 1vh; }
  body.view-mode .emp-list { grid-template-columns: 1fr; gap: 8px; }
  body.view-mode .emp-thead {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr) 8.5rem 7.5rem 8.5rem;
    gap: 12px; align-items: end;
    padding: 0 14px 8px; font-size: clamp(13px, 1vw, 18px); font-weight: 800;
    letter-spacing: .06em; text-transform: uppercase; color: #5c524c;
  }
  body.view-mode .emp-row {
    grid-template-columns: 4.2rem minmax(0, 1fr) 8.5rem 7.5rem 8.5rem;
    gap: 12px; padding: 1vh 14px; min-height: 72px;
  }
  body.view-mode .emp-meta { display: none; }
  body.view-mode .emp-bn-col, body.view-mode .emp-st { display: block; }
  body.view-mode .emp-bn-col {
    font-size: clamp(22px, 1.8vw, 36px); font-weight: 800; color: #8a4b00; text-align: center;
  }
  body.view-mode .emp-st {
    font-size: clamp(16px, 1.2vw, 24px); font-weight: 800; color: #1d7a3a; text-align: right;
  }
  body.view-mode .emp-row.out .emp-st, body.view-mode .emp-row.is-skipped .emp-st { color: #8a4b00; }
  body.view-mode .emp-nm { font-size: clamp(28px, 2.4vw, 48px); }
  body.view-mode .emp-turns { text-align: center; }
  body.view-mode .emp-turns b { font-size: clamp(36px, 3vw, 64px); color: #1a1412; }
  body.view-mode .emp-pos { width: clamp(40px, 3vw, 56px); height: clamp(40px, 3vw, 56px); font-size: clamp(18px, 1.4vw, 28px); }
  body.view-mode .emp .bl-row { padding: 1vh 1vw; }
  body.view-mode .emp .bl-nm { font-size: clamp(26px, 2.1vw, 48px); color: #1a1412; }
  body.view-mode .emp .bl-ct, body.view-mode .emp .bl-pos { font-size: clamp(20px, 1.7vw, 36px); }
  body.view-mode .emp .bl-row.first .bl-nm { font-size: clamp(30px, 2.5vw, 56px); }

  /* Edit / PIN-unlocked: same cream, use the width */
  body.board-page:not(.view-mode) .bhead,
  body.board-page:not(.view-mode) .stick,
  body.board-page:not(.view-mode) .bmain,
  body.board-page:not(.view-mode) .bonus-view {
    max-width: 1760px; margin-left: auto; margin-right: auto;
  }
  body.board-page:not(.view-mode) .bhead,
  body.board-page:not(.view-mode) .stick,
  body.board-page:not(.view-mode) .bmain { padding-left: 2.2vw; padding-right: 2.2vw; }
  body.board-page:not(.view-mode) .nexts { gap: 16px; }
  body.board-page:not(.view-mode) .nx { padding: 14px 20px; border-radius: 18px; }
  body.board-page:not(.view-mode) .nx b { font-size: clamp(28px, 2.4vw, 48px); }
  body.board-page:not(.view-mode) .nx small { font-size: 15px; }
  body.board-page:not(.view-mode) .bmain {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr);
    column-gap: 2vw; row-gap: 8px; align-items: start;
    padding-bottom: 80px;
  }
  body.board-page:not(.view-mode) .bmain > section:first-child { grid-column: 1; grid-row: 1; }
  body.board-page:not(.view-mode) #blSec { grid-column: 2; grid-row: 1 / span 4; }
  body.board-page:not(.view-mode) #notSec,
  body.board-page:not(.view-mode) #outSec,
  body.board-page:not(.view-mode) #rosterSec,
  body.board-page:not(.view-mode) #logSec,
  body.board-page:not(.view-mode) #resetSec,
  body.board-page:not(.view-mode) #noBoard { grid-column: 1; }
  body.board-page:not(.view-mode) .tname { font-size: 22px; }
  body.board-page:not(.view-mode) .trow .turns { font-size: 28px; }
  body.board-page:not(.view-mode) .bl-list.compact {
    display: grid; gap: 8px; flex-wrap: unset;
  }
  body.board-page:not(.view-mode) .bl-list.compact .bl-row {
    display: grid; grid-template-columns: 2.2rem 1fr auto; width: 100%;
    padding: 10px 14px; font-size: 18px; max-width: none;
  }
  body.board-page:not(.view-mode) .bl-list.compact .bl-row.first { font-size: 22px; }
  body.board-page:not(.view-mode) .bl-nm { font-size: 22px; }
  body.board-page:not(.view-mode) .bl-ct { font-size: 20px; }

  /* Manager Bonus tab */
  body.board-page:not(.view-mode) .bonus-view {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 2vw; padding: 12px 2.2vw 40px;
    background: #fbf7f0; color: #1a1412;
  }
  body.board-page:not(.view-mode) .bonus-view .bv-top { grid-column: 1 / -1; }
  body.board-page:not(.view-mode) .bonus-view > section:nth-of-type(3) { grid-column: 1 / -1; }
  body.board-page:not(.view-mode) .bv-counts { grid-template-columns: 1fr 1fr 1fr; }
  body.board-page:not(.view-mode) .dialog { max-width: 460px; background: #fff; color: #1a1412; }
}

/* Calculator stays cream on a wide desktop too */
@media (min-width: 1200px) {
  body:not(.board-page) .top,
  body:not(.board-page) main { max-width: 720px; }
}


/* Phone view-only (≤599px): turn list | Bonus line, banners on top, cream theme.
   Unlock / edit stay available. Desktop 900px+ / 1200px+ layouts are unchanged. */
@media (max-width: 599px) {
  body.view-mode {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: 100dvh;
  }
  body.view-mode .bhead {
    flex: none;
    max-width: none;
    padding: 6px 10px 8px;
    background: #fbf7f0;
  }
  body.view-mode .emp {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 6px 8px 10px;
    background: #fbf7f0;
  }
  body.view-mode .emp-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: none;
    margin-bottom: 8px;
  }
  body.view-mode .emp-up,
  body.view-mode .emp-bon {
    padding: 8px 10px 10px;
    border-radius: 14px;
  }
  body.view-mode .emp-lbl {
    font-size: 10px;
    letter-spacing: .06em;
    line-height: 1.15;
  }
  body.view-mode .emp-lbl small {
    display: block;
    margin-left: 0;
    font-size: 10px;
  }
  body.view-mode .emp-name {
    font-size: clamp(28px, 8.4vw, 40px);
  }
  body.view-mode .emp-bon .emp-name {
    font-size: clamp(24px, 7.4vw, 36px);
  }
  body.view-mode .emp-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
  }
  body.view-mode .emp-order,
  body.view-mode .emp-bl {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.view-mode .emp-h {
    font-size: 11px;
    margin: 0 0 6px;
    color: #1a1412;
  }
  body.view-mode .emp-thead,
  body.view-mode .emp-bn-col,
  body.view-mode .emp-st,
  body.view-mode .emp-meta { display: none !important; }
  body.view-mode .emp-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  body.view-mode .emp-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 6px 7px;
    min-height: 48px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e4d8ce;
  }
  body.view-mode .emp-pos {
    width: 22px; height: 22px; font-size: 11px;
    background: #efe7e0; color: #1a1412;
  }
  body.view-mode .emp-row.is-next .emp-pos { background: #c42d62; color: #fff; }
  body.view-mode .emp-nm {
    font-size: clamp(16px, 4.8vw, 22px);
    font-weight: 900;
    color: #1a1412;
  }
  body.view-mode .emp-turns { text-align: right; line-height: 1; }
  body.view-mode .emp-turns b {
    font-size: clamp(22px, 6.4vw, 30px);
    color: #1a1412;
  }
  body.view-mode .emp-turns small { font-size: 9px; color: #5c524c; }
  body.view-mode .emp-skip {
    font-size: 10px;
    margin-top: 2px;
    padding: 2px 6px;
    color: #241500;
    background: #ffc93c;
  }
  body.view-mode .emp-skip small { display: block; margin-left: 0; font-size: 10px; }
  body.view-mode .emp .bl-row {
    display: grid;
    grid-template-columns: 1.3rem minmax(0, 1fr) auto;
    gap: 4px;
    align-items: center;
    padding: 6px 7px;
    min-height: 48px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e4d8ce;
    color: #1a1412;
  }
  body.view-mode .emp .bl-pos { font-size: 13px; color: #5c524c; }
  body.view-mode .emp .bl-nm {
    font-size: clamp(15px, 4.4vw, 20px);
    color: #1a1412;
  }
  body.view-mode .emp .bl-ct {
    font-size: clamp(13px, 3.6vw, 16px);
    color: #8a4b00;
    white-space: nowrap;
  }
  body.view-mode .emp .bl-row.first {
    background: #ffc93c;
    border-color: #e0a00a;
    color: #241500;
  }
  body.view-mode .emp .bl-row.first .bl-nm {
    font-size: clamp(16px, 4.8vw, 22px);
    color: #241500;
  }
  body.view-mode .emp .bl-row.first .bl-pos,
  body.view-mode .emp .bl-row.first .bl-ct { color: #241500; }
  body.view-mode .emp .bl-row.first .bl-nm::after { content: none; }
}

/* ---------- manager row, Combined tickets, History ---------- */
.mgr .lockbtn { flex: 1; margin-left: 0; }
.combo-bar { margin: 4px 0 6px; }
.combo-btn {
  width: 100%; min-height: 60px; border-radius: 14px; border: 2px dashed var(--accent); background: var(--accent-soft);
  color: var(--accent); font-weight: 800; font-size: 18px; line-height: 1.15; padding: 6px 12px;
}
.combo-btn small { display: block; font-size: 12px; font-weight: 600; opacity: .85; }
.combo-btn:active { transform: scale(.98); }
.gtag {
  display: inline-block; margin: 4px 0 0; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: 12px; font-weight: 800;
}

.grp-list, .cb-parts { list-style: none; margin: 0; padding: 0; }
.grp, .cb-part { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.grp { border-left: 5px solid var(--accent); }
.grp-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 14px; color: var(--muted); }
.grp-top b { color: var(--ink); font-size: 17px; }
.gp-list { list-style: none; margin: 6px 0; padding: 0; }
.gp { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.gp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gp-n { font-weight: 800; font-size: 18px; }
.gp-r { font-weight: 800; font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
.gp-r.bonus { color: var(--gold); }
.gp-act { display: flex; gap: 8px; margin: 6px 0 4px; }
.gp-act button { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 15px; line-height: 1.1; }
.gp-act button small { display: block; font-size: 11px; opacity: .8; font-weight: 600; }
.gp-act .warn { color: #8b1b1b; border-color: #e6c3c3; }
.grp-del { width: 100%; min-height: 44px; margin-top: 4px; border-radius: 12px; border: 1px solid #e6c3c3; background: #fff; font-weight: 700; font-size: 15px; }

.combo-view, .history-view { max-width: 640px; margin: 0 auto; padding: 8px 14px 28px; }
.cb-field { display: block; margin: 8px 0; font-weight: 700; font-size: 15px; }
.cb-field input { display: block; width: 100%; margin-top: 6px; min-height: 52px; font-size: 18px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.cb-seg { margin: 6px 0 4px; }
.cb-seg .seg-btn small { display: block; font-size: 11px; font-weight: 600; }
.cb-addh { margin-top: 14px; }
.cb-techs { margin-bottom: 8px; }
.cb-foot { position: sticky; bottom: 0; z-index: 6; display: flex; gap: 10px; padding: 10px 0 max(10px, env(safe-area-inset-bottom, 0px)); background: var(--bg); box-shadow: 0 -8px 12px rgba(251, 247, 240, .95); margin-top: 8px; }
.cb-foot .ghost { flex: 0 0 90px; }
.cb-foot .add { flex: 1; min-height: 56px; }
.cb-foot button:disabled { opacity: .45; }
.combo-view .err { margin: 8px 0; }
/* in the picker: a combined part uses the ticket's walk-in / appointment choice */
#sheet.collect #tkSeg { display: none; }

.hv-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.hv-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.hv-table th, .hv-table td { padding: 8px 6px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.hv-table thead th { border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hv-table th:first-child { text-align: left; padding-left: 10px; font-weight: 800; }
.hv-table td small { display: block; font-size: 11px; color: var(--muted); }
.hv-table th small { font-size: 11px; color: var(--muted); font-weight: 600; }
.hv-table .tot { font-weight: 800; color: var(--accent); font-size: 17px; }
.hv-table tfoot th, .hv-table tfoot td { background: #f7f1e8; font-weight: 800; }
.hv-table tr.sel th, .hv-table tr.sel td { background: var(--accent-soft); }
.hv-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.hv-tools select { flex: 1; min-width: 0; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 16px; font-weight: 700; padding: 0 10px; }
.hv-tools .ghost { flex: none; min-height: 48px; padding: 2px 12px; font-size: 14px; }
.hv-log { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.hv-row { padding: 9px 12px; border-top: 1px solid var(--line); }
.hv-row:first-child { border-top: 0; }
.hv-l1 { display: flex; align-items: baseline; gap: 8px; }
.hv-t { flex: none; width: 74px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.hv-n { flex: 1; min-width: 0; font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-d { flex: none; font-weight: 800; font-size: 17px; color: #155d2c; font-variant-numeric: tabular-nums; }
.hv-row.neg .hv-d { color: #8b1b1b; }
.hv-l2 { margin-top: 2px; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.hv-l2 small { color: var(--muted); }
.hv-row.skip .hv-n, .hv-row.undoSkip .hv-n { color: var(--accent); }
.hv-row.reset .hv-l2, .hv-row.undoReset .hv-l2 { font-weight: 700; color: #8a4b00; }

/* Love Beauty & Spa TEST branding */
.salon-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  background: #163656; color: #fff; font-weight: 800; font-size: 15px;
  padding: max(7px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 7px max(10px, env(safe-area-inset-left, 0px));
  letter-spacing: .02em; text-align: center;
}
.test-badge {
  display: inline-block; background: #ffc93c; color: #241500;
  font-size: 11px; font-weight: 900; letter-spacing: .1em;
  padding: 2px 7px; border-radius: 6px; line-height: 1.3;
}

/* 20-tech roster: tighter name grid so Not-in still fits on a phone */
.ngrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nbtn { min-height: 52px; font-size: 16px; padding: 6px 6px; border-radius: 12px; }
@media (min-width: 600px) {
  .ngrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .nbtn { min-height: 56px; font-size: 18px; }
}
@media (min-width: 1200px) {
  .ngrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .nbtn { min-height: 58px; font-size: 18px; }
}

/* Phone view-only: slightly tighter rows so 20 names stay readable without huge scrolling */
@media (max-width: 599px) {
  body.view-mode .emp-list { gap: 6px; }
  body.view-mode .emp-row { padding: 8px 10px; gap: 8px; }
  body.view-mode .emp-pos { width: 34px; height: 34px; font-size: 16px; }
  body.view-mode .emp-nm { font-size: clamp(22px, 6.5vw, 30px); }
  body.view-mode .emp-meta { font-size: 14px; }
  body.view-mode .emp-turns b { font-size: clamp(32px, 10vw, 48px); }
  body.view-mode .emp .bl-row { padding: 8px 10px; }
  body.view-mode .emp .bl-nm { font-size: clamp(20px, 6vw, 26px); }
  body.view-mode .emp-name { font-size: clamp(36px, 12vw, 56px); }
  body.view-mode .emp-bon .emp-name { font-size: clamp(28px, 9vw, 44px); }
}

/* Desktop / TV view-only: two columns so 20 techs fit on one screen */
@media (min-width: 1200px) {
  body.view-mode .emp-list { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  body.view-mode .emp-thead { display: none !important; }
  body.view-mode .emp-row {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    min-height: 56px;
    padding: 8px 12px;
  }
  body.view-mode .emp-meta { display: block; }
  body.view-mode .emp-bn-col,
  body.view-mode .emp-st { display: none; }
  body.view-mode .emp .bl-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
}

/* Bonus line rule hint (view + edit) */
.bl-hint, p.bl-hint {
  margin: 0 4px 8px; font-size: 13px; font-weight: 700; line-height: 1.35;
  color: #5c524c; max-width: 52rem;
}
body.view-mode .bl-hint { color: #4a433e; font-size: 13px; margin: 0 4px 10px; }
@media (max-width: 599px) {
  body.view-mode .bl-hint { font-size: 12px; margin: 0 2px 8px; }
}


/* TEST: ring + passcodes (manager edit) */
.nx-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ring-next {
  min-height: 44px; border: 2px solid var(--accent); border-radius: 12px; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 15px; padding: 0 12px; margin-top: 6px;
}
.ring-next:disabled { opacity: .5; }
.nx-btns .skip-next { margin-top: 6px; }
.tact { position: relative; }
.ring-wrap {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 44px; width: 100%;
  overflow: hidden; contain: layout paint; isolation: isolate;
}
.tact .ring-btn, .ring-next { contain: layout paint; }
.tact .ring-btn { background: #fff0cf; border-color: var(--gold); color: #7a5300; font-weight: 800; position: relative; overflow: hidden; isolation: isolate; flex: 0 0 13rem; width: 13rem; max-width: 13rem; box-sizing: border-box; white-space: nowrap; }
.tact .ring-btn.calling,
.ring-next.calling {
  position: relative;
  z-index: 1;
  overflow: hidden;
  contain: layout paint;
  /* No transform/scale on the button itself — that was making the list look like it was shaking. */
  transform: none;
  animation: ring-glow-bg 0.9s ease-in-out infinite;
}
.tact .ring-btn.calling .ring-bell,
.ring-next.calling .ring-bell {
  display: inline-block;
  will-change: transform;
  transform: translateZ(0);
  animation: ring-bell 0.9s ease-in-out infinite;
}
.tact .ring-btn.calling::after,
.ring-next.calling::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: ring-glow 0.9s ease-in-out infinite;
}
@keyframes ring-bell {
  0%, 100% { transform: rotate(0deg) translateZ(0); }
  30% { transform: rotate(-12deg) translateZ(0); }
  60% { transform: rotate(12deg) translateZ(0); }
}
@keyframes ring-glow-bg {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
@keyframes ring-glow {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(224, 160, 10, 0); }
  50% { box-shadow: inset 0 0 0 3px rgba(224, 160, 10, .75); }
}
@media (prefers-reduced-motion: reduce) {
  .tact .ring-btn.calling, .ring-next.calling { animation: ringblink 1s steps(1) infinite; transform: none; filter: none; }
  .tact .ring-btn.calling .ring-bell, .ring-next.calling .ring-bell { animation: none; }
  .tact .ring-btn.calling::after, .ring-next.calling::after { animation: none; }
  .tdetail, .overlay, .overlay .dialog, #sheet, .sheet { transition: none !important; }
  .trow.just-saved { animation: none; }
  .overlay.is-in .dialog, .sheet.is-in { transform: none; }
}
.ring-st {
  /* Out of flow, inside the action row, so the card never grows or clips the status. */
  position: absolute;
  top: 6px;
  right: 8px;
  left: auto;
  bottom: auto;
  z-index: 3;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff6d8;
  color: #7a5300;
  box-shadow: 0 1px 4px rgba(40, 24, 8, .12);
}
.ring-st.ok { color: #1c6b3b; background: #e2f4e7; }
.ring-st.ringing { color: #b3261e; animation: ringblink 1s steps(1) infinite; }
.ring-st.miss { color: var(--muted); }
@keyframes ringblink { 50% { opacity: .35; } }
.pc-btn.set { background: #e3f4ea; border-color: #1c6b3b; color: #14572f; }
#pcInput { width: 100%; min-height: 60px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); padding: 0 14px; font-size: 28px; letter-spacing: .3em; text-align: center; }


/* One board: sign-in gate (no public view) */
body.signed-out .bmain,
body.signed-out .stick,
body.signed-out #mgrRow,
body.signed-out .dateline,
body.tech-mode .bmain,
body.tech-mode .stick,
body.tech-mode #mgrRow,
body.tech-mode .dateline { display: none !important; }
body.signed-out #gate { display: block; }
#gate { display: none; padding: 16px 14px 40px; max-width: 920px; margin: 0 auto; }
body.signed-out #gate, .gate { display: block; }
#gate h1 { font-size: 28px; margin: 8px 0 6px; }
.gate-lead { font-weight: 650; color: #5c524c; line-height: 1.4; margin: 0 0 18px; }
.gate-cols { display: grid; gap: 16px; }
@media (min-width: 800px) { .gate-cols { grid-template-columns: 1.2fr .8fr; align-items: start; } }
.gate-card { background: var(--card, #fff); border: 2px solid var(--line, #e5dcd0); border-radius: 18px; padding: 16px; }
.gate-card h2 { margin: 0 0 10px; font-size: 20px; }
#gateMgrBtn { width: 100%; margin-top: 8px; }
/* Reserve room for ~20 names (10 rows x 2 cols) so the Manager card doesn't jump when /api/tech/names lands (CLS). */
#nameGrid { min-height: calc(10 * 64px + 9 * 10px); }
@media (max-width: 429px) { #nameGrid { min-height: calc(10 * 56px + 9 * 10px); } }
body.tech-mode #gate { display: none; }
body.tech-mode #app { display: block; }
#app { display: none; }


/* ---------- one-board phone layout ---------- */
body.signed-out #live,
body.signed-out #mode { display: none !important; }
body.tech-mode #mode { display: none !important; }
body.tech-mode,
body.signed-out { padding-bottom: env(safe-area-inset-bottom, 0px); }
body.tech-mode #app,
body.signed-out #gate {
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}
body.tech-mode .bhead .brow { margin-bottom: 6px; }
.board-page main.bmain,
.combo-view, .history-view, .bonus-view {
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
.ring-ov { padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px)); }

.cb-client { display: block; margin: 8px 0 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.cb-client input {
  display: block; width: 100%; margin-top: 4px; min-height: 44px; font-size: 16px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.cb-techs { padding-bottom: 8px; }
@media (max-width: 429px) {
  .cb-techs.ngrid, #cbTechs.ngrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-techs .nbtn { min-height: 56px; font-size: 16px; }
  .nx b { font-size: 20px; }
  .tact button, .gp-act button, .grp-del { min-height: 44px; }
  #gate h1 { font-size: 24px; }
  .name-btn { min-height: 56px; font-size: 20px; }
  .lockbtn, .calc-link { min-height: 44px; }
}

/* Not-in grid: 2 columns on the narrowest Android width so long names stay readable */
@media (max-width: 359px) {
  .ngrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nbtn { min-height: 56px; font-size: 16px; }
}

/* ---- ticket review (in service / pending) ---- */
.start-next { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 0.45rem 0.8rem; background: #1d6b4f; color: #fff; cursor: pointer; }
.start-next:disabled { opacity: 0.45; }
.pending-btn { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 0.4rem 0.75rem; background: #8a4b12; color: #fff; cursor: pointer; margin-right: 0.4rem; }
.pending-btn b { display: inline-block; min-width: 1.2em; margin-left: 0.15em; }
.pending-sec { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border: 1px solid rgba(138,75,18,.35); border-radius: 14px; background: rgba(138,75,18,.06); }
.pending-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.pending-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; padding: 0.55rem 0.7rem; border-radius: 12px; background: #fff; border: 1px solid rgba(0,0,0,.08); }
.pending-item .pend-who { font-weight: 700; }
.pending-item .pend-svcs { flex: 1 1 12rem; color: #444; font-size: 0.92rem; }
.pending-item .pend-turns { font-weight: 700; }
.pending-item .pend-open { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 0.35rem 0.75rem; background: #1d6b4f; color: #fff; cursor: pointer; }
.tk-st { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: .02em; padding: 0.1rem 0.45rem; border-radius: 999px; vertical-align: middle; }
.tk-st.in-service { background: #e7f4ec; color: #1d6b4f; }
.tk-st.pending { background: #f8ead8; color: #8a4b12; }
.tact .start-btn { font-weight: 700; }
.sheet-pin { display: grid; gap: 0.25rem; font-size: 0.88rem; color: #444; margin: 0 0 0.5rem; }
.sheet-pin input { font: inherit; padding: 0.45rem 0.6rem; border-radius: 8px; border: 1px solid #ccc; }
.sheet.review #sheetSave, .sheet.upload #sheetSave { display: none; }

/* Staff PIN screen (manager, unlocked only) */
.staff-pin-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border: 1px solid #e6d9c8; border-radius: 12px; }
.sp-name { font-weight: 800; min-width: 88px; flex: 1 1 88px; }
.sp-current { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: 0.12em; min-width: 64px; }
.sp-current.unset { letter-spacing: 0; font-weight: 600; opacity: .55; }
.sp-input { width: 88px; min-height: 44px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: 0.2em; border: 2px solid #c9b8a2; border-radius: 10px; }
.sp-save { min-height: 44px; }

/* Not-in section: a single Clock in button (no names) that opens the PIN pad dialog. */
.clockin-btn { min-height: 56px; max-width: 420px; }
#ciDlg .pin-ok, #coDlg .pin-ok { margin: 6px 0 0; }
/* Self clock-out: one button under the turn order (PIN pad, no names). */
.clockout-btn { display: block; width: 100%; max-width: 420px; min-height: 52px; margin: 10px 0 0; font-size: 17px; }
.clockout-btn[hidden] { display: none; }


/* =====================================================================
   Casabella-preview manager LAYOUT, ported to Lovely (layout only).
   Everything is scoped to body.mgr-mode (set by render() for the signed-in manager),
   so the PIN gate, the tech's My Turn screen and every rule stay exactly as they were.
   Chunks copied from the Casabella preview: Turn line | Bonus line cards, manager
   stage, Out button + sheet, sticky line cards (desktop 700px+).
   ===================================================================== */
/* ---------- Turn line · Hàng lượt and Bonus line: two equal columns, same size, tops aligned. ---------- */
.pair-lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
/* One visible child (the other [hidden]) → no empty column */
.pair-lines:not(:has(> :not([hidden]) + :not([hidden]))) {
  grid-template-columns: 1fr;
}
.pair-lines > * {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--card, #fff);
  border: 2px solid var(--line, #e4d8ce);
  border-radius: 16px;
  padding: 10px 12px 8px;
  overflow: hidden;
}
.emp .pair-lines > * {
  background: var(--emp-card, #fff);
  border-color: var(--emp-line, #e4d8ce);
}
.pair-lines .tl-list,
.pair-lines .bl-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* Headings inside the two cards match, so chrome + typography stay even. */
.pair-lines .tl-h,
.pair-lines .emp-h,
.pair-lines h2.sec {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #1a1412;
}
.pair-lines .tl-h small,
.pair-lines .emp-h small,
.pair-lines h2.sec small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}
.pair-lines .tl-hint,
.pair-lines .bl-hint,
.pair-lines p.bl-hint {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  max-width: none;
}
.tl-sec { margin: 0; }
.tl-h { margin: 0 0 6px; font-size: 15px; font-weight: 900; letter-spacing: .02em; color: var(--ink, #1a1412); }
.tl-h small { display: inline; font-size: inherit; font-weight: 700; color: var(--muted, #5c524c); }
.tl-hint { margin: 0 0 6px; font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--muted, #5c524c); }
.tl-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 6px;
  min-height: 44px;
}
.tl-chip {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px;
  min-height: 40px; max-width: 100%; box-sizing: border-box;
  padding: 5px 10px; border-radius: 14px; background: var(--card, #fff); border: 2px solid var(--line, #e4d8ce);
  font-weight: 800; font-size: 15px; color: var(--ink, #1a1412);
}
.tl-pos {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: #efe7e0; color: #1a1412; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.tl-nm {
  min-width: 0;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}
.tl-ct { font-variant-numeric: tabular-nums; color: var(--muted, #5c524c); white-space: nowrap; }
.tl-ct small { display: inline; font-size: .75em; font-weight: 700; color: inherit; }
.tl-chip.first { background: #fde8ef; border-color: #c42d62; color: #5a0f2a; }
.tl-chip.first .tl-pos { background: #c42d62; color: #fff; }
.tl-chip.first .tl-ct { color: #8b1b3d; }
.emp .tl-sec { margin: 0; }
.emp .tl-h { color: #1a1412; font-size: 16px; text-transform: uppercase; letter-spacing: .06em; }
.emp .tl-h small { text-transform: none; letter-spacing: 0; color: var(--emp-muted, #5c524c); }
.emp .tl-hint { color: #4a433e; }
.emp .tl-chip { background: var(--emp-card, #fff); border-color: var(--emp-line, #e4d8ce); color: #1a1412; font-size: 16px; }
.emp .tl-chip .tl-ct { color: #5c524c; }
.emp .tl-chip.first { background: #fde8ef; border-color: #c42d62; color: #5a0f2a; }
.emp .tl-chip.first .tl-ct { color: #8b1b3d; }
@media (min-width: 900px) and (orientation: landscape) {
  .emp .tl-chip { font-size: clamp(16px, 1.3vw, 26px); min-height: clamp(40px, 3.6vh, 56px); }
  .emp .tl-pos { width: clamp(22px, 1.8vw, 36px); height: clamp(22px, 1.8vw, 36px); font-size: clamp(12px, .9vw, 18px); }
  .emp .tl-h { font-size: clamp(15px, 1.1vw, 24px); }
}
@media (min-width: 1200px) {
  body.board-page.mgr-mode .tl-chip { font-size: 16px; }
  body.board-page.mgr-mode .tl-chip.first { font-size: 18px; }
  body.board-page.mgr-mode .tl-h { font-size: 16px; }
}
/* Manager one-screen main stage */
body.board-page.mgr-mode .bmain {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.15fr);
  column-gap: 10px;
  row-gap: 8px;
  align-items: start;
  overflow: visible;
  padding-bottom: 16px;
}
body.board-page.mgr-mode #ordSec {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
body.board-page.mgr-mode #editPair {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: visible;
}
body.board-page.mgr-mode #ordSec .sec,
body.board-page.mgr-mode .pair-lines .tl-h,
body.board-page.mgr-mode .pair-lines h2.sec { flex: none; }
body.board-page.mgr-mode #inList,
body.board-page.mgr-mode .pair-lines .tl-list,
body.board-page.mgr-mode .pair-lines .bl-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  overflow: visible;
  gap: 8px;
}
body.board-page.mgr-mode .pair-lines .bl-list.compact {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
}
body.board-page.mgr-mode #inList .trow,
body.board-page.mgr-mode .pair-lines .tl-chip,
body.board-page.mgr-mode .pair-lines .bl-row {
  flex: none;
  min-height: auto;
  max-height: none;
  overflow: visible;
}
/* Scale type with the number of techs / viewport so 10–14 rows fit without page scroll. */
body.board-page.mgr-mode #inList .tname {
  font-size: clamp(13px, 2.4vh, 22px);
}
body.board-page.mgr-mode #inList .turns {
  font-size: clamp(16px, 3vh, 28px);
}

/* Full manager rows: number + name + turns + all action buttons, nothing clipped. */
body.board-page.mgr-mode #inList .trow {
  overflow: visible;
}
body.board-page.mgr-mode #inList .tmain { min-height: 64px; overflow: visible; }
body.board-page.mgr-mode #inList .tpos {
  flex: none;
  width: 34px;
  height: 34px;
  font-size: 16px;
  font-weight: 900;
}
body.board-page.mgr-mode #inList .tact { display: flex; }
body.board-page.mgr-mode #inList .tact button { min-height: 48px; min-width: 48px; }
body.board-page.mgr-mode #tlList .tl-pos,
body.board-page.mgr-mode #blList .bl-pos,
body.board-page.mgr-mode .pair-lines .tl-pos,
body.board-page.mgr-mode .pair-lines .bl-pos {
  flex: none;
  display: grid;
  place-items: center;
}

body.board-page.mgr-mode .pair-lines .tl-chip,
body.board-page.mgr-mode .pair-lines .bl-row {
  font-size: clamp(12px, 2.2vh, 18px);
  padding: clamp(2px, 0.6vh, 8px) 10px;
}
/* Lovely keeps its Bonus line rule reminder (Casabella hides it); clamped to two lines so it never grows the card. */
body.board-page.mgr-mode .pair-lines .tl-hint,
body.board-page.mgr-mode .pair-lines .bl-hint {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 11px; line-height: 1.3; margin: 0 0 6px; flex: none;
}

/* Clock-in easing: transform/opacity only — no layout shift. */
@keyframes justIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.trow.just-in,
.tl-chip.just-in,
.bl-row.just-in,
.emp-row.just-in {
  animation: justIn 0.28s ease-out;
}

/* Out button + sheet (manager). The sheet itself may scroll; the page may not. */
.out-panel-btn { position: relative; }
.out-count {
  display: inline-grid; place-items: center;
  min-width: 1.4em; height: 1.4em; margin-left: 4px; padding: 0 5px;
  border-radius: 999px; background: #1a1412; color: #fff;
  font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.out-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #c42d62; color: #fff;
  font-size: 11px; font-weight: 900; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
#outDlg.overlay { align-items: flex-end; }
#outDlg .out-sheet {
  width: min(720px, 100%);
  max-height: min(88dvh, 900px);
  display: flex; flex-direction: column;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  background: #fff; color: #1a1412;
}
.out-sheet-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line, #e4d8ce);
}
.out-sheet-head h2 { flex: 1; margin: 0; font-size: 18px; }
.out-dlg-close {
  min-height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line, #e4d8ce); background: #fff; font-weight: 800;
}
.out-sheet-body {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 24px;
}
@media (min-width: 800px) {
  #outDlg.overlay { align-items: center; }
  #outDlg .out-sheet { border-radius: 20px; max-height: min(80dvh, 860px); }
}

@media (max-width: 599px) {
  /* Compact manager chrome so 14 rows can fit at 390×844. */
  body.board-page.mgr-mode .bhead { padding: 6px 8px 6px; }
  body.board-page.mgr-mode .brow { margin-bottom: 4px; }
  body.board-page.mgr-mode .stick { padding-left: 8px; padding-right: 8px; }
  body.board-page.mgr-mode .bmain {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.15fr);
    column-gap: 6px; padding-left: 6px; padding-right: 6px; padding-bottom: 6px;
  }
  body.board-page.mgr-mode .pair-lines { gap: 6px; }
  body.board-page.mgr-mode #inList .tname { font-size: clamp(12px, 2.6vh, 16px); }
  body.board-page.mgr-mode #inList .turns { font-size: clamp(14px, 3vh, 20px); }
}

body[data-in-count="10"] .pair-lines .tl-chip,
body[data-in-count="11"] .pair-lines .tl-chip,
body[data-in-count="12"] .pair-lines .tl-chip,
body[data-in-count="13"] .pair-lines .tl-chip,
body[data-in-count="14"] .pair-lines .tl-chip,
body[data-in-count="10"] .pair-lines .bl-row,
body[data-in-count="11"] .pair-lines .bl-row,
body[data-in-count="12"] .pair-lines .bl-row,
body[data-in-count="13"] .pair-lines .bl-row,
body[data-in-count="14"] .pair-lines .bl-row,
body[data-in-count="10"] #inList .trow,
body[data-in-count="11"] #inList .trow,
body[data-in-count="12"] #inList .trow,
body[data-in-count="13"] #inList .trow,
body[data-in-count="14"] #inList .trow {
  gap: 4px;
}
/* Desktop manager (≥700px): Turn line | Bonus line stay on screen while the long
   Turn order list scrolls. Stick just below the already-sticky Next-up bar
   (#stick, z-index 15). Lists inside the cards scroll if the pair is taller
   than the leftover viewport. Phone layout is unchanged (see max-width: 699px). */
@media (min-width: 700px) {
  /* Extra space at the end of the order list so the sticky pair is not
     pushed up under #stick when the page is scrolled all the way down. */
  body.board-page.mgr-mode #ordSec { padding-bottom: 32px; }
  body.board-page.mgr-mode #editPair {
    position: sticky;
    top: var(--mgr-stick-h, 0px);
    z-index: 4;
    align-self: start;
    max-height: calc(100dvh - var(--mgr-stick-h, 0px) - 48px);
    overflow: hidden;
    box-sizing: border-box;
    grid-template-rows: minmax(0, 1fr);
  }
  body.board-page.mgr-mode #editPair > * {
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.board-page.mgr-mode #editPair .tl-list,
  body.board-page.mgr-mode #editPair .bl-list,
  body.board-page.mgr-mode #editPair .bl-list.compact {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Manager on a phone (<700px): Turn order on the left would squeeze Turn line | Bonus line to ~90px each
   (names and numbers clip). Stack instead: the two equal line cards on top, Turn order full width below.
   Wide screens keep Order left, lines right. */
@media (max-width: 699px) {
  body.board-page.mgr-mode .bmain { grid-template-columns: minmax(0, 1fr); }
  body.board-page.mgr-mode #editPair { grid-column: 1; grid-row: 1; }
  body.board-page.mgr-mode #ordSec { grid-column: 1; grid-row: 2; }
  body.board-page.mgr-mode #noBoard { grid-column: 1; grid-row: 3; }
}

/* ---- Lovely-specific placement inside the Casabella manager layout ---- */
/* tech.css .ring-bell (96px) was meant for the full-screen Ring overlay only; scoped there now. */
body.board-page.mgr-mode .bmain {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.15fr);
  row-gap: 0;
  padding-bottom: 16px;
}
body.board-page.mgr-mode #comboBar { grid-column: 1 / -1; grid-row: 1; margin: 0 0 8px; }
body.board-page.mgr-mode #pendingSec { grid-column: 1 / -1; grid-row: 2; margin: 0 0 8px; }
body.board-page.mgr-mode #ordSec { grid-column: 1; grid-row: 3; }
body.board-page.mgr-mode #editPair { grid-column: 2; grid-row: 3; }
body.board-page.mgr-mode #grpSec { grid-column: 1 / -1; grid-row: 4; }
body.board-page.mgr-mode #noBoard { grid-column: 1 / -1; grid-row: 5; }
body.board-page.mgr-mode .combo-btn { min-height: 44px; }
/* Pending review: one compact line when empty (the list still shows every waiting ticket). */
body.board-page.mgr-mode .pending-sec { padding: 6px 12px; }
body.board-page.mgr-mode .pending-sec .sec { margin: 4px 0; }
body.board-page.mgr-mode .pending-sec .empty-note { margin: 0 0 4px; text-align: left; font-size: 13px; }
body.board-page.mgr-mode #ordSec > .sec { margin: 4px 4px 8px; }
body.board-page.mgr-mode #ordSec .clockout-btn { max-width: none; margin-top: 8px; }
/* Out sheet holds the Lovely Clock in (PIN pad) button + name buttons */
body.board-page.mgr-mode #outDlg .clockin-btn { max-width: none; width: 100%; }
body.board-page.mgr-mode #outDlg .sec { margin-top: 14px; }
#outDlg .out-sheet { box-sizing: border-box; }

/* Header: the Out button joins Bonus / History / Staff PINs; four equal buttons on every width */
#mgrRow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#mgrRow .out-panel-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
@media (max-width: 440px) { #mgrRow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Next up bar: Client in / Ring / Skip share one row under the name */
body.board-page.mgr-mode .nx-btns { display: flex; flex-wrap: wrap; gap: 6px; }
body.board-page.mgr-mode .nx-btns > button { flex: 1 1 96px; margin-top: 6px; min-height: 48px; width: auto; border-radius: 12px; }

/* Order rows: first line = Client in · Add completed · ▲ ▼ · Clock out; second line = −0.25 · +0.25 · Skip · Ring */
body.board-page.mgr-mode #inList .tact { gap: 6px; padding: 0 10px 8px; align-items: stretch; }
body.board-page.mgr-mode #inList .tact .plus { flex: 1 1 110px; font-size: 16px; }
body.board-page.mgr-mode #inList .tact .start-btn { flex: 1 1 96px; }
body.board-page.mgr-mode #inList .tact .mv { flex: 0 0 48px; width: 48px; }
body.board-page.mgr-mode #inList .tact button { min-height: 48px; }
body.board-page.mgr-mode #inList .tact.tadj { padding-top: 0; }
body.board-page.mgr-mode #inList .tact .ring-btn { flex: 1 1 96px; width: auto; max-width: none; }
body.board-page.mgr-mode #inList .tact .ring-wrap { min-height: 44px; }
body.board-page.mgr-mode #inList .tcounts { display: block; }
body.board-page.mgr-mode #inList .tname { white-space: normal; overflow-wrap: anywhere; }
body.board-page.mgr-mode #inList .tmain { padding: 6px 12px; }

/* Line cards: Casabella main's rules (appended at the end of this file) */
body.board-page.mgr-mode #blSec { display: flex; flex-direction: column; }
body.board-page.mgr-mode #blSec .sec { margin: 0 0 6px; }
body.board-page.mgr-mode #blSec .empty-note { margin: 4px 0; }

/* Phone: keep the sticky Next-up bar short — Client in / Ring / Skip wrap under the name, small type */
@media (max-width: 699px) {
  body.board-page.mgr-mode .nexts { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 6px; }
  body.board-page.mgr-mode .nx { padding: 6px 8px; border-radius: 12px; }
  body.board-page.mgr-mode .nx b { font-size: 20px; }
  body.board-page.mgr-mode .nx-btns { gap: 4px; }
  body.board-page.mgr-mode .nx-btns > button { flex: 1 1 56px; min-height: 48px; margin-top: 4px; padding: 0 4px; font-size: 13px; }
}

/* Phone (<700px): the two line cards sit above the Order list; names stack over the count so nothing clips */
@media (max-width: 699px) {
  body.board-page.mgr-mode .bmain { grid-template-columns: minmax(0, 1fr); padding-left: 8px; padding-right: 8px; }
  body.board-page.mgr-mode #editPair { grid-column: 1; grid-row: 3; margin-bottom: 8px; gap: 6px; }
  body.board-page.mgr-mode #ordSec { grid-column: 1; grid-row: 4; }
  body.board-page.mgr-mode #grpSec { grid-row: 5; }
  body.board-page.mgr-mode #noBoard { grid-row: 6; }
  body.board-page.mgr-mode #editPair .pair-lines-list,
  body.board-page.mgr-mode #editPair .tl-list,
  body.board-page.mgr-mode #editPair .bl-list { max-height: 44dvh; overflow-y: auto; }
  body.board-page.mgr-mode #editPair { padding: 0; border: 0; background: transparent; }
  body.board-page.mgr-mode #editPair > * { padding: 8px 8px 6px; }
}
@media (min-width: 700px) {
  body.board-page.mgr-mode .bhead,
  body.board-page.mgr-mode .stick,
  body.board-page.mgr-mode .bmain { max-width: 1760px; margin-left: auto; margin-right: auto; }
}

/* First paint for a returning manager: keep the header at its final height (no jump when the board replaces the gate). */
html.has-mgr body.signed-out #gate { display: none !important; }
/* nothing in the header is painted until the first render, so nothing in it can jump */
html.has-mgr body.signed-out .bhead,
html.has-mgr body.signed-out .salon-banner ~ .bhead { visibility: hidden; }

/* Manager screen: no half-built list area while the first board is still on its way (keeps CLS at 0) */
body.mgr-mode.awaiting-snap .bmain { visibility: hidden; }
/* Header row 1 never wraps on a phone (the "reconnecting" → "Live" text change used to re-flow the page) */
@media (max-width: 699px) {
  body.mgr-mode .bhead > .brow:first-child { flex-wrap: nowrap; }
  body.mgr-mode .bhead > .brow:first-child .live { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  body.mgr-mode .bhead > .brow:first-child .calc-link { flex: none; }
}

/* =====================================================================
   Manager header = Casabella's: Calculator … Live on row 1; then the mode pill and the
   buttons spread across one row (wraps on a phone); then the date line.
   (Only in mgr-mode — sign-in gate, tech My Turn and PIN flows keep their own header.)
   ===================================================================== */
body.board-page.mgr-mode .bhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.board-page.mgr-mode .bhead > .brow:first-child,
body.board-page.mgr-mode .bhead > .dateline { flex: 0 0 100%; }
body.board-page.mgr-mode .bhead > .brow:first-child { margin-bottom: 0; }
body.board-page.mgr-mode .bhead > .brow:first-child .live { margin-left: auto; }
body.board-page.mgr-mode .bhead > .brow:nth-child(2),
body.board-page.mgr-mode #mgrRow { display: contents; }
body.board-page.mgr-mode .bhead .lockbtn { margin-left: auto; min-width: 0; }
body.board-page.mgr-mode .bhead #unlockBtn { margin-left: auto; }
body.board-page.mgr-mode #mgrRow .out-panel-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }

/* =====================================================================
   Ring = a small icon button (🔔) everywhere in the manager view. The words stay in the DOM
   (screen readers + tests) but are not painted; ringing shows the shaking bell + glow.
   ===================================================================== */
body.board-page.mgr-mode .ring-btn,
body.board-page.mgr-mode .ring-next,
body.board-page.mgr-mode #inList .tact .ring-btn,
body.board-page.mgr-mode .nx-btns > .ring-next {
  flex: 0 0 48px; width: 48px; min-width: 48px; max-width: 48px; min-height: 48px; padding: 0; font-size: 0; line-height: 0;
}
body.board-page.mgr-mode .ring-btn .ring-wrap,
body.board-page.mgr-mode .ring-next .ring-wrap { min-height: 44px; width: 100%; gap: 0; font-size: 0; }
body.board-page.mgr-mode .ring-btn .ring-bell,
body.board-page.mgr-mode .ring-next .ring-bell { font-size: 22px; line-height: 1; }
body.board-page.mgr-mode .bhead .lockbtn,
body.board-page.mgr-mode #mgrRow .lockbtn { flex: 0 0 auto; width: auto; }
body.board-page.mgr-mode #mgrRow .out-panel-btn { padding-right: 20px; }

/* =====================================================================
   Casabella MAIN (live t/u) — Turn line / Bonus line cards + 700–1199px width, copied from
   /workspace/turn-casabella-promote board.css (selectors scoped to Lovely's manager screen).
   Manager Turn line / Bonus line cards are narrow, so the count sits UNDER the name everywhere below
   1500px; names break only at spaces (never mid-word).
   ===================================================================== */
@media (max-width: 1499px) {
  body.board-page.mgr-mode #editPair .bl-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 0;
    align-items: center;
  }
  body.board-page.mgr-mode #editPair .bl-pos { grid-row: span 2; }
  body.board-page.mgr-mode #editPair .bl-nm {
    font-size: 19px; line-height: 1.15; min-width: 0;
    white-space: normal; overflow-wrap: break-word; word-break: normal;
  }
  body.board-page.mgr-mode #editPair .bl-ct { grid-column: 2; font-size: 14px; }
  body.board-page.mgr-mode #editPair .tl-chip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 0;
    align-items: center;
  }
  body.board-page.mgr-mode #editPair .tl-pos { grid-row: span 2; }
  body.board-page.mgr-mode #editPair .tl-nm {
    font-size: 19px; line-height: 1.15; min-width: 0;
    white-space: normal; overflow-wrap: break-word; word-break: normal;
  }
  body.board-page.mgr-mode #editPair .tl-ct { grid-column: 2; font-size: 14px; }
}
@media (min-width: 700px) and (max-width: 1199px) {
  body.board-page.mgr-mode .bhead,
  body.board-page.mgr-mode .stick,
  body.board-page.mgr-mode .bmain {
    max-width: none; margin-left: auto; margin-right: auto;
  }
  body.board-page.mgr-mode .bhead,
  body.board-page.mgr-mode .stick,
  body.board-page.mgr-mode .bmain { padding-left: 14px; padding-right: 14px; }
  body.board-page.mgr-mode .bmain { column-gap: 12px; }
}
