:root {
  --paper: #f4f1eb;
  --paper-deep: #ebe7df;
  --surface: #fffdf9;
  --surface-quiet: #f9f7f2;
  --ink: #242522;
  --muted: #777870;
  --muted-light: #a5a59c;
  --line: #e5e1d8;
  --line-strong: #d7d2c8;
  --accent: #b96d50;
  --accent-deep: #934e38;
  --sage: #497d6f;
  --sage-light: #dfece6;
  --sand: #eed9bd;
  --warning: #c18a45;
  --danger: #b9534b;
  --sidebar: #292b27;
  --sidebar-muted: #a8aba1;
  --shadow: 0 16px 45px rgba(60, 54, 44, 0.06);
  --radius: 14px;
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .calendar-scroll:focus-visible { outline: 3px solid rgba(185, 109, 80, 0.28); outline-offset: 2px; }

.icon { display: block; flex: 0 0 auto; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; display: flex; flex-direction: column; padding: 28px 15px 18px; color: #f8f6f0; background: var(--sidebar); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: inherit; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--sidebar); background: #e7c9a8; border-radius: 11px 11px 11px 3px; font: 600 22px/1 "Fraunces", Georgia, serif; transform: rotate(-5deg); }
.brand b, .brand small { display: block; }
.brand b { font-size: 16px; line-height: 1.1; letter-spacing: -0.04em; }
.brand small { margin-top: 3px; color: var(--sidebar-muted); font: 500 10px/1 "DM Mono", monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.sidebar-label { margin: 56px 13px 12px; color: #767a72; font: 500 10px/1 "DM Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.sidebar-label-bottom { margin-top: 34px; }
.main-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 0 13px; color: var(--sidebar-muted); border-radius: 10px; font-size: 13px; transition: color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.07); transform: translateX(2px); }
.nav-item.active { color: #fbf8f1; background: #42443e; box-shadow: inset 3px 0 0 #e0a178; }
.sidebar-footer { margin-top: auto; }
.account-chip { display: flex; align-items: center; gap: 9px; padding: 12px 10px; border-top: 1px solid #454840; }
.account-avatar { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; color: #614b3f; background: #e9c4a3; border-radius: 50%; font-size: 10px; font-weight: 700; }
.account-chip b, .account-chip small { display: block; }
.account-chip b { color: #ece9e1; font-size: 11px; font-weight: 600; }
.account-chip small { margin-top: 2px; color: #8f938b; font-size: 10px; }
.account-status { width: 6px; height: 6px; margin-left: auto; background: #79ae81; border-radius: 50%; }
.demo-note { padding: 12px 13px 0; color: #747970; font-size: 10px; line-height: 1.45; }
.demo-note span { color: #5f645c; }

.main-content { width: calc(100% - 248px); max-width: 1500px; min-width: 0; padding: 0 44px 52px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 78px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted-light); font-size: 12px; }
.breadcrumb i { color: #c4c1b7; font-style: normal; }
.breadcrumb b { color: var(--ink); font-weight: 600; }
.topbar-actions, .calendar-actions, .modal-foot-actions { display: flex; align-items: center; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 600; white-space: nowrap; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: #fffaf5; background: var(--accent); box-shadow: 0 5px 12px rgba(185, 109, 80, 0.16); }
.button-primary:hover { background: var(--accent-deep); }
.button-quiet { color: #676963; background: transparent; }
.button-quiet:hover { color: var(--ink); background: rgba(255, 255, 255, 0.55); }
.button-outline { color: #5e625c; background: var(--surface); border-color: var(--line-strong); }
.button-outline:hover { color: var(--ink); background: #fff; border-color: #aaa99f; }
.button-danger { color: var(--danger); background: #fff7f5; border-color: #efd3cc; }
.button-danger:hover { background: #fbeae6; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; color: #6e706a; background: transparent; border: 1px solid var(--line); border-radius: 9px; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.icon-button:hover { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 42px 0 28px; }
.eyebrow, .section-kicker { color: var(--muted); font: 500 10px/1.2 "DM Mono", monospace; letter-spacing: 0.11em; text-transform: uppercase; }
.page-heading h1 { margin: 9px 0 9px; font: 600 clamp(26px, 3vw, 36px)/1.05 "Fraunces", Georgia, serif; letter-spacing: -0.045em; }
.page-heading p { max-width: 590px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.heading-meta { display: inline-flex; align-items: center; gap: 7px; padding-bottom: 7px; color: var(--sage); font: 500 11px "DM Mono", monospace; white-space: nowrap; }
.live-dot { display: inline-block; width: 7px; height: 7px; background: #70a47e; border-radius: 50%; box-shadow: 0 0 0 4px rgba(112, 164, 126, 0.14); }

.master-strip { padding: 19px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.master-strip-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.master-counter { color: var(--muted-light); font-size: 11px; }
.master-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 1px 4px; scrollbar-width: thin; }
.master-card { display: flex; align-items: center; gap: 10px; min-width: 190px; padding: 10px 12px; text-align: left; color: var(--muted); background: rgba(255, 253, 249, 0.42); border: 1px solid transparent; border-radius: 10px; transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.master-card:hover { background: var(--surface); border-color: var(--line); transform: translateY(-1px); }
.master-card.selected { background: var(--surface); border-color: #cbbdaf; box-shadow: 0 4px 10px rgba(60, 54, 44, 0.04); }
.master-card-copy { min-width: 0; flex: 1; }
.master-card-copy b, .master-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.master-card-copy b { color: var(--ink); font-size: 12px; font-weight: 600; }
.master-card-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.selected-mark { color: var(--sage); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; color: #754d3c; border-radius: 50%; font-size: 10px; font-weight: 700; }
.avatar-coral { background: #f0cdbb; }
.avatar-sage { color: #386253; background: #cde2d6; }
.avatar-blue { color: #496174; background: #d5e2e7; }
.avatar-sand { color: #7d6344; background: #ecdabb; }
.avatar-small { width: 38px; height: 38px; font-size: 11px; }
.avatar-large { width: 58px; height: 58px; font-size: 15px; }

.calendar-section { margin-top: 28px; padding: 24px 24px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.calendar-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.calendar-title-row h2 { margin: 0; font: 600 20px/1.1 "Fraunces", Georgia, serif; letter-spacing: -0.03em; }
.week-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; color: var(--accent-deep); background: #f8e6dc; border-radius: 5px; font-size: 10px; font-weight: 700; }
.button-today { min-height: 36px; padding: 0 12px; font-size: 11px; }
.calendar-legend { display: flex; align-items: center; gap: 18px; margin: 20px 0 15px 68px; color: var(--muted); font-size: 11px; }
.calendar-legend > span, .legend-hint, .public-footer > div { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.appointment { background: var(--accent); }
.legend-dot.blocked { background: #91958e; }
.legend-dot.free { background: #c6d8cc; }
.legend-hint { gap: 5px; margin-left: auto; padding: 0; color: var(--sage); background: none; border: 0; font-size: 11px; }
.legend-hint:hover { color: var(--accent-deep); }
.calendar-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; scrollbar-color: #c8c3ba transparent; }
.calendar-head, .calendar-layout { min-width: 800px; }
.calendar-head { display: grid; grid-template-columns: 68px repeat(7, minmax(104px, 1fr)); background: var(--surface-quiet); border-bottom: 1px solid var(--line); }
.calendar-time-head { display: flex; align-items: center; justify-content: center; color: var(--muted-light); font: 500 9px "DM Mono", monospace; letter-spacing: 0.08em; }
.day-head { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 54px; color: var(--muted); border-left: 1px solid var(--line); font-size: 11px; }
.day-head b { display: grid; place-items: center; width: 25px; height: 25px; color: var(--ink); background: transparent; border-radius: 50%; font-size: 12px; }
.day-head.is-today span { color: var(--accent); font-weight: 700; }
.day-head.is-today b { color: #fff; background: var(--accent); }
.calendar-layout { display: grid; grid-template-columns: 68px 1fr; }
.time-axis { display: grid; grid-template-rows: repeat(14, 48px); background: var(--surface-quiet); }
.time-axis span { display: flex; justify-content: center; padding-top: 8px; color: var(--muted-light); font: 10px "DM Mono", monospace; }
.calendar-body { position: relative; display: grid; grid-template-columns: repeat(7, minmax(104px, 1fr)); grid-template-rows: repeat(14, 48px); background-color: #fffefa; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: calc(100% / 7) 100%, 100% 48px; }
.time-slot { min-width: 0; padding: 0; background: transparent; border: 0; z-index: 0; }
.time-slot:hover { background: rgba(216, 232, 222, 0.38); }
.time-slot.is-today { background-color: rgba(251, 238, 230, 0.24); }
.time-slot.is-today:hover { background-color: rgba(251, 229, 216, 0.55); }
.calendar-event { min-width: 0; margin: 3px; padding: 7px 8px; overflow: hidden; color: #653a2d; text-align: left; background: #f6daca; border: 1px solid #edc7b6; border-radius: 7px; z-index: 2; transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.calendar-event:hover { filter: saturate(1.08); transform: translateY(-1px); box-shadow: 0 5px 10px rgba(90, 55, 38, 0.1); }
.calendar-event.event-blocked { color: #565b56; background: #e6e8e1; border-color: #d5d8d0; }
.event-time, .calendar-event strong, .calendar-event small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-time { margin-bottom: 3px; font: 9px "DM Mono", monospace; opacity: 0.78; }
.calendar-event strong { font-size: 11px; font-weight: 700; }
.calendar-event small { margin-top: 3px; font-size: 9px; opacity: 0.8; }

.bottom-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 13px; margin-top: 15px; }
.integration-card, .status-card { display: flex; align-items: center; gap: 13px; min-height: 108px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; color: var(--sage); background: var(--sage-light); border-radius: 10px; }
.integration-copy { min-width: 0; flex: 1; }
.integration-copy h3, .status-card h3 { margin: 5px 0 3px; font: 600 16px/1.1 "Fraunces", Georgia, serif; letter-spacing: -0.025em; }
.integration-copy p { max-width: 410px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.status-card { display: block; }
.status-card-head { display: flex; align-items: flex-start; justify-content: space-between; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.status-row a { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-deep); font-weight: 600; }
.status-row a:hover { text-decoration: underline; }
.status-pending { display: inline-flex; align-items: center; gap: 5px; color: var(--warning); font-size: 10px; font-weight: 500; }
.status-pending i { width: 6px; height: 6px; background: var(--warning); border-radius: 50%; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(28, 30, 27, 0.42); opacity: 0; visibility: hidden; z-index: 20; transition: opacity 180ms ease, visibility 180ms ease; }
.modal-backdrop.is-visible { opacity: 1; visibility: visible; }
.modal-card { width: min(100%, 470px); max-height: calc(100vh - 40px); overflow: auto; padding: 25px; background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 16px; box-shadow: 0 22px 65px rgba(28, 30, 27, 0.24); transform: translateY(12px) scale(0.985); transition: transform 180ms ease; }
.is-visible .modal-card { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-head h2 { margin: 7px 0 0; font: 600 23px/1.06 "Fraunces", Georgia, serif; letter-spacing: -0.04em; }
.form-field { display: grid; gap: 6px; margin-bottom: 15px; }
.form-field label { color: #5e625b; font-size: 11px; font-weight: 600; }
.form-field label span { color: var(--muted-light); font-weight: 400; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 10px 11px; color: var(--ink); background: #fffefa; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; font-size: 12px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.form-field textarea { resize: vertical; min-height: 62px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(185, 109, 80, 0.12); }
.form-grid { display: grid; grid-template-columns: 1.3fr 0.8fr 0.8fr; gap: 9px; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 8px; margin-top: 5px; border-top: 1px solid var(--line); }

.public-shell { min-height: 100vh; }
.public-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 max(24px, calc((100vw - 1120px) / 2)); border-bottom: 1px solid var(--line); }
.public-header .brand-mark { color: #614b3f; background: #e7c9a8; }
.public-header .brand { color: var(--ink); }
.public-header .brand small { color: var(--muted); }
.public-header-note { display: inline-flex; align-items: center; gap: 8px; color: var(--sage); font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: 0.06em; }
.public-main { width: min(1120px, calc(100% - 48px)); min-width: 0; margin: 0 auto; padding: 67px 0 58px; }
.public-intro { display: grid; grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.1fr); column-gap: 60px; align-items: end; padding-bottom: 35px; }
.public-profile { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.public-profile h1 { margin: 0; font: 600 clamp(30px, 4vw, 46px)/0.98 "Fraunces", Georgia, serif; letter-spacing: -0.055em; }
.public-profile p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.public-description { max-width: 420px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.public-calendar-card { width: 100%; min-width: 0; overflow: hidden; padding: 26px 26px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.public-toolbar { width: 100%; min-width: 0; padding-bottom: 20px; }
.public-note { display: flex; align-items: center; gap: 9px; max-width: 100%; overflow: hidden; padding: 10px 12px; margin-bottom: 16px; color: #637066; background: #f1f6f1; border: 1px solid #dfebe0; border-radius: 8px; font-size: 11px; }
.public-note-icon { display: inline-grid; place-items: center; color: var(--sage); }
.public-event { cursor: default; color: #596c61; background: #dfece6; border-color: #cfe0d6; }
.public-event:hover { filter: none; transform: none; box-shadow: none; }
.public-event strong { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.public-event .event-time { font-size: 9px; }
.public-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 16px; color: var(--muted); font-size: 11px; }
.public-footer > div { gap: 14px; }
.public-footer > div span { display: inline-flex; align-items: center; gap: 6px; }
.public-caption { margin: 16px 2px 0; color: var(--muted-light); text-align: right; font-size: 10px; }
.public-footer-site { display: flex; align-items: center; justify-content: space-between; width: min(1120px, calc(100% - 48px)); padding: 17px 0 25px; margin: 0 auto; color: var(--muted-light); border-top: 1px solid var(--line); font-size: 10px; }
.public-footer-site span:first-child { color: var(--ink); font: 600 12px "Fraunces", Georgia, serif; }

.toast { position: fixed; left: 50%; bottom: 24px; padding: 11px 15px; color: #fffdf9; background: #292b27; border-radius: 8px; box-shadow: 0 10px 24px rgba(20, 20, 18, 0.2); opacity: 0; visibility: hidden; transform: translate(-50%, 8px); z-index: 40; font-size: 12px; transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (max-width: 1040px) {
  .sidebar { width: 72px; flex-basis: 72px; align-items: center; padding-left: 10px; padding-right: 10px; }
  .brand { gap: 0; }
  .brand > span:last-child, .sidebar-label, .nav-item span, .account-chip > span:not(.account-avatar):not(.account-status), .demo-note { display: none; }
  .nav-item { justify-content: center; width: 44px; padding: 0; }
  .sidebar-label-bottom { display: block; width: 1px; height: 1px; margin: 34px 0 12px; overflow: hidden; }
  .account-chip { border-top: 1px solid #454840; }
  .account-status { margin-left: 0; }
  .main-content { width: calc(100% - 72px); padding-right: 28px; padding-left: 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .heading-meta { padding-bottom: 0; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  .main-content { width: 100%; padding: 0 16px 34px; }
  .topbar { min-height: 68px; }
  .breadcrumb { font-size: 11px; }
  .topbar-actions .button-quiet span { display: none; }
  .topbar-actions .button-quiet { width: 38px; padding: 0; }
  .page-heading { padding: 32px 0 22px; }
  .page-heading h1 { font-size: 30px; }
  .page-heading p { font-size: 12px; }
  .master-card { min-width: 177px; }
  .calendar-section { padding: 18px 12px 13px; margin-top: 20px; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .calendar-actions { align-self: stretch; justify-content: space-between; }
  .calendar-legend { flex-wrap: wrap; gap: 10px 14px; margin-left: 0; }
  .legend-hint { width: 100%; justify-content: flex-start; margin-left: 0; }
  .bottom-grid { grid-template-columns: 1fr; }
  .integration-card, .status-card { padding: 16px; }
  .integration-card { align-items: flex-start; flex-wrap: wrap; }
  .integration-copy { flex-basis: calc(100% - 54px); }
  .integration-card .button { margin-left: 52px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .form-field:first-child { grid-column: 1 / -1; }
  .modal-card { padding: 20px; }
  .public-header { min-height: 67px; padding: 0 16px; }
  .public-header-note { display: none; }
  .public-header .button-quiet { width: 38px; padding: 0; }
  .public-header .button-quiet span { display: none; }
  .public-header .brand > span:last-child { display: block; }
  .public-main { width: calc(100% - 32px); padding: 40px 0 42px; }
  .public-intro { display: block; padding-bottom: 25px; }
  .public-profile h1 { font-size: 34px; }
  .public-description { margin-top: 23px; font-size: 12px; }
  .public-calendar-card { width: calc(100vw - 32px); max-width: calc(100vw - 32px); padding: 18px 12px 13px; }
  .public-calendar-card .calendar-actions { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; width: 100%; }
  .public-calendar-card .calendar-actions .button-today { justify-self: center; }
  .public-calendar-card .calendar-actions .icon-button:last-child { justify-self: end; }
  .public-footer { align-items: flex-start; flex-direction: column; }
  .public-footer .button { width: 100%; }
  .public-caption { text-align: left; }
  .public-footer-site { width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
