@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #111827;
  --muted: #64748b;
  --border: #d9e1ec;
  --accent: #f97316;
  --on-accent: #ffffff;
  --control-active: var(--accent);
  --control-active-text: #ffffff;
  --ghost-bg: #eef3f9;
  --ghost-border: #d5e0ec;
  --ghost-text: #111827;
  --soft-border: color-mix(in srgb, var(--border) 58%, transparent);
  --section-border: color-mix(in srgb, var(--border) 72%, transparent);
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --base-font: 16px;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { font-size: var(--base-font); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

html:has(.calendar-time-grid),
body:has(.calendar-time-grid) {
  height: 100%;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
a, button, input, select, textarea, label {
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-main { width: min(100%, 1120px); }

.auth-shell.setup-fullscreen-shell {
  display: block;
  padding: 0;
  background: var(--surface);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.auth-shell:has(.phone-setup) {
  display: block;
  padding: 0;
  background: var(--surface);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.auth-main.setup-fullscreen-main {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-main:has(.phone-setup) {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.login-card, .setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 40px);
}

.login-card {
  max-width: 460px;
  margin: auto;
  text-align: center;
}

.login-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 28px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-bottom: 0;
}

.app-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  min-height: 0;
  height: 100%;
  padding: 0 16px calc(104px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.swup-transition {
  transition: opacity .12s ease;
}

html.is-changing .swup-transition {
  pointer-events: none;
}

html.is-animating .swup-transition {
  opacity: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-items: center;
  min-height: calc(70px + env(safe-area-inset-top, 0px));
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 0;
}

.topbar h1, h1, h2, h3, p { margin-top: 0; }
.topbar h1 {
  margin: 0;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1;
  text-align: center;
}
.topbar-title h1,
.topbar-title .eyebrow {
  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(.2, .8, .2, 1);
}

.topbar-title.is-changing h1,
.topbar-title.is-changing .eyebrow {
  opacity: 0;
  transform: translateY(-6px);
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.topbar-actions, .inline-actions, .form-actions, .section-head, .toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head, .toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font-weight: 700;
  box-shadow: none;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}

.phone-setup .button.primary.large {
  box-shadow: none;
}
.button.ghost { background: var(--surface-2); }
.button.danger, .icon-button.danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); color: var(--danger); }
.button.large { width: 100%; min-height: 52px; }
.button.small, .icon-button.small { min-height: 34px; padding: 0 10px; }
.icon-button { width: 44px; padding: 0; }

.panel, .settings-tile, .appointment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.customer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  margin-bottom: 14px;
}

.panel h2 span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 13px;
}

.content-grid { display: grid; gap: 16px; }
.content-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.35;
  padding: 10px 12px;
  transition: border-color .14s ease, box-shadow .14s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea {
  border-radius: 24px;
  resize: none;
}

.stack-form { display: grid; gap: 16px; }
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  color: var(--text);
  background: var(--surface);
}

.toggle-row input { width: auto; min-height: auto; }

.flash {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--surface);
}
.flash-success { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); color: var(--success); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); color: var(--danger); }

.app-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(14px + env(safe-area-inset-top, 0px));
  z-index: 220;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--border));
  border-radius: 18px;
  background: var(--surface);
  color: var(--danger);
  font-size: 14px;
  font-weight: 740;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 18px 44px rgba(2, 6, 23, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(.98);
  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(.22, 1, .36, 1);
}

.app-notice.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-notice-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 13px;
  line-height: 1;
}

.app-notice-text {
  min-width: 0;
  text-align: left;
}

.app-notice[data-type="success"] {
  border-color: color-mix(in srgb, var(--success) 36%, var(--border));
  color: var(--success);
}

.app-notice[data-type="warning"] {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  color: var(--accent);
}

.app-notice[data-type="error"] {
  border-color: color-mix(in srgb, var(--danger) 36%, var(--border));
  color: var(--danger);
}

.app-confirm {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  place-items: end center;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  pointer-events: none;
}

.app-confirm.is-open {
  pointer-events: auto;
}

.app-confirm-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, .28);
  opacity: 0;
  transition: opacity .18s ease;
}

.app-confirm.is-open .app-confirm-backdrop {
  opacity: 1;
}

