/* Today (A2): the admin panel's home. Big, plain, inked like the menu page.
   Every class starts with td- so nothing here touches Manager's screens. */

.td {
  --td-lip: #1f5355;
  --td-ink: 2px solid var(--ink);
  --td-tap: 56px;
  --td-side-l: max(16px, env(safe-area-inset-left, 0px));
  --td-side-r: max(16px, env(safe-area-inset-right, 0px));
  width: min(100%, 560px);
  margin-inline: auto;
  padding-block: 18px 140px;
  padding-left: var(--td-side-l);
  padding-right: var(--td-side-r);
  font-size: 1.125rem;
  outline: none;
}

/* ── The sign header ── */

.td-top {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.td-top .sign-wrap {
  width: min(100%, 250px);
}

.td-top .sign__row--title {
  --row-max: 2.4rem;
}

.td-top__date {
  color: var(--ink-2);
  font-size: 1.05rem;
  font-weight: 600;
}

.td-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 2px solid var(--brand-teal);
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-teal);
  font-size: 1rem;
  font-weight: 800;
}

.td-chip::before {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.td-chip--busy::before {
  animation: td-blink 1s ease-in-out infinite;
}

.td-chip--bad {
  border-color: var(--ink);
  background: #fde7c9;
  color: var(--ink);
}

@keyframes td-blink {
  50% {
    opacity: 0.25;
  }
}

/* ── Buttons: a lip under each, like the sign's cabinet ── */

.td-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--td-tap, 56px);
  padding: 10px 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.td-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.td-btn:focus-visible,
.td-tile:focus-visible,
.td-pick:focus-visible,
.td-choice:focus-visible,
.td-case:focus-visible,
.td-input:focus-visible {
  outline: 3px solid var(--brand-rule);
  outline-offset: 3px;
}

.td-btn--teal {
  background: var(--brand-teal);
  color: #fff;
}

.td-btn--wide {
  width: 100%;
}

.td-btn--small {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 1rem;
}

.td-btn--dashed,
.td-btn--quiet {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

.td-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}

