:root {
  color-scheme: light;
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #193b34;
  background: #f7f6f2;
  font-synthesis: none;
  --ink: #193b34;
  --muted: #53665d;
  --green: #155b49;
  --green-hover: #104c3d;
  --leaf: #eaf2e9;
  --surface: #fff;
  --line: #dce5db;
  --purple: #753e70;
  --error: #963b39;
  --shadow: 0 12px 32px #2542360a;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-inline-size: 0; }
h1, h2, p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .59; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #887198; outline-offset: 3px; }
[data-icon] { display: inline-grid; place-items: center; flex-shrink: 0; }
[data-icon] svg { display: block; width: 1em; height: 1em; }
.button [data-icon] svg { width: 16px; height: 16px; }
h1 { font-size: clamp(1.9rem, 3vw, 2.75rem); line-height: 1.09; letter-spacing: -.047em; }
h2 { font-size: 1.15rem; line-height: 1.23; letter-spacing: -.022em; }

.brand { width: 162px; height: auto; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 42px;
  padding: .6rem .88rem;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: center;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.25;
}

.button.primary { background: var(--green); color: white; }
.button.primary:hover:not(:disabled) { background: var(--green-hover); }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: var(--leaf); border-color: #c4d8ca; }
.button.text { background: transparent; color: var(--purple); }
.button.text:hover:not(:disabled) { text-decoration: underline; }
.button.danger { background: #fff6f4; border-color: #f1d6d2; color: var(--error); }
.button.danger:hover:not(:disabled) { background: #fdebe7; }

label { color: var(--ink); font-size: .85rem; font-weight: 650; }
input, select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: .67rem .8rem;
  min-height: 44px;
  border: 1px solid #cad7cc;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
textarea { resize: vertical; }

.global-status {
  position: fixed;
  z-index: 2;
  inset: auto 1rem 1rem auto;
  max-width: min(420px, calc(100% - 2rem));
  padding: .8rem .95rem;
  border: 1px solid #e7dad0;
  border-radius: 10px;
  background: #fff9ee;
  color: #664834;
  box-shadow: var(--shadow);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.global-status:empty { opacity: 0; pointer-events: none; padding: 0; border: 0; }
.global-status.error, .global-status[data-kind='error'] { background: #fff6f4; color: var(--error); }
.preview-badge {
  position: fixed;
  z-index: 1;
  inset: auto 1rem 1rem auto;
  padding: .38rem .65rem;
  border: 1px solid #dfd0e1;
  border-radius: 999px;
  color: #663d65;
  background: #f7eff5;
  font-size: .75rem;
  font-weight: 650;
}
.global-status:not(:empty) + .preview-badge { bottom: 5rem; }

.auth-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 5vw, 4rem);
  background: linear-gradient(145deg, #edf2e9 0%, #f7f6f2 46%, #f3eee6 100%);
}
.auth-card {
  display: grid;
  grid-template-columns: 1fr .94fr;
  width: min(100%, 970px);
  min-height: min(570px, 87dvh);
  overflow: hidden;
  border: 1px solid #dce4d9;
  border-radius: 23px;
  background: var(--surface);
  box-shadow: 0 23px 56px #25423613;
}
.auth-content {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.4rem;
  padding: clamp(1.5rem, 4vw, 3.25rem);
}
.auth-panel { align-self: center; width: 100%; max-width: 375px; }
.auth-form { display: grid; gap: .55rem; }
.auth-form > p { margin: .65rem 0 1rem; color: var(--muted); line-height: 1.55; }
.auth-form .primary { margin-top: .42rem; min-height: 46px; }
.auth-form .text { justify-self: start; padding-inline: 0; }
.auth-form .local-code {
  margin: 0 0 .3rem;
  padding: .56rem .72rem;
  border: 1px solid #ded3e2;
  border-radius: 8px;
  background: #f6f0f6;
  color: #653861;
  font-variant-numeric: tabular-nums;
}
#code { letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.auth-photo {
  min-width: 0;
  background: #eee7db url('./assets/calendar-desk.png') 67% center / cover no-repeat;
}


.app-shell {
  --shell-width: 1100px;
  --nav-height: 76px;
  min-height: 100dvh;
  padding-block-end: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: #f5f6f8;
  color: #202b2b;
}

.app-header {
  position: sticky;
  z-index: 3;
  inset-block-start: 0;
  padding-block-start: env(safe-area-inset-top);
  border-block-end: 1px solid #e8ebea;
  background: #fff;
}
.header-content, .app-content, .nav-inner {
  width: min(100%, var(--shell-width));
  margin-inline: auto;
  padding-inline: clamp(15px, 3.3vw, 38px);
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  min-height: 64px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 14px);
  min-width: 0;
}
.brand-link { display: block; min-width: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.header-brand .brand { width: clamp(111px, 15vw, 163px); }
.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #d7e3d9;
  border-radius: 6px;
  padding: 4px 7px;
  background: #eef5ef;
  color: #3c6355;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .055em;
  line-height: 1;
  white-space: nowrap;
}
.plan-badge:is([data-plan='pro'], [data-active='true'], .is-pro) { border-color: #eaddeb; background: #f4ecf5; color: #754b77; }
.language-control {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  inline-size: min(9rem, 42vw);
  min-block-size: 37px;
  padding-inline: 21px;
  border: 1px solid #e0e7e1;
  border-radius: 9px;
  background: var(--surface);
  color: #456050;
  font-size: .84rem;
  font-weight: 630;
}
.language-control:hover { border-color: #c4d8ca; background: #f8faf8; }
.language-control:focus-within { outline: 3px solid #887198; outline-offset: 3px; }
.language-display { display: inline-flex; align-items: center; gap: 6px; max-inline-size: 100%; }
#language-name { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-display svg { width: 16px; height: 16px; }
.language-chevron { position: absolute; inset-inline-end: 8px; inset-block-start: 50%; transform: translateY(-50%); }
.language-chevron svg { width: 12px; height: 12px; }
.language-control select {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.app-content { padding-block: clamp(14px, 2.7vw, 26px) clamp(16px, 2.4vw, 30px); }
.workspace-controls {
  display: grid;
  align-items: stretch;
  gap: 8px 12px;
  margin-block-end: 17px;
}
.role-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #e0e7e2;
  border-radius: 11px;
  background: #fff;
}
.role-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #55695e;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}
.role-switch button:hover:not(.is-active) { background: #f5f8f6; }
.role-switch button:is(.is-active, [aria-pressed='true']) { background: #eaf3ef; color: #174f55; font-weight: 700; }
#personal-role:is(.is-active, [aria-pressed='true']) { background: #f4edf5; color: #794876; }
.role-switch button svg { flex: 0 0 16px; width: 16px; height: 16px; }
.business-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  border: 1px solid #e0e7e2;
  border-radius: 10px;
  padding: 7px 11px 7px 8px;
  background: #fff;
  color: #274d43;
  text-align: start;
}
.business-control:hover { border-color: #bad0c1; background: #f9fcfa; }
.button.business-control { justify-content: flex-start; text-align: start; }
.business-trigger-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px; background: #eaf3ef; color: #315f50; }
.business-trigger-icon svg { width: 17px; height: 17px; }
.business-trigger-label { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.business-trigger-label small { color: #506b60; font-size: .72rem; font-weight: 620; }
.business-trigger-label strong { color: #405f50; font-size: .95rem; font-weight: 720; }
.business-trigger-action { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto; color: #315f50; font-size: .81rem; font-weight: 680; }
.business-trigger-action svg { flex: 0 0 13px; width: 13px; height: 13px; }
.header-date { justify-self: end; align-self: center; color: #5e6f66; font-size: .82rem; }
.workspace-heading { display: grid; gap: .32rem; margin-block-end: .85rem; }
.workspace-heading h1, .workspace-heading h2 { color: #213934; font-size: clamp(1.55rem, 2.6vw, 2.2rem); }
.workspace-heading p { color: #526458; font-size: .86rem; line-height: 1.5; }
.workspace-heading p:first-child { color: #536c5c; font-size: .7rem; font-weight: 630; letter-spacing: .055em; text-transform: uppercase; }

.business-dialog {
  width: min(780px, calc(100% - 1.3rem));
  max-height: calc(100% - 1.3rem);
  border: 1px solid #dce6da;
  border-radius: 15px;
  padding: 0;
  color: #203c32;
  box-shadow: 0 20px 55px #1f342e24;
}
.business-dialog::backdrop { background: #172e2690; }
.business-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); gap: .65rem; margin-block: .9rem; }
.business-option { display: grid; grid-template-rows: auto 1fr; width: 100%; overflow: hidden; border: 1px solid #e0e7e2; border-radius: 10px; padding: 0; background: #fff; color: #274d43; text-align: start; }
.business-option:hover, .business-option[aria-pressed='true'] { border-color: #75a693; box-shadow: 0 0 0 1px #75a693; }
.business-option img { width: 100%; height: 82px; object-fit: cover; }
.business-option span { padding: .65rem; font-size: .84rem; font-weight: 670; line-height: 1.3; overflow-wrap: anywhere; }

.page-panel { min-width: 0; }
.workspace-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(340px, 40vw, 485px);
  overflow: hidden;
  border: 1px solid #e4e5dc;
  border-radius: 15px;
  background: #f8f5ef;
  color: #174f55;
}
.hero-photo {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.workspace-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #f7f3ea 6%, #f7f3eaf5 25%, #f7f3eab0 46%, #f7f3ea12 75%);
}
.hero-content { width: 65%; max-width: 570px; padding: clamp(26px, 5vw, 58px); }
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-block-end: .9rem;
  color: #785275;
  font-size: .72rem;
  font-weight: 730;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-eyebrow::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #a9c69d; }
.hero-content h1, .hero-content h2 { font-size: clamp(1.9rem, 4.1vw, 3.35rem); line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; }
.hero-content p:not(.hero-eyebrow) { margin-block-start: .9rem; color: #475f53; font-size: clamp(.97rem, 1.5vw, 1.12rem); line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 1.5rem; }
.hero-actions .button { min-height: 44px; padding-inline: 14px; }
.workspace-hero:is(.business, .is-business, [data-role='business']):not([data-workspace='personal']),
.app-shell:has(#business-role[aria-pressed='true']) .workspace-hero {
  border-color: #254637;
  background: #16392b;
  color: #fff;
}
.workspace-hero:is(.business, .is-business, [data-role='business']):not([data-workspace='personal'])::before,
.app-shell:has(#business-role[aria-pressed='true']) .workspace-hero::before {
  background: linear-gradient(90deg, #092e26ef 0%, #0b3025dc 28%, #0c312581 55%, #1033230a 83%);
}
.workspace-hero:is(.business, .is-business, [data-role='business']) .hero-eyebrow,
.app-shell:has(#business-role[aria-pressed='true']) .hero-eyebrow { color: #e0e9d9; }
.workspace-hero:is(.business, .is-business, [data-role='business']) .hero-content p:not(.hero-eyebrow),
.app-shell:has(#business-role[aria-pressed='true']) .hero-content p:not(.hero-eyebrow) { color: #f0f4ed; }

.agenda-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-block-end: 14px;
}
.agenda-heading h1, .settings-heading h1, #settings-panel > h1 {
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  color: #213934;
}
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: start; gap: clamp(12px, 2.2vw, 21px); }
.calendar-card, .daily-card, .settings-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e0e7e3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px #26483a06;
}
.calendar-hero {
  position: relative;
  isolation: isolate;
  min-height: 94px;
  padding: 13px 15px;
  overflow: hidden;
  background: #f9f5ee;
}
.calendar-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  inset-inline-start: auto;
  width: min(64%, 320px);
  background: url('./assets/calendar-desk.png') right 47% / cover no-repeat;
  mask-image: linear-gradient(to right, transparent, #000 56%);
  opacity: .72;
  pointer-events: none;
}
html[dir='rtl'] .calendar-hero::before { mask-image: linear-gradient(to left, transparent, #000 56%); }
.calendar-hero h2 { margin-block-end: 8px; color: #334e39; font-size: 1rem; }
.calendar-date-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid #d9e4db;
  border-radius: 8px;
  padding: 6px 12px;
  background: #fffffff2;
  color: #174a3e;
  font-size: .88rem;
  font-weight: 680;
  text-align: start;
}
.calendar-date-button:hover { border-color: #aec7b8; background: #fff; }
.calendar-date-button svg { flex: 0 0 17px; width: 17px; height: 17px; }
.upcoming { padding: 11px 12px 10px; }
.upcoming h2, .upcoming h3, .upcoming > p { margin: 0 0 7px; color: #3e5c4d; font-size: .79rem; font-weight: 700; }
.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 4px;
  overflow-x: auto;
  direction: ltr;
}
.upcoming-day, .calendar-grid > button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .15rem;
  min-width: 0;
  min-height: 58px;
  padding: .18rem .05rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f2f5f3;
  color: #24483e;
  font-variant-numeric: tabular-nums;
}
.upcoming-day:first-child { position: sticky; left: 0; z-index: 1; }
.upcoming-day:hover, .calendar-grid > button:hover:not(:disabled) { border-color: #86b29d; }
.upcoming-day[aria-pressed='true'], .calendar-grid > button[aria-pressed='true'] {
  border-color: #276553;
  box-shadow: inset 0 0 0 1px #276553, inset 0 0 0 2px #fff;
}
.upcoming-day:focus-visible, .calendar-grid > button:focus-visible { outline: 2px solid #3f7964; outline-offset: -3px; }
.upcoming-day > span, .upcoming-day > small { font-size: .65rem; line-height: 1.12; }
.upcoming-day > strong { font-size: .96rem; line-height: 1; }
.upcoming-day .empty-mark { color: #9b3942; }
:is(.upcoming-day, .calendar-grid > button)[data-count='low'] { background: #e5f1e8; }
:is(.upcoming-day, .calendar-grid > button)[data-count='medium'] { background: #cbe5d6; }
:is(.upcoming-day, .calendar-grid > button)[data-count='busy'] { background: #a8d3bc; }
:is(.upcoming-day, .calendar-grid > button)[data-count='high'] { background: #22624f; color: #fff; }
.calendar-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px 12px;
  min-height: 44px;
  border-block-start: 1px solid #e5ece6;
}
.calendar-footer .button { min-height: 32px; padding-block: 4px; background: #edf5ef; color: #355e4e; }
#sync-status { color: #3f6452; font-size: .74rem; font-weight: 630; }
#sync-status:empty { display: none; }

.month-dialog {
  width: min(550px, calc(100% - 1.3rem));
  max-height: calc(100% - 1.3rem);
  border: 1px solid #dce6da;
  border-radius: 15px;
  padding: 0;
  color: #203c32;
  box-shadow: 0 20px 55px #1f342e24;
}
.month-dialog::backdrop { background: #172e2690; }
.calendar-header, .daily-header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.calendar-header { margin-block-end: .85rem; }
#calendar-title:first-letter, #selected-date:first-letter { text-transform: uppercase; }
.calendar-actions { display: flex; gap: .35rem; }
.calendar-actions .button { min-height: 38px; }
.calendar-actions .icon-button { width: 38px; padding: 0; font-size: 1.45rem; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .29rem; }
.calendar-weekdays { margin-block-end: .42rem; color: #52685c; text-align: center; font-size: .75rem; font-weight: 620; }
.calendar-grid > button { min-height: clamp(42px, 5.5vw, 58px); font-size: .92rem; font-weight: 650; }
.calendar-grid > button:disabled, .calendar-grid > button.outside-month:not([data-count]) { background: #fbfbfa; color: #687d70; }
.calendar-grid > button[aria-current='date']:not([aria-pressed='true']) { box-shadow: inset 0 0 0 1px #47806a; }
.calendar-grid > button small, .calendar-grid .day-count { font-size: .65rem; line-height: 1; font-weight: 670; }
.month-dialog > .button, .month-close { margin-block-start: 1rem; }

.daily-header { flex-wrap: wrap; padding: clamp(.8rem, 2vw, 1.15rem); border-block-end: 1px solid #e7ede5; }
.daily-header h2 { color: #304c3c; font-size: 1.04rem; }
.daily-header #selected-date { margin-block-start: 4px; color: #5a6d61; font-size: .8rem; }
.daily-agenda { display: grid; gap: 12px; min-width: 0; }
.agenda-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px; }
.agenda-stats:empty { display: none; }
.agenda-stats > * { position: relative; display: grid; gap: 4px; min-width: 0; border: 1px solid #e0e7e3; border-radius: 12px; padding: 12px; background: #fff; color: #34584a; }
.agenda-stats strong { color: #28473b; font-size: 1.44rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.agenda-stats :is(p, small) { color: #52685d; font-size: .75rem; line-height: 1.35; }
.agenda-stats .stat-title { font-weight: 660; }
.agenda-stats [data-icon] { position: absolute; inset-block-start: 9px; inset-inline-end: 9px; width: 24px; height: 24px; border-radius: 6px; background: #edf5ee; color: #376a55; font-size: .81rem; }
.list-count { min-width: 22px; border-radius: 4px; padding: 3px 5px; background: #edf4ee; color: #3c654e; font-size: .74rem; font-weight: 680; text-align: center; }
.agenda-filters { display: grid; gap: .52rem; padding: .7rem clamp(.8rem, 2vw, 1.15rem) .25rem; }
.status-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.status-filters button { min-height: 33px; padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: #50685b; font-size: .75rem; font-weight: 610; }
.status-filters button:hover { background: #f3f7f2; }
.status-filters button:is(.is-active, [aria-pressed='true'], [aria-selected='true']) { background: #eaf4ed; color: #315b49; font-weight: 710; }
.agenda-search { position: relative; display: block; }
.agenda-search [data-icon] { position: absolute; inset-block: 0; inset-inline-start: .7rem; color: #567363; }
.agenda-search input { min-height: 41px; padding-inline-start: 2rem; font-size: .88rem; }
.plus-icon { position: relative; width: 14px; height: 14px; flex: 0 0 14px; }
.plus-icon::before, .plus-icon::after { content: ''; position: absolute; inset: 6px 1px auto; height: 1.5px; border-radius: 1px; background: currentColor; }
.plus-icon::after { transform: rotate(90deg); }
.appointment-list { list-style: none; margin: 0; padding: 0 clamp(.8rem, 2vw, 1.15rem); }
.appointment-list > li { padding: .85rem 0; overflow-wrap: anywhere; }
.appointment-list > li + li { border-block-start: 1px solid #e7ede5; }
.appointment-list p { margin: .3rem 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.appointment-list time { margin-inline-end: .35rem; color: #306650; font-size: .85rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.appointment-list button { display: flex; min-height: 36px; margin: .35rem 0 0; padding-inline: 0; }
.appointment-list .empty { color: var(--muted); }
.appointment-row .appointment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-block-end: 5px; }
.appointment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-block-start: 6px; }
.appointment-actions .button { min-width: 36px; margin: 0; padding-inline: .46rem; }
.appointment-state {
  display: inline-block;
  border-radius: 5px;
  padding: 3px 6px;
  background: #eaf4ed;
  color: #355e4b;
  font-size: .71rem;
  font-weight: 650;
}
.appointment-state[data-state='pending'] { color: #795529; background: #fbf1e1; }
.appointment-state[data-state='cancelled'] { color: #983c40; background: #f9ebec; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.2vw, 20px);
  margin-block-start: 14px;
}
.settings-card { display: grid; align-content: start; gap: 9px; padding: clamp(14px, 2.25vw, 24px); }
.settings-summary { grid-template-rows: auto auto 1fr auto; }
.settings-card h2 { color: #174f55; }
.settings-card p { color: var(--muted); font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
.settings-card p:empty { display: none; }
.settings-card .button { justify-self: start; }
.settings-summary > .button { inline-size: min(12rem, 100%); overflow-wrap: anywhere; }
.settings-option-list { display: grid; }
.settings-option-list > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  min-block-size: 45px;
  padding: .55rem .1rem;
  border: 0;
  border-block-end: 1px solid #e9efea;
  background: transparent;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 650;
  text-align: start;
}
.settings-option-list > button:last-child { border-block-end: 0; }
.settings-option-list > button:hover { background: #f5f9f6; }
.settings-option-list [data-icon] { color: #4f6a5c; transform: rotate(-90deg); }
[dir='rtl'] .settings-option-list [data-icon] { transform: rotate(90deg); }
.settings-dialog { width: min(calc(100% - 24px), 550px); }
.settings-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-dialog-header .button { flex-shrink: 0; }
.settings-detail-form, .settings-detail-copy { display: grid; gap: 10px; }
.settings-detail-form > .button { justify-self: start; }
.settings-detail-copy p, .settings-detail-status { color: var(--muted); font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.settings-detail-copy h3, .settings-detail-copy dl { margin: 0; }
.settings-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-detail-status:empty { display: none; }
.settings-detail-status[data-kind='error'] { color: var(--error); }
.settings-faq-list { display: grid; gap: 7px; }
.settings-faq { padding: .67rem .76rem; border: 1px solid var(--line); border-radius: 9px; }
.settings-faq summary { cursor: pointer; font-weight: 650; }
.settings-faq p { margin-block-start: .55rem; }
.settings-about-brand { display: block; width: 144px; height: auto; }
.setting-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #eaf3ef; color: #225b48; font-size: 19px; }

.app-navigation {
  position: fixed;
  z-index: 3;
  inset: auto 0 0;
  border-block-start: 1px solid #e4eae5;
  padding-block-end: env(safe-area-inset-bottom);
  background: #fff;
}
.nav-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  min-height: var(--nav-height);
  gap: 6px;
  padding-block: 7px;
}
.nav-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #556d60;
  font-size: .8rem;
  font-weight: 640;
  line-height: 1.2;
  text-align: center;
}
.nav-link svg { width: 20px; height: 20px; }
.nav-link:hover { background: #f1f7f2; }
.nav-link[aria-current='page'] { background: #eaf4ee; color: #185744; }
body:has(.app-shell:not([hidden])) .global-status, body:has(.app-shell:not([hidden])) .preview-badge { bottom: calc(84px + env(safe-area-inset-bottom)); }
body:has(.app-shell:not([hidden])) .global-status:not(:empty) + .preview-badge { bottom: calc(136px + env(safe-area-inset-bottom)); }

.agenda-dialog {
  width: min(515px, calc(100% - 1.25rem));
  max-height: calc(100% - 1.25rem);
  padding: 0;
  border: 1px solid #dce6da;
  border-radius: 17px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 20px 55px #1f342e24;
  overflow: auto;
}
.agenda-dialog::backdrop { background: #172e2690; }
.dialog-form { display: grid; gap: .52rem; padding: clamp(1rem, 4vw, 1.6rem); }
.dialog-form h2 { margin-bottom: .5rem; font-size: 1.45rem; }
.dialog-form label:not(:first-child) { margin-top: .22rem; }
.dialog-row, .dialog-field, .additional-fields { display: grid; gap: .52rem; }
.dialog-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.additional-fields:empty { display: none; }
.dialog-actions { display: flex; justify-content: end; gap: .45rem; flex-wrap: wrap; padding-top: .4rem; }
.dialog-actions .danger { margin-right: auto; }
.appointment-error { color: var(--error); font-size: .87rem; line-height: 1.45; }
.appointment-error:empty { display: none; }


@media (min-width: 740px) {
  .workspace-controls { grid-template-columns: minmax(255px, .85fr) minmax(255px, 1fr) minmax(110px, auto); }
  .role-switch { grid-column: 1; }
  .business-control { grid-column: 2; }
  .header-date { grid-column: 3; }
}

@media (max-width: 739px) {
  .app-shell { --nav-height: 66px; }
  .header-content { min-height: 60px; }
  .workspace-controls { margin-block-end: 13px; }
  .workspace-hero { display: grid; min-height: clamp(420px, 97vw, 500px); align-items: end; }
  .hero-photo { object-position: right top; }
  .workspace-hero::before { background: linear-gradient(180deg, transparent 19%, #f6f2e941 38%, #f7f3ea 68%); }
  .workspace-hero:is(.business, .is-business, [data-role='business']):not([data-workspace='personal'])::before,
  .app-shell:has(#business-role[aria-pressed='true']) .workspace-hero::before {
    background: linear-gradient(180deg, transparent 14%, #1033233a 34%, #103323ec 72%, #103323fa 100%);
  }
  .hero-content { width: 100%; max-width: 540px; padding: 24px 21px 26px; }
  .hero-content h1, .hero-content h2 { font-size: clamp(2rem, 6.2vw, 2.8rem); }
  .hero-actions .button { flex: 1 1 155px; }
  .agenda-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .auth-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-panel { max-width: none; }
  .auth-photo { min-height: clamp(115px, 28vw, 165px); background-position: 58% 48%; }
}

@media (max-width: 440px) {
  .header-content { gap: .55rem; }
  .role-switch button { font-size: .79rem; }
  .hero-actions .button { flex-basis: 100%; }
  .agenda-heading .primary { flex-basis: 100%; }
  .calendar-weekdays, .calendar-grid { gap: .2rem; }
  .calendar-grid > button { font-size: .86rem; }
  .calendar-actions .icon-button { width: 33px; }
  .calendar-actions .button { padding-inline: .48rem; }
  .agenda-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .business-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.social-login {
  display: grid;
  gap: .55rem;
  margin-bottom: .75rem;
}

.social-login .button {
  width: 100%;
  min-height: 44px;
}

.social-login .google-mark {
  display: inline-flex;
}

.social-login .social-apple {
  color: #fff;
  background: #161b19;
  border-color: #161b19;
}

.social-login .social-apple:hover:not(:disabled) {
  background: #303633;
}

.social-divider {
  font-size: .86rem;
  text-align: center;
  margin: .15rem 0 0;
}

