:root {
  --ink: #142e38;
  --muted: #74858a;
  --muted-dark: #50646a;
  --line: #e5eceb;
  --paper: #f4f7f5;
  --white: #ffffff;
  --deep: #102b36;
  --deep-2: #193d48;
  --mint: #dff2e9;
  --mint-strong: #2e8869;
  --orange: #e9a46c;
  --red: #a64f48;
  --shadow: 0 18px 55px rgba(20, 46, 56, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(215, 236, 226, .6), transparent 34rem),
    var(--paper);
  min-height: 100vh;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(46, 136, 105, .3); outline-offset: 2px; }
.hidden { display: none !important; }
.page-shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(20, 46, 56, .08); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px 14px 14px 4px; background: var(--deep); color: #e4f1e9; font: 800 22px "Manrope", sans-serif; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font: 800 17px "Manrope", sans-serif; letter-spacing: -.5px; }
.brand-copy small { color: var(--muted); font-size: 9px; letter-spacing: 1.5px; font-weight: 700; }
.user-area { display: flex; align-items: center; gap: 18px; }
.user-ident { display: flex; align-items: center; gap: 9px; }
.user-ident > span:last-child { display: grid; gap: 2px; }
.user-ident small { font-size: 10px; color: var(--muted); }
.user-ident strong { font-size: 13px; }
.user-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint-strong); box-shadow: 0 0 0 4px var(--mint); }

