/* Wall-tablet UI. Each salon sets the variables in its own tablet.html. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent; user-select: none; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { opacity: .35; cursor: not-allowed; }
#tablet { height: 100%; }

/* ---------- lock + pin ---------- */
.tb-lock {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; padding: 2rem; text-align: center; background: var(--lock-bg, var(--bg));
}
.tb-brand { display: flex; flex-direction: column; gap: .2rem; }
.tb-brand b { font-family: var(--font-display); font-size: 2rem; letter-spacing: var(--display-track, 0); }
.tb-brand span, .tb-clock span { color: var(--muted); }
.tb-clock b { display: block; font-family: var(--font-display); font-size: clamp(4rem, 12vw, 8rem); line-height: 1; font-variant-numeric: tabular-nums; }
.tb-lock h2 { margin: .5rem 0 0; font-weight: 500; font-size: 1.3rem; color: var(--muted); }
.tb-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 190px)); gap: 1rem; justify-content: center; width: 100%; max-width: 900px; }
.tb-person {
  display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.4rem 1rem;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line);
  transition: transform .15s ease, border-color .15s;
}
.tb-person:active { transform: scale(.96); border-color: var(--c); }
.tb-person small { color: var(--muted); font-size: .8rem; }
.tb-avatar {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--c, var(--accent)); color: var(--avatar-ink, #fff); font-family: var(--font-display); font-size: 1.7rem;
}
.tb-who .tb-avatar { width: 46px; height: 46px; font-size: 1.2rem; }
.tb-tools button { color: var(--muted); padding: .6rem 1rem; border-radius: 99px; border: 1px solid var(--line); }
.tb-note { margin: 0; color: var(--muted); min-height: 1.4em; }
.tb-note--err { color: var(--danger); }
.tb-dots { display: flex; gap: 1rem; }
.tb-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); transition: background .15s; }
.tb-dots i.on { background: var(--ink); }
.tb-dots.is-error { animation: tb-shake .4s; }
@keyframes tb-shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.tb-pad { display: grid; grid-template-columns: repeat(3, 88px); gap: 14px; }
.tb-pad button {
  height: 88px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  font-size: 2rem; font-family: var(--font-display); transition: background .1s;
}
.tb-pad button:active { background: var(--accent); color: var(--accent-ink); }

