/* ==========================================================================
   Rantevou design system
   Warm off-white ground, ink text, one brand accent (per business via --accent)
   ========================================================================== */
:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #efece8;
  --ink: #1c1a19;
  --ink-2: #4a4542;
  --muted: #6f6a66;
  --faint: #9a938d;
  --line: #e6e1dc;
  --line-2: #efece8;
  --accent: #7a2f5e;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, white);
  --accent-soft-2: color-mix(in oklab, var(--accent) 24%, white);
  --accent-deep: color-mix(in oklab, var(--accent) 80%, black);
  --success: #2f7a4f;
  --success-soft: #e6efe9;
  --danger: #a33a3a;
  --danger-soft: #fbeaea;
  --warn: #b3641e;
  --warn-soft: #f8ecdf;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 8px 24px rgba(28, 26, 25, 0.06);
  --shadow-lg: 0 20px 50px rgba(28, 26, 25, 0.14);
  --font: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: Literata, Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.2, 0.9, 0.3, 1.3);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161514; --surface: #1f1d1c; --surface-2: #2a2725; --ink: #f2efeb; --ink-2: #d5d0ca; --muted: #a39d97; --faint: #726c67;
    --line: #34302d; --line-2: #2a2725; --accent-soft: color-mix(in oklab, var(--accent) 22%, #1f1d1c); --accent-soft-2: color-mix(in oklab, var(--accent) 38%, #1f1d1c);
    --success-soft: #1e3327; --danger-soft: #3a2222; --warn-soft: #3a2c1c; --shadow: 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-family: var(--font-display); font-weight: 500; font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft-2); }

/* View transitions (MPA) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 160ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 260ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Entrance animations */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: rise 0.5s var(--ease) both; }
.stagger > * { animation: rise 0.45s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s } .stagger > *:nth-child(2) { animation-delay: 0.06s } .stagger > *:nth-child(3) { animation-delay: 0.10s }
.stagger > *:nth-child(4) { animation-delay: 0.14s } .stagger > *:nth-child(5) { animation-delay: 0.18s } .stagger > *:nth-child(6) { animation-delay: 0.22s }
.stagger > *:nth-child(7) { animation-delay: 0.26s } .stagger > *:nth-child(8) { animation-delay: 0.30s } .stagger > *:nth-child(n+9) { animation-delay: 0.34s }

