/* Kalendar i studios — HEGART PHOTO STUDIO. Tokens: replica/design/tokens.json */
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #f4f6f5;      /* page ground */
  --card: #ffffff;       /* sidebar, board, modal */
  --line: #e1e7e4;       /* hairlines */
  --line-soft: #edf1ef;
  --ink: #17211d;
  --muted: #66746e;
  --faint: #a6b2ad;      /* other-month days */
  --green: #0c7655;      /* brand primary */
  --green-deep: #095c42;
  --green-tint: #e3f1ea;
  --amber: #d08a1e;
  --red: #c4473c;
  --danger: #b3372d;
  --on-green: #ffffff;
  --input: #8a9691;      /* 3:1 on white, WCAG 1.4.11 */
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --shadow-btn: 0 6px 16px -6px rgba(12, 118, 85, .45);
  --shadow-pop: 0 24px 60px -20px rgba(16, 38, 30, .35), 0 0 0 1px rgba(16, 38, 30, .06);
  --sidebar: 300px;
  --hour: 52px; --gutter: 58px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; flex: none; }

/* ---------- primitives */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: var(--r-md); padding: 0 18px; min-height: 44px; font-weight: 500; }
.btn:hover { border-color: var(--input); background: #fbfcfb; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--on-green); font-weight: 700; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: var(--r-sm); display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.sq-btn { width: 48px; height: 48px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--ink); }
.sq-btn:hover { border-color: var(--input); }
.round-btn { width: 56px; height: 56px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--ink); }
.round-btn.avatar { border-radius: 50%; border-color: transparent; font-weight: 700; font-size: 18px; }
.round-btn:hover { border-color: var(--input); }

.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea, .search input {
  width: 100%; border: 1px solid var(--input); border-radius: var(--r-md); background: var(--card);
  min-height: 56px; padding: 0 18px; font-size: 16px; min-width: 0;
}
.field textarea { padding: 14px 18px; min-height: 120px; resize: vertical; line-height: 1.5; }
.field select { appearance: none; padding-right: 44px; background: var(--card) no-repeat right 16px center / 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317211d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
/* grid items may shrink below their content (iOS date/time inputs are wide) */
.field { min-width: 0; }
/* iOS Safari draws date/time inputs at its own size: give them the same box as the other fields */
@supports (-webkit-touch-callout: none) {
  .field input[type="date"], .field input[type="time"] {
    -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%;
    height: 56px; line-height: 56px; text-align: left; background-color: var(--card);
  }
  .field input::-webkit-date-and-time-value { text-align: left; margin: 0; }
  .field input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
}
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: #8b9792; }
.form-error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 14px; }
.bk .form-error:empty { display: none; }

/* ---------- brand */
.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark { width: 60px; height: 60px; border-radius: 14px; background: var(--green-deep); color: #fff; display: grid; place-items: center; font: 600 30px/1 var(--serif); box-shadow: 0 10px 22px -10px rgba(9, 92, 66, .7); flex: none; }
.brand-mark svg { width: 56%; height: auto; display: block; }
.brand-name { display: grid; line-height: 1.1; }
.brand-name b { font: 700 27px/1 var(--serif); letter-spacing: .01em; }
.brand-name small { font-size: 14px; letter-spacing: .16em; color: var(--muted); margin-top: 6px; }

/* ---------- login */
.login { height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); display: grid; gap: 18px; background: var(--card); padding: 36px; border-radius: 22px; box-shadow: var(--shadow-pop); }
.login-card h1 { font: 700 30px/1.15 var(--serif); margin: 10px 0 4px; }

/* ---------- shell */
.app { height: 100%; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { background: var(--card); border-right: 1px solid var(--line); padding: 44px 26px 26px; display: flex; flex-direction: column; gap: 28px; overflow-y: auto; }
.btn-new { min-height: 76px; border-radius: var(--r-md); font-size: 19px; gap: 14px; flex: none; }
.btn-new svg.i { width: 22px; height: 22px; stroke-width: 2.2; }
.side-h { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--muted); margin: 0 12px 10px; }
.side-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 22px; border: 0; background: none; text-align: left; padding: 0 16px; min-height: 60px; border-radius: var(--r-md); font-size: 19px; color: var(--ink); }
.nav-item svg.i { color: var(--green); }
.nav-item:hover { background: var(--paper); }
.nav-item.is-active { background: var(--green-tint); color: var(--green-deep); font-weight: 700; }