/* ---------- board ---------- */
.tb-board { height: 100%; display: flex; flex-direction: column; }
.tb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.tb-who { display: flex; align-items: center; gap: .7rem; }
.tb-who div { display: flex; flex-direction: column; }
.tb-who small { color: var(--muted); }
.tb-datenav { display: flex; align-items: center; gap: .3rem; }
.tb-datenav > button { min-width: 56px; height: 56px; border-radius: var(--radius); border: 1px solid var(--line); font-size: 1.6rem; }
.tb-datelabel { display: flex; flex-direction: column; align-items: center; padding: 0 1.2rem; font-size: 1.05rem !important; font-weight: 600; }
.tb-datelabel small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.tb-actions { display: flex; gap: .6rem; }
.tb-primary, .tb-ghost, .tb-danger { min-height: 56px; padding: 0 1.4rem; border-radius: var(--radius); font-weight: 600; font-size: 1.05rem; }
.tb-primary { background: var(--accent); color: var(--accent-ink); }
.tb-ghost { border: 1px solid var(--line); }
.tb-danger { color: var(--danger); border: 1px solid var(--danger); }
.tb-danger.is-confirm { background: var(--danger); color: #fff; }

.tb-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.tb-closed { padding: 4rem; text-align: center; color: var(--muted); font-size: 1.3rem; }
.tb-grid {
  --head: 54px; position: relative; display: grid;
  grid-template-columns: 64px repeat(var(--cols), minmax(170px, 1fr)); min-width: max-content;
}
.tb-times { padding-top: var(--head); }
.tb-times span { display: block; height: var(--slot); font-size: .75rem; color: var(--muted); text-align: right; padding-right: .5rem; transform: translateY(-.5em); }
.tb-col { border-left: 1px solid var(--line); }
.tb-col-head {
  position: sticky; top: 0; z-index: 2; height: var(--head); display: flex; flex-direction: column; justify-content: center;
  padding: 0 .8rem; background: var(--bg); border-bottom: 1px solid var(--line); font-weight: 600;
}
.tb-col-head small { color: var(--muted); font-weight: 400; }
.tb-col-body {
  position: relative; height: calc(var(--rows) * var(--slot));
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--slot) * 4 - 1px), var(--line) calc(var(--slot) * 4 - 1px) calc(var(--slot) * 4));
}
.tb-block {
  position: absolute; left: 4px; right: 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 4px 8px; overflow: hidden; text-align: left; border-radius: calc(var(--radius) * .6);
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-left: 4px solid var(--c); font-size: .8rem; line-height: 1.2;
}
.tb-block b { font-size: .85rem; }
.tb-block span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tb-block.is-mine { box-shadow: 0 0 0 2px var(--c) inset; }
.tb-block.is-done { opacity: .55; }
.tb-block.is-noshow { opacity: .45; text-decoration: line-through; }
.tb-tag { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: .65rem; padding: 1px 6px; border-radius: 99px; background: var(--c); color: #fff; }
.tb-now { position: absolute; left: 64px; right: 0; height: 2px; background: var(--danger); z-index: 1; pointer-events: none; }
.tb-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* ---------- sheets ---------- */
.tb-sheet-wrap { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0); transition: background .25s; }
.tb-sheet-wrap.is-open { background: rgba(0, 0, 0, .45); }
.tb-sheet {
  width: min(860px, 100%); max-height: 92vh; overflow: auto; padding: 1.6rem 1.8rem 2rem; background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.tb-sheet-wrap.is-open .tb-sheet { transform: none; }
.tb-sheet h3 { margin: 0 0 1rem; font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; }
.tb-dl { display: grid; grid-template-columns: 140px 1fr; gap: .5rem 1rem; margin: 0 0 1.4rem; font-size: 1.05rem; }
.tb-dl dt { color: var(--muted); }
.tb-dl dd { margin: 0; }
.tb-dl a { color: var(--accent-strong, var(--accent)); font-weight: 600; }
.tb-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.tb-row--inputs > label { flex: 1 1 240px; }
.tb-close { margin-top: 1rem; width: 100%; min-height: 52px; color: var(--muted); }
.tb-form { display: flex; flex-direction: column; gap: 1.1rem; }
.tb-form label { display: flex; flex-direction: column; gap: .45rem; font-weight: 600; font-size: .9rem; color: var(--muted); user-select: text; }
.tb-form input {
  min-height: 56px; padding: 0 1rem; font: inherit; font-size: 1.15rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: calc(var(--radius) * .7); user-select: text;
}
.tb-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tb-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.tb-chips--time { max-height: 220px; overflow: auto; }
.tb-chip {
  min-height: 50px; padding: 0 1rem; border-radius: 99px; border: 1px solid var(--line); background: var(--bg);
  font-weight: 500; color: var(--ink); font-size: 1rem;
}
.tb-chip small { color: var(--muted); font-weight: 400; }
.tb-chip.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tb-chip.is-on small { color: inherit; opacity: .8; }

.tb-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 20; padding: 1rem 1.6rem;
  background: var(--ink); color: var(--bg); border-radius: 99px; font-weight: 600; animation: tb-toast 4.2s forwards;
}
@keyframes tb-toast { 0% { opacity: 0; transform: translate(-50%, 20px); } 8%, 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

@media (max-width: 760px) {
  .tb-bar { flex-wrap: wrap; }
  .tb-pad { grid-template-columns: repeat(3, 72px); } .tb-pad button { height: 72px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
