:root {
  --bg: #121214;
  --bg-elevated: #17171a;
  --card: #1c1c1f;
  --card-soft: #222226;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #9a9aa3;
  --faint: #6d6d76;
  --accent: #e8e8ea;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "Manrope", system-ui, sans-serif;
  padding: env(safe-area-inset-top) 0 calc(96px + env(safe-area-inset-bottom));
}

.week-scroll::-webkit-scrollbar {
  display: none;
}

.week-scroll {
  scrollbar-width: none;
}

.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.day-pill {
  min-width: 52px;
  height: 74px;
  border-radius: 22px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.day-pill.is-today {
  background: #1a1a1d;
  border-color: var(--line);
  color: var(--text);
}

.day-pill.is-active {
  background: #f2f2f4;
  color: #111113;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.calendar-nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  transition: transform 140ms ease, background-color 140ms ease;
}
.calendar-nav:active { transform: scale(.92); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekdays { margin-bottom: 5px; color: var(--faint); text-align: center; font-size: 10px; font-weight: 700; }
.calendar-weekdays span { padding: 4px 0; }
.calendar-empty, .calendar-day { min-height: 38px; }
.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  transition: background-color 140ms ease, transform 140ms ease;
}
.calendar-day:active { transform: scale(.93); }
.calendar-day.is-today { border-color: var(--line); }
.calendar-day.is-selected { background: var(--text); color: var(--bg); font-weight: 800; }
.calendar-day i {
  position: absolute;
  right: 3px;
  bottom: 2px;
  min-width: 11px;
  height: 11px;
  border-radius: 6px;
  background: #a78bfa;
  color: #17131f;
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  line-height: 11px;
  text-align: center;
}

.nav-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  padding: 8px;
  border-radius: 28px;
  background: rgba(28, 28, 31, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.nav-btn {
  flex: 1;
  height: 52px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--faint);
}

.nav-btn.is-active {
  background: #2a2a2e;
  color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 6, 12, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: modal-fade-in 180ms ease-out both;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background:
    radial-gradient(ellipse at 92% 0%, rgba(167, 139, 250, 0.19), transparent 43%),
    linear-gradient(155deg, #20212a 0%, #17171b 72%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.48);
  animation: modal-rise-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.booking-modal-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.booking-modal-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(196, 181, 253, 0.34);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.32), rgba(45, 212, 191, 0.16));
  color: #d8ccff;
  font-size: 23px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 8px 24px rgba(124, 92, 220, 0.14);
}

.booking-modal-eyebrow {
  color: #c4b5fd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.booking-modal-lead {
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.booking-details {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  padding: 4px 15px 13px;
}

.booking-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-top: 13px;
  color: var(--muted);
  font-size: 13px;
}

.booking-detail-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.booking-duration {
  display: inline-flex;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.12);
  padding: 6px 10px;
  color: #8de8da;
  font-size: 11px;
  font-weight: 700;
}

.booking-modal-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.booking-success {
  padding: 8px 2px 2px;
  text-align: center;
}

.booking-success-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid rgba(110, 231, 183, 0.3);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.24), rgba(45, 212, 191, 0.12));
  color: #86efac;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(45, 212, 191, 0.12);
}

.booking-success-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.modal-cancel,
.modal-cta {
  min-height: 50px;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.modal-cancel {
  color: #d1d1d8;
}

.modal-cta {
  background: linear-gradient(105deg, #c9baff 0%, #9fe9dc 100%);
  box-shadow: 0 8px 24px rgba(147, 224, 211, 0.19);
}

.modal-cta:not(:disabled):active,
.modal-cancel:active {
  transform: scale(0.98);
}

.modal-cta:disabled {
  cursor: wait;
  opacity: 0.72;
  box-shadow: none;
}

.modal-error {
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 14px;
  background: rgba(127, 29, 29, 0.18);
  padding: 12px;
  color: #fca5a5;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-rise-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

input[type="time"],
input[type="text"] {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

html[data-theme="light"] {
  --bg: #f4f5f8;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-soft: #eef0f5;
  --line: rgba(27, 32, 45, 0.11);
  --text: #20232b;
  --muted: #687080;
  --faint: #9299a6;
  --accent: #313743;
}

html[data-theme="light"] .day-pill.is-today { background: #e9ebf1; }
html[data-theme="light"] .day-pill.is-active { background: #282d37; color: #fff; }
html[data-theme="light"] .nav-bar { background: rgba(255, 255, 255, 0.92); }
html[data-theme="light"] .nav-btn.is-active { background: #eef0f5; }
html[data-theme="light"] .modal-sheet {
  background: radial-gradient(ellipse at 92% 0%, rgba(167, 139, 250, 0.12), transparent 43%), #fff;
  border-color: rgba(27, 32, 45, 0.12);
}
html[data-theme="light"] .modal-cancel { color: #4c5361; }
html[data-theme="light"] .booking-details { background: rgba(27, 32, 45, 0.035); border-color: var(--line); }
html[data-theme="light"] .interactive-card,
html[data-theme="light"] #btn-back,
html[data-theme="light"] #btn-notifications,
html[data-theme="light"] #btn-add-slot { background-color: var(--card) !important; color: var(--muted); }
html[data-theme="light"] #avatar { background: #e7e9ef !important; }
html[data-theme="light"] #modal .bg-white\/15 { background: rgba(32, 35, 43, 0.15); }

.interactive-card {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.interactive-card:hover { border-color: rgba(167, 139, 250, 0.35); }
.interactive-card:active { transform: scale(0.985); }
.interactive-card:focus-visible,
#btn-notifications:focus-visible { outline: 2px solid #a78bfa; outline-offset: 3px; }
.booking-cancel { border: 1px solid rgba(251, 113, 133, 0.25); color: #fda4af; }
.booking-cancel:active { transform: scale(0.98); }
html[data-theme="light"] .booking-cancel { color: #be123c; }

.modal-backdrop.is-closing { animation: modal-fade-out 180ms ease-in both; }
.modal-sheet.is-closing { animation: modal-drop-out 180ms ease-in both; }
@keyframes modal-fade-out { to { opacity: 0; } }
@keyframes modal-drop-out { to { opacity: 0; transform: translateY(24px); } }

.modal-section-hint { margin: -6px 0 14px; color: var(--muted); }
.activity-list, .news-list { display: grid; gap: 10px; }
.activity-item, .news-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.035);
  padding: 13px;
}
.activity-icon, .news-item-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd;
  font-size: 16px;
  font-weight: 800;
}
.activity-icon-success { color: #6ee7b7; background: rgba(52, 211, 153, 0.12); }
.activity-icon-reminder { color: #fcd34d; background: rgba(251, 191, 36, 0.12); }
.activity-copy { min-width: 0; }
.activity-copy strong, .news-item strong { display: block; color: var(--text); font-size: 13px; }
.activity-copy p, .news-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.activity-empty { border: 1px dashed var(--line); border-radius: 17px; padding: 22px 14px; text-align: center; }
.news-item { align-items: center; }

.settings-form { display: grid; gap: 15px; }
.settings-field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.settings-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}
.settings-group-title { margin: 2px 0 -7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.settings-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); cursor: pointer; }
.settings-toggle strong, .settings-toggle small { display: block; }
.settings-toggle strong { font-size: 13px; }
.settings-toggle small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.settings-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-switch { width: 42px; height: 25px; flex: 0 0 auto; border-radius: 999px; background: #45464e; transition: background 160ms ease; }
.settings-switch::after { content: ""; display: block; width: 19px; height: 19px; margin: 3px; border-radius: 50%; background: #fff; transition: transform 160ms ease; }
.settings-toggle input:checked + .settings-switch { background: #8b78e6; }
.settings-toggle input:checked + .settings-switch::after { transform: translateX(17px); }
.settings-toggle input:focus-visible + .settings-switch { outline: 2px solid #a78bfa; outline-offset: 3px; }
.settings-footnote { margin: -2px 0 0; color: var(--faint); font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