/* ---------- Layout primitives ---------- */
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 10px); }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex-grow: 1; }
.grid { display: grid; gap: var(--gap, 14px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-s { margin-top: 8px; } .mb-s { margin-bottom: 8px; }
.hide { display: none !important; }
.label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.num { font-family: var(--font-display); font-size: 30px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.pad-s { padding: 14px 16px; }
.card.soft { background: var(--accent-soft); border-color: transparent; }
.card.flat { box-shadow: none; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.tile.hl { border-color: var(--accent-soft-2); background: color-mix(in oklab, var(--accent) 5%, var(--surface)); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: transform 0.15s var(--ease), box-shadow 0.15s, background 0.15s, border-color 0.15s; white-space: nowrap; user-select: none; }
.btn:hover { border-color: var(--faint); color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px color-mix(in oklab, var(--accent) 30%, transparent); }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.dark:hover { color: var(--bg); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 54px; padding: 0 24px; font-size: 16px; border-radius: var(--radius); }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 36px; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); }
.input, input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"], input[type="month"], select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="color"] { width: 44px; height: 44px; padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check.top { align-items: flex-start; }
.check input { flex-shrink: 0; margin-top: 2px; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f6a66' stroke-width='2.4' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); border: 0; background: transparent; cursor: pointer; transition: background 0.15s, color 0.15s; }
.segmented .on { background: var(--ink); color: var(--bg); }

/* ---------- Pills, badges, avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.dark { background: var(--ink); color: var(--bg); }
.pill.outline { background: transparent; border: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---------- Tables / lists ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.link { cursor: pointer; transition: background 0.12s; }
.tbl tr.link:hover { background: var(--surface-2); }
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.list > .item:first-child { border-top: 0; }
.list > a.item { color: inherit; transition: background 0.12s; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 10px; }
.list > a.item:hover { background: var(--surface-2); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Flash messages ---------- */
.flashes { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100% - 32px)); pointer-events: none; }
.flash { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise 0.4s var(--ease) both; }
.flash.success { background: var(--success); color: #fff; }
.flash.error { background: var(--danger); color: #fff; }
.flash button { margin-left: auto; background: transparent; border: 0; color: inherit; opacity: 0.7; cursor: pointer; font-size: 18px; line-height: 1; }

/* ---------- Dialog / sheet ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: min(560px, calc(100% - 32px)); width: 100%; margin: auto; }
dialog::backdrop { background: rgba(20, 18, 17, 0.5); backdrop-filter: blur(2px); animation: fade 0.2s both; }
dialog[open] .sheet { animation: rise 0.3s var(--ease) both; }
.sheet { background: var(--surface); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); max-height: 90dvh; overflow: auto; }
@media (max-width: 640px) {
  dialog { max-width: 100%; margin: auto 0 0 0; }
  .sheet { border-radius: 20px 20px 0 0; }
}

/* ---------- Progress / bars ---------- */
.bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; transform-origin: left; animation: grow 0.8s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.steps { display: flex; gap: 6px; }
.steps > i { flex-grow: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background 0.3s; }
.steps > i.on { background: var(--accent); }

/* ==========================================================================
   Public booking (mobile-first, max 480px column)
   ========================================================================== */
.pub { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 20px 24px; padding-top: max(20px, env(safe-area-inset-top)); }
.pub.wide { max-width: 720px; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand .logo { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 18px; overflow: hidden; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand b { font-size: 15px; display: block; }
.brand span { font-size: 12px; color: var(--muted); display: block; }
.pub h1 { font-size: 26px; }
.pub-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 0 6px; }
.pub-foot { margin-top: auto; padding-top: 16px; font-size: 12px; color: var(--faint); text-align: center; }
.pub-foot a { color: var(--muted); }

.option { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); cursor: pointer; transition: transform 0.15s var(--ease), border-color 0.15s, box-shadow 0.15s; min-height: 64px; }
.option:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.option:active { transform: scale(0.99); }
.option .t { font-weight: 700; font-size: 15px; }
.option .s { font-size: 13px; color: var(--muted); }
.option .p { margin-left: auto; font-weight: 700; white-space: nowrap; }
.option .chev { color: var(--faint); flex-shrink: 0; }
.cat-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin: 18px 0 10px; }

.daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 10px 0 16px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s; min-height: 58px; justify-content: center; }
.day small { font-size: 11px; font-weight: 600; color: var(--muted); }
.day b { font-size: 16px; }
.day:hover { border-color: var(--accent); }
.day.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px color-mix(in oklab, var(--accent) 30%, transparent); }
.day.on small { color: rgba(255,255,255,0.85); }
.day.off { color: var(--faint); pointer-events: none; background: transparent; border-style: dashed; }
.day.off small { color: var(--faint); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot { height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; transition: transform 0.15s var(--ease), border-color 0.15s, background 0.15s; animation: pop 0.3s var(--ease) both; }
.slot:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--ink); }
.slot.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sticky-cta { position: sticky; bottom: 0; margin: 16px -20px 0; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.summary { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.summary b { color: var(--ink); }
.datebox { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; flex-shrink: 0; }
.datebox small { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; }
.datebox b { font-size: 22px; font-weight: 800; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--success); display: flex; align-items: center; justify-content: center; margin: 24px auto 14px; box-shadow: 0 12px 28px rgba(47,122,79,0.3); animation: pop 0.5s var(--ease-spring) both; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; }
.kv span:first-child { color: var(--muted); }
.kv b { text-align: right; }
.hr { height: 1px; background: var(--line-2); margin: 8px 0; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; overflow: auto; background: var(--bg); }
.side .brand { padding: 0 8px 20px; }
.nav { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background 0.12s, color 0.12s; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav:hover { background: var(--surface-2); color: var(--ink); }
.nav.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28,26,25,0.06); }
.nav .badge { margin-left: auto; font-size: 11px; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 7px; }
.main { min-width: 0; padding: 22px 28px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar h1 { font-size: 26px; }
.side-user { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 16px 16px 90px; }
  .mobile-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 50; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: var(--muted); padding: 4px 8px; border-radius: 10px; min-width: 56px; }
  .mobile-bar a.on { color: var(--accent); }
  .mobile-bar svg { width: 22px; height: 22px; }
  .topbar h1 { font-size: 22px; }
}

