:root {
  color: #1a1a1a;
  background: #fff;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --c-text: #1a1a1a;
  --c-text-2: #555;
  --c-text-3: #999;
  --c-border: #e8e8e8;
  --c-surface: #f7f7f8;
  --c-hl: #ffe28a;
  --c-illo: #f9f0d8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: #fff;
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 75%);
  pointer-events: none;
}

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

a { color: inherit; text-decoration: none; }

#app {
  width: min(480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 40px 20px calc(96px + env(safe-area-inset-bottom));
}

.back {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 700;
}

.hero {
  margin: 8px 0 0;
  font-size: 36px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero.mark {
  display: inline-block;
  background-image: linear-gradient(#ffe28a, #ffe28a);
  background-repeat: no-repeat;
  background-position: 0 0.72em;
  background-size: 100% 0.42em;
}

.desc {
  margin: 8px 0 0;
  color: var(--c-text-2);
  font-size: 16px;
  line-height: 1.85;
}

.intro .desc { margin-top: 12px; }

.places {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 36px;
}

.places .card + .card { margin-top: 0; }

.place-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 18px 16px;
}

.place-card b {
  display: block;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}

.pick {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--c-hl);
  color: var(--c-text);
  font-size: 14px;
  font-weight: 700;
}

.section { margin-top: 22px; }

.date {
  margin: 22px 0 10px;
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 700;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 18px;
}

.week button {
  min-width: 0;
  margin: 0;
  padding: 8px 0 6px;
  border: 0;
  border-radius: 14px;
  background: var(--c-surface);
  color: var(--c-text);
  text-align: center;
}

.week .w,
.week .d {
  display: block;
  line-height: 1.25;
}

.week .w {
  font-size: 14px;
  font-weight: 700;
}

.week .d {
  margin-top: 2px;
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 600;
}

.week button.on {
  background: var(--c-text);
  color: #fff;
}

.week button.on .d { color: rgba(255, 255, 255, 0.86); }

.week-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.week-nav button {
  border: 0;
  background: transparent;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 0;
}

.loc-switch {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 8px;
}

.loc-switch button {
  flex: none;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
}

.loc-switch button.on {
  background: var(--c-text);
  color: #fff;
}

.slot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  box-shadow: none;
  padding: 16px;
  max-width: 100%;
  overflow: hidden;
}

.card + .card, .slot + .slot { margin-top: 12px; }

.slot, .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.time {
  font-size: 22px;
  font-weight: 700;
}

.place {
  display: block;
  margin-top: 4px;
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 600;
}

.place-select {
  display: block;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--c-surface);
  padding: 8px 10px;
  font-size: 14px;
}

.remain {
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 700;
}

.go, .link {
  color: var(--c-text);
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
}

.slot.taken {
  background: var(--c-surface);
  box-shadow: none;
  color: var(--c-text-3);
}

.slot.taken .time,
.slot.taken .go,
.slot.taken .remain {
  color: var(--c-text-3);
  font-weight: 700;
}

.slot.taken button.link {
  color: var(--c-text);
}

.slot.mine {
  background: var(--c-illo);
  box-shadow: 0 0 0 2px var(--c-text);
}

.muted { color: var(--c-text-3); font-size: 14px; line-height: 1.7; }

.tag {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
}

.tag.booked, .tag.confirmed, .tag.active { background: var(--c-illo); color: var(--c-text); }
.tag.done { background: #ecfdf5; color: #059669; }
.tag.closed, .tag.cancelled { background: var(--c-surface); color: var(--c-text-3); }

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.filters button {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 700;
}

.filters button.on {
  background: var(--c-hl);
  color: var(--c-text);
}

[hidden] { display: none !important; }
label { display: block; margin-top: 14px; min-width: 0; max-width: 100%; }
label span, .label { display: block; margin-bottom: 6px; color: var(--c-text-2); font-size: 14px; }

input, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: #fff;
  padding: 14px 12px;
  font-size: 16px;
}

input[type="date"],
input[type="time"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  background: var(--c-surface);
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  display: inline-block;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
}

textarea { min-height: 88px; resize: vertical; }

.times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.times label { min-width: 0; overflow: hidden; }

label span.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 0;
}
.code-row input { flex: 1; min-width: 0; }
.code-send {
  width: auto;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--c-text);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
}
.code-send:disabled { opacity: 0.45; }

.btn, .ghost {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 700;
}

a.btn, a.ghost {
  text-align: center;
  line-height: 48px;
}
.btn:disabled { opacity: 0.45; }
.btn { background: var(--c-text); color: #fff; }
.ghost { background: var(--c-surface); color: var(--c-text); }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 0;
  padding: 12px 0;
  border-top: 1px solid var(--c-border);
}

.choice:first-of-type { border-top: 0; }

.choice input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 1px 0 0;
  padding: 0;
  flex: none;
  background: transparent;
  border-radius: 50%;
  accent-color: #1a1a1a;
}

.choice > span {
  display: block;
  margin: 0;
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}

.choice .muted {
  display: block;
  margin-top: 2px;
  font-weight: 400;
}

.empty, .banner {
  margin-top: 16px;
  padding: 18px 14px;
  border-radius: 16px;
  text-align: center;
  color: var(--c-text-2);
  font-size: 16px;
  line-height: 1.7;
  background: var(--c-illo);
}

.banner { text-align: left; background: var(--c-illo); color: var(--c-text); }

.success {
  margin-top: 18px;
  padding: 22px 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--c-border);
  box-shadow: none;
}

.success h2 { margin: 0; font-size: 28px; line-height: 1.4; }
.fact { margin-top: 16px; }
.fact b { display: block; font-size: 18px; }
.fact .address { display: block; margin-top: 4px; font-size: 16px; line-height: 1.7; }
.fact a, .muted a, .desc a { color: var(--c-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--c-border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar a {
  flex: 1;
  text-align: center;
  line-height: 52px;
  color: var(--c-text-3);
  font-weight: 700;
}

.tabbar a.on {
  color: var(--c-text);
  background-image: linear-gradient(#ffe28a, #ffe28a);
  background-repeat: no-repeat;
  background-position: center 38px;
  background-size: 28px 6px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid transparent;
}

.tile b { display: block; font-size: 17px; line-height: 1.3; }
.tile .muted { display: block; }
.tile.loc { background: #f9f0d8; }
.tile.slot { background: #ffe28a; }
.tile.book { background: #1a1a1a; color: #fff; }
.tile.book .muted { color: rgba(255, 255, 255, 0.72); }
.tile.book .chev { color: #ffe28a; }

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex: none;
  background: #1a1a1a;
}

.record.active .swatch,
.record.confirmed .swatch { background: #ffe28a; }
.record.done .swatch { background: #b7e4c7; }
.record.cancelled .swatch,
.record.closed .swatch { background: #e4e4e4; }

.chev {
  margin-left: auto;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
}

.kicker::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #ffe28a;
}

.record {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.record > div { flex: 1; min-width: 0; }

.entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--c-border);
}

.entry:first-child { border-top: 0; }
.error { color: #b42318; font-size: 16px; line-height: 1.7; }
.ok {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--c-illo);
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.7;
}
.switch { display: flex; align-items: center; gap: 8px; }
.switch input { width: 18px; height: 18px; }
