:root {
  --bg: #FBF8F3;
  --card: #FFFFFF;
  --ink: #443D5F;
  --muted: #8E87A6;
  --lav: #B9AEE8;
  --lav-soft: #EFEBFC;
  --lav-deep: #6F5FC4;
  --mint: #9FD8C3;
  --mint-soft: #E6F6EF;
  --mint-deep: #2E8C6A;
  --peach: #F4C39B;
  --peach-soft: #FBEFE2;
  --peach-deep: #BA7536;
  --rose-soft: #FBE7EA;
  --rose-deep: #C05C72;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(68, 61, 95, 0.08);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  min-height: 100%;
  overflow-x: hidden;
}

/* ---------- breathing blob header ---------- */
.hero { position: relative; padding: 28px 20px 18px; overflow: hidden; }
.blob {
  position: absolute; top: -110px; right: -80px; width: 280px; height: 280px;
  background: linear-gradient(135deg, var(--lav-soft), var(--mint-soft) 55%, var(--peach-soft));
  border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%;
  animation: breathe 9s ease-in-out infinite;
  z-index: 0;
}
@keyframes breathe {
  0%, 100% { border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%; transform: scale(1) rotate(0deg); }
  33%      { border-radius: 45% 55% 48% 52% / 55% 45% 58% 42%; transform: scale(1.08) rotate(4deg); }
  66%      { border-radius: 52% 48% 42% 58% / 44% 52% 48% 56%; transform: scale(0.96) rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
.hero h1 { position: relative; z-index: 1; font-size: 24px; font-weight: 800; }
.hero p  { position: relative; z-index: 1; color: var(--muted); margin-top: 4px; font-size: 14px; }
.sound-toggle {
  position: absolute; top: 24px; right: 18px; z-index: 2;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 18px; cursor: pointer;
  transition: transform .25s var(--spring);
}
.sound-toggle:active { transform: scale(.88); }
.sound-toggle.on { background: var(--lav-soft); }

/* ---------- layout ---------- */
.wrap { padding: 0 16px 96px; max-width: 560px; margin: 0 auto; }
.section-title {
  font-size: 13px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin: 22px 4px 10px;
}

/* ---------- day strip ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 0 0 auto; min-width: 64px; padding: 10px 12px; text-align: center;
  background: var(--card); border: 2px solid transparent; border-radius: 16px;
  box-shadow: var(--shadow); cursor: pointer; user-select: none;
  transition: transform .25s var(--spring), border-color .2s, background .2s;
}
.day-pill:active { transform: scale(.93); }
.day-pill.active { border-color: var(--lav); background: var(--lav-soft); }
.day-pill .dw { font-size: 12px; font-weight: 800; color: var(--muted); }
.day-pill.active .dw { color: var(--lav-deep); }
.day-pill .dn { font-size: 17px; font-weight: 800; }
.day-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); margin: 3px auto 0; opacity: 0; }
.day-pill.has .dot { opacity: 1; }

/* ---------- time chips ---------- */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.chip {
  padding: 13px 0; text-align: center; font-weight: 800; font-size: 15px;
  background: var(--card); border: 2px solid transparent; border-radius: 16px;
  box-shadow: var(--shadow); cursor: pointer; user-select: none;
  transition: transform .25s var(--spring), border-color .2s, background .2s, opacity .3s;
  animation: pop-in .4s var(--spring) backwards;
}
.chip:nth-child(2) { animation-delay: .03s; } .chip:nth-child(3) { animation-delay: .06s; }
.chip:nth-child(4) { animation-delay: .09s; } .chip:nth-child(5) { animation-delay: .12s; }
.chip:nth-child(6) { animation-delay: .15s; } .chip:nth-child(7) { animation-delay: .18s; }
@keyframes pop-in { from { opacity: 0; transform: scale(.7) translateY(8px); } }
.chip:active { transform: scale(.9); }
.chip.selected { border-color: var(--mint); background: var(--mint-soft); color: var(--mint-deep); }
.chip.booked { background: var(--peach-soft); color: var(--peach-deep); }
.chip.open-admin { background: var(--mint-soft); color: var(--mint-deep); }
.chip.open-rus { background: var(--lav-soft); color: var(--lav-deep); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px;
  animation: rise .45s var(--spring) backwards;
  display: flex; align-items: center; gap: 14px;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card .badge {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 16px;
  background: var(--lav-soft); color: var(--lav-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
}
.card .badge .b-day { font-size: 11px; }
.card .badge .b-num { font-size: 18px; line-height: 1; }
.card .meta { flex: 1; }
.card .meta .title { font-weight: 800; }
.card .meta .sub { font-size: 13px; color: var(--muted); }
.card .x {
  border: none; background: var(--rose-soft); color: var(--rose-deep);
  width: 38px; height: 38px; border-radius: 13px; font-size: 16px; cursor: pointer;
  transition: transform .25s var(--spring);
}
.card .x:active { transform: scale(.85) rotate(-8deg); }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 14px; }
.empty .e-ico { font-size: 34px; margin-bottom: 6px; }

/* ---------- bottom sheet ---------- */
.sheet-veil {
  position: fixed; inset: 0; background: rgba(68, 61, 95, .35);
  opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 50;
}
.sheet-veil.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .45s var(--spring);
  max-width: 560px; margin: 0 auto;
}
.sheet.open { transform: translateY(0); }
.sheet h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.sheet .s-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.btn {
  width: 100%; padding: 16px; border: none; border-radius: 18px;
  font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
  transition: transform .25s var(--spring), filter .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, var(--lav), #A795E5); color: #fff; }
.btn-mint { background: linear-gradient(135deg, var(--mint), #87CDB2); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); margin-top: 8px; }
.btn:disabled { filter: grayscale(.5) opacity(.6); }

/* ---------- success check ---------- */
.success-wrap { text-align: center; padding: 8px 0 4px; }
.check-svg { width: 92px; height: 92px; }
.check-circle {
  fill: none; stroke: var(--mint); stroke-width: 3;
  stroke-dasharray: 290; stroke-dashoffset: 290;
  animation: draw 0.7s ease-out forwards;
}
.check-mark {
  fill: none; stroke: var(--mint-deep); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 80; stroke-dashoffset: 80;
  animation: draw 0.45s ease-out 0.5s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 80px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 16px;
  font-size: 14px; font-weight: 700; z-index: 99; opacity: 0;
  transition: transform .4s var(--spring), opacity .3s; max-width: 88vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- tabs (admin) ---------- */
.tabs {
  display: flex; gap: 6px; background: var(--card); padding: 6px;
  border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 6px;
}
.tab {
  flex: 1; padding: 11px 0; text-align: center; font-weight: 800; font-size: 14px;
  border: none; background: transparent; color: var(--muted); border-radius: 13px;
  cursor: pointer; font-family: inherit; transition: background .25s, color .25s, transform .25s var(--spring);
}
.tab:active { transform: scale(.95); }
.tab.active { background: var(--lav-soft); color: var(--lav-deep); }

.week-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 4px; }
.week-nav .wn-label { font-weight: 800; font-size: 14px; color: var(--muted); }
.wn-btn {
  border: none; width: 38px; height: 38px; border-radius: 13px;
  background: var(--card); box-shadow: var(--shadow); font-size: 16px; cursor: pointer;
  color: var(--ink); transition: transform .25s var(--spring);
}
.wn-btn:active { transform: scale(.85); }

.f-label {
  display: block; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin: 0 4px 6px;
}
textarea.hw, input.hw, select.hw {
  width: 100%; min-height: 110px; border: 2px solid var(--lav-soft); border-radius: 16px;
  padding: 14px; font-family: inherit; font-size: 15px; color: var(--ink);
  resize: vertical; outline: none; background: var(--bg); margin-bottom: 14px;
}
input.hw { min-height: 0; height: 54px; resize: none; }
textarea.hw:focus, input.hw:focus { border-color: var(--lav); background: #fff; }

.skeleton {
  height: 64px; border-radius: var(--radius); margin-bottom: 12px;
  background: linear-gradient(90deg, var(--card) 25%, var(--lav-soft) 50%, var(--card) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