/* Calendar */
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.cal-head { display: grid; grid-template-columns: 56px repeat(var(--cols, 3), minmax(140px, 1fr)); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 3; }
.cal-head > div { padding: 10px 12px; border-left: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-head > div:first-child { border-left: 0; }
.cal-scroll { overflow: auto; max-height: calc(100dvh - 210px); }
.cal-body { display: grid; grid-template-columns: 56px repeat(var(--cols, 3), minmax(140px, 1fr)); }
.cal-times { position: relative; }
.cal-times > div { height: var(--hour-h, 64px); font-size: 11px; color: var(--faint); text-align: right; padding: 4px 8px 0 0; border-top: 1px solid var(--line-2); }
.cal-col { position: relative; border-left: 1px solid var(--line-2); background-image: linear-gradient(var(--line-2) 1px, transparent 1px); background-size: 100% var(--hour-h, 64px); cursor: crosshair; }
.cal-col .offhours { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in oklab, var(--ink) 4%, transparent) 6px 7px); pointer-events: none; }
.ev { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 6px 8px; font-size: 12px; overflow: hidden; cursor: pointer; border-left: 3px solid var(--c, var(--accent)); background: color-mix(in oklab, var(--c, var(--accent)) 12%, var(--surface)); color: var(--ink); transition: transform 0.12s var(--ease), box-shadow 0.12s; animation: fade 0.3s both; line-height: 1.3; }
.ev:hover { transform: scale(1.01); box-shadow: var(--shadow); z-index: 2; }
.ev b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .m { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.pending { border-left-style: dashed; opacity: 0.85; }
.ev.completed { background: var(--success-soft); border-left-color: var(--success); }
.ev.no_show { background: var(--danger-soft); border-left-color: var(--danger); }
.ev.cancelled { background: transparent; border: 1.5px dashed var(--faint); color: var(--muted); }
.ev.block { background: var(--surface-2); border-left-color: var(--faint); color: var(--muted); cursor: default; }
.ev.off { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 6px, transparent 6px 12px); border-left-color: var(--faint); color: var(--muted); cursor: default; }
.ev .tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.ev .tags i { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--surface); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 1; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.week-day { border-left: 1px solid var(--line-2); padding: 8px; min-height: 120px; }
.week-day .d { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.week-day .d.today { color: var(--accent); }
.week-ev { display: block; font-size: 12px; padding: 4px 8px; border-radius: 8px; margin-bottom: 4px; border-left: 3px solid var(--c, var(--accent)); background: color-mix(in oklab, var(--c, var(--accent)) 12%, var(--surface)); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); }

/* Heatmap */
.heat { display: grid; gap: 4px; font-size: 10px; color: var(--faint); align-items: center; }
.heat span { text-align: center; }
.heat span.lbl { text-align: left; }
.heat i { display: block; height: 18px; border-radius: 4px; background: color-mix(in oklab, var(--accent) calc(var(--v) * 100%), var(--surface-2)); }

/* Chart bars */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 24px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .col i { width: 100%; max-width: 44px; border-radius: 6px 6px 3px 3px; background: var(--accent-soft-2); transform-origin: bottom; animation: growY 0.7s var(--ease) both; display: block; position: relative; }
.chart .col.on i { background: var(--accent); }
.chart .col i::after { content: attr(data-v); position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; opacity: 0; transition: opacity 0.15s; }
.chart .col:hover i::after, .chart .col.on i::after { opacity: 1; }
.chart .col small { font-size: 11px; color: var(--faint); }
@keyframes growY { from { transform: scaleY(0); } }

/* Auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 400px; padding: 32px; }

/* Landing */
.hero { max-width: 720px; margin: 0 auto; padding: 80px 20px 40px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; margin-bottom: 16px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 520px; margin: 0 auto 28px; }
.features { max-width: 960px; margin: 40px auto; padding: 0 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }
.plans { max-width: 960px; margin: 0 auto 60px; padding: 0 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.plan .price { font-family: var(--font-display); font-size: 40px; }
.plan ul { padding-left: 18px; margin: 12px 0; color: var(--ink-2); font-size: 14px; line-height: 1.8; }

/* Autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 20; overflow: hidden; }
.ac-list button { display: flex; flex-direction: column; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: transparent; cursor: pointer; }
.ac-list button:hover { background: var(--surface-2); }
.ac-list small { color: var(--muted); }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; height: 46px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Install banner */
.install { display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; background: var(--ink); color: var(--bg); border-radius: 16px; padding: 12px 14px; gap: 12px; align-items: center; z-index: 60; box-shadow: var(--shadow-lg); animation: rise 0.4s var(--ease) both; }
.install.on { display: flex; }
.install .btn { height: 36px; }

.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; word-break: break-all; user-select: all; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
details.acc summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.acc summary::after { content: "+"; color: var(--muted); font-size: 18px; }
details.acc[open] summary::after { content: "−"; }
.impersonate { background: var(--warn); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 6px; }
