:root {
  --bg: #141311;
  --surface: #1c1b18;
  --line: #333029;
  --ink: #f2eee6;
  --muted: #9c9588;
  --dim: #6f685e;
  --price: #e8cc62;
  --low: #cfe08a;
  --btn: #f2eee6;
  --btn-ink: #141311;
  --focus: #e8cc62;
  --danger: #e08a5a;
  --radius: 8px;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  max-width: 560px;
  padding: 24px 16px 48px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  line-height: 1.15;
  text-wrap: balance;
}

button,
input,
select,
a {
  font: inherit;
}

.top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.identity h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.identity p {
  color: var(--muted);
  font-size: 14px;
}

.lede {
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.lede strong {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.lede sup {
  font-size: 11px;
  line-height: 1;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

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

.chip {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chip.is-on {
  background: var(--surface);
  border-color: #4a463c;
  color: var(--ink);
}

.chip:hover {
  color: var(--ink);
}

.chip:focus-visible,
.ghost:focus-visible,
.primary:focus-visible,
.retry:focus-visible,
select:focus-visible,
input:focus-visible,
.station:focus-visible,
.map:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.chip:active,
.ghost:active,
.primary:active,
.station:active {
  transform: scale(0.96);
}

.chip,
.ghost,
.primary,
.retry,
.station {
  transition: transform 140ms ease, color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .chip,
  .ghost,
  .primary,
  .station {
    transition: none;
  }

  .chip:active,
  .ghost:active,
  .primary:active,
  .station:active {
    transform: none;
  }
}

.board {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.station {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.station:hover {
  border-color: #4a463c;
}

.station.is-low {
  border-color: #3f4a2c;
}

.price {
  display: flex;
  align-items: flex-start;
  color: var(--price);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.station.is-low .price {
  color: var(--low);
}

.price.is-empty,
.price.is-stale {
  color: var(--dim);
}

.price .num {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.price .tenth {
  margin-left: 1px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.meta .name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.meta .where,
.meta .age {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: pretty;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 400;
}

.state {
  padding: 24px 12px;
  color: var(--muted);
}

.state.is-error {
  color: var(--danger);
}

.retry {
  margin-top: 12px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 500;
  cursor: pointer;
}

.foot {
  margin-top: 32px;
  color: var(--dim);
  font-size: 14px;
}

.foot p {
  text-wrap: pretty;
}

dialog {
  width: min(100% - 32px, 400px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.56);
}

#report {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-head h2 {
  font-size: 18px;
  font-weight: 600;
}

.sheet-head p {
  color: var(--muted);
  font-size: 14px;
}

.ghost {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

input,
select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
}

input {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.pay {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.pay legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.radio {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 16px;
}

.radio input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.form-error {
  color: var(--danger);
  font-size: 14px;
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.primary {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 500;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.map {
  color: var(--muted);
  text-decoration: none;
}

.map:hover {
  color: var(--ink);
}

.cash {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