.login-layout { min-height: 650px; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(50px, 9vw, 130px); padding: 72px 4.5% 90px; }
.intro-panel { max-width: 520px; }
.eyebrow, .card-kicker { color: var(--mint-strong); font-size: 10px; font-weight: 700; letter-spacing: 1.9px; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow-line { width: 25px; height: 1px; background: var(--mint-strong); }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Manrope", sans-serif; }
.intro-panel h1 { margin: 25px 0 20px; font-size: clamp(42px, 5.3vw, 67px); letter-spacing: -3.8px; line-height: 1.08; }
.intro-panel h1 span { color: var(--mint-strong); }
.intro-panel > p { color: var(--muted-dark); max-width: 410px; line-height: 1.8; font-size: 15px; }
.intro-note { display: flex; align-items: center; gap: 11px; margin-top: 36px; color: var(--muted-dark); font-size: 12px; }
.note-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #e5f1eb; color: var(--mint-strong); }
.login-card, .calendar-card, .times-card { background: var(--white); border: 1px solid rgba(20, 46, 56, .06); border-radius: 18px; box-shadow: var(--shadow); }
.login-card { width: 100%; max-width: 410px; padding: 38px; justify-self: end; }
.login-card h2 { margin: 11px 0 7px; font-size: 27px; letter-spacing: -1px; }
.muted { color: var(--muted); }
.login-card > .muted { margin-bottom: 27px; font-size: 13px; }
.form-stack { display: grid; gap: 9px; }
.form-stack label { margin-top: 7px; color: var(--muted-dark); font-size: 11px; font-weight: 700; }
.form-stack input { height: 48px; width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; color: var(--ink); padding: 0 14px; font-size: 13px; transition: border-color .2s, box-shadow .2s; }
.form-stack input:focus { border-color: #77ae96; box-shadow: 0 0 0 3px rgba(46, 136, 105, .1); outline: 0; }
.button { border: 0; border-radius: 9px; font-weight: 700; transition: transform .15s, background .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { min-height: 49px; margin-top: 13px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; background: var(--deep); color: white; font-size: 13px; }
.button-primary:hover:not(:disabled) { background: var(--deep-2); }
.button-full { width: 100%; }
.button-small { padding: 9px 12px; font-size: 11px; }
.button-quiet { color: var(--muted-dark); background: #edf2ef; }
.button-quiet:hover:not(:disabled) { background: #e3ebe6; }
.login-footnote { padding-top: 20px; margin: 20px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.notice { margin-top: 16px; padding: 11px 13px; border-radius: 8px; background: #fff5e9; color: #855525; font-size: 12px; line-height: 1.5; }
.notice.success { background: #eaf5ef; color: #286c50; }
.notice.error { background: #fff0ee; color: #98483f; }

.app-view { padding: 58px 0 72px; }
.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.welcome-row h1 { margin: 10px 0 6px; font-size: clamp(30px, 4vw, 40px); letter-spacing: -1.8px; }
.welcome-copy { margin-bottom: 0; font-size: 13px; }
.legend { display: flex; align-items: center; gap: 18px; padding-bottom: 5px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.available { background: var(--mint-strong); }
.legend-dot.booked { background: var(--orange); }
.booking-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr); gap: 22px; align-items: stretch; }
.calendar-card, .times-card { padding: 27px; }
.calendar-top, .times-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.calendar-top h2, .times-heading-row h2 { margin: 7px 0 0; font-size: 21px; letter-spacing: -.8px; }
.month-controls { display: flex; align-items: center; gap: 12px; }
.month-controls strong { min-width: 126px; text-align: center; font: 700 12px "Manrope", sans-serif; text-transform: capitalize; }
.icon-button { display: grid; place-items: center; width: 31px; height: 31px; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-size: 23px; line-height: 1; }
.icon-button:hover { background: #f1f6f2; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday-row { margin-top: 29px; padding-bottom: 11px; border-bottom: 1px solid var(--line); color: #9aa7a5; font-size: 10px; font-weight: 700; text-align: center; }
.calendar-days { row-gap: 5px; padding-top: 9px; }
.day-button { position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; gap: 5px; min-width: 0; min-height: 59px; padding: 8px 2px 5px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); }
.day-button:hover:not(:disabled) { background: #f3f7f4; }
.day-button.outside-month { color: #b8c1bf; }
.day-button:disabled { cursor: default; opacity: .45; }
.day-number { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; font-size: 12px; }
.day-button.today .day-number { border: 1px solid #8bb8a2; }
.day-button.selected .day-number { background: var(--deep); color: white; border-color: var(--deep); }
.day-count { min-height: 9px; color: var(--mint-strong); font-size: 8px; font-weight: 700; }
.day-button.selected .day-count { color: #698e7d; }
.calendar-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.today-marker { width: 8px; height: 8px; border: 1px solid #8bb8a2; border-radius: 3px; }
.date-chip { border-radius: 8px; background: #edf5f0; color: var(--mint-strong); padding: 8px 10px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.times-help { margin: 17px 0 17px; font-size: 11px; line-height: 1.6; }
.time-slots { display: grid; gap: 9px; }
.slot-row { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px 9px 14px; }
.slot-time { display: flex; align-items: center; gap: 10px; font: 700 13px "Manrope", sans-serif; }
.slot-time::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint-strong); }
.slot-row.is-booked .slot-time::before { background: var(--orange); }
.slot-status { display: flex; align-items: center; gap: 10px; min-width: 0; }
.slot-status span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.slot-action { min-width: 81px; border: 0; border-radius: 7px; padding: 8px 10px; background: #eaf4ee; color: #2e775b; font-size: 10px; font-weight: 700; }
.slot-action:hover:not(:disabled) { background: #dceee3; }
.slot-action.cancel { background: #f7eeeb; color: var(--red); }
.slot-action.cancel:hover:not(:disabled) { background: #f1e1dd; }
.slot-action:disabled { cursor: default; background: #f1f3f2; color: #9ba6a3; }
.slot-empty { padding: 19px 12px; border: 1px dashed #dbe5df; border-radius: 10px; color: var(--muted); text-align: center; font-size: 11px; }
.loading-state { padding: 24px 10px; color: var(--muted); text-align: center; font-size: 12px; }

.yearly-hours-card { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 16px; background: #eef5f0; border: 1px solid #dce9df; border-radius: 12px; }
.yearly-hours-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; background: #dcebe0; color: #315d43; font-size: 23px; }
.yearly-hours-copy { flex: 1; min-width: 0; }
.yearly-hours-copy strong { display: block; color: var(--ink); font-size: 12px; }
.yearly-hours-copy p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.yearly-hours-total { display: flex; align-items: baseline; gap: 5px; color: #244d35; }
.yearly-hours-total span { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.yearly-hours-total small { font-size: 10px; }

.your-bookings { display: flex; align-items: center; gap: 11px; margin-top: 21px; padding: 13px; background: #f4f8f5; border-radius: 10px; }
.your-bookings-icon { display: grid; place-items: center; flex: 0 0 auto; width: 27px; height: 27px; border-radius: 8px; background: #e0efe5; color: var(--mint-strong); font-size: 13px; }
.your-bookings strong { display: block; margin-bottom: 3px; font-size: 10px; }
.your-bookings p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.privacy-note { margin: 18px 0 0; color: #899895; font-size: 10px; text-align: center; }
.footer { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 28px; border-top: 1px solid rgba(20, 46, 56, .08); color: #93a09d; font-size: 10px; }
.footer span:first-child { color: var(--muted-dark); font-weight: 700; }

@media (max-width: 850px) {
  .login-layout { gap: 40px; padding-left: 0; padding-right: 0; }
  .booking-layout { grid-template-columns: 1fr; }
  .times-card { min-height: 0; }
}
@media (max-width: 620px) {
  .page-shell { width: min(100% - 28px, 520px); }
  .topbar { height: 76px; }
  .brand-mark { width: 37px; height: 37px; }
  .user-area { gap: 8px; }
  .user-ident small { display: none; }
  .button-small { padding: 8px 9px; font-size: 10px; }
  .login-layout { display: flex; flex-direction: column; align-items: stretch; gap: 31px; min-height: 0; padding: 55px 0 65px; }
  .intro-panel h1 { margin: 17px 0 13px; font-size: 46px; letter-spacing: -2.8px; }
  .intro-panel > p { font-size: 13px; }
  .intro-note { margin-top: 20px; }
  .login-card { max-width: none; padding: 27px 22px; }
  .app-view { padding: 42px 0 52px; }
  .welcome-row { display: block; }
  .legend { margin-top: 17px; }
  .calendar-card, .times-card { padding: 19px 15px; border-radius: 14px; }
  .month-controls { gap: 7px; }
  .month-controls strong { min-width: 105px; font-size: 11px; }
  .day-button { min-height: 53px; }
  .weekday-row { margin-top: 22px; }
  .slot-status span { max-width: 90px; }
  .footer { gap: 10px; font-size: 9px; }
}

#password-setup-view.hidden {
  display: none;
}

#password-setup-view {
  max-width: 460px;
  margin: 60px auto;
  padding: 24px;
}

.password-setup-card {
  background: white;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

#password-setup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

#password-setup-form input {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

#save-password-button {
  padding: 14px;
  margin-top: 12px;
  background: #294c3c;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#save-password-button:disabled {
  opacity: 0.6;
}