@font-face { font-family: "DINish"; src: local("Bahnschrift"); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #111719;
  --surface: #182124;
  --surface-2: #202b2e;
  --paper: #f3f0e7;
  --ink: #15191a;
  --text: #f4f1e9;
  --muted: #aeb8b8;
  --line: #344245;
  --lane: #f2c94c;
  --tomato: #e05a47;
  --green: #69b68b;
  --shadow: rgba(0, 0, 0, .25);
  --radius: 18px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf0ed;
  --surface: #ffffff;
  --surface-2: #e3e8e4;
  --paper: #ffffff;
  --ink: #15191a;
  --text: #15191a;
  --muted: #5c6868;
  --line: #c9d1cd;
  --lane: #b98400;
  --tomato: #b73e2f;
  --green: #17734a;
  --shadow: rgba(29, 42, 38, .12);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), color-mix(in srgb, var(--lane) 12%, transparent) 50%, transparent calc(50% + 1px)) fixed,
    var(--bg);
  font-family: "DINish", "Arial Narrow", Arial, sans-serif;
  line-height: 1.45;
  transition: background-color .2s ease, color .2s ease;
}

button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible + .toggle-track, summary:focus-visible {
  outline: 3px solid var(--lane);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  color: var(--ink);
  background: var(--paper);
}
.skip-link:focus-visible {
  width: auto;
  height: auto;
  padding: 10px 14px;
  margin: 0;
  overflow: visible;
  clip-path: none;
}

.topbar, main, footer { width: min(100% - 32px, 760px); margin-inline: auto; }
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px 8px 8px 2px;
  color: #15191a;
  background: var(--lane);
  font-size: 18px;
  font-weight: 900;
}
.quiet-button, .text-button {
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.intro { padding: 58px 0 30px; }
.location-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--muted);
  font: 700 12px/1 "DINish", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
h1 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(58px, 14vw, 108px);
  font-weight: 900;
  line-height: .82;
  letter-spacing: -.07em;
}
h1 em { color: var(--lane); font-style: normal; }
.intro-copy { max-width: 560px; margin: 28px 0 0; color: var(--muted); font-size: clamp(17px, 3.8vw, 21px); }

.controls { display: grid; gap: 18px; margin: 14px 0 28px; }
.mode-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.mode-row::-webkit-scrollbar { display: none; }
.mode-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.mode-button.is-active { color: #15191a; border-color: var(--lane); background: var(--lane); font-weight: 800; }
.open-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  cursor: pointer;
}
.open-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 48px; height: 28px; padding: 3px; border-radius: 99px; background: var(--line); transition: background .2s; }
.toggle-track span { display: block; width: 22px; height: 22px; border-radius: 50%; background: white; transition: transform .2s; }
.open-toggle input:checked + .toggle-track { background: var(--green); }
.open-toggle input:checked + .toggle-track span { transform: translateX(20px); }
.open-toggle strong, .open-toggle small { display: block; }
.open-toggle small { color: var(--muted); }

.recommendation { min-height: 430px; }
.loading-card { min-height: 300px; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.order-ticket {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 6vw, 46px);
  color: var(--ink);
  background: var(--paper);
  border-radius: 10px;
  box-shadow: 0 22px 70px var(--shadow);
  animation: ticket-in .38s cubic-bezier(.2, .8, .2, 1);
}
.order-ticket::before, .order-ticket::after {
  content: "";
  position: absolute;
  top: 82px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
}
.order-ticket::before { left: -12px; }
.order-ticket::after { right: -12px; }
@keyframes ticket-in { from { opacity: 0; transform: translateY(12px) rotate(-.3deg); } }
.ticket-topline { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 24px; border-bottom: 2px dashed #a7aaa4; font: 800 12px/1.2 "DINish", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.service-tag { color: #8b3127; }
.open-status { color: #176541; text-align: right; }
.restaurant-name { margin: 28px 0 8px; color: #626966; font-weight: 750; }
.item-name { margin: 0; max-width: 630px; font-size: clamp(34px, 8vw, 60px); line-height: .98; letter-spacing: -.045em; }
.fit-reason { margin: 18px 0 26px; max-width: 570px; color: #4f5855; font-size: 16px; }
.nutrition { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 0 0 22px; border: 1px solid #c8ccc7; border-radius: 10px; background: #c8ccc7; }
.nutrition div { padding: 16px 12px; background: var(--paper); }
.nutrition strong, .nutrition span { display: block; }
.nutrition strong { font-size: clamp(23px, 6vw, 35px); line-height: 1; }
.nutrition span { margin-top: 6px; color: #69716e; font-size: 12px; }
.order-detail { padding: 18px; border-left: 5px solid var(--tomato); background: #e5e1d7; }
.order-detail span, .order-detail strong, .order-detail small { display: block; }
.order-detail span { color: #69716e; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.order-detail strong { margin-top: 5px; font-size: 18px; }
.order-detail small { margin-top: 4px; color: #69716e; }
.actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; margin-top: 22px; }
.primary-action, .secondary-action { min-height: 54px; display: grid; place-items: center; padding: 0 18px; border-radius: 8px; font-weight: 850; text-decoration: none; cursor: pointer; }
.primary-action { color: white; border: 2px solid var(--tomato); background: var(--tomato); }
.secondary-action { color: var(--ink); border: 2px solid var(--ink); background: transparent; }
.source-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 20px; color: #5d6663; font-size: 13px; }
.source-row a { text-underline-offset: 3px; }

.reroll-wrap { padding: 24px 0 42px; text-align: center; }
.reroll-button { min-height: 48px; padding: 0 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.reroll-wrap p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.history-panel, .trust-note { margin: 0 0 22px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.history-panel summary { cursor: pointer; font-weight: 800; }
.history-panel summary span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 8px; border-radius: 99px; color: #15191a; background: var(--lane); font-size: 12px; }
.history-list { display: grid; gap: 10px; margin: 18px 0; }
.history-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-item strong, .history-item span { display: block; }
.history-item span, .empty-history, .trust-note p { color: var(--muted); }
.trust-note strong { color: var(--lane); }
.trust-note p { margin-bottom: 0; }
footer { display: grid; gap: 6px; padding: 32px 0 54px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  .topbar, main, footer { width: min(100% - 24px, 760px); }
  .topbar { min-height: 66px; }
  .intro { padding-top: 46px; }
  .mode-row { flex-wrap: wrap; overflow: visible; padding-bottom: 2px; }
  .mode-button { flex: 1 1 calc(50% - 8px); }
  .recommendation { min-height: 380px; }
  .order-ticket { padding: 24px 20px 22px; }
  .order-ticket::before, .order-ticket::after { top: 74px; }
  .ticket-topline { padding-bottom: 20px; }
  .nutrition strong { font-size: 24px; }
  .nutrition div { padding: 14px 8px; }
  .actions { grid-template-columns: 1fr; }
  .source-row { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