.app-confirm-card {
  position: relative;
  width: min(100%, 420px);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(2, 6, 23, .22);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(.22, 1, .36, 1);
}

.app-confirm.is-open .app-confirm-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-confirm-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 16px;
}

.app-confirm-card h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
  text-align: center;
}

.app-confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.app-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  pointer-events: none;
}

.bottom-nav-track {
  --bottom-nav-count: 3;
  --bottom-nav-index: 0;
  --bottom-nav-padding: 6px;
  --bottom-nav-height: 54px;
  --bottom-nav-cell: calc((100% - (var(--bottom-nav-padding) * 2)) / var(--bottom-nav-count));
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--bottom-nav-count), minmax(0, 1fr));
  align-items: stretch;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: var(--bottom-nav-padding);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
  overflow: hidden;
  isolation: isolate;
}

.bottom-nav-thumb {
  position: absolute;
  top: var(--bottom-nav-padding);
  bottom: var(--bottom-nav-padding);
  left: calc(var(--bottom-nav-padding) + (var(--bottom-nav-cell) * var(--bottom-nav-index)));
  width: var(--bottom-nav-cell);
  border-radius: calc(var(--bottom-nav-height) / 2);
  background: var(--accent);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: left .24s cubic-bezier(.2, .8, .2, 1);
}

.bottom-nav-track.has-active .bottom-nav-thumb {
  opacity: 1;
}

.bottom-nav-item {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: var(--bottom-nav-height);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: 7px 0 3px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  transition: color .18s ease;
}
.bottom-nav-item i {
  font-size: 17px;
  line-height: 1;
}

.bottom-nav-item span {
  line-height: 1;
  margin-top: 6px;
}
.bottom-nav-item.is-active {
  color: var(--on-accent);
}

.appointment-sheet[hidden] {
  display: none;
}

body.appointment-sheet-active {
  overflow: hidden;
}

.topbar,
.bottom-nav,
.app-main > :not(.appointment-sheet) {
  transition: filter .42s cubic-bezier(.22, 1, .36, 1);
}

body.appointment-sheet-backdrop-active .topbar,
body.appointment-sheet-backdrop-active .bottom-nav,
body.appointment-sheet-backdrop-active .app-main > :not(.appointment-sheet) {
  filter: blur(3px);
}

.appointment-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-items: end;
  padding: 0 12px calc(12px + var(--safe-bottom));
  opacity: 1;
  pointer-events: none;
}

.appointment-sheet.is-opening,
.appointment-sheet.is-open {
  pointer-events: auto;
}

.appointment-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, .34);
  opacity: 0;
  transition: opacity .42s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity;
}

.appointment-sheet.is-opening .appointment-sheet-backdrop,
.appointment-sheet.is-open .appointment-sheet-backdrop {
  opacity: 1;
}

.appointment-sheet.is-closing .appointment-sheet-backdrop {
  opacity: 0;
}

.appointment-sheet-panel {
  --sheet-drag-y: 0px;
  --sheet-radius: 30px;
  --sheet-padding: 12px;
  --sheet-action-size: 42px;
  --sheet-inner-radius: calc(var(--sheet-radius) - var(--sheet-padding));
  position: relative;
  width: min(100%, 680px);
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0 auto;
  padding: var(--sheet-padding);
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: var(--sheet-radius);
  background: var(--surface);
  box-shadow: none;
  overflow: visible;
  overscroll-behavior: contain;
  transform: translateY(calc(104% + var(--sheet-drag-y)));
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}

.appointment-sheet-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 -24px 70px rgba(2, 6, 23, .24);
  opacity: 0;
  pointer-events: none;
  transition: opacity .42s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity;
}

.appointment-sheet.is-opening .appointment-sheet-panel::before,
.appointment-sheet.is-open .appointment-sheet-panel::before {
  opacity: 1;
}

.appointment-sheet.is-closing .appointment-sheet-panel::before {
  opacity: 0;
}

.sheet-drag-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  transform: translateX(-50%);
  cursor: grab;
  touch-action: none;
  z-index: 4;
}

.sheet-drag-notch:active {
  cursor: grabbing;
}

.appointment-sheet.is-opening .appointment-sheet-panel,
.appointment-sheet.is-open .appointment-sheet-panel {
  transform: translateY(var(--sheet-drag-y));
}

