:root {
  color-scheme: light dark;
  --bg: var(--tg-theme-bg-color, #fff);
  --bg-secondary: var(--tg-theme-secondary-bg-color, #f4f4f5);
  --text: var(--tg-theme-text-color, #111);
  --hint: var(--tg-theme-hint-color, #707579);
  --link: var(--tg-theme-link-color, #2481cc);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-text: var(--tg-theme-button-text-color, #fff);
  --destructive: var(--tg-theme-destructive-text-color, #d9534f);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  min-height: 100vh;
}

#app {
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom)) 16px;
  max-width: 640px;
  margin: 0 auto;
}

.loading,
.empty {
  text-align: center;
  color: var(--hint);
  padding: 48px 16px;
}

h1 {
  font-size: 22px;
  margin: 0 0 16px;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.subtitle {
  color: var(--hint);
  font-size: 14px;
  margin: -8px 0 16px;
}

.card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card .body {
  flex: 1;
  min-width: 0;
}

.card .title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.card .meta {
  color: var(--hint);
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--hint);
}
.dot.available {
  background: #34c759;
}
.dot.unavailable {
  background: #d0d0d0;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--destructive);
  font-size: 22px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

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

.choice {
  background: var(--bg-secondary);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.choice:active {
  filter: brightness(0.95);
}

.choice .label {
  flex: 1;
}

.choice .badge {
  color: var(--hint);
  font-size: 13px;
}

.choice.selected {
  outline: 2px solid var(--accent);
}

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  z-index: 10;
}
.fab:active {
  filter: brightness(0.95);
}

.error {
  background: rgba(217, 83, 79, 0.12);
  color: var(--destructive);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 8px 0 16px;
  font-size: 14px;
}

.summary {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

.summary dt {
  color: var(--hint);
  font-size: 13px;
  margin-top: 8px;
}
.summary dt:first-child {
  margin-top: 0;
}
.summary dd {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 500;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--link);
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
}

.date-input {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  margin: 8px 0 16px;
  box-sizing: border-box;
}
.date-input:focus {
  outline: 2px solid var(--accent);
}