.mini { padding: 0 12px; }
.mm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mm-head > span:first-child { font-weight: 700; font-size: 18px; }
.mm-head > span:last-child { display: flex; }
.mm-head .icon-btn { width: 30px; height: 30px; color: var(--ink); }
.mm-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; row-gap: 4px; }
.mm-grid .wd { font-size: 12px; color: var(--muted); padding-bottom: 14px; }
.mm-day { position: relative; border: 0; background: none; width: 44px; height: 44px; max-width: 100%; margin: auto; border-radius: 50%; font-size: 16px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.mm-day:hover { background: var(--paper); }
.mm-day.out { color: var(--ink); }
.mm-day.today { background: var(--green); color: #fff; font-weight: 700; box-shadow: 0 0 0 3px var(--green-tint); }
.mm-day.sel:not(.today) { box-shadow: inset 0 0 0 1.5px var(--green); }
.mm-day.busy::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--green); }
.mm-day.today.busy::after { background: #fff; }

.legend ul { list-style: none; margin: 0; padding: 0 12px; display: grid; gap: 4px; }
.legend label { display: flex; align-items: center; gap: 14px; font-size: 17px; padding: 6px 0; cursor: pointer; position: relative; }
.legend input { position: absolute; opacity: 0; pointer-events: none; }
.legend .dot { width: 13px; height: 13px; border-radius: 50%; background: var(--c); flex: none; }
.legend input:not(:checked) + .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.legend input:not(:checked) ~ .lbl { color: var(--faint); text-decoration: line-through; }
.legend input:focus-visible + .dot { outline: 2px solid var(--green); outline-offset: 3px; }
.legend li { display: flex; align-items: center; }
.legend li label { flex: 1; min-width: 0; }
.legend .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .icon-btn { width: 30px; height: 30px; opacity: 0; }
.legend li { position: relative; border-radius: var(--r-sm); }
.legend li.dragging { opacity: .5; background: var(--green-tint); }
.legend .grip { position: absolute; left: -16px; top: 50%; width: 8px; height: 14px; margin-top: -7px; cursor: grab; opacity: 0;
  background: radial-gradient(circle, var(--muted) 1.2px, transparent 1.5px) 0 0 / 4px 4.6px; }
.legend li:hover .grip { opacity: .8; }
.legend li[draggable="true"] label { cursor: grab; }
.legend li:hover .icon-btn, .legend .icon-btn:focus-visible { opacity: 1; }
.add-type { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 8px 0; color: var(--green-deep); font-weight: 700; font-size: 15px; }
.add-type svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.add-type:hover { text-decoration: underline; }
@media (hover: none) { .legend .icon-btn { opacity: 1; } }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 52px 60px 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 40px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-weight: 700; font-size: 15px; letter-spacing: .2em; }
.page-title { margin: 0; font: 700 50px/1.05 var(--serif); letter-spacing: -.01em; }
.head-actions { display: flex; align-items: center; gap: 18px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.sync-dot.off { background: var(--faint); }

.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; flex-wrap: wrap; }
.menu-btn { display: none; }
.nav-arrows { display: flex; gap: 16px; }
.range-title { font: 700 32px/1 var(--serif); margin: 0 0 0 16px; min-width: 260px; white-space: nowrap; }
.btn-today { min-height: 60px; padding: 0 22px; font-size: 19px; }
.search { position: relative; margin-left: auto; width: 290px; }
.search input { min-height: 62px; padding-left: 52px; background: var(--card) no-repeat 20px 50% / 18px; font-size: 17px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: 60vh; overflow: auto; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-pop); z-index: 40; padding: 6px; min-width: 300px; }
.sr-item { display: grid; grid-template-columns: 10px 1fr; gap: 2px 12px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; align-items: center; }
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--paper); }
.sr-item .dot { width: 9px; height: 9px; border-radius: 50%; }
.sr-item small { grid-column: 2; color: var(--muted); }
.sr-empty { padding: 12px; color: var(--muted); }
.segmented { display: inline-flex; background: #e9eeec; border-radius: var(--r-md); padding: 6px; gap: 4px; margin-left: 14px; }
.segmented button { border: 0; background: transparent; padding: 0 20px; min-height: 52px; border-radius: 9px; font-size: 18px; color: #4a5853; }
.segmented button[aria-selected="true"] { background: var(--card); color: var(--green-deep); font-weight: 700; box-shadow: 0 1px 3px rgba(16, 38, 30, .12); }

.banner { margin: -16px 0 18px; padding: 10px 16px; background: #fbefd8; border-radius: var(--r-sm); font-size: 14px; }
.board { flex: 1; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; position: relative; box-shadow: 0 1px 2px rgba(16, 38, 30, .04); }
.foot { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 16px; padding: 30px 0 0; }

.search-toggle, .search-close, .phone-only { display: none; }

/* ---------- event colour per session type: --c set inline */
.ev { --tint: color-mix(in srgb, var(--c) 13%, white); --ink-c: color-mix(in srgb, var(--c) 62%, #10211a); }

/* ---------- month */
.mo { flex: 1; display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.mo-wd { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.mo-wd div { text-align: center; padding: 26px 8px 22px; color: var(--muted); font-size: 17px; letter-spacing: .1em; }
.mo-weeks { display: grid; grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); min-height: 0; }
.mo-week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); min-height: 0; }
.mo-week:last-child { border-bottom: 0; }
.mo-cell { border-left: 1px solid var(--line); padding: 18px 18px 0; min-width: 0; }
.mo-cell:first-child { border-left: 0; }
.mo-cell.out { background: #f8faf9; color: var(--faint); }
.mo-cell.drop { background: var(--green-tint); }
.mo-num { display: inline-grid; place-items: center; min-width: 38px; height: 38px; margin: -8px 0 0 -8px; border-radius: 19px; font-size: 18px; font-variant-numeric: tabular-nums; }
.mo-cell.today .mo-num { background: var(--green); color: #fff; font-weight: 700; }
.mo-bars { position: absolute; inset: 62px 0 6px; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 42px; row-gap: 6px; pointer-events: none; align-content: start; }
.mo-bars > * { pointer-events: auto; }
.chip, .bar { margin: 0 14px; display: flex; align-items: center; gap: 6px; min-width: 0; border: 0; text-align: left; border-radius: var(--r-sm); background: var(--tint); color: var(--ink-c); box-shadow: inset 4px 0 0 var(--c); padding: 0 12px 0 16px; font-size: 16px; white-space: nowrap; overflow: hidden; touch-action: none; }
.chip .tm { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip .tt, .bar .tt { overflow: hidden; text-overflow: ellipsis; }
.chip:hover, .bar:hover { filter: brightness(.97); }
.chip.sel, .bar.sel { background: var(--c); color: #fff; }
.bar { font-weight: 600; }
.past { opacity: .7; }
.more { margin: 0 14px; font-size: 14px; color: var(--muted); background: none; border: 0; text-align: left; padding: 0 4px; font-weight: 700; }
.more:hover { color: var(--green); }

/* ---------- day / week */
.wk { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.wk-sticky { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.wk-head, .wk-allday { display: grid; grid-template-columns: var(--gutter) repeat(var(--n), minmax(0, 1fr)); }
.wk-dh { padding: 18px 8px 14px; text-align: center; white-space: nowrap; overflow: hidden; }
.wk-dh .wd { display: block; color: var(--muted); font-size: 14px; letter-spacing: .1em; margin-bottom: 6px; }
.wk-dh .num { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: 20px; font-size: 19px; font-variant-numeric: tabular-nums; }
.wk-dh.today .num { background: var(--green); color: #fff; font-weight: 700; }
.wk-allday { min-height: 34px; border-top: 1px solid var(--line-soft); }
.wk-allday .lbl { font-size: 12px; color: var(--muted); text-align: right; padding: 8px; line-height: 1.2; }
.wk-bars { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-auto-rows: 30px; row-gap: 4px; padding: 4px 0 6px; }
.wk-bars .bar { margin: 0 4px; font-size: 14px; }
.wk-body { display: grid; grid-template-columns: var(--gutter) repeat(var(--n), minmax(0, 1fr)); position: relative; height: calc(var(--hour) * 24); }
.wk-gutter { position: relative; }
.wk-gutter span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line-soft) 1px, transparent 1px); background-size: 100% var(--hour); touch-action: none; }
.blk { position: absolute; border-radius: var(--r-sm); background: var(--tint); color: var(--ink-c); box-shadow: inset 4px 0 0 var(--c); padding: 6px 8px 6px 12px; font-size: 14px; overflow: hidden; cursor: default; user-select: none; touch-action: none; }
.blk .tm { font-weight: 700; font-variant-numeric: tabular-nums; display: block; }
.blk .t { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.blk .m { display: block; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.blk.short { display: flex; gap: 6px; align-items: center; padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.blk.short .tm, .blk.short .t { display: inline; }
.blk.sel { background: var(--c); color: #fff; z-index: 3; }
.blk.dragging { box-shadow: inset 4px 0 0 var(--c), var(--shadow-pop); z-index: 6; }
.blk.ghost { --c: var(--green); background: var(--green-tint); color: var(--green-deep); z-index: 4; }
.blk .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.blk.ro .rz { display: none; }
.now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--green); z-index: 4; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.now-lbl { position: absolute; right: 8px; transform: translateY(-50%); color: var(--green); font-size: 13px; font-weight: 700; background: var(--card); z-index: 4; }

/* ---------- list */
.ls { flex: 1; overflow: auto; padding: 10px 34px 30px; }
.ls-day { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.ls-day:last-child { border-bottom: 0; }
.ls-date b { display: block; font: 700 30px/1 var(--serif); }
.ls-date span { color: var(--muted); }
.ls-date.today b { color: var(--green); }
.ls-items { display: grid; gap: 10px; }
.ls-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: center; text-align: left; border: 0; background: var(--tint); color: var(--ink); box-shadow: inset 4px 0 0 var(--c); border-radius: var(--r-md); padding: 14px 18px 14px 22px; width: 100%; }
.ls-item:hover { filter: brightness(.98); }
.ls-item .tm { font-weight: 700; color: var(--ink-c); font-variant-numeric: tabular-nums; }
.ls-item .who { font-weight: 700; font-size: 17px; }
.ls-item .sub { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.ls-item .ph { color: var(--ink-c); font-weight: 600; white-space: nowrap; }
.ls-empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.ls-empty b { display: block; font: 700 26px/1.2 var(--serif); color: var(--ink); margin-bottom: 8px; }

/* ---------- modal (booking) and popovers */
.scrim { position: fixed; inset: 0; background: rgba(15, 30, 24, .32); z-index: 45; }
.popover { position: fixed; z-index: 50; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 22px; }
.popover.modal { width: 560px; padding: 34px; border-radius: 22px; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.bk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
.bk-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; margin-bottom: -4px; }
.bk-head h2 { margin: 0; font: 700 38px/1.1 var(--serif); }
.close-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #edf1ef; color: var(--muted); font-size: 22px; display: grid; place-items: center; flex: none; }
.close-btn:hover { background: var(--line); color: var(--ink); }
.bk .full { grid-column: 1 / -1; }
.type-input { position: relative; display: block; }
.type-input::before { content: ""; position: absolute; left: 18px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--c); pointer-events: none; }
.type-input select { padding-left: 42px; }
.bk .field input[name="title"] { border-color: color-mix(in srgb, var(--green) 55%, var(--input)); }
.bk-more { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; }
.bk-more summary { cursor: pointer; color: var(--green-deep); font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.bk-more summary::-webkit-details-marker { display: none; }
.bk-more summary::before { content: "+"; font-size: 20px; width: 18px; }
.bk-more[open] summary::before { content: "–"; }
.bk-more .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 26px; margin-top: 18px; }
.ed-days { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-days label { display: block; position: relative; }
.ed-days input { position: absolute; opacity: 0; pointer-events: none; }
.ed-days span { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--input); font-size: 14px; cursor: pointer; }
.ed-days input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.ed-days input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.bk-foot { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.bk-foot .grow { flex: 1; }
.bk-foot .btn { min-height: 60px; padding: 0 26px; font-size: 18px; }
.bk-foot .btn-primary { padding: 0 34px; }
.bk-meta { grid-column: 1 / -1; color: var(--muted); font-size: 14px; margin: -8px 0 0; }
.bk-ro { grid-column: 1 / -1; margin: 0; padding: 14px 16px; background: var(--paper); border-radius: var(--r-md); color: var(--muted); }
.bk-view { grid-column: 1 / -1; display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; margin: 0; }
.bk-view dt { color: var(--muted); font-weight: 700; font-size: 14px; }
.bk-view dd { margin: 0; white-space: pre-wrap; }
.type-pill { display: inline-flex; align-items: center; gap: 8px; }
.type-pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

.panel { display: grid; gap: 18px; }
.badge { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--red); color: #fff; font-size: 13px; display: grid; place-items: center; }
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-height: 60vh; overflow: auto; }
.req { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; gap: 10px; }
.req-head { display: grid; gap: 2px; }
.req-head span { color: var(--muted); font-size: 14px; }
.req .bk-view { grid-template-columns: 110px 1fr; font-size: 14px; gap: 4px 10px; }
.req a, .bk-booking a { color: var(--green-deep); }
.bk-booking { margin: -8px 0 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--green-tint); color: var(--green-deep); font-size: 14px; font-weight: 600; }
.bk-booking.is-pending { background: #fbefd8; color: #7a4d0b; display: grid; gap: 10px; }
.bk-booking.is-pending p { margin: 0; }
.bk-booking .row-btns .btn { min-height: 40px; }
/* an enquiry waiting for an answer: striped, so it never reads as a fixed booking */
.ev.pending { background: repeating-linear-gradient(135deg, var(--tint) 0 6px, #fff 6px 12px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), inset 4px 0 0 var(--c); }
.panel h2 { margin: 0; font: 700 26px/1.15 var(--serif); }
.panel p.help { margin: -8px 0 0; color: var(--muted); font-size: 14px; }
.panel .field input, .panel .field select { min-height: 46px; font-size: 15px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, 30px); gap: 8px; }
.swatches button, .swatch-custom { width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; background: var(--c); }
.swatches button[aria-pressed="true"], .swatch-custom.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.swatch-custom { position: relative; overflow: hidden; cursor: pointer; background: conic-gradient(#e05780, #d08a1e, #c9a227, #2e8b57, #2a9d8f, #2f6fdb, #7b4fc9, #e05780); }
.swatch-custom.on { background: var(--c); }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.row-btns .btn:disabled { opacity: .4; cursor: default; }
.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.share-list li { display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: center; }
.share-list select { min-height: 40px; border: 1px solid var(--input); border-radius: var(--r-sm); padding: 0 10px; background: var(--card); }
.feed { display: flex; gap: 8px; }
.feed input { flex: 1; min-width: 0; border: 1px solid var(--input); border-radius: var(--r-sm); padding: 0 10px; min-height: 40px; font-size: 13px; color: var(--muted); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.cal-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-pick button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; display: inline-flex; gap: 8px; align-items: center; }
.cal-pick button[aria-pressed="true"] { border-color: var(--green); background: var(--green-tint); color: var(--green-deep); font-weight: 700; }
.cal-pick .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.menu { display: grid; gap: 2px; }
.menu .who { padding: 4px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; }
.menu .who span { color: var(--muted); font-size: 14px; }
.menu .field { padding: 6px 10px; }
.menu .field select { min-height: 44px; font-size: 15px; }
.menu button.item { border: 0; background: none; text-align: left; padding: 10px; border-radius: var(--r-sm); }
.menu button.item:hover { background: var(--paper); }
.today-list { display: grid; gap: 10px; }
.today-list h2 { margin: 0 0 4px; font: 700 24px/1.2 var(--serif); }
.today-list .ls-item { grid-template-columns: 64px 1fr; padding: 10px 14px 10px 18px; }
.today-list p { margin: 0; color: var(--muted); }

.dialog { border: 0; border-radius: 20px; box-shadow: var(--shadow-pop); padding: 28px; width: min(440px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
.dialog::backdrop { background: rgba(15, 30, 24, .35); }
.dialog p { margin: 0 0 22px; font-size: 17px; }
.dialog .btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-md); z-index: 60; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-pop); }
.toast button { background: none; border: 0; color: #9fe0c6; font-weight: 700; padding: 0; }

/* ---------- smaller screens */
@media (max-width: 1500px) {
  .main { padding: 36px 36px 18px; }
  .page-head { margin-bottom: 26px; }
  .page-title { font-size: 40px; }
  .toolbar { margin-bottom: 22px; gap: 12px; }
  .range-title { font-size: 26px; min-width: 200px; margin-left: 6px; }
  .sq-btn { width: 42px; height: 42px; }
  .btn-today, .segmented button { min-height: 44px; font-size: 16px; }
  .search { width: 240px; }
  .search input { min-height: 48px; font-size: 15px; }
  .segmented button { padding: 0 16px; }
  .mo-wd div { padding: 16px 6px 14px; font-size: 14px; }
  .mo-cell { padding: 12px 12px 0; }
  .mo-num { font-size: 16px; min-width: 32px; height: 32px; }
  .mo-bars { inset: 48px 0 4px; grid-auto-rows: 32px; row-gap: 4px; }
  .chip, .bar { margin: 0 8px; font-size: 14px; padding: 0 8px 0 12px; }
  .foot { font-size: 14px; padding-top: 16px; }
  .round-btn { width: 48px; height: 48px; }
  .sidebar { padding: 32px 22px 22px; gap: 22px; }
  .btn-new { min-height: 62px; font-size: 17px; }
  .nav-item { min-height: 50px; font-size: 16px; gap: 16px; }
  .mm-day { width: 36px; height: 36px; font-size: 15px; }
  .mm-grid .wd { padding-bottom: 8px; }
  .legend label { font-size: 15px; padding: 4px 0; }
}
@media (max-width: 1180px) {
  :root { --sidebar: 260px; }
  .sidebar { padding: 30px 18px 18px; gap: 22px; }
  .brand-mark { width: 48px; height: 48px; font-size: 24px; }
  .brand-name b { font-size: 22px; }
  .btn-new { min-height: 58px; font-size: 17px; }
  .nav-item { min-height: 48px; font-size: 16px; gap: 14px; }
  .mm-day { width: 32px; height: 32px; font-size: 14px; }
  .search { order: 5; margin-left: 0; flex: 1 1 200px; }
  .segmented { margin-left: auto; }
}
/* ---------- one slim toolbar instead of a page header: the calendar gets the height */
.main { padding: 18px 28px 14px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: nowrap; }
.nav-arrows { gap: 8px; }
.sq-btn { width: 40px; height: 40px; border-radius: 10px; }
.range-title { font-size: 26px; margin: 0 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.btn-today { min-height: 40px; font-size: 15px; padding: 0 16px; border-radius: 10px; }
.search { order: 0; flex: none; margin-left: auto; width: auto; display: flex; align-items: center; position: relative; }
.search input, .search-close { display: none; }
.search-toggle { display: inline-grid; width: 40px; height: 40px; color: var(--ink); border-radius: 10px; }
.search.open .search-toggle { display: none; }
.search.open input { display: block; width: 280px; min-height: 40px; padding-left: 38px; font-size: 15px; background-position: 13px 50%; border-color: var(--input); }
.search.open .search-close { display: inline-grid; width: 36px; height: 36px; font-size: 22px; color: var(--muted); }
.search-results { left: auto; right: 0; min-width: 340px; }
.segmented { margin-left: 4px; padding: 4px; }
.segmented button { min-height: 32px; font-size: 15px; padding: 0 14px; }
.head-actions { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.round-btn { width: 40px; height: 40px; border-radius: 10px; }
.round-btn.avatar { border-radius: 50%; font-size: 16px; }
.foot { padding-top: 10px; font-size: 13px; }

/* month view: sizes the script reads to know how many bookings fit in a day */
.board { --mo-head: 40px; --mo-top: 44px; --mo-lane: 30px; --mo-gap: 4px; }
.mo-wd div { height: var(--mo-head); padding: 0 6px; display: grid; place-items: center; font-size: 13px; }
.mo-week { overflow: hidden; }
.mo-cell { padding: 10px 12px 0; }
.mo-num { font-size: 15px; min-width: 30px; height: 30px; margin: -4px 0 0 -6px; }
.mo-bars { inset: var(--mo-top) 0 4px; grid-auto-rows: var(--mo-lane); row-gap: var(--mo-gap); }
.mo-cell { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.mo-cell .more { margin: -2px 0 0; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink); font-size: 12px; font-weight: 700; position: relative; z-index: 2; }
.mo-cell .more:hover { background: var(--green-tint); color: var(--green-deep); }
@media (max-height: 760px) { .board { --mo-top: 38px; --mo-lane: 26px; --mo-gap: 3px; } .mo-cell { padding-top: 7px; } .chip, .bar { font-size: 13px; } }
.chip, .bar { margin: 0 8px; font-size: 14px; padding: 0 8px 0 12px; }

@media (max-width: 880px) {
  :root { --gutter: 48px; --hour: 56px; }
  html, body { overflow: hidden; overscroll-behavior: none; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); z-index: 46; transform: translateX(-102%); transition: transform .2s var(--ease); box-shadow: var(--shadow-pop); padding-top: calc(24px + env(safe-area-inset-top)); }
  .app.side-open .sidebar { transform: none; }
  .main { padding: calc(10px + env(safe-area-inset-top)) 12px 0; overflow: hidden; }

  /* phone: two slim rows above the calendar, everything else in the ☰ menu */
  .page-head, .toolbar .head-actions { display: none; }
  .board { --mo-head: 32px; --mo-top: 34px; --mo-lane: 22px; --mo-gap: 2px; }
  .mo-cell .more { font-size: 10px; padding: 1px 5px; margin: 2px 0 0; }
  .phone-only { display: flex; }
  .toolbar { display: grid; grid-template-columns: 40px minmax(0, 1fr) 38px 38px 40px; grid-template-areas: "menu title prev next search" "views views views today today"; align-items: center; gap: 8px 6px; margin-bottom: 10px; position: relative; }
  .menu-btn { display: inline-grid; grid-area: menu; width: 40px; height: 40px; }
  .nav-arrows { display: contents; }
  .nav-arrows #btn-prev { grid-area: prev; }
  .nav-arrows #btn-next { grid-area: next; }
  .sq-btn { width: 38px; height: 38px; border-radius: 10px; }
  .range-title { grid-area: title; font-size: 21px; min-width: 0; margin: 0 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .range-title .lite { font-size: 14px; }
  .btn-today { grid-area: today; min-height: 36px; font-size: 15px; padding: 0 10px; border-radius: 10px; }
  .segmented { grid-area: views; margin: 0; width: 100%; padding: 3px; border-radius: 10px; }
  .segmented button { flex: 1; padding: 0 2px; min-height: 30px; font-size: 14px; border-radius: 8px; }

  /* search: a magnifier that opens a field over the first row */
  .search { grid-area: search; width: 40px; margin: 0; position: static; }
  .search input, .search-close { display: none; }
  .search-toggle { display: inline-grid; width: 40px; height: 40px; color: var(--ink); }
  .search.open { grid-area: 1 / 1 / 2 / -1; position: absolute; inset: 0; width: auto; z-index: 20; display: flex; align-items: center; gap: 6px; background: var(--paper); }
  .search.open .search-toggle { display: none; }
  .search.open input { display: block; flex: 1; min-height: 40px; font-size: 16px; padding-left: 40px; background-position: 13px 50%; }
  .search.open .search-close { display: inline-grid; width: 40px; height: 40px; font-size: 24px; color: var(--muted); }
  .search-results { min-width: 0; right: 0; }

  .board { border-radius: 16px; }
  .foot { display: none; }
  .board { margin-bottom: calc(10px + env(safe-area-inset-bottom)); }

  /* day / week */
  .wk-dh { padding: 10px 2px 8px; }
  .wk-dh .wd { font-size: 11px; letter-spacing: .04em; margin-bottom: 4px; }
  .wk-dh .num { min-width: 32px; height: 32px; font-size: 15px; }
  .wk-allday .lbl { font-size: 10px; line-height: 1.15; padding: 5px 4px; hyphens: auto; overflow-wrap: anywhere; }
  .n1 .wk-head { display: none; }   /* the range title already names the day */
  .wk-gutter span { font-size: 11px; right: 6px; }
  .wk-gutter span:first-child { display: none; }
  .now-lbl { font-size: 10px; right: 4px; }
  .blk { font-size: 13px; padding: 5px 6px 5px 10px; }
  .n7 .blk { font-size: 10px; padding: 2px 2px 2px 5px; box-shadow: inset 3px 0 0 var(--c); }
  .n7 .blk .m { display: none; }
  .n7 .wk-bars .bar { font-size: 10px; padding: 0 2px 0 5px; }

  /* month */
  .mo-wd div { font-size: 11px; letter-spacing: 0; padding: 10px 2px; }
  .mo-cell { padding: 6px 4px 0; }
  .mo-num { margin: 0; font-size: 14px; min-width: 26px; height: 26px; }
  .mo-bars { inset: 34px 0 2px; grid-auto-rows: 22px; row-gap: 2px; }
  .chip, .bar { margin: 0 2px; font-size: 11px; padding: 0 3px 0 6px; box-shadow: inset 3px 0 0 var(--c); }
  .chip .tm { display: none; }

  /* list */
  .ls { padding: 4px 14px 20px; }
  .ls-day { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .ls-date { display: flex; align-items: baseline; gap: 10px; }
  .ls-date b { font-size: 24px; }
  .ls-item { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px 12px 18px; }
  .ls-item .tm { grid-column: 1 / -1; font-size: 13px; }
  .ls-item .ph { grid-column: 2; grid-row: 2; align-self: start; font-size: 13px; }

  /* booking modal becomes a sheet from the bottom, with its buttons always in reach */
  .popover.modal { left: 0 !important; right: 0; top: auto !important; bottom: 0; transform: none; width: 100%; max-width: none; max-height: calc(100dvh - 24px - env(safe-area-inset-top)); border-radius: 22px 22px 0 0; padding: 22px 18px 0; }
  .bk { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 12px; }
  .bk .m-full { grid-column: 1 / -1; }
  .bk .field input, .bk .field select { padding: 0 12px; }
  .bk .type-input select { padding-left: 36px; }
  .bk .type-input::before { left: 14px; }
  .bk-head h2 { font-size: 28px; }
  .close-btn { width: 44px; height: 44px; }
  .bk .field input, .bk .field select { min-height: 50px; }
  .bk .field input[type="date"], .bk .field input[type="time"] { height: 50px; line-height: 50px; }
  .bk .field textarea { min-height: 96px; }
  .bk-more .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .bk-foot { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  .bk-foot .grow { display: none; }
  .bk-foot .btn { min-height: 50px; padding: 0 12px; font-size: 16px; width: 100%; }
  .bk-foot .btn-primary { padding: 0 12px; }

  /* other popovers (share, menu, today) also sit at the bottom */
  .popover:not(.modal) { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: 80dvh; }
  .share-list li { grid-template-columns: 1fr 150px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
}
/* touch: swipes scroll the calendar natively; taps open (see views.js) */
@media (pointer: coarse) {
  .wk-col, .blk, .chip, .bar { touch-action: pan-x pan-y; }
  .blk .rz { display: none; }
}
@media (max-width: 880px) and (prefers-reduced-motion: no-preference) {
  .popover.modal:not([hidden]) { animation: sheet .24s var(--ease); }
  @keyframes sheet { from { transform: translateY(24px); } }
}
@media (min-width: 881px) and (prefers-reduced-motion: no-preference) {
  .popover.modal:not([hidden]) { animation: rise .22s var(--ease); }
  @keyframes rise { from { transform: translate(-50%, calc(-50% + 12px)); } }
}