.appointment-sheet.is-closing .appointment-sheet-panel {
  transform: translateY(calc(104% + var(--sheet-drag-y)));
}

.appointment-sheet-panel.is-dragging {
  transition: none;
}

.appointment-sheet-head {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--sheet-action-size, 42px) minmax(0, 1fr) var(--sheet-action-size, 42px);
  align-items: center;
  gap: 8px;
  min-height: var(--sheet-action-size, 42px);
  margin: 0 0 10px;
  padding: 0;
  background: var(--surface);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.appointment-sheet-panel.is-dragging .appointment-sheet-head {
  cursor: grabbing;
}

.appointment-sheet-head h2 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-icon-button {
  inline-size: var(--sheet-action-size, 42px);
  block-size: var(--sheet-action-size, 42px);
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  appearance: none;
}

.sheet-icon-button i {
  display: block;
  line-height: 1;
}

.sheet-save-button {
  background: var(--accent);
  color: var(--on-accent);
}

.appointment-sheet-form {
  display: grid;
  gap: 11px;
}

.appointment-sheet-form label {
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 820;
  line-height: 1.1;
}

.appointment-sheet-form input,
.appointment-sheet-form textarea,
.appointment-sheet-form .custom-select-button {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 760;
}

.appointment-sheet-form input,
.appointment-sheet-form textarea {
  padding: 10px 12px;
}

.appointment-sheet-form textarea {
  min-height: 102px;
  border-radius: 24px;
}

.appointment-sheet-form .form-status:empty {
  display: none;
  min-height: 0;
}

.appointment-sheet-form input:focus,
.appointment-sheet-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.appointment-sheet-form .custom-select-button {
  padding: 0 12px;
  box-shadow: none;
}

.appointment-sheet-form .custom-select-button i {
  width: 18px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 12px;
}

.appointment-sheet-form .custom-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
  max-height: min(226px, 34dvh);
  padding: 6px;
  border-color: color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 24px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, .12);
  transform: translateY(8px) scale(.98);
  transform-origin: bottom center;
}

.appointment-sheet-form .custom-select.is-open .custom-select-menu {
  transform: translateY(0) scale(1);
}

.appointment-sheet-form .custom-select-option {
  min-height: 40px;
  border-radius: 999px;
  font-weight: 760;
}

.customer-search-field {
  position: relative;
  z-index: 4;
}

.customer-search-field:has(.customer-search-results.is-open) {
  z-index: 40;
}

.customer-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  z-index: 45;
  display: grid;
  gap: 6px;
  max-height: min(260px, 38dvh);
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .14);
  opacity: 0;
  contain: paint;
  overflow-y: auto;
  pointer-events: none;
  transform: translate3d(0, -8px, 0) scale(.975);
  transform-origin: 50% 0;
  transition:
    opacity .2s ease,
    transform .24s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.customer-search-results[hidden] {
  display: none;
}

.customer-search-results.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.customer-search-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  font-weight: 750;
}

.customer-search-option.is-add {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.customer-search-option i {
  color: var(--accent);
}

.quick-customer-window[hidden] {
  display: none;
}

.quick-customer-window {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-items: end;
  padding: 12px;
  pointer-events: none;
}

.quick-customer-window.is-open {
  pointer-events: auto;
}

.quick-customer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, .38);
  opacity: 0;
  transition: opacity .2s ease;
  will-change: opacity;
}

.quick-customer-window.is-open .quick-customer-backdrop {
  opacity: 1;
}

