/* สั่งอาหาร — night kitchen: deep navy surfaces, one amber accent, soft corners. */

:root {
  color-scheme: dark;

  --bg: #0d1017;
  --surface: #141823; /* panels */
  --card: #1b2030; /* controls and cards on a panel */
  --card-2: #242b3e; /* hover */
  --line: #2a3144; /* panel edges, separators */
  --line-2: #3d465e; /* stronger edges */
  --field-line: #5a6480; /* input borders, 3:1 on --surface */

  --text: #eef1f6;
  --text-2: #b3bacb; /* secondary, 9:1 on --surface */
  --text-3: #8f98ad; /* placeholders, 5.5:1 on --card */

  --accent: #f6a821;
  --accent-hover: #ffbd4a;
  --accent-ink: #1b1203; /* text on amber */
  --accent-wash: rgb(246 168 33 / 0.13);
  --accent-line: rgb(246 168 33 / 0.6);

  --danger: #ff8a8a; /* not-yet-ordered, 7:1 on --surface */
  --danger-wash: rgb(255 122 122 / 0.08);
  --danger-line: rgb(255 122 122 / 0.55);
  --ok: #57d39b;

  --font: 'Prompt', 'Leelawadee UI', 'Thonburi', 'Noto Sans Thai', system-ui, sans-serif;
  --emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --gutter: 16px;
  --tabbar: 60px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scrollbar-color: var(--line-2) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6; /* Thai stacks marks above and below the line */
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 30;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.icon {
  display: block;
  flex: none;
}

.emoji {
  font-family: var(--emoji);
  font-variant-emoji: emoji;
  line-height: 1;
}

/* --- top bar ------------------------------------------------------------ */

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 12px var(--gutter) 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

/* Tabs: a thumb-reach bar on phones, a row in the top bar on wide screens. */
.tabs {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px -14px rgb(0 0 0 / 0.7);
}

.tabs__tab {
  display: grid;
  place-items: center;
  min-height: var(--tabbar);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9375rem;
  box-shadow: inset 0 0 0 var(--accent);
  transition: box-shadow 200ms var(--ease-out), color 200ms, background-color 200ms;
}

.tabs__tab[aria-current='page'] {
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 2px 0 var(--accent);
}

.tabs__tab:focus-visible {
  outline-offset: -4px;
}

.topbar__date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
}

.topbar__date:empty {
  display: none;
}

.datebar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: -8px;
}

.datebar__center {
  position: relative;
}

.datebar__date {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 150ms;
}

.datebar__date:hover {
  background: var(--card);
}

#date-day {
  color: var(--accent);
  font-weight: 600;
}

/* Present for showPicker(), but never seen or tabbed to. */
.datebar__input {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.datebar__status {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  font-size: 0.875rem;
  color: var(--text-2);
}

.offline {
  margin: 12px var(--gutter) 0;
  padding: 12px 16px;
  background: var(--danger-wash);
  border: 1px solid var(--danger-line);
  border-radius: var(--r);
  color: var(--danger);
  font-weight: 500;
}

/* --- shared controls ---------------------------------------------------- */

.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background-color 150ms, color 150ms;
}

.icon-button:hover {
  background: var(--card-2);
  color: var(--text);
}

.link-button {
  min-height: 44px;
  padding: 0 8px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.link-button:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 8px;
  white-space: nowrap;
  min-height: 52px;
  padding: 0 22px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  color: var(--accent-ink);
  font-weight: 600;
  transition: background-color 150ms, border-color 150ms, color 150ms,
    transform 150ms var(--ease-out);
}

.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.5;
  cursor: progress;
}

.button--block {
  width: 100%;
}

.button--small {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.button--outline {
  background: var(--card);
  border-color: var(--line-2);
  color: var(--text);
}

.button--outline:hover {
  background: var(--card-2);
  border-color: var(--accent-line);
  color: var(--accent);
}

.button--quiet {
  background: none;
  border-color: transparent;
  color: var(--text-2);
}

.button--quiet:hover {
  background: var(--card-2);
  border-color: transparent;
  color: var(--text);
}

.panel {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  container-type: inline-size;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 14px;
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.panel__title .icon {
  color: var(--accent);
}

.panel__hint {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-2);
}

.panel__meta {
  flex: none;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.badge {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--accent-wash);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
}

.field__optional {
  font-weight: 400;
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--field-line);
  border-radius: 10px;
  font-size: 1rem; /* 16px stops iOS zooming on focus */
  transition: border-color 150ms, box-shadow 150ms;
}

