/* Shared shop tablet. Every target is finger-sized and reachable with gloves on;
   nothing here is smaller than 64px tall. */

body {
  font-size: 18px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.who {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  min-height: 48px;
  cursor: pointer;
}

.conn { font-size: 0.85rem; color: var(--text-dim); }
.conn.is-down { color: var(--overdue); font-weight: 700; }

.screen { padding: 1rem; flex: 1; }

.screen h2 {
  margin: 0.3rem 0 1rem;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sub { margin: -0.7rem 0 1rem; color: var(--text-dim); }

.back {
  font: inherit;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--st-assigned);
  padding: 0.6rem 0;
  min-height: 48px;
  cursor: pointer;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.8rem;
}

.tile {
  display: grid;
  gap: 0.25rem;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 8px solid var(--status, var(--line));
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 84px;
  cursor: pointer;
  touch-action: manipulation;
}

.tile:active { background: var(--surface-2); transform: scale(0.99); }

.tile-title { font-size: 1.25rem; font-weight: 700; }
.tile-sub { font-size: 0.95rem; color: var(--text-dim); }

.tile-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--status, var(--text-dim));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* The uppercase treatment is for the status word only — it turns "53m" into
   a misleading "53M". */
.tile-time {
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.tile.is-overdue { box-shadow: inset 0 0 0 2px var(--overdue); }

.tile-tech {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  border-radius: 50%;
  font-weight: 800;
  color: #08111f;
  background: var(--tech, var(--st-assigned));
}

.tech-tile { display: flex; align-items: center; gap: 0.9rem; }

.status-tile {
  align-content: center;
  justify-items: center;
  text-align: center;
  min-height: 110px;
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--status, var(--text));
  border-left-width: 8px;
}

.empty { color: var(--text-dim); padding: 2rem 0; }

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 1.5rem;
}
dialog::backdrop { background: rgba(4, 7, 12, 0.85); }
dialog h2 { margin-top: 0; }
#pin-input {
  font: inherit;
  font-size: 2rem;
  letter-spacing: 0.5em;
  text-align: center;
  width: 100%;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem;
}
.pin-actions { display: flex; gap: 0.8rem; margin-top: 1rem; }
.pin-actions button {
  flex: 1;
  font: inherit;
  font-weight: 700;
  min-height: 56px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.pin-actions .primary { background: var(--st-assigned); border-color: var(--st-assigned); color: #08111f; }
.error { color: var(--overdue); margin: 0.6rem 0 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 6px solid var(--st-in_progress);
  border-radius: 10px;
  padding: 0.9rem 1.4rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.is-error { border-left-color: var(--overdue); }

/* ---- intercom ------------------------------------------------------------ */

/* Room at the bottom so the talk bar never covers the last row of tiles. */
body { padding-bottom: 7.5rem; }

.ic-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  gap: 0.4rem;
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.ptt {
  min-height: 4.5rem;            /* gloved thumb */
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface-2);
  border: 3px solid var(--line);
  border-radius: 16px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* no iOS copy/lookup sheet on a long press */
  touch-action: none;
  cursor: pointer;
}
.ptt.is-held, .ptt.is-connecting { border-color: var(--due-soon); color: var(--due-soon); }
.ptt.is-live { background: var(--overdue); border-color: var(--overdue); color: #1a0505; }

.ic-status { margin: 0; text-align: center; font-size: 0.9rem; color: var(--due-soon); }

.ic-incoming {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--st-in_progress);
  color: #04130a;
}
.ic-incoming.is-page { background: var(--due-soon); color: #1a1204; }
.ic-dot {
  width: 1rem; height: 1rem; border-radius: 50%;
  background: currentColor;
  animation: ic-pulse 0.9s ease-in-out infinite;
}
@keyframes ic-pulse { 50% { opacity: 0.25; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .ic-dot { animation: none; } }