.quick-customer-card {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(2, 6, 23, .24);
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(.985);
  transform-origin: 50% 100%;
  transition:
    opacity .2s ease,
    transform .26s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.quick-customer-window.is-open .quick-customer-card {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.quick-customer-form {
  display: grid;
  gap: 12px;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.appointment-form-actions {
  justify-content: flex-end;
}

.search-form {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 12px;
}
.search-form input { border: 0; background: transparent; }

.search-form input:focus {
  border-color: transparent;
  outline: none;
  box-shadow: none;
}

.customer-new-button {
  flex: 0 0 auto;
}

.button.primary.customer-new-button {
  box-shadow: none;
}

.customer-list, .settings-grid {
  display: grid;
  gap: 10px;
}

.customer-list {
  flex: 1 1 auto;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  min-height: 0;
  max-height: none;
  padding-bottom: calc(104px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  transition: opacity .12s ease;
}

.app-shell:has(.customer-list) {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-main:has(.customer-list) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.app-main:has(.customer-list) .toolbar {
  flex: 0 0 auto;
}

.customer-list.is-loading {
  opacity: .45;
}

.customer-card, .settings-tile, .list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.customer-card {
  min-height: 64px;
  align-self: start;
}
.customer-card > div:nth-child(2), .list-row > div { min-width: 0; flex: 1; }
.customer-card span, .list-row small, .muted, .empty-line { color: var(--muted); }
.customer-card strong,
.customer-card span {
  display: block;
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  white-space: nowrap;
}
.avatar.large { width: 72px; height: 72px; font-size: 24px; }

.sheet-icon-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.customer-detail-grid,
.appointment-detail-grid {
  display: grid;
  gap: 8px;
}

.sheet-info-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 30%, var(--surface));
}

.customer-detail-grid > div[hidden],
.appointment-detail-grid > div[hidden] {
  display: none !important;
}

.sheet-info-icon {
  inline-size: 38px;
  block-size: 38px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  color: var(--accent);
  font-size: 14px;
}

.sheet-info-icon i {
  display: block;
  line-height: 1;
}

.sheet-info-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sheet-info-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.1;
}

.sheet-info-copy strong {
  min-height: 20px;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sheet-info-item-notes {
  align-items: start;
  border-radius: 24px;
}

.sheet-info-item-notes .sheet-info-icon {
  margin-top: 1px;
}

.sheet-edit-button {
  background: var(--accent);
  color: var(--on-accent);
}

.customer-sheet-form {
  display: grid;
  gap: 11px;
}

.customer-sheet-form label {
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 820;
  line-height: 1.1;
}

.customer-sheet-form input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 760;
}

.customer-sheet-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.customer-sheet-form .form-status:empty {
  display: none;
  min-height: 0;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.appointment-card {
  --status-color: var(--accent);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-left: 4px solid var(--status-color);
}

.calendar-slot {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.calendar-slot::before {
  content: "";
  position: absolute;
  left: 58px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--section-border);
}

.appointment-time {
  position: relative;
  padding-top: 12px;
  color: var(--muted);
  text-align: right;
}

.appointment-time::after {
  content: "";
  position: absolute;
  top: 12px;
  right: -6px;
  bottom: -10px;
  width: 1px;
  background: var(--section-border);
}

.appointment-time strong,
.appointment-time span {
  display: block;
}

.appointment-time strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.1;
}

.appointment-time span {
  margin-top: 3px;
  font-size: 12px;
}

.appointment-main a {
  font-weight: 820;
}

.appointment-main p,
.appointment-main small {
  margin: 2px 0 0;
  color: var(--muted);
}

.calendar-grid-card {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: start;
  padding: 7px 8px;
  border-left-width: 3px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.calendar-grid-event.is-compact .calendar-grid-card {
  padding-block: 4px;
}

.calendar-grid-event.is-compact .calendar-grid-card .appointment-main small {
  display: none;
}

.calendar-grid-card,
.calendar-grid-card:active,
.calendar-grid-card:focus,
.calendar-grid-card:focus-visible {
  outline: none;
  background-color: var(--surface);
}

.calendar-grid-card .appointment-main {
  min-width: 0;
}

.calendar-grid-card .appointment-main strong,
.calendar-grid-card .appointment-main p,
.calendar-grid-card .appointment-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-grid-card .appointment-main strong {
  font-size: 12px;
  font-weight: 760;
  line-height: 1.1;
  color: var(--text);
}

.calendar-grid-card .appointment-main p,
.calendar-grid-card .appointment-main small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.15;
}

.calendar-toolbar {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
}

.calendar-view-switch {
  --calendar-view-count: 3;
  --calendar-view-index: 1;
  --calendar-view-padding: 3px;
  --calendar-view-height: 42px;
  --calendar-view-cell: calc((100% - (var(--calendar-view-padding) * 2)) / var(--calendar-view-count));
  position: relative;
  width: 100%;
  min-height: calc(var(--calendar-view-height) + (var(--calendar-view-padding) * 2));
  display: grid;
  grid-template-columns: repeat(var(--calendar-view-count), minmax(0, 1fr));
  align-items: stretch;
  padding: var(--calendar-view-padding);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
}

.calendar-view-thumb {
  position: absolute;
  top: var(--calendar-view-padding);
  bottom: var(--calendar-view-padding);
  left: calc(var(--calendar-view-padding) + (var(--calendar-view-cell) * var(--calendar-view-index)));
  width: var(--calendar-view-cell);
  border-radius: calc(var(--calendar-view-height) / 2);
  background: var(--surface-2);
  z-index: 0;
  pointer-events: none;
  transition: left .22s cubic-bezier(.2, .8, .2, 1);
}

.calendar-view-option {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: var(--calendar-view-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  transition: color .16s ease;
}

.calendar-view-option.is-active {
  color: var(--text);
}

.calendar-period-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
}

.calendar-period-row strong {
  min-width: 0;
  text-align: center;
  font-size: 16px;
}

.calendar-list {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
  transition: opacity .12s ease;
}

.app-shell:has(.calendar-time-grid) {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-main:has(.calendar-time-grid) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.calendar-list.panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.calendar-list.is-loading {
  opacity: .45;
}

.calendar-time-grid {
  --calendar-time-col: 52px;
  --calendar-hour-height: 96px;
  height: 100%;
  min-height: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--section-border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.calendar-grid-head,
.calendar-grid-body {
  display: grid;
  grid-template-columns: var(--calendar-time-col) minmax(0, 1fr);
}

.calendar-grid-head {
  flex: 0 0 auto;
  min-height: 48px;
  border-bottom: 1px solid var(--section-border);
  background: var(--surface);
}

.calendar-grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.calendar-time-corner {
  border-right: 1px solid var(--section-border);
}

.calendar-day-heads,
.calendar-day-columns {
  display: grid;
  grid-template-columns: repeat(var(--calendar-day-count), minmax(0, 1fr));
}

.calendar-day-head {
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 0;
  border-left: 1px solid var(--section-border);
  text-align: center;
}

.calendar-day-head:first-child,
.calendar-day-column:first-child {
  border-left: 0;
}

.calendar-day-head strong {
  font-size: 13px;
  line-height: 1.1;
}

.calendar-day-head span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-grid-body {
  height: calc(var(--calendar-hour-count) * var(--calendar-hour-height));
  min-width: 0;
}

.calendar-time-labels {
  display: grid;
  grid-template-rows: repeat(var(--calendar-hour-count), var(--calendar-hour-height));
  border-right: 1px solid var(--section-border);
  background: var(--surface);
}

.calendar-time-labels span {
  padding: 5px 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
}

.calendar-day-columns {
  position: relative;
  isolation: isolate;
  background: var(--surface);
}

.calendar-grid-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-rows: repeat(var(--calendar-hour-count), var(--calendar-hour-height));
  pointer-events: none;
}

.calendar-grid-lines span {
  border-top: 1px solid var(--section-border);
}

.calendar-grid-lines span:last-child {
  border-bottom: 1px solid var(--section-border);
}

.calendar-day-column {
  position: relative;
  z-index: 1;
  min-width: 0;
  border-left: 1px solid var(--section-border);
  background: transparent;
  cursor: crosshair;
}

.calendar-grid-event {
  position: absolute;
  top: var(--event-top);
  left: 4px;
  right: 4px;
  height: var(--event-height);
  min-height: 0;
  padding-block: 2px;
  z-index: 2;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  transition: opacity .14s ease, transform .14s ease;
  will-change: transform;
}

.calendar-grid-event.is-dragging {
  cursor: grabbing;
  opacity: .78;
  z-index: 8;
  transition: none;
}

.calendar-day-column.is-drop-target {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.calendar-list-empty {
  display: grid;
  place-items: center;
}

.calendar-list-empty .empty-state {
  transform: translateY(-60px);
}

.calendar-day-title {
  margin: 12px 0 2px 68px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.inline-reminder-form { display: flex; gap: 8px; margin: -2px 0 8px 68px; }
.inline-reminder-form select { max-width: 160px; }

.settings-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.settings-tile {
  min-height: 130px;
  align-items: flex-start;
  flex-direction: column;
}
.settings-tile i { color: var(--accent); font-size: 24px; }
.settings-tile span { color: var(--muted); }

.owner-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  background: var(--surface);
}

.owner-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 30px;
  font-weight: 900;
}

.owner-card-main span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.owner-card-main h2 {
  margin: 4px 0 2px;
  font-size: 26px;
  line-height: 1.05;
}

.owner-card-main p {
  margin: 0;
  color: var(--muted);
}

.passkey-panel {
  padding: 16px;
}

.passkey-panel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.passkey-panel-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-2));
  color: var(--accent);
  font-size: 22px;
}