.field__input--area {
  display: block;
  min-height: 84px;
  padding: 10px 14px;
  line-height: 1.6;
  resize: vertical;
}

.field__input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.field__input:hover {
  border-color: var(--text-3);
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.field__input[aria-invalid='true'] {
  border-color: var(--danger);
}

.field__message {
  font-size: 0.8125rem;
  color: var(--text-2);
}

.field__message:empty {
  display: none;
}

.field__message--error {
  color: var(--danger);
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* A person. Red outline while they still owe an order, amber once picked. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 0 14px;
  background: var(--danger-wash);
  border: 1px solid var(--danger-line);
  border-radius: 999px;
  color: var(--danger);
  font-size: 0.9375rem;
  line-height: 1.3;
  text-align: left;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}

.chip::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.chip:hover {
  background: rgb(255 122 122 / 0.16);
  border-color: var(--danger);
}

.chip--done {
  background: var(--card);
  border-color: var(--line-2);
  color: var(--text-2);
}

.chip--done::before {
  background: var(--ok);
  border-color: var(--ok);
}

.chip--done:hover {
  background: var(--card-2);
  border-color: var(--text-3);
}

.chip[aria-pressed='true'],
.chip[aria-pressed='true']:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}

.chip[aria-pressed='true']::before {
  background: currentColor;
  border-color: currentColor;
}

.chip[aria-pressed='true']:focus-visible {
  outline-color: var(--text);
}