.td-link {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Home: four big tiles ── */

.td-home-ask {
  margin-bottom: 14px;
  font-family: var(--font-sign);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-align: center;
}

.td-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.td-tile {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-height: 178px;
  padding: 16px 10px 14px;
  border: var(--td-ink);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 5px 0 var(--ink);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.td-tile:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.td-tile__art {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--brand-tint);
}

.td-tile__art svg {
  width: 74px;
  height: 74px;
}

.td-tile__label {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
}

.td-tile__now {
  color: var(--brand-teal);
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.td-manager {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 28px;
}

.td-manager__hint {
  color: var(--ink-3);
  font-size: 0.95rem;
}

.td-manager .td-link {
  margin-top: 18px;
}

/* ── A tile's screen ── */

.td-bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -18px calc(-1 * var(--td-side-r)) 14px calc(-1 * var(--td-side-l));
  padding-block: 12px;
  padding-left: var(--td-side-l);
  padding-right: var(--td-side-r);
  background: var(--brand-teal);
  box-shadow: 0 4px 0 var(--td-lip);
}

.td-bar .td-btn {
  flex: none;
  min-height: 48px;
  padding: 6px 14px;
  font-size: 1.05rem;
}

.td-bar__title {
  color: #fff;
  font-family: var(--font-sign);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.td-help {
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.td-heading {
  margin: 22px 0 10px;
  font-family: var(--font-sign);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.td-group {
  margin: 16px 0 8px;
  color: var(--brand-teal);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.td-empty {
  padding: 18px;
  border: 2px dashed var(--leader);
  border-radius: 18px;
  color: var(--ink-2);
  font-weight: 600;
  text-align: center;
}

.td-full {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--brand-tint);
  font-weight: 700;
}

.td-failed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: var(--td-ink);
  border-radius: 16px;
  background: #fde7c9;
  font-weight: 700;
}

.td-failed__text {
  flex: 1 1 220px;
}

/* Bulbs: how many rack spots are used. */
.td-spots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 700;
}

.td-spots__dots {
  display: flex;
  gap: 5px;
}

.td-spots__dots i {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
}

.td-spots__dots i.on {
  background: var(--bulb);
  box-shadow: 0 0 5px 1px rgb(255 226 150 / 80%);
}

/* Cards: what's on the rack, what's out. */
.td-cards {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.td-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 4px 12px;
  padding: 12px;
  border: var(--td-ink);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 4px 0 var(--ink);
}

.td-card.is-new {
  animation: td-card-in 380ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes td-card-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
}

.td-card__art {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: var(--brand-tint);
}

.td-card__art svg,
.td-pick__art svg,
.td-case__art svg {
  width: 88%;
  height: 88%;
}

.td-card__name {
  align-self: end;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.td-card__state {
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 600;
}

.td-card__state--out {
  color: var(--ink);
  font-weight: 800;
}

.td-card__actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.td-card__actions--one {
  grid-template-columns: 1fr;
}

/* Picks: a food's drawing and name, to tap. */
.td-picks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.td-pick {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-height: 128px;
  padding: 10px 6px;
  border: var(--td-ink);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.td-pick:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.td-pick[disabled] {
  opacity: 0.4;
  cursor: default;
}

.td-pick__art,
.td-case__art {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--brand-tint);
}

.td-pick__art .ink-sketch,
.td-card__art .ink-sketch,
.td-case__art .ink-sketch {
  width: 80%;
  height: 80%;
  fill: none;
  stroke: var(--leader);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.td-pick__badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #fde7c9;
  font-size: 0.85rem;
  font-weight: 800;
}

/* Who's cooking: big name buttons. */
.td-choices {
  display: grid;
  gap: 12px;
}

.td-choice {
  min-height: 64px;
  padding: 12px 18px;
  border: var(--td-ink);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.td-choice[aria-pressed="true"] {
  background: var(--brand-teal);
  color: #fff;
}

.td-choice[aria-pressed="true"]::after {
  float: right;
  content: "✓ Cooking now";
  font-size: 1rem;
}

.td-choice--new {
  border-style: dashed;
  box-shadow: none;
}

.td-new {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: var(--td-ink);
  border-radius: 16px;
  background: var(--brand-tint);
}

.td-new[hidden],
.td-choice[hidden],
.td-problem[hidden] {
  display: none;
}

.td-label {
  font-weight: 800;
}

.td-input {
  min-height: 56px;
  padding: 10px 14px;
  border: var(--td-ink);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.2rem;
}

.td-problem {
  color: var(--ink);
  font-weight: 800;
}

.td-problem::before {
  content: "! ";
}

/* Donut case: one big button a spot. */
.td-case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.td-case {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-height: 150px;
  padding: 10px 6px;
  border: var(--td-ink);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.td-case__name {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.15;
}

.td-case__state {
  color: var(--brand-teal);
  font-size: 0.9rem;
  font-weight: 800;
}

.td-case.is-out {
  border-style: dashed;
  background: var(--page);
  box-shadow: none;
}

.td-case.is-out .td-case__art {
  opacity: 0.4;
  filter: grayscale(1);
}

.td-case.is-out .td-case__state {
  color: var(--ink);
}

/* ── Saved note with Undo ── */

.td-toast-zone {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: grid;
  justify-items: center;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.td-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 520px);
  padding: 12px 12px 14px 16px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  pointer-events: auto;
  animation: td-toast-in 220ms ease-out;
}

@keyframes td-toast-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.td-toast__text {
  flex: 1;
}

.td-toast--ok .td-toast__text::before {
  margin-right: 6px;
  color: var(--brand-rule);
  content: "✓";
}

.td-toast .td-btn {
  min-height: 48px;
  padding: 6px 16px;
  border-color: #fff;
  background: var(--bulb);
  box-shadow: none;
}

.td-toast__clock {
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--brand-rule);
  transform-origin: left;
  animation: td-toast-clock linear forwards;
}

@keyframes td-toast-clock {
  to {
    transform: scaleX(0);
  }
}

/* ── The sheet: a few big choices over the screen ── */

.td-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 12px max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: rgb(29 31 36 / 45%);
}

.td-sheet {
  width: min(100%, 520px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 18px;
  border: var(--td-ink, 2px solid var(--ink));
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  font-size: 1.125rem;
  animation: td-toast-in 200ms ease-out;
}

.td-sheet__title {
  margin-bottom: 14px;
  font-size: 1.25rem;
  font-weight: 800;
}

.td-sheet__choices {
  display: grid;
  gap: 12px;
}

/* Manager's way back. */
.admin-head__today {
  flex: none;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .td *,
  .td-toast,
  .td-sheet {
    animation: none !important;
    transition: none !important;
  }

  .td-toast__clock {
    display: none;
  }
}