.passkey-panel-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.passkey-panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.passkey-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.passkey-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--section-border);
  border-radius: calc(var(--radius) + 2px);
  background: color-mix(in srgb, var(--surface-2) 42%, var(--surface));
}

.settings-panel {
  display: grid;
  gap: 16px;
}

.settings-panel-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.settings-panel-head > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  color: var(--accent);
}

.settings-panel-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
}

.settings-panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.settings-form .button {
  justify-self: end;
}

.passkey-card-main {
  min-width: 0;
}

.passkey-card-main strong,
.passkey-card-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.passkey-card-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.form-status.centered {
  text-align: center;
}

.settings-logout {
  margin-top: 24px;
  padding-bottom: 8px;
}

.settings-logout form,
.settings-logout .button {
  width: 100%;
}

.settings-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  padding-bottom: 0;
  overflow: hidden;
}

html:has(.settings-page),
body:has(.settings-page) {
  height: 100%;
  overflow: hidden;
}

.app-shell:has(.settings-page) {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-main:has(.settings-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding-bottom: 0;
  overflow: hidden;
}

.settings-scroll-list {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding-bottom: calc(112px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
}

.settings-scroll-list label,
.settings-scroll-list button,
.settings-scroll-list input,
.settings-scroll-list .custom-select,
.settings-scroll-list .custom-select-button,
.settings-scroll-list .choice-pill {
  touch-action: pan-y;
}

.settings-hero,
.settings-section,
.settings-status-grid article {
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  background: var(--surface);
}

.settings-hero {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 30px;
}

.settings-hero-mark {
  inline-size: 58px;
  block-size: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 22px;
}

.settings-hero span,
.settings-days > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.settings-hero h2 {
  margin: 2px 0 1px;
  overflow: hidden;
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-hero p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-section {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 30px;
  flex: 0 0 auto;
  touch-action: pan-y;
}

.settings-section-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.settings-section-head > span {
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  color: var(--accent);
}

.settings-section-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.settings-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.settings-form label {
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.1;
}

.settings-form input,
.settings-form .custom-select-button {
  min-height: 52px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: var(--surface);
  font-size: 14px;
  font-weight: 740;
  line-height: 1.35;
}

.settings-form input {
  padding-block: 13px;
}

.settings-form .button {
  justify-self: end;
}

.settings-custom-select .custom-select-menu {
  max-height: min(246px, 36dvh);
}

.settings-days {
  display: grid;
  gap: 8px;
}

.settings-days .setup-choice-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.settings-days .choice-pill {
  min-height: 42px;
  justify-content: center;
  padding: 8px;
  font-size: 13px;
}

.settings-wide-action {
  width: 100%;
}

.settings-section .passkey-list {
  margin-top: 0;
}

.passkey-card {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  border-radius: 999px;
}

.passkey-card-icon {
  inline-size: 38px;
  block-size: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.settings-status-grid {
  display: grid;
  gap: 8px;
}

.settings-status-grid article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 66px;
  padding: 12px;
  border-radius: 999px;
}

.settings-status-grid i {
  grid-row: span 2;
  inline-size: 40px;
  block-size: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  color: var(--accent);
}

.settings-status-grid strong,
.settings-status-grid span {
  display: block;
  min-width: 0;
}

.settings-status-grid strong {
  overflow: hidden;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-status-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.settings-page .settings-logout {
  margin-top: 4px;
  padding-bottom: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 260px;
  padding: 24px;
  color: var(--muted);
}
.empty-state i { font-size: 38px; color: var(--accent); }
.empty-state i + h2 { margin-top: 10px; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state.compact { min-height: 180px; }

.phone-setup {
  --setup-action-height: 64px;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: max(22px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
}

.setup-phone-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.setup-phone-top h1 { margin-bottom: 0; }

.setup-dots {
  display: grid;
  grid-template-columns: repeat(var(--setup-step-count, 6), minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 0 0 26px;
}

.setup-dots span {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
}

.setup-dots span.is-active { background: var(--accent); }

.setup-wizard-form {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.setup-screen {
  display: none;
  min-height: 0;
  align-content: start;
  gap: 16px;
  opacity: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 calc(var(--setup-action-height) + 74px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: thin;
}

.setup-screen.is-active {
  display: grid;
  animation: setupStepForward .32s cubic-bezier(.2, .8, .2, 1) both;
}

.phone-setup[data-setup-direction="back"] .setup-screen.is-active {
  animation-name: setupStepBack;
}

.setup-screen h2 {
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1.05;
  margin-bottom: 0;
}

.setup-screen p {
  color: var(--muted);
  font-size: 17px;
  max-width: 640px;
}

#setupPasskeyStatus {
  width: 100%;
  max-width: none;
  text-align: center;
}

.setup-hero-icon { display: none; }

.setup-summary-list {
  display: grid;
  gap: 10px;
}

.setup-summary-list span,
.setup-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--section-border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
}

.setup-summary-list i { color: var(--success); }

.setup-finish-screen {
  min-height: 100%;
  place-content: center;
  text-align: center;
}

.setup-finish-screen h2 {
  font-size: clamp(42px, 12vw, 72px);
  line-height: .98;
  max-width: 760px;
  margin: 0 auto;
}

.setup-note {
  display: block;
  color: var(--muted);
  background: var(--surface-2);
}

.form-grid.single { grid-template-columns: 1fr; }

.phone-setup .form-grid { grid-template-columns: 1fr; }

.phone-setup input,
.phone-setup select,
.phone-setup textarea {
  min-height: 52px;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 999px;
}

.phone-setup textarea {
  border-radius: 24px;
}

.phone-setup input:focus,
.phone-setup select:focus,
.phone-setup textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.setup-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.choice-pill {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--soft-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
}

.choice-pill input { width: auto; min-height: auto; }

.agenda-setup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.agenda-setting {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--section-border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
}

.agenda-setting-wide { grid-column: auto; }

.agenda-setting strong {
  display: block;
  font-size: 16px;
  color: var(--text);
}

.agenda-setting small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.setup-segmented {
  --segment-count: 3;
  --segment-index: 0;
  --segment-padding: 5px;
  --segment-height: 44px;
  --segment-track-height: calc(var(--segment-height) + (var(--segment-padding) * 2));
  --segment-cell: calc((100% - (var(--segment-padding) * 2)) / var(--segment-count));
  position: relative;
  width: 100%;
  height: var(--segment-track-height);
  display: grid;
  grid-template-columns: repeat(var(--segment-count), minmax(0, 1fr));
  align-items: stretch;
  padding: var(--segment-padding);
  border: 1px solid var(--soft-border);
  border-radius: calc(var(--segment-track-height) / 2);
  background: var(--surface-2);
  overflow: hidden;
  isolation: isolate;
}

.setup-segmented-thumb {
  position: absolute;
  top: var(--segment-padding);
  bottom: var(--segment-padding);
  left: calc(var(--segment-padding) + (var(--segment-cell) * var(--segment-index)));
  width: var(--segment-cell);
  display: block;
  border-radius: calc(var(--segment-height) / 2);
  background: var(--accent);
  z-index: 0;
  transition: left .24s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}

.setup-segmented label {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: var(--segment-height);
  display: grid;
  place-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
}

.setup-segmented input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.setup-segmented label > span:not(.setup-segmented-thumb) {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 6px;
  border-radius: calc(var(--segment-height) / 2);
  color: currentColor;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transform: none;
  transition: color .18s ease;
}

.setup-segmented label > span:not(.setup-segmented-thumb) i {
  flex: 0 0 auto;
  line-height: 1;
}

.setup-segmented input:checked + span {
  color: var(--on-accent);
}

.custom-select {
  position: relative;
  z-index: 6;
}

.custom-select.is-open {
  z-index: 30;
}

.custom-select-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 2px solid var(--soft-border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
}

.custom-select-button:focus,
.custom-select.is-open .custom-select-button {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.custom-select-button i {
  color: var(--muted);
  transition: transform .2s ease;
}

.custom-select.is-open .custom-select-button i {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 6px;
  max-height: min(280px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 34px rgba(15, 23, 42, .14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(.98);
  transform-origin: top center;
  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(.2, .8, .2, 1);
  scrollbar-width: thin;
}

.custom-select.is-open .custom-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.custom-select-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.custom-select-option:active {
  transform: scale(.98);
}

.custom-select-option i {
  opacity: 0;
  color: currentColor;
}

.custom-select-option.is-selected {
  background: var(--accent);
  color: var(--on-accent);
}

.custom-select-option.is-selected i {
  opacity: 1;
}

.days-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.day-pill {
  justify-content: center;
  min-width: 0;
  padding: 10px 8px;
}

.day-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.day-pill span { font-weight: 900; }

.day-pill:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.setup-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px max(20px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  margin: 0;
  border-top: 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: none;
}

.setup-actions.has-back { grid-template-columns: 132px minmax(0, 1fr); }

.setup-actions:has([data-setup-back][hidden]) { grid-template-columns: 1fr; }

.setup-actions [hidden] { display: none !important; }
.setup-actions .button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: var(--setup-action-height);
  min-height: var(--setup-action-height);
  min-width: 0;
  margin: 0;
  padding: 0 18px;
  border-radius: calc(var(--setup-action-height) / 2);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.setup-actions .button[hidden] {
  display: none !important;
}

.setup-actions .button.ghost {
  background: color-mix(in srgb, var(--ghost-bg) 58%, transparent);
  border: 1px solid color-mix(in srgb, var(--ghost-border) 52%, transparent);
  color: var(--text);
  box-shadow: none;
}

.setup-actions .button.primary[data-setup-next] {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: fit-content !important;
  max-width: 100%;
  justify-self: end;
  height: var(--setup-action-height);
  min-height: var(--setup-action-height);
  margin: 0;
  border: 0;
  border-radius: calc(var(--setup-action-height) / 2);
  padding: 0 20px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 900;
  box-shadow: none;
}

.setup-actions .button.primary[data-setup-next] i {
  color: currentColor;
}

.setup-actions .button.primary[data-setup-next]:hover {
  transform: translateY(-1px);
}

@keyframes setupStepForward {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes setupStepBack {
  from {
    opacity: 0;
    transform: translateX(-34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 860px) {
  .content-grid.two, .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .topbar { align-items: center; }
  .appointment-card { grid-template-columns: minmax(0, 1fr) auto; }
  .calendar-time-grid {
    --calendar-time-col: 46px;
    --calendar-hour-height: 87px;
  }
  .profile-head { align-items: flex-start; flex-direction: column; }
  .owner-card, .passkey-panel-head { grid-template-columns: 1fr; }
  .passkey-panel-head .button { width: 100%; }
  .agenda-setup { grid-template-columns: 1fr; }
  .days-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .inline-reminder-form { margin-left: 0; }
}

@media (max-width: 430px) {
  .calendar-time-grid {
    --calendar-time-col: 38px;
  }

  .calendar-time-grid[data-calendar-days="3"] {
    --calendar-time-col: 34px;
  }

  .calendar-time-grid[data-calendar-days="3"] .calendar-grid-head {
    min-height: 44px;
  }

  .calendar-time-grid[data-calendar-days="3"] .calendar-day-head strong {
    font-weight: 700;
  }

  .calendar-time-grid[data-calendar-days="3"] .calendar-time-labels span {
    padding-right: 4px;
  }

  .calendar-time-grid[data-calendar-days="3"] .calendar-grid-event {
    left: 2px;
    right: 2px;
  }

  .calendar-time-grid[data-calendar-days="3"] .calendar-grid-card {
    padding: 5px 4px;
    border-left-width: 2px;
    border-radius: 9px;
  }

  .calendar-time-grid[data-calendar-days="3"] .calendar-grid-card .appointment-main strong {
    font-weight: 720;
  }

  .calendar-time-grid[data-calendar-days="3"] .calendar-grid-card .appointment-main p,
  .calendar-time-grid[data-calendar-days="3"] .calendar-grid-card .appointment-main small {
    margin-top: 1px;
    line-height: 1.1;
  }
}

@media (max-width: 520px) {
  .phone-setup {
    --setup-action-height: 58px;
  }

  .setup-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .setup-actions.has-back {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .setup-actions:has([data-setup-back][hidden]) {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .app-main { padding: 24px; }
}