.empty {
  padding: 12px 0;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.row-actions {
  display: flex;
}

.confirm {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
}

.confirm__question {
  font-weight: 500;
}

.confirm__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* --- main and view headers ---------------------------------------------- */

main {
  padding: var(--gutter) var(--gutter)
    calc(var(--tabbar) + 72px + env(safe-area-inset-bottom));
}

main:focus {
  outline: none;
}

.view--narrow {
  max-width: 1080px;
  margin: 0 auto;
}

.view__head {
  display: grid;
  gap: 4px;
  margin: 8px 0 20px;
}

.view__title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

.view__lede,
.summary__total {
  max-width: 60ch;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.summary__total:empty {
  display: none;
}

/* --- order view --------------------------------------------------------- */

.order-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.order-view__controls {
  display: grid;
  gap: 12px;
}

.shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Shift: the top-level choice, one track with a solid amber thumb. */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.segmented__option {
  min-height: 44px;
  padding: 0 12px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
  transition: background-color 200ms, color 200ms;
}

.segmented__option:hover {
  background: var(--card-2);
  color: var(--text);
}

.segmented__option[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.segmented__option[aria-pressed='true']:focus-visible {
  outline-offset: 3px;
}

/* Meal: two outlined buttons; the chosen one takes the amber edge. */
.mealswitch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mealswitch__option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text-2);
  font-weight: 500;
  transition: background-color 200ms, color 200ms, border-color 200ms;
}

.mealswitch__option .icon {
  color: var(--text-3);
  transition: color 200ms;
}

.mealswitch__option:hover {
  background: var(--card-2);
  color: var(--text);
}

.mealswitch__option[aria-pressed='true'] {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.mealswitch__option[aria-pressed='true'] .icon {
  color: var(--accent);
}

/* On a phone a long staff list must not bury the menu: show about four and a
   half rows, so the cut-off row says there is more to scroll. */
@media (max-width: 759px) {
  .roster .chips {
    max-height: 242px;
    padding: 2px;
    margin: -2px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.roster__done {
  margin-top: 6px;
}

.roster__done .chips {
  margin-top: 4px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.menu-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 96px;
  padding: 14px 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms,
    transform 150ms var(--ease-out);
}

.menu-card__icon {
  font-size: 1.875rem;
}

.menu-card:hover {
  background: var(--card-2);
  border-color: var(--line-2);
}

.menu-card:active {
  transform: scale(0.98);
}

.menu-card[aria-pressed='true'] {
  background: var(--accent-wash);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* The ingredient picked for this menu, shown under its name. */
.menu-card__pick {
  margin-top: -4px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--accent);
}

.menu-card__pick:empty {
  display: none;
}

.menus .panel__title .emoji {
  font-size: 1.25rem;
}

/* On a phone, three cards across keeps a dozen dishes within about one screen. */
@media (max-width: 759px) {
  .menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .menu-card {
    min-height: 88px;
    padding: 12px 4px 10px;
    gap: 6px;
    font-size: 0.8125rem;
  }

  .menu-card__icon {
    font-size: 1.625rem;
  }
}

.order-form {
  display: grid;
  gap: 16px;
}

.order-form .panel__head {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.mode {
  display: flex;
  gap: 6px;
}

.mode__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}

.mode__option .icon {
  width: 16px;
  height: 16px;
}

.mode__option:hover {
  color: var(--text);
  border-color: var(--line-2);
}

.mode__option[aria-pressed='true'] {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.chosen {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 4px 4px 14px;
  background: var(--card);
  border: 1px solid var(--field-line);
  border-radius: 10px;
}

.chosen--empty {
  border-style: dashed;
  color: var(--text-3);
}

.chosen[data-invalid='true'] {
  border-color: var(--danger);
}

.chosen__icon {
  font-size: 1.375rem;
}

.chosen__name {
  flex: 1;
  font-weight: 500;
}

.mealtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 -16px;
  border-bottom: 1px solid var(--line);
}

.mealtab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 8px;
  background: none;
  border: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  box-shadow: inset 0 0 0 var(--accent);
  transition: color 200ms, box-shadow 200ms var(--ease-out);
}

.mealtab:hover {
  color: var(--text);
}

.mealtab[aria-pressed='true'] {
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.mealtab:focus-visible {
  outline-offset: -3px;
}

.mealtab__count {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-2);
}

.mealtab__count:empty {
  display: none;
}

.order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order:last-child {
  border-bottom: 0;
}

.order__person {
  grid-column: 1;
  font-weight: 600;
}

.order__dish {
  grid-column: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9375rem;
}

.order__icon {
  flex: none;
  font-size: 1.0625rem;
}

.order__note {
  grid-column: 1;
  font-size: 0.875rem;
  color: var(--accent);
}

.order > .row-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}

.order--editing,
.name--editing {
  display: block;
}

.order-edit,
.name-edit {
  display: grid;
  gap: 10px;
  padding: 6px 0 8px;
}

.order-edit__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* The one authored moment: a new order lights up amber, then settles in. */
.order.is-new {
  animation: arrive 1100ms var(--ease-out);
}

@keyframes arrive {
  from {
    clip-path: inset(0 100% 0 0);
    background: var(--accent-wash);
    box-shadow: inset 2px 0 0 var(--accent), 0 0 0 8px var(--accent-wash);
  }
  40% {
    clip-path: inset(0 -8px 0 -8px);
    background: var(--accent-wash);
    box-shadow: inset 0 0 0 var(--accent), 0 0 0 8px var(--accent-wash);
  }
  to {
    clip-path: inset(0 -8px 0 -8px);
    background: transparent;
    box-shadow: inset 0 0 0 var(--accent), 0 0 0 8px transparent;
  }
}

/* --- summary view ------------------------------------------------------- */

.summary__shifts {
  display: grid;
  gap: 32px;
}

.summary-shift__title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
}

.summary-shift__slots {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.slot__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 44px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.slot__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.slot__title .icon {
  color: var(--accent);
}

.slot__total {
  margin-right: auto;
  font-size: 0.875rem;
  color: var(--text-2);
}

.tally {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.tally__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.tally__icon {
  flex: none;
  font-size: 1.25rem;
}

.tally__menu {
  font-size: 1.0625rem;
  font-weight: 500;
}

/* Dotted leader, as on a printed menu. */
.tally__leader {
  flex: 1;
  min-width: 24px;
  border-bottom: 1px dotted var(--line-2);
  transform: translateY(-5px);
}

.tally__count {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.tally__variants {
  display: grid;
  gap: 2px;
  margin-top: 2px;
  padding: 0 2.5rem 0 calc(1.25rem + 10px);
  font-size: 0.875rem;
  color: var(--text-2);
}

.tally__note {
  margin-right: 10px;
  font-weight: 500;
  color: var(--text);
}

/* --- manage view -------------------------------------------------------- */

.manage {
  display: grid;
  gap: 14px;
}

.add-form {
  display: grid;
  gap: 6px;
}

.add-form__row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.add-form__row .button {
  min-height: 48px;
}

.names {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.name {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  min-height: 56px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.name:last-child {
  border-bottom: 0;
}

.name__text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.name__icon {
  flex: none;
  font-size: 1.375rem;
}

.name__meta {
  flex: none;
  font-size: 0.8125rem;
  color: var(--text-2);
}

/* Sends a person to the other shift. Text, not just an arrow: the
   destination is the whole point of the button. */
.move-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-right: 4px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}

.move-button .icon {
  width: 16px;
  height: 16px;
}

.move-button:hover {
  background: var(--accent-wash);
  border-color: var(--accent-line);
  color: var(--accent);
}

.icon-picker {
  display: grid;
  gap: 6px;
}

.icon-picker__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.icon-choice {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms;
}

.icon-choice .emoji {
  font-size: 1.375rem;
}

.icon-choice:hover {
  background: var(--card-2);
  border-color: var(--line-2);
}

.icon-choice[aria-pressed='true'] {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- toast -------------------------------------------------------------- */

.toast {
  position: fixed;
  z-index: 25;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom));
  max-width: 440px;
  margin: 0 auto;
  padding: 14px 18px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  font-size: 0.9375rem;
  box-shadow: 0 14px 32px -10px rgb(0 0 0 / 0.75);
}

.noscript {
  padding: 24px var(--gutter);
  font-weight: 600;
}

/* --- pointer devices: tighter chips, as people are picked with a mouse ---- */

@media (hover: hover) and (pointer: fine) {
  .chip {
    min-height: 36px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .button--small {
    min-height: 40px;
  }
}

/* --- wide screens ------------------------------------------------------- */

@media (min-width: 760px) {
  :root {
    --gutter: 20px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .topbar__date {
    order: 2;
    justify-content: center;
  }

  .datebar {
    margin-left: 0;
  }

  .tabs {
    order: 3;
    position: static;
    display: flex;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .tabs__tab {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    box-shadow: none;
  }

  .tabs__tab:hover {
    background: var(--card);
    color: var(--text);
  }

  .tabs__tab[aria-current='page'] {
    background: var(--accent-wash);
    box-shadow: none;
  }

  .tabs__tab:focus-visible {
    outline-offset: 2px;
  }

  main {
    padding-bottom: 96px;
  }

  .toast {
    bottom: 28px;
  }

  .order-view {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .order-view__controls {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }

  .summary-shift__slots,
  .manage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  /* The two shift lists side by side, menus across the full width below. */
  .name-list--menus {
    grid-column: 1 / -1;
  }
}

/* Three working columns: who and what on the left, the menu in the middle,
   what has been ordered on the right. */
@media (min-width: 1100px) {
  .order-view {
    grid-template-columns: 340px minmax(0, 1fr) 320px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      'controls menus placed'
      'roster   menus placed'
      'form     menus placed';
  }

  .order-view__controls {
    grid-area: controls;
    grid-template-columns: minmax(0, 1fr);
  }

  .roster {
    grid-area: roster;
  }

  .order-form {
    grid-area: form;
  }

  .menus,
  .placed {
    position: sticky;
    top: var(--gutter);
    max-height: calc(100vh - 2 * var(--gutter));
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .menus {
    grid-area: menus;
  }

  .placed {
    grid-area: placed;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }

  .view--narrow:has(.manage) {
    max-width: 1280px;
  }

  .manage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .name-list--menus {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
