:root {
  --bg: #f3f7f7;
  --surface: #ffffff;
  --surface-soft: #f8fbfb;
  --text: #18302f;
  --muted: #667978;
  --border: #dce7e6;
  --primary: #0f766e;
  --primary-dark: #0b5d57;
  --primary-soft: #dff5f1;
  --danger: #b42318;
  --danger-soft: #fee9e7;
  --warning: #9a6700;
  --shadow: 0 18px 50px rgba(26, 72, 68, .08);
  --radius: 22px;
  --radius-sm: 14px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }

.topbar { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(220, 231, 230, .9); background: rgba(255, 255, 255, .9); backdrop-filter: blur(18px); }
.topbar-inner { width: min(1440px, calc(100% - 40px)); min-height: 74px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: max-content; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #0f766e, #1aa89b); border-radius: 13px; font-weight: 800; box-shadow: 0 8px 20px rgba(15, 118, 110, .25); }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 1.08rem; letter-spacing: -.02em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a, .link-button { padding: 10px 13px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 650; }
.main-nav > a:hover, .main-nav > a.active, .link-button:hover { color: var(--primary); background: var(--primary-soft); }
.nav-logout { margin: 0; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); font-size: 1.2rem; }

.page-shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 60px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.eyebrow { display: block; margin-bottom: 7px; color: var(--primary); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.optional { color: var(--muted); font-size: .78rem; font-weight: 500; }

.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border: 1px solid transparent; border-radius: 12px; font-weight: 750; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--primary); box-shadow: 0 9px 20px rgba(15, 118, 110, .18); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: var(--text); background: white; border-color: var(--border); }
.btn-secondary:hover { border-color: #aac8c5; background: var(--surface-soft); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: #f9c4be; }
.btn-small { min-height: 36px; padding: 7px 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: white; font-size: 1.7rem; line-height: 1; }
.icon-btn:hover { color: var(--primary); border-color: #9bcac5; }

.flash-stack { position: fixed; z-index: 100; top: 88px; right: 20px; width: min(420px, calc(100% - 40px)); display: grid; gap: 10px; }
.flash { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 15px; border: 1px solid; border-radius: 13px; background: white; box-shadow: 0 16px 35px rgba(20, 50, 48, .16); font-weight: 650; }
.flash button { border: 0; color: inherit; background: transparent; font-size: 1.35rem; line-height: 1; }
.flash-success { color: #17633a; border-color: #a9dec0; background: #effaf3; }
.flash-danger { color: #9b241c; border-color: #f5b8b2; background: #fff2f0; }
.flash-warning { color: #865b00; border-color: #edd18a; background: #fff9e8; }
.flash-info { color: #245c79; border-color: #b5d8e9; background: #f0f8fc; }

.hero-card { position: relative; overflow: hidden; min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 35px 38px; border-radius: 28px; color: white; background: linear-gradient(120deg, #0d5f5a 0%, #0f766e 52%, #26988d 100%); box-shadow: 0 24px 60px rgba(15, 118, 110, .22); }
.hero-card::after { content: ""; position: absolute; width: 360px; height: 360px; right: -100px; top: -170px; border: 55px solid rgba(255,255,255,.08); border-radius: 50%; }
.hero-card::before { content: ""; position: absolute; width: 160px; height: 160px; right: 240px; bottom: -110px; border: 35px solid rgba(255,255,255,.06); border-radius: 50%; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: #bff5ed; }
.hero-card h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.05; letter-spacing: -.045em; }
.hero-card p { max-width: 660px; margin: 13px 0 0; color: rgba(255,255,255,.82); font-size: 1.03rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.hero-actions .btn-primary { color: var(--primary-dark); background: white; }
.hero-actions .btn-secondary { color: white; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.stat-card { min-height: 120px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; align-items: end; gap: 5px 18px; padding: 21px 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.stat-card > span { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; font-weight: 700; }
.stat-card strong { font-size: 2rem; line-height: 1; letter-spacing: -.04em; }
.stat-card strong.stat-date { font-size: 1.65rem; }
.stat-card small { align-self: end; color: var(--muted); font-weight: 650; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.calendar-panel, .upcoming-panel { overflow: hidden; }
.panel-header { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.025em; }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.today-link { padding: 9px 12px; color: var(--primary); font-weight: 750; }
.calendar-scroll { overflow-x: auto; }
.calendar-weekdays, .calendar-grid { min-width: 730px; display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.calendar-weekdays span { padding: 11px 8px; color: var(--muted); font-size: .72rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 118px; padding: 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: white; transition: background .15s ease; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day[data-new-booking] { cursor: pointer; }
.calendar-day[data-new-booking]:hover { background: #f2fbf9; }
.calendar-day.outside { color: #aebdbc; background: #fafcfc; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.day-number { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 24px; font-size: .84rem; font-weight: 800; }
.day-number em { padding: 3px 6px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: .58rem; font-style: normal; text-transform: uppercase; }
.free-label { display: inline-block; margin-top: 15px; color: #9aabaa; font-size: .67rem; font-weight: 700; }
.booking-chip { --member-color: var(--primary); display: grid; grid-template-columns: 7px 1fr; column-gap: 7px; margin-top: 9px; padding: 8px; border-radius: 9px; background: color-mix(in srgb, var(--member-color) 11%, white); overflow: hidden; }
.booking-chip:hover { outline: 2px solid color-mix(in srgb, var(--member-color) 35%, white); }
.booking-dot { grid-row: 1 / 3; width: 7px; height: 100%; min-height: 28px; border-radius: 999px; background: var(--member-color); }
.booking-chip strong, .booking-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-chip strong { font-size: .74rem; }
.booking-chip small { color: var(--muted); font-size: .61rem; }
.calendar-hint { margin: 0; padding: 13px 20px; color: var(--muted); background: var(--surface-soft); font-size: .76rem; }

.upcoming-list { display: grid; }
.upcoming-item { display: grid; grid-template-columns: 53px 1fr; gap: 13px; padding: 17px 20px; border-bottom: 1px solid var(--border); transition: background .15s ease; }
.upcoming-item:last-child { border-bottom: 0; }
.upcoming-item:hover { background: var(--surface-soft); }
.date-tile { height: 57px; display: grid; place-items: center; align-content: center; border-radius: 12px; color: var(--primary-dark); background: var(--primary-soft); }
.date-tile strong, .date-tile small { line-height: 1.05; }
.date-tile strong { font-size: 1.2rem; }
.date-tile small { margin-top: 3px; font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.upcoming-copy { min-width: 0; display: grid; gap: 3px; }
.upcoming-copy > strong, .upcoming-copy > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-copy > strong { font-size: .91rem; }
.upcoming-copy > small, .upcoming-copy > span { color: var(--muted); font-size: .72rem; }
.upcoming-copy > span { display: flex; align-items: center; gap: 5px; }
.upcoming-copy i { width: 7px; height: 7px; border-radius: 50%; }
.empty-state { padding: 46px 24px; text-align: center; }
.empty-state p { color: var(--muted); }
.empty-icon { width: 55px; height: 55px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 18px; color: var(--primary); background: var(--primary-soft); font-size: 1.6rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 5px 0 24px; }
.page-heading h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.65rem); line-height: 1.1; letter-spacing: -.045em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); }
.form-layout, .detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.form-card { overflow: hidden; }
.narrow-card { max-width: 860px; }
.form-section { padding: 27px 28px; }
.form-section h2, .help-card h2, .meta-card h2 { margin: 0 0 20px; font-size: 1.22rem; letter-spacing: -.025em; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 17px; }
label { color: var(--text); font-size: .83rem; font-weight: 750; }
label > small { display: block; margin-top: 6px; color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid #cbdcda; border-radius: 11px; color: var(--text); background: white; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
input:disabled { color: #839290; background: #f2f5f5; }
textarea { resize: vertical; min-height: 125px; }
.form-actions { min-height: 74px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 28px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.help-card, .meta-card { padding: 25px; }
.help-icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-weight: 900; }
.feature-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.feature-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.feature-list li > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: .8rem; font-weight: 900; }
.feature-list strong, .feature-list small { display: block; }
.feature-list small { margin-top: 4px; color: var(--muted); }
.check-card { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.check-card input, .check-row input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--primary); }
.check-card strong, .check-card small { display: block; }
.check-card small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.color-fieldset { margin: 0; padding: 0; border: 0; }
.color-fieldset legend { margin-bottom: 9px; font-size: .83rem; font-weight: 750; }
.color-options { display: flex; flex-wrap: wrap; gap: 10px; }
.color-option { position: relative; }
.color-option input { position: absolute; opacity: 0; }
.color-option span { width: 34px; height: 34px; display: block; border: 4px solid white; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--border); }
.color-option input:checked + span { box-shadow: 0 0 0 3px white, 0 0 0 5px var(--swatch); }

.member-banner { --member-color: var(--primary); display: flex; align-items: center; gap: 13px; padding: 24px 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--member-color) 8%, white); }
.member-avatar { width: 47px; height: 47px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; color: white; background: var(--member-color); font-size: 1.15rem; font-weight: 850; }
.member-avatar.small { width: 34px; height: 34px; border-radius: 10px; font-size: .82rem; }
.member-banner small, .member-banner strong { display: block; }
.member-banner small { color: var(--muted); }
.detail-card { overflow: hidden; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 0; }
.detail-grid > div { min-height: 130px; padding: 27px 28px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-grid > div:nth-child(2) { border-right: 0; }
.detail-grid > div.span-2 { border-right: 0; border-bottom: 0; }
.detail-grid span, .detail-grid strong, .detail-grid small { display: block; }
.detail-grid span { margin-bottom: 8px; color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.detail-grid strong { font-size: 1.08rem; }
.detail-grid small { margin-top: 5px; color: var(--muted); }
.detail-grid p { margin: 0; white-space: pre-wrap; }
.detail-actions { justify-content: space-between; }
.meta-card dl { margin: 0; }
.meta-card dl > div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.meta-card dl > div:last-child { border-bottom: 0; }
.meta-card dt { color: var(--muted); }
.meta-card dd { margin: 0; text-align: right; font-weight: 700; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.status-badge.active { color: #17633a; background: #e7f8ed; }
.status-badge.inactive { color: #8b3a32; background: #fcece9; }
.status-badge.admin { color: #6342a0; background: #f0eafd; }

.table-panel { overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: var(--surface-soft); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfd; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.table-action { text-align: right; }

.error-card { max-width: 620px; margin: 80px auto; padding: 48px; text-align: center; }
.error-card > span { display: block; color: var(--primary); font-size: 5rem; font-weight: 900; line-height: 1; opacity: .2; }
.error-card h1 { margin: 10px 0; }
.error-card p { margin: 0 0 24px; color: var(--muted); }

.login-page { background: #edf5f3; }
.login-page main { min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(430px, .9fr); }
.login-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(45px, 7vw, 110px); color: white; background: linear-gradient(145deg, #084f4b 0%, #0f766e 55%, #2d9f94 100%); }
.login-visual h1 { position: relative; z-index: 2; max-width: 700px; margin: 22px 0 15px; font-size: clamp(3rem, 6.2vw, 6.2rem); line-height: .98; letter-spacing: -.065em; }
.login-visual p { position: relative; z-index: 2; max-width: 560px; margin: 0; color: rgba(255,255,255,.8); font-size: clamp(1rem, 1.7vw, 1.25rem); }
.visual-badge { position: relative; z-index: 2; width: max-content; padding: 7px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(255,255,255,.1); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.login-panel { display: grid; place-items: center; padding: 40px; background: white; }
.login-card { width: min(430px, 100%); }
.brand-login { margin-bottom: 55px; }
.login-card h2 { margin: 0; font-size: 2.25rem; letter-spacing: -.04em; }
.login-card > p { margin: 8px 0 28px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 83px; }
.password-toggle { position: absolute; right: 8px; top: 15px; padding: 7px; border: 0; color: var(--primary); background: transparent; font-size: .75rem; font-weight: 800; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.house-art { position: absolute; inset: auto 0 0; height: 42%; opacity: .92; }
.sun { position: absolute; width: 110px; height: 110px; right: 16%; top: 0; border-radius: 50%; background: rgba(255, 225, 148, .9); box-shadow: 0 0 70px rgba(255,225,148,.4); }
.hill { position: absolute; bottom: -35%; border-radius: 50% 50% 0 0; }
.hill-one { width: 110%; height: 110%; left: -25%; background: #0b625d; transform: rotate(4deg); }
.hill-two { width: 90%; height: 78%; right: -20%; background: #094f4b; transform: rotate(-5deg); }
.house { position: absolute; z-index: 3; width: 150px; height: 105px; left: 20%; bottom: 18%; border-radius: 4px; background: #f6e2bc; box-shadow: 0 22px 40px rgba(0,0,0,.18); }
.roof { position: absolute; width: 120px; height: 120px; left: 15px; top: -61px; background: #9f4e34; transform: rotate(45deg); border-radius: 6px 0 0; }
.house::after { content: ""; position: absolute; inset: 0; background: #f6e2bc; }
.door, .window { position: absolute; z-index: 2; bottom: 0; background: #4c7772; }
.door { width: 32px; height: 58px; left: 59px; }
.window { width: 28px; height: 30px; right: 18px; bottom: 40px; border: 4px solid #dff2ef; }
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
  .upcoming-panel { order: -1; }
  .upcoming-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upcoming-item:nth-child(odd) { border-right: 1px solid var(--border); }
  .form-layout, .detail-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 820px) {
  .topbar-inner, .page-shell { width: min(100% - 24px, 1440px); }
  .topbar-inner { min-height: 66px; }
  .nav-toggle { display: grid; place-items: center; }
  .main-nav { position: absolute; left: 12px; right: 12px; top: 72px; display: none; align-items: stretch; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: white; box-shadow: var(--shadow); }
  .main-nav.open { display: grid; }
  .main-nav > a, .link-button { width: 100%; text-align: left; }
  .page-shell { padding-top: 14px; }

  /* Dashboard: on phones the calendar is the main content, not the summary cards. */
  .dashboard-page .hero-card { min-height: 0; display: grid; gap: 17px; padding: 22px; border-radius: 22px; }
  .dashboard-page .hero-card h1 { font-size: clamp(1.85rem, 8vw, 2.5rem); }
  .dashboard-page .hero-card p { margin-top: 8px; font-size: .92rem; }
  .dashboard-page .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; gap: 8px; }
  .dashboard-page .hero-actions .btn { min-height: 40px; padding: 8px 10px; font-size: .8rem; }
  .dashboard-page .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
  .dashboard-page .stats-grid .stat-card:last-child { grid-column: auto; }
  .dashboard-page .stat-card { min-height: 86px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 12px; border-radius: 14px; }
  .dashboard-page .stat-card > span { font-size: .66rem; line-height: 1.2; }
  .dashboard-page .stat-card strong, .dashboard-page .stat-card strong.stat-date { font-size: 1.4rem; }
  .dashboard-page .stat-card small { max-width: 100%; overflow: hidden; font-size: .64rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-page .calendar-panel { order: -1; }
  .dashboard-page .upcoming-panel { order: 0; }

  .form-layout, .detail-layout, .settings-grid { grid-template-columns: 1fr; }
  .help-card, .meta-card { order: -1; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 44vh; padding: 40px 28px; }
  .login-visual h1 { font-size: clamp(2.7rem, 11vw, 5rem); }
  .login-panel { padding: 38px 24px; }
  .brand-login { margin-bottom: 35px; }
}

@media (max-width: 620px) {
  .page-heading { display: grid; align-items: start; }
  .page-heading .btn { width: 100%; }
  .content-grid { gap: 14px; }
  .panel-header { min-height: 72px; padding: 14px 16px; }

  .dashboard-page .hero-card { gap: 13px; padding: 18px; }
  .dashboard-page .hero-card .eyebrow { margin-bottom: 4px; font-size: .65rem; }
  .dashboard-page .hero-card h1 { font-size: 1.8rem; }
  .dashboard-page .hero-card p { display: none; }
  .dashboard-page .stats-grid { gap: 6px; margin: 10px 0 12px; }
  .dashboard-page .stat-card { min-height: 78px; padding: 10px; }
  .dashboard-page .stat-card > span { min-height: 2.4em; }
  .dashboard-page .stat-card strong, .dashboard-page .stat-card strong.stat-date { font-size: 1.27rem; }

  /* Use the whole phone width and give every calendar day more vertical room. */
  .dashboard-page .calendar-panel { width: calc(100% + 24px); margin-left: -12px; border-right: 0; border-left: 0; border-radius: 18px; }
  .calendar-header { align-items: center; }
  .calendar-header .eyebrow { margin-bottom: 3px; font-size: .65rem; }
  .calendar-header h2 { font-size: 1.2rem; }
  .calendar-nav { gap: 5px; }
  .calendar-nav .icon-btn { width: 38px; height: 38px; }
  .today-link { padding: 8px 7px; font-size: .76rem; }
  .calendar-scroll { overflow: visible; }
  .calendar-weekdays, .calendar-grid { min-width: 0; }
  .calendar-weekdays span { padding: 9px 2px; font-size: .65rem; }
  .calendar-day { min-height: 88px; padding: 7px 5px; }
  .day-number { min-height: 21px; font-size: .78rem; }
  .day-number em, .free-label, .booking-chip small { display: none; }
  .booking-chip { display: flex; align-items: center; gap: 5px; margin-top: 8px; padding: 7px 5px; border-radius: 8px; }
  .booking-dot { width: 6px; min-height: 23px; }
  .booking-chip strong { min-width: 0; overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-hint { padding: 10px 14px; font-size: .7rem; }

  .upcoming-list { grid-template-columns: 1fr; }
  .upcoming-item { grid-template-columns: 46px 1fr; gap: 11px; padding: 13px 15px; }
  .upcoming-item:nth-child(odd) { border-right: 0; }
  .date-tile { height: 50px; border-radius: 10px; }
  .date-tile strong { font-size: 1.05rem; }

  .form-grid.two-cols { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-section { padding: 22px 18px; }
  .form-actions { padding: 13px 18px; }
  .form-actions .btn { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div, .detail-grid > div:nth-child(2) { border-right: 0; }
  .detail-grid > div.span-2 { grid-column: auto; }
  .detail-actions { align-items: stretch; flex-direction: column-reverse; }
  .detail-actions form, .detail-actions .btn { width: 100%; }
  .detail-actions form .btn { width: 100%; }
  .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table th, .responsive-table td { display: block; }
  .responsive-table thead { display: none; }
  .responsive-table tr { padding: 13px; border-bottom: 1px solid var(--border); }
  .responsive-table td { padding: 5px; border: 0; white-space: normal; }
  .table-action { text-align: left; }
  .table-action .btn { width: 100%; margin-top: 8px; }
  .login-visual { min-height: 38vh; }
  .house-art { height: 40%; opacity: .55; }
  .house { left: 58%; transform: scale(.8); transform-origin: bottom; }
  .flash-stack { top: 78px; right: 12px; width: calc(100% - 24px); }
}

@media (max-width: 390px) {
  .dashboard-page .hero-actions .btn { padding-inline: 6px; font-size: .72rem; }
  .dashboard-page .stat-card { min-height: 74px; padding: 9px 8px; }
  .dashboard-page .stat-card > span { font-size: .61rem; }
  .dashboard-page .stat-card strong, .dashboard-page .stat-card strong.stat-date { font-size: 1.18rem; }
  .dashboard-page .stat-card small { font-size: .58rem; }
  .calendar-nav { gap: 3px; }
  .today-link { padding: 8px 4px; font-size: .72rem; }
  .calendar-day { min-height: 84px; padding-inline: 4px; }
  .booking-chip { padding-inline: 4px; }
  .booking-chip strong { font-size: .6rem; }
}

/* v1.2: Keep month navigation focused on the calendar. */
#calendar-section { scroll-margin-top: 86px; }

@media (max-width: 620px) {
  /* The monthly grid remains seven columns, but gains more height and clearer touch targets. */
  #calendar-section { scroll-margin-top: 76px; }
  .dashboard-page .calendar-panel { border-radius: 20px; }
  .dashboard-page .calendar-panel .panel-header { min-height: 82px; padding-top: 16px; padding-bottom: 16px; }
  .calendar-weekdays span { padding-block: 11px; font-size: .7rem; }
  .calendar-day {
    min-height: 108px;
    padding: 8px 5px;
  }
  .day-number {
    min-height: 28px;
    font-size: .88rem;
    font-weight: 850;
  }
  .day-number > span {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 50%;
  }
  .calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
  .calendar-day.is-today .day-number > span {
    color: white;
    background: var(--primary);
  }
  .calendar-day.is-booked {
    background: color-mix(in srgb, var(--member-color) 5%, white);
  }
  .booking-chip {
    min-height: 39px;
    display: grid;
    grid-template-columns: 6px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    margin-top: 11px;
    padding: 7px 5px;
  }
  .booking-dot {
    width: 6px;
    min-height: 27px;
  }
  .booking-chip strong {
    font-size: .69rem;
    line-height: 1.15;
  }
  .calendar-hint { padding-block: 12px; }
}

@media (max-width: 390px) {
  .calendar-day { min-height: 104px; }
  .day-number { font-size: .84rem; }
  .day-number > span { width: 25px; height: 25px; }
  .booking-chip { min-height: 37px; }
  .booking-chip strong { font-size: .64rem; }
}
