:root {
  color-scheme: dark;
  --bg: #101827;
  --panel: #1c2a40;
  --raised: #263953;
  --line: #405573;
  --ink: #fff6e9;
  --muted: #becbdb;
  --accent: #edbe83;
  --accent-ink: #191727;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--ink);
  background: #0b111c;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: var(--accent); }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h2 { font-size: 1.2rem; line-height: 1.2; letter-spacing: -.02em; }
ul { padding: 0; list-style: none; margin: 0; }

.app {
  display: grid;
  grid-template:
    "status" auto
    "header" auto
    "main" minmax(0, 1fr)
    "composer" auto
    "dock" auto
    "home" auto / minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  background: var(--bg);
}
.device-status, .device-home { display: none; }
.app-header {
  grid-area: header;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: max(14px, env(safe-area-inset-top)) 18px 10px;
}
.app-header.has-back {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  text-align: center;
}
.app-header h1 { font-size: 2rem; line-height: 1.08; letter-spacing: -.04em; }
.app-header.has-back h1 { font-size: 1.125rem; line-height: 1.15; letter-spacing: -.014em; }
#page-title:focus { outline: none; }
.app-header p { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.brand-link, .back-button {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.back-button svg { width: 20px; }
.brand-link { justify-self: end; }
#app-main {
  grid-area: main;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px 18px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.stack { display: grid; gap: 16px; }
.tight { display: grid; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.bold { font-weight: 720; }
.money { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.action, .round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--raised);
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.action:hover, .round:hover { border-color: var(--accent); text-decoration: none; }
.action.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.round { min-width: 44px; padding: 6px; border-radius: 50%; }
.notice { padding: 13px 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--muted); }
.surface { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.section-title { margin: 0 0 9px; }
.rows { border: 1px solid var(--line); border-radius: 17px; background: var(--panel); overflow: clip; }
.rows:empty { display: none; }
.rows li + li { border-top: 1px solid var(--line); }
.row, .row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 13px;
  min-height: 58px;
  width: 100%;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.row-link { text-align: start; text-decoration: none; border: none; background: transparent; }
.row-link:hover { background: var(--raised); text-decoration: none; }
.row-link:focus-visible { outline-offset: -3px; }
.row .action { flex-shrink: 0; }
.row-heading { flex: 1; min-width: 0; }
.row small, .row-link small { display: block; color: var(--muted); margin-top: 3px; }
.chevron { color: var(--muted); font-size: 1.35rem; padding-inline: 5px; }
.map-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
input, select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 11px;
}
input::placeholder { color: var(--muted); }
.map-layout { display: grid; gap: 16px; }
.map-card { position: relative; }
#apple-map { height: 275px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
#map-status { position: absolute; inset: 14px 14px auto; padding: 10px; border-radius: 10px; background: var(--bg); pointer-events: none; }
#map-status:empty { display: none; }
.chat-compose {
  grid-area: composer;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}
.chat-compose label { flex: 1; min-width: 0; }
.thread { display: grid; gap: 12px; }
.thread:empty { display: none; }
.bubble { padding: 12px 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); max-width: 92%; overflow-wrap: anywhere; }
.bubble-you { justify-self: end; border-bottom-right-radius: 5px; background: var(--raised); }
.bubble-gusto { border-bottom-left-radius: 5px; }
.bubble p + p { margin-top: 8px; }
.bubble a { display: inline-block; margin-top: 8px; }
.bubble .action { margin-top: 10px; }
.quantities { display: flex; gap: 6px; align-items: center; }
.receipt-total { font-size: 1.45rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.dock {
  grid-area: dock;
  width: 100%;
  margin: 0 auto;
  padding: 0 12px max(9px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  gap: 8px;
  align-items: end;
}
.glass-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid #8190a682;
  border-radius: 30px;
  background: linear-gradient(160deg, #788ba160, #253349bd 50%, #43546e7c);
  box-shadow: inset 0 1px #edf5ff50, inset 0 -1px #a9c5e93b;
  backdrop-filter: blur(17px) saturate(135%);
}
.side-tab, .gusto-button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 44px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 25px;
  padding: 2px;
  font-size: .75rem;
  font-weight: 650;
  color: var(--muted);
}
.side-tab svg { width: 19px; height: 19px; }
.side-tab[aria-current="page"] {
  border-color: #efc695b0;
  background: linear-gradient(150deg, #c99d6cb8, #735437d9);
  color: #fff3dd;
}
.gusto-button { font-size: .825rem; margin-top: 2px; }
.gusto-plate {
  display: grid;
  place-items: center;
  width: 69px;
  height: 69px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid #a48f7d;
  background: #594338;
  box-shadow: 0 4px 12px #0006;
}
.gusto-plate canvas { width: 100%; height: auto; mask-image: linear-gradient(#000 77%, #0008 91%, transparent); }
.gusto-button[aria-current="page"] { color: #ffdaaa; }
.gusto-button[aria-current="page"] .gusto-plate { border-color: #ffe0af; box-shadow: 0 0 0 3px #f3c58a38; }

@media (max-width: 365px) {
  .app-header { padding-inline: 12px; }
  #app-main, .chat-compose { padding-inline: 12px; }
  .dock { grid-template-columns: 1fr 64px 1fr; gap: 4px; padding-inline: 6px; }
  .gusto-plate { width: 57px; height: 57px; }
}
.check { width: auto; min-height: 0; accent-color: var(--accent); }
.select-label { position: relative; }
.select-label select { appearance: none; padding-right: 28px; }
.select-label::after {
  content: '';
  position: absolute;
  top: 17px;
  right: 12px;
  width: 7px;
  height: 7px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.restaurant-pin {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  touch-action: manipulation;
}
.restaurant-pin::before {
  content: '';
  display: block;
  width: 25px;
  height: 25px;
  border: 2px solid #fff4e3;
  border-radius: 50% 50% 50% 4px;
  background: #ad3929;
  box-shadow: -2px 3px 6px #0008;
  transform: translateY(-4px) rotate(-45deg);
}
.restaurant-pin::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff4e3;
  transform: translateY(-4px);
}
.apple-map-frame { width: 100%; height: 100%; display: block; border: 0; }
.map-frame-body { background: var(--panel); }
#map-frame-canvas { width: 100%; height: 100dvh; }
.map-filters label:first-child { grid-column: 1 / -1; }
.rating { color: var(--accent); display: inline-flex; gap: .12em; align-items: center; }

/* The desktop frame fits the viewport. The screen inside always lays out at 402 × 874. */
@media (min-width: 520px) {
  .device-stage {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    background: radial-gradient(ellipse at 50% 24%, #1c2a40, #0b111c 64%);
  }
  .device-frame {
    position: relative;
    width: min(402px, calc(100vw - 40px), calc((100dvh - 40px) * 402 / 874));
    aspect-ratio: 402 / 874;
    overflow: clip;
    border-radius: 13.43% / 6.18%;
    box-shadow: 0 0 0 1px #586579, 0 0 0 6px #232b38, 0 0 0 7px #475266, 0 24px 56px #0008;
  }
  .app {
    position: absolute;
    inset: 0 auto auto 0;
    width: 402px;
    height: 874px;
    transform: scale(var(--device-scale, 1));
    transform-origin: 0 0;
  }
  .device-status {
    grid-area: status;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 59px;
    padding: 0 29px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 650;
  }
  .device-island {
    position: absolute;
    top: 11px;
    left: 50%;
    width: 126px;
    height: 37px;
    transform: translateX(-50%);
    border-radius: 99px;
    background: #070a0f;
  }
  .device-indicators { display: flex; align-items: center; gap: 5px; }
  .device-signal {
    width: 14px;
    height: 10px;
    background: currentColor;
    clip-path: polygon(0 76%, 23% 76%, 23% 51%, 49% 51%, 49% 27%, 74% 27%, 74% 0, 100% 0, 100% 100%, 0 100%);
  }
  .device-wifi {
    position: relative;
    width: 13px;
    height: 10px;
    border-top: 1.5px solid currentColor;
    border-radius: 50%;
  }
  .device-wifi::before, .device-wifi::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    content: "";
  }
  .device-wifi::before { top: 2px; width: 8px; height: 5px; border-top: 1.5px solid currentColor; border-radius: 50%; }
  .device-wifi::after { top: 5px; width: 2.5px; height: 2.5px; border-radius: 50%; background: currentColor; }
  .device-battery {
    position: relative;
    width: 19px;
    height: 9px;
    margin-right: 2px;
    border: 1px solid currentColor;
    border-radius: 2.5px;
    box-shadow: inset 0 0 0 1px var(--bg);
    background: currentColor;
  }
  .device-battery::after { position: absolute; top: 2px; right: -3px; width: 1px; height: 3px; content: ""; background: currentColor; }
  .device-home { grid-area: home; display: grid; place-items: end center; height: 25px; padding-bottom: 8px; }
  .device-home span { width: 134px; height: 5px; border-radius: 99px; background: #b6bdc9; }
  .app-header { padding-top: 3px; }
  .dock { padding-bottom: 1px; }
}
