/* Team Calendar — Scaled Growth Agency. Design system v2 (vanilla CSS, light). */
@import url('/client/assets/fonts/inter.css');
:root {
  --ink: #0b1220; --text: #111827; --muted: #667085; --faint: #98a2b3;
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --line: #e7e9f0; --line-2: #d3d7e1;
  --brand: #4f46e5; --brand-2: #6366f1; --brand-soft: #eef0ff; --brand-ink: #3730a3;
  --ok: #16a34a; --ok-soft: #ecfdf3; --warn: #b45309; --warn-soft: #fffaeb; --danger: #dc2626; --danger-soft: #fef3f2;
  --r-sm: 10px; --r: 14px; --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(16,24,40,.05);
  --sh-2: 0 6px 16px -6px rgba(16,24,40,.14), 0 1px 3px rgba(16,24,40,.06);
  --sh-3: 0 30px 70px -30px rgba(16,24,40,.32), 0 10px 30px -18px rgba(16,24,40,.16);
  --ease: cubic-bezier(.2,.7,.2,1);
  --hour-h: 56px; --time-w: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
[hidden] { display: none !important; }
.only-mobile { display: none !important; }
.hide-mobile { display: inline; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.public-bg { background: radial-gradient(900px 480px at 15% -10%, #e6e6ff 0%, transparent 60%), radial-gradient(700px 400px at 100% 0%, #e9f3ff 0%, transparent 55%), var(--bg); background-attachment: fixed; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s, background .15s, border-color .15s; box-shadow: var(--sh-1); }
.btn:hover { background: var(--surface-2); border-color: #bfc5d2; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.35), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover { background: linear-gradient(180deg, #5b54ea, #4338ca); border-color: #4338ca; box-shadow: 0 8px 20px -8px rgba(79,70,229,.6); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: var(--danger-soft); border-color: #fca5a5; }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 13px 20px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible, .icon-btn:focus-visible, .seg button:focus-visible, .avatar-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .menu-item:focus-visible, .slot:focus-visible, .day:focus-visible, .dur:focus-visible, .addcal-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text); transition: background .15s, transform .15s, border-color .15s; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.icon-btn:active { transform: scale(.96); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; font-size: 12px; line-height: 1.3; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.ok { background: var(--ok-soft); color: #067647; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }

/* ---------- forms ---------- */
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
label.f .opt { color: var(--faint); font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=time], input[type=number], select, textarea, .link-row input { width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; box-shadow: var(--sh-1); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79,70,229,.14); outline: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 88px; resize: vertical; }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 23px; border-radius: 999px; background: #cbd2dd; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip-check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; font-weight: 500; }
.chip-check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.chip-check input { accent-color: var(--brand); }

/* ---------- auth (sign-in / invite) ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 28px 16px; }
.auth-split { width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden; }
.auth-hero { position: relative; padding: 44px 40px; background: radial-gradient(600px 300px at 0% 0%, #6366f1 0%, transparent 55%), linear-gradient(160deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.auth-hero .eyebrow { color: #c7d2fe; }
.auth-hero h2 { font-size: 30px; line-height: 1.15; margin: 10px 0 12px; letter-spacing: -.02em; color: #fff; }
.auth-hero p { color: #c7d2fe; font-size: 15px; max-width: 34ch; }
.auth-hero ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #e0e7ff; }
.auth-hero li svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: #a5b4fc; }
.mini-cal { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 14px; backdrop-filter: blur(6px); }
.mini-cal .mc-head { display: flex; justify-content: space-between; font-size: 12px; color: #c7d2fe; margin-bottom: 10px; font-weight: 600; }
.mini-cal .mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mini-cal .mc-cell { height: 22px; border-radius: 6px; background: rgba(255,255,255,.07); }
.mini-cal .mc-cell.busy { background: repeating-linear-gradient(135deg, rgba(255,255,255,.28) 0 3px, rgba(255,255,255,.06) 3px 6px); }
.mini-cal .mc-cell.shared { background: #22d3ee; }
.mini-cal .mc-cell.booking { background: #fff; box-shadow: inset 0 0 0 2px #818cf8; }
.mini-cal .mc-legend { display: flex; gap: 12px; margin-top: 10px; font-size: 11.5px; color: #c7d2fe; flex-wrap: wrap; }
.mini-cal .mc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mini-cal .mc-legend i { width: 12px; height: 9px; border-radius: 3px; display: inline-block; }
.auth-panel { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-panel .auth-logo img { height: 34px; width: auto; display: block; margin-bottom: 26px; }
.auth-panel h1 { font-size: 26px; margin: 10px 0 8px; }
.auth-panel .lead { color: var(--muted); font-size: 15px; }
.auth-actions { display: flex; gap: 10px; margin: 24px 0 12px; flex-wrap: wrap; }
.google-btn { width: 100%; padding: 13px 16px; font-size: 15px; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--sh-2); }
.google-btn:hover { background: #fff; border-color: #a5b4fc; box-shadow: 0 10px 24px -10px rgba(79,70,229,.35); }
.g-logo { width: 20px; height: 20px; flex: none; }
.auth-fine { font-size: 12.5px; color: var(--muted); }
.auth-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 36px 34px; box-shadow: var(--sh-3); }
.auth-card .auth-logo img { height: 34px; width: auto; display: block; margin-bottom: 22px; }
.auth-card h1 { font-size: 24px; margin: 8px 0 8px; }

/* ---------- app shell ---------- */
.app-body { overflow: hidden; height: 100vh; height: 100dvh; }
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 18px; height: 62px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { justify-content: flex-end; }
.topbar-center { display: flex; align-items: center; gap: 6px; justify-content: center; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand span { padding-left: 10px; border-left: 1px solid var(--line-2); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.nav-arrows { display: inline-flex; }
.range-label { font-size: 17px; font-weight: 650; white-space: nowrap; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-variant-numeric: tabular-nums; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); padding: 0; overflow: hidden; background: var(--surface-2); cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.avatar-btn:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reconnect-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; background: var(--danger-soft); color: #991b1b; border-bottom: 1px solid #fecaca; font-size: 13px; }

.layout { flex: 1; display: grid; grid-template-columns: 304px 1fr; min-height: 0; }
.sidebar { border-right: 1px solid var(--line); background: var(--surface-2); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.sidebar-scrim { display: none; }
.side-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface); box-shadow: var(--sh-1); }
.side-title { font-weight: 650; font-size: 13.5px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; letter-spacing: -.01em; }
.side-title .muted { font-weight: 600; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.side-title .muted:empty { display: none; }
.member-list { display: flex; flex-direction: column; gap: 2px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background .15s, opacity .15s; }
.member:hover { background: var(--surface-2); }
.member.off { opacity: .4; }
.member .av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--line-2); }
.member .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-left: 2px; }
.member .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.member .st { font-size: 11px; color: var(--faint); white-space: nowrap; }
.member .st.warn { color: var(--warn); font-weight: 600; }
.link-row { display: flex; gap: 6px; }
.link-row input { font-size: 12.5px; padding: 8px 10px; min-width: 0; border-radius: 10px; }
.booking-list { display: flex; flex-direction: column; gap: 6px; }
.bk { display: flex; gap: 10px; padding: 8px; border-radius: 11px; border: 1px solid var(--line); cursor: pointer; transition: background .15s, border-color .15s, transform .15s; background: #fff; }
.bk:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); }
.bk .when { width: 46px; flex: none; text-align: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); padding: 5px 0; line-height: 1.1; }
.bk .when b { display: block; font-size: 16px; }
.bk .when span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bk .info { min-width: 0; }
.bk .info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .info span { font-size: 12px; color: var(--muted); }
.legend { font-size: 12.5px; color: var(--muted); }
.legend-row { display: flex; align-items: center; gap: 9px; padding: 3px 0; }
.swatch { width: 20px; height: 12px; border-radius: 4px; background: var(--brand); flex: none; }
.swatch.hatch { background: repeating-linear-gradient(135deg, #c3c9d6 0 3px, #f1f3f8 3px 6px); border: 1px solid #c3c9d6; }
.swatch.booking { background: #fff; border: 2px solid var(--brand); }
.empty { color: var(--muted); font-size: 13px; padding: 8px 4px; line-height: 1.45; }

/* ---------- calendar grid ---------- */
.calendar { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.cal-head { display: grid; grid-template-columns: var(--time-w) repeat(var(--cols, 7), 1fr); border-bottom: 1px solid var(--line); }
.cal-head .dh { padding: 12px 6px 10px; text-align: center; border-left: 1px solid var(--line); }
.cal-head .dh .dow { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.cal-head .dh .dn { font-size: 21px; font-weight: 650; line-height: 1; margin-top: 4px; display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-head .dh.today .dn { background: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgba(79,70,229,.6); }
.cal-head .dh.today .dow { color: var(--brand); }
.cal-allday { display: grid; grid-template-columns: var(--time-w) repeat(var(--cols, 7), 1fr); border-bottom: 1px solid var(--line); min-height: 8px; background: var(--surface-2); }
.cal-allday .ad { border-left: 1px solid var(--line); padding: 3px 4px; display: flex; flex-direction: column; gap: 3px; min-height: 8px; }
.cal-allday .adl { font-size: 10px; color: var(--faint); text-align: right; padding: 5px 8px 0 0; }
.ad-chip { font-size: 11.5px; padding: 3px 8px; border-radius: 7px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ad-chip.busy { background: repeating-linear-gradient(135deg, #c3c9d6 0 3px, #f1f3f8 3px 6px); color: var(--muted); border: 1px solid #c3c9d6; }
.cal-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: thin; }
.cal-grid { display: grid; grid-template-columns: var(--time-w) repeat(var(--cols, 7), 1fr); position: relative; height: calc(var(--hour-h) * 24); }
.time-col { position: relative; }
.time-col .tl { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.day-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour-h); }
.day-col.today { background-color: #fafaff; }
.day-col.past-day { background-color: #fbfbfc; }
.day-col .off-hours { position: absolute; left: 0; right: 0; background: rgba(148,163,184,.09); pointer-events: none; }
.ev { position: absolute; border-radius: 8px; padding: 5px 8px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.14); transition: transform .15s var(--ease), box-shadow .15s; border-left: 3px solid rgba(0,0,0,.2); }
.ev:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(16,24,40,.4); z-index: 5; }
.ev .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .s { opacity: .88; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ev.busy { background: repeating-linear-gradient(135deg, var(--h1, #c3c9d6) 0 3px, #f7f8fb 3px 6px); color: #475467; border: 1px solid var(--h1, #c3c9d6); border-left-width: 3px; box-shadow: none; }
.ev.own-private { background: #fff; color: var(--text); border: 1px solid var(--c, var(--brand)); border-left-width: 3px; box-shadow: var(--sh-1); }
.ev.booking { background: #fff; color: var(--text); border: 2px solid var(--c, var(--brand)); border-left-width: 4px; }
.ev.booking .t::before { content: "\2605"; margin-right: 4px; font-size: 10px; color: var(--c, var(--brand)); }
.ev.transparent { opacity: .6; }
.ev.short { padding: 2px 7px; }
.ev.short .s { display: none; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 6; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.cal-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.5); z-index: 15; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; }

/* ---------- popover / menu ---------- */
.popover { position: fixed; z-index: 60; width: 372px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-3); padding: 0; animation: pop .16s var(--ease); overflow: hidden; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.pop-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), #fff); }
.pop-head .bar { width: 5px; align-self: stretch; border-radius: 3px; flex: none; }
.pop-head h3 { font-size: 15.5px; line-height: 1.3; flex: 1; word-break: break-word; padding-top: 3px; }
.pop-close { margin-left: auto; width: 32px; height: 32px; }
.pop-body { padding: 12px 14px 14px; }
.pop-meta { display: grid; gap: 8px; font-size: 13.5px; }
.pop-meta div { display: flex; gap: 10px; align-items: flex-start; }
.pop-meta svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--faint); }
.pop-meta .desc { white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow: auto; color: var(--muted); }
.pop-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.pop-actions:empty { display: none; }
.pop-actions .switch { margin-right: auto; font-size: 13px; }
.pop-who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.pop-who .av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.pop-add { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pop-add .addcal-title { font-size: 11px; margin-bottom: 8px; }
.menu { position: fixed; z-index: 60; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-3); padding: 6px; animation: pop .16s var(--ease); }
.menu-head { padding: 10px 12px 10px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font-weight: 500; }
.menu-item:hover { background: var(--surface-2); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(11,18,32,.5); backdrop-filter: blur(2px); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { position: relative; width: 100%; max-width: 580px; max-height: calc(100vh - 32px); background: var(--surface); border-radius: 18px; box-shadow: var(--sh-3); display: flex; flex-direction: column; animation: pop .2s var(--ease); }
.modal.wide { max-width: 740px; }
.modal-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h2 { font-size: 18px; flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 18px 18px; }
.modal-foot .left { margin-right: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -8px -22px 18px; padding: 0 22px; }
.tabs button { border: 0; background: transparent; padding: 11px 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; transition: color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabpane[hidden] { display: none; }
.avail-day { display: grid; grid-template-columns: 100px 1fr auto; align-items: start; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.avail-day:last-child { border-bottom: 0; }
.avail-day .dn { font-weight: 600; padding-top: 8px; }
.avail-day .wins { display: flex; flex-direction: column; gap: 6px; }
.win { display: flex; align-items: center; gap: 6px; }
.win input[type=time] { width: 122px; padding: 8px 9px; }
.avail-day .off { color: var(--faint); font-size: 13px; padding-top: 9px; }
.dur-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.steps { padding-left: 0; margin: 0; display: grid; gap: 16px; list-style: none; counter-reset: step; }
.steps li { position: relative; padding-left: 44px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.steps li strong { display: block; margin-bottom: 3px; font-size: 14.5px; }
.steps li > span { display: block; color: var(--muted); font-size: 13.5px; }
.steps .tcn { font-weight: 650; color: var(--text); }
.steps li .tip { margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); color: #92400e; font-size: 12.5px; }
.steps .link-row { margin-top: 8px; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.team-row .tinfo { flex: 1; min-width: 0; }
.team-row .tinfo strong { display: block; }
.team-row .tinfo span { font-size: 12px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-box { padding: 14px; border-radius: 12px; background: var(--brand-soft); margin-bottom: 16px; border: 1px solid #e0e3ff; }
.invite-box .link-row { margin-top: 8px; }
.inv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.sent-list { margin-top: 16px; display: grid; gap: 6px; }
.sent-list .addcal-title { margin-bottom: 2px; }
.sent-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sent-item .ch { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.sent-item .ch.fail { background: var(--danger-soft); color: var(--danger); }
.sent-item em { color: var(--danger); font-style: normal; }
.callout { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: #92400e; font-size: 13px; margin-bottom: 12px; }
.callout.danger { background: var(--danger-soft); color: #991b1b; }
.callout.ok { background: var(--ok-soft); color: #065f46; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 11px 15px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; font-size: 13.5px; box-shadow: var(--sh-3); animation: pop .2s var(--ease); display: flex; gap: 8px; align-items: center; max-width: min(92vw, 520px); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }

/* ---------- add-to-calendar group ---------- */
.addcal { position: relative; }
.addcal-title { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.addcal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.addcal-grid.compact { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.addcal-btn { display: inline-flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--text); font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; box-shadow: var(--sh-1); }
.addcal-grid.compact .addcal-btn { padding: 8px 8px; font-size: 12px; gap: 6px; border-radius: 10px; }
.addcal-btn:hover { border-color: #a5b4fc; box-shadow: 0 8px 18px -10px rgba(79,70,229,.45); transform: translateY(-1px); text-decoration: none; }
.addcal-btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--brand-ink); padding-left: 8px; }
.addcal-btn.ghost:hover { background: var(--brand-soft); transform: none; box-shadow: none; }
.addcal-ic { width: 20px; height: 20px; flex: none; display: inline-flex; }
.addcal-ic svg { width: 20px; height: 20px; }
.addcal-grid.compact .addcal-ic, .addcal-grid.compact .addcal-ic svg { width: 17px; height: 17px; }
.addcal-row { display: flex; gap: 4px; margin-top: 8px; }
.addcal-toast { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 8px; transition: opacity .3s; z-index: 2; }

/* ---------- public booking pages ---------- */
.bk-body { min-height: 100vh; padding: 36px 18px 48px; }
.bk-page { max-width: 1060px; margin: 0 auto; }
.bk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); display: grid; grid-template-columns: 350px 1fr; overflow: hidden; min-height: 600px; }
.bk-side { padding: 36px 32px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #fbfbff 0%, #fff 60%); display: flex; flex-direction: column; }
.bk-side .avs { display: flex; margin-bottom: 18px; }
.avs img, .avs .avf { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: #e2e8f0; box-shadow: 0 0 0 1px var(--line), 0 6px 16px -8px rgba(16,24,40,.3); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 20px; }
.avs.sm img, .avs.sm .avf { width: 30px; height: 30px; font-size: 12px; border-width: 2px; }
.avs > * + * { margin-left: -16px; }
.avs.sm > * + * { margin-left: -9px; }
.bk-side h1 { font-size: 26px; margin: 8px 0 10px; letter-spacing: -.02em; }
.bk-side .intro { color: var(--muted); font-size: 14.5px; white-space: pre-wrap; }
.bk-side .divider { height: 1px; background: var(--line); margin: 22px 0 18px; }
.bk-side .lbl { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.bk-side .dur-pills { margin-bottom: 18px; }
.dur-pills .dur { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 600; font-size: 13.5px; transition: all .15s var(--ease); box-shadow: var(--sh-1); }
.dur-pills .dur:hover { border-color: #a5b4fc; }
.dur-pills .dur.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(79,70,229,.6); }
.bk-meta { display: grid; gap: 10px; }
.bk-meta .mrow { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.bk-meta .mrow .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.bk-meta .mrow .ic svg { width: 17px; height: 17px; }
.bk-meta .mrow .mt { min-width: 0; flex: 1; }
.bk-meta .mrow .mt small { display: block; color: var(--faint); font-size: 12px; }
.bk-meta select { padding: 7px 10px; font-size: 13px; border-radius: 10px; width: 100%; box-shadow: none; }
.bk-side.locked .dur-pills, .bk-side.locked .bk-meta select { opacity: .55; pointer-events: none; }
.bk-side .powered { margin-top: auto; padding-top: 26px; font-size: 12px; color: var(--faint); }
.bk-side .powered a { color: var(--muted); }
.bk-main { padding: 32px 34px 36px; display: flex; flex-direction: column; min-width: 0; }
.rail { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.rail .rs { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--faint); }
.rail .rs i { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; }
.rail .rs.active { color: var(--text); }
.rail .rs.active i { background: var(--brand); border-color: var(--brand); color: #fff; }
.rail .rs.done { color: var(--muted); }
.rail .rs.done i { background: var(--ok-soft); border-color: #a7f3d0; color: var(--ok); }
.rail .rsep { width: 26px; height: 1px; background: var(--line-2); }
.pick { display: grid; grid-template-columns: minmax(0, 1fr) 224px; gap: 30px; align-items: start; }
.pick h2 { font-size: 17px; margin-bottom: 14px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month-nav strong { font-size: 15.5px; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month .dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 6px 0 4px; }
.day { aspect-ratio: 1; max-height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: transparent; font-weight: 600; font-size: 14px; cursor: default; color: #b8c0cc; position: relative; transition: background .15s, transform .15s var(--ease), box-shadow .15s; font-variant-numeric: tabular-nums; }
.day.avail { background: var(--brand-soft); color: var(--brand-ink); cursor: pointer; }
.day.avail:hover { background: #e0e3ff; transform: scale(1.06); }
.day.sel { background: var(--brand); color: #fff; box-shadow: 0 8px 16px -8px rgba(79,70,229,.7); }
.day.today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.slots { display: flex; flex-direction: column; gap: 8px; max-height: 440px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.slots h3 { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot { padding: 11px 12px; border: 1px solid var(--brand); color: var(--brand-ink); background: #fff; border-radius: 12px; font-weight: 650; text-align: center; cursor: pointer; transition: background .15s, color .15s, transform .15s var(--ease), box-shadow .15s; font-variant-numeric: tabular-nums; }
.slot:hover { background: var(--brand-soft); transform: translateY(-1px); box-shadow: var(--sh-2); }
.slot.sel { background: #1f2937; border-color: #1f2937; color: #fff; }
.slot-confirm { display: flex; gap: 6px; animation: pop .15s var(--ease); }
.slot-confirm .slot { flex: 1; }
.slot-confirm .btn { flex: 1; padding: 11px 10px; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 12px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

.bk-form .summary { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--brand-soft); border: 1px solid #e0e3ff; margin-bottom: 22px; }
.date-tile { width: 58px; flex: none; text-align: center; border-radius: 12px; background: #fff; border: 1px solid #e0e3ff; box-shadow: var(--sh-1); overflow: hidden; }
.date-tile span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--brand); color: #fff; padding: 4px 0 3px; }
.date-tile b { display: block; font-size: 24px; line-height: 1.15; padding: 4px 0 6px; color: var(--text); font-variant-numeric: tabular-nums; }
.summary .sm-text strong { display: block; font-size: 15px; }
.summary .sm-text span { font-size: 13px; color: var(--muted); }
.bk-form .fine { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 12px; }
.bk-form .fine svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }

.done { text-align: center; padding: 6px 4px 0; }
.done .check { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; box-shadow: 0 0 0 10px #f0fdf4; animation: popin .5s var(--ease); }
@keyframes popin { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.done .check svg { width: 34px; height: 34px; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h2 { font-size: 24px; margin-bottom: 6px; letter-spacing: -.02em; }
.done .lead { color: var(--muted); font-size: 14.5px; max-width: 46ch; margin: 0 auto; }
.done .card { text-align: left; margin: 22px auto 0; max-width: 460px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; box-shadow: var(--sh-2); background: #fff; }
.done .card .drow { display: flex; gap: 12px; align-items: flex-start; }
.done .card .drow > svg { width: 17px; height: 17px; color: var(--faint); flex: none; margin-top: 2px; }
.done .card .drow strong { display: block; }
.done .card .drow span { color: var(--muted); font-size: 13.5px; word-break: break-word; }
.done .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.done .addcal { text-align: left; max-width: 560px; margin: 24px auto 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.done .manage { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* manage page */
.mg-card { max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 36px 34px; }
.mg-card .logo img { height: 30px; width: auto; display: block; margin-bottom: 22px; }
.mg-card .who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mg-card h1 { font-size: 24px; margin: 8px 0 16px; letter-spacing: -.02em; }
.mg-card .details { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; background: #fff; box-shadow: var(--sh-1); }
.mg-card .details .drow { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.mg-card .details .drow > svg { width: 17px; height: 17px; color: var(--faint); flex: none; margin-top: 2px; }
.mg-card .details .drow strong { display: block; }
.mg-card .details .drow span { color: var(--muted); font-size: 13.5px; word-break: break-word; }
.mg-card .addcal { margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.mg-card .mg-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.mg-card .cancel-box { margin-top: 14px; padding: 16px; border: 1px solid #fecaca; border-radius: 14px; background: var(--danger-soft); }
.mg-card .cancel-box label.f { color: #991b1b; }
.book-foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 18px; }
.book-foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 260px 1fr; }
  .bk-card { grid-template-columns: 310px 1fr; }
}
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; max-width: 520px; }
  .auth-hero { padding: 28px 26px; gap: 18px; }
  .auth-hero h2 { font-size: 24px; }
  .auth-hero .mini-cal { display: none; }
  .auth-panel { padding: 30px 26px 34px; }
  .bk-card { grid-template-columns: 1fr; min-height: 0; }
  .bk-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 24px 24px; }
  .bk-side .powered { display: none; }
  .bk-main { padding: 26px 22px 30px; }
  .pick { grid-template-columns: 1fr; gap: 22px; }
  .slots { max-height: none; }
  .slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .slot-confirm { grid-column: 1 / -1; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-flex !important; }
  .hide-mobile { display: none; }
  .brand { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 10px; gap: 6px; height: 56px; }
  .range-label { font-size: 15px; }
  .seg { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 330px); z-index: 70; transform: translateX(-105%); transition: transform .22s var(--ease); box-shadow: var(--sh-3); background: var(--surface); }
  .sidebar.open { transform: none; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(11,18,32,.45); z-index: 65; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  :root { --time-w: 46px; --hour-h: 52px; }
  .cal-head .dh .dn { font-size: 18px; width: 30px; height: 30px; }
  .popover { left: 8px !important; right: 8px !important; width: auto; bottom: 8px; top: auto !important; max-height: 78vh; overflow-y: auto; z-index: 76; }
  .avail-day { grid-template-columns: 1fr auto; }
  .avail-day .wins { grid-column: 1 / -1; }
  .win { flex-wrap: wrap; }
  .win input[type=time] { flex: 1 1 0; min-width: 0; width: auto; }
  .bk-body { padding: 16px 12px 40px; }
  .mg-card { padding: 28px 22px; }
  .addcal-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .addcal-grid { grid-template-columns: 1fr; }
  .addcal-grid.compact { grid-template-columns: repeat(3, 1fr); }
  .bk-side h1 { font-size: 22px; }
}
