:root {
  --bg: #efe6d4;
  --bg-2: #f7f1e4;
  --ink: #1c2418;
  --muted: #5e685c;
  --line: #ddd2ba;
  --green: #17382c;
  --green-2: #245743;
  --mint: #e4f0e6;
  --amber: #c2410c;
  --amber-soft: #fff0e4;
  --card: #fffaf2;
  --danger: #8d2c2c;
  --shadow: 0 12px 28px rgba(28, 36, 24, 0.08);
  --nav: 74px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 280px at 80% -40px, #d7e7d4 0%, transparent 60%),
    linear-gradient(180deg, #f3ecdc 0%, var(--bg) 220px);
  color: var(--ink);
  font-family: "Golos Text", "Segoe UI", sans-serif;
  font-size: 16px;
}

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

button { cursor: pointer; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(var(--nav) + env(safe-area-inset-bottom));
}

#app.plain { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.kicker {
  margin: 0;
  color: var(--green-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-family: Unbounded, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

input[type="text"], input[type="time"] {
  width: 100%;
  min-height: 52px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 0 14px;
  font-size: 16px;
}

input:focus { outline: 2px solid #8fbf9b; border-color: transparent; }

.btn {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 0 16px;
  background: var(--green);
  color: #f6f3ea;
  font-weight: 700;
  width: 100%;
}

.btn.soft { background: var(--mint); color: var(--green); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: #f8e8e4; color: var(--danger); }
.btn:active { transform: translateY(1px); }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.card-hit {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.plate {
  display: flex;
  align-items: stretch;
  background: #f4f1e6;
  border: 2px solid #1c2418;
  border-radius: 10px;
  overflow: hidden;
  min-height: 54px;
}

.plate-flag {
  width: 28px;
  background: #1d4e89;
  color: #f4f7fb;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.plate-num {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-family: Unbounded, sans-serif;
  font-size: clamp(16px, 4.6vw, 22px);
  letter-spacing: 0.03em;
}

.meta { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.when { margin: 8px 0 0; font-weight: 700; }
.when.soon { color: var(--amber); }
.when.calm { color: var(--green-2); }

.top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.back {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 20px;
}

.top h1 { font-size: 22px; }

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

.day {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  min-height: 64px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.day b { font-size: 12px; }
.day span { font-size: 11px; color: var(--muted); font-weight: 700; }
.day.on { background: var(--amber-soft); border-color: #f0c2a4; }
.day.on span { color: var(--amber); }

.chips { display: flex; gap: 8px; margin-top: 12px; }
.chips button { flex: 1; }

.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 250, 242, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 5;
}

.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
}

.nav button.on { color: var(--green); }
.nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.sheet-bg {
  position: fixed;
  inset: 0;
  background: rgba(23, 28, 22, 0.38);
  z-index: 20;
}

.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  background: var(--bg-2);
  border-radius: 22px 22px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  z-index: 21;
  box-shadow: 0 -10px 40px rgba(23, 28, 22, 0.16);
}

.handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #d3c7b0;
  margin: 0 auto 12px;
}

.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.presets button, .choice {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 700;
}

.choice { width: 100%; }

.leave {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
}

.leave time {
  font-family: Unbounded, sans-serif;
  font-size: 16px;
  color: var(--amber);
}

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.seg button { min-height: 44px; border-radius: 14px; border: 1px solid var(--line); background: transparent; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--green); color: #f6f3ea; border-color: var(--green); }

.person { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.person .who { font-weight: 700; }
.tiny { color: var(--muted); font-size: 13px; margin-top: 2px; }

.toast {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  background: var(--ink);
  color: #f6f3ea;
  border-radius: 14px;
  padding: 12px 14px;
  z-index: 40;
  font-weight: 600;
}

.empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
}

a.phone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 16px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 700;
  text-decoration: none;
}

code.house {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--mint);
  font-family: Unbounded, sans-serif;
  font-size: 18px;
}

.tour {
  position: fixed;
  inset: 0;
  z-index: 35;
}

.tour-hole {
  position: fixed;
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(18, 28, 22, 0.72);
  outline: 2px solid #f6f3ea;
  pointer-events: none;
}

.tour-card {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 28px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  z-index: 36;
  box-shadow: 0 16px 40px rgba(18, 28, 22, 0.28);
}

.tour-card h2 {
  margin: 4px 0 0;
  font-family: Unbounded, sans-serif;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.tour-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.4; }

.tour-actions { display: flex; gap: 8px; margin-top: 14px; }
.tour-actions .btn { flex: 1; width: auto; min-height: 46px; }
