/* ==========================================================================
   From Dark to Shine — design system
   Tailwind provides the utilities; this file holds the brand: tokens,
   components and motion. Everything here respects prefers-reduced-motion.
   ========================================================================== */

:root {
  --canvas: #0b0a09;
  --surface: #141210;
  --raised: #1b1815;
  --line: #2a2520;
  --line-soft: #1f1c18;
  --cream: #ede8e0;
  --ivory: #f7f3ec;
  --muted: #a0988c;
  --faint: #6e675e;
  --gold: #c4a87c;
  --gold-deep: #9e845c;
  --accent: #3a818e;
  --accent-deep: #2e5961;
  --danger: #d9776b;
  --success: #7fb59a;
  --warning: #d8b26a;
  --phone: #8e86c9;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Didot", "GFS Didot", "Bodoni Moda", "Playfair Display", Georgia, serif;
  --radius: 4px;
  color-scheme: dark;
}

* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  background: var(--canvas);
  color: var(--cream);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(196, 168, 124, 0.35); color: var(--ivory); }

.font-display { font-family: var(--display); font-weight: 400; letter-spacing: 0.005em; }

/* Film grain + vignette: depth without imagery */
.grain::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, 3%); }
  80% { transform: translate(3%, -1%); }
}
.vignette {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(196, 168, 124, 0.09), transparent 60%),
    radial-gradient(90% 60% at 50% 110%, rgba(58, 129, 142, 0.07), transparent 60%),
    var(--canvas);
}

/* ── Logo ──────────────────────────────────────────────────────────── */
.kb-logo { display: inline-block; color: #fff; }
.kb-logo svg { display: block; width: 100%; height: 100%; overflow: visible; }
.kb-logo .frame { fill: none; stroke: currentColor; }
.kb-logo.animate .frame {
  stroke-dasharray: 9000;
  stroke-dashoffset: 9000;
  animation: draw-frame 1.8s var(--ease-out) 0.15s forwards;
}
.kb-logo.animate .letters {
  opacity: 0;
  filter: blur(14px);
  transform: scale(1.06);
  transform-origin: center;
  transform-box: fill-box;
  animation: letters-in 1.4s var(--ease-out) 0.6s forwards;
}
@keyframes draw-frame { to { stroke-dashoffset: 0; } }
@keyframes letters-in { to { opacity: 1; filter: blur(0); transform: scale(1); } }

.logo-button { position: relative; cursor: pointer; transition: transform 0.6s var(--ease); }
.logo-button::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(255, 255, 255, 0);
  transition: border-color 0.6s var(--ease), inset 0.6s var(--ease);
}
.logo-button:hover::after { border-color: rgba(255, 255, 255, 0.12); inset: -14px; }
.logo-button:active { transform: scale(0.97); }

/* ── Type details ─────────────────────────────────────────────────── */
.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.hairline { height: 1px; background: linear-gradient(90deg, transparent, rgba(196, 168, 124, 0.55), transparent); }
.hairline-left { height: 1px; background: linear-gradient(90deg, rgba(196, 168, 124, 0.5), transparent); }
.shine-text {
  background: linear-gradient(100deg, var(--cream) 0%, var(--cream) 40%, #fff 50%, var(--gold) 58%, var(--cream) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 7s var(--ease) 1.4s infinite;
}
@keyframes shine { 0% { background-position: 100% 0; } 35%, 100% { background-position: -50% 0; } }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 3.25rem;
  padding: 0 1.75rem;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  transition: transform 0.5s var(--ease), background-color 0.4s var(--ease), color 0.4s var(--ease),
    border-color 0.4s var(--ease), opacity 0.3s, box-shadow 0.5s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--ivory); color: var(--canvas); }
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(196, 168, 124, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}
.btn-primary:hover:not(:disabled)::before { transform: translateX(120%); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 18px 50px -18px rgba(247, 243, 236, 0.35); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #43919f; box-shadow: 0 14px 40px -14px rgba(58, 129, 142, 0.7); }
.btn-ghost { border: 1px solid var(--line); color: var(--cream); background: transparent; }
.btn-ghost:hover:not(:disabled) { border-color: rgba(196, 168, 124, 0.5); color: var(--ivory); }
.btn-danger { border: 1px solid rgba(217, 119, 107, 0.35); color: var(--danger); background: rgba(217, 119, 107, 0.06); }
.btn-danger:hover:not(:disabled) { background: rgba(217, 119, 107, 0.14); }
.btn-sm { height: 2.5rem; padding: 0 1.1rem; font-size: 11.5px; letter-spacing: 0.12em; }
.btn-xs { height: 2rem; padding: 0 0.8rem; font-size: 11px; letter-spacing: 0.08em; }
.btn .arrow { transition: transform 0.5s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.icon { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Cards & surfaces ─────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, rgba(27, 24, 21, 0.75), rgba(20, 18, 16, 0.75));
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}
.glass {
  background: rgba(14, 13, 12, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
}

/* ── Booking: original layout (labels, cards, summary, button) ─────── */
.step-label { display: block; margin-bottom: 0.75rem; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sum-label { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sum-value { font-size: 13px; font-weight: 500; color: var(--cream); text-align: right; }

.service-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  text-align: left;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 18, 16, 0.6);
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease), box-shadow 0.5s var(--ease), transform 0.2s var(--ease);
}
.service-card:hover { border-color: rgba(58, 129, 142, 0.45); }
.service-card:active { transform: scale(0.985); }
.service-card[aria-checked="true"] {
  border-color: var(--accent);
  background: rgba(46, 89, 97, 0.12);
  box-shadow: 0 0 0 4px rgba(46, 89, 97, 0.08), 0 0 24px 2px rgba(46, 89, 97, 0.06);
}
.service-card .selected-indicator { opacity: 0; transform: translateY(2px); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.service-card[aria-checked="true"] .selected-indicator { opacity: 1; transform: none; }

.btn-book {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 1rem 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 32px rgba(46, 89, 97, 0.3);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.15s var(--ease), opacity 0.3s;
}
.btn-book::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 50%, rgba(255, 255, 255, 0.04)); }
.btn-book:hover:not(:disabled) { background: var(--cream); color: var(--canvas); }
.btn-book:active:not(:disabled) { transform: scale(0.97); }
.btn-book:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-book .spinner { color: #fff; }

/* ── Booking: date strip ──────────────────────────────────────────── */
.date-strip { scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 62px;
  height: 78px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(20, 18, 16, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.45s var(--ease);
}
.date-chip:hover:not(:disabled) { border-color: rgba(58, 129, 142, 0.45); }
.date-chip .num { font-family: var(--display); font-size: 22px; line-height: 1; margin: 2px 0; color: var(--cream); }
.date-chip .dow, .date-chip .mon { font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.date-chip:disabled { opacity: 0.28; cursor: not-allowed; }
.date-chip:disabled .num { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: rgba(237, 232, 224, 0.4); }
.date-chip[data-status="full"]:disabled::after { content: "Full"; font-size: 8.5px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }
.date-chip[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(46, 89, 97, 0.35);
}
.date-chip[aria-checked="true"] .num { color: #fff; }
.date-chip[aria-checked="true"] .dow, .date-chip[aria-checked="true"] .mon { color: rgba(255, 255, 255, 0.8); }
.date-chip:active:not(:disabled) { transform: scale(0.94); }
.date-fade { -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 48px), transparent); }

/* ── Booking: time slots ──────────────────────────────────────────── */
.slot {
  height: 3rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(20, 18, 16, 0.6);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--cream);
  transition: all 0.4s var(--ease);
}
.slot:hover { border-color: rgba(58, 129, 142, 0.5); color: var(--ivory); }
.slot:active { transform: scale(0.96); }
.slot[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 12px 30px -12px rgba(58, 129, 142, 0.8); }

/* ── Forms ────────────────────────────────────────────────────────── */
.field { display: block; }
.field-label { display: block; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; font-weight: 500; }
.input {
  width: 100%;
  height: 3.1rem;
  padding: 0 1rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(11, 10, 9, 0.6);
  color: var(--ivory);
  font-size: 16px; /* no iOS zoom */
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.35s;
}
textarea.input { height: auto; padding: 0.85rem 1rem; line-height: 1.5; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23A0988C' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: rgba(196, 168, 124, 0.7); box-shadow: 0 0 0 4px rgba(196, 168, 124, 0.1); background: rgba(11, 10, 9, 0.9); }
.input[aria-invalid="true"] { border-color: rgba(217, 119, 107, 0.7); }
.input-sm { height: 2.5rem; font-size: 15px; padding: 0 0.75rem; }
input[type="time"].input, input[type="date"].input { color-scheme: dark; font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
:focus-visible { outline: 1px solid rgba(196, 168, 124, 0.8); outline-offset: 3px; }

/* Toggle */
.toggle { position: relative; display: inline-flex; width: 46px; height: 28px; flex-shrink: 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #2a2520; transition: background 0.4s var(--ease); }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.45s var(--ease), background 0.3s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + span { outline: 1px solid var(--gold); outline-offset: 3px; }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(11, 10, 9, 0.5); }
.segmented a, .segmented button { padding: 0.45rem 0.9rem; border-radius: 4px; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); transition: all 0.35s var(--ease); white-space: nowrap; }
.segmented .on, .segmented [aria-selected="true"] { background: var(--raised); color: var(--ivory); box-shadow: 0 0 0 1px var(--line); }

.chip { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.6rem; padding: 0 0.6rem; border-radius: 999px; font-size: 11px; letter-spacing: 0.04em; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.chip-gold { color: var(--gold); border-color: rgba(196, 168, 124, 0.35); background: rgba(196, 168, 124, 0.07); }
.chip-accent { color: #8cc5cf; border-color: rgba(58, 129, 142, 0.45); background: rgba(58, 129, 142, 0.1); }
.chip-warn { color: var(--warning); border-color: rgba(216, 178, 106, 0.4); background: rgba(216, 178, 106, 0.08); }
.chip-danger { color: var(--danger); border-color: rgba(217, 119, 107, 0.4); background: rgba(217, 119, 107, 0.08); }
.chip-ok { color: var(--success); border-color: rgba(127, 181, 154, 0.4); background: rgba(127, 181, 154, 0.08); }
.chip-phone { color: #b5afe6; border-color: rgba(142, 134, 201, 0.4); background: rgba(142, 134, 201, 0.1); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Motion: reveal on scroll / on swap ───────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out), filter 1s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal].in { opacity: 1; transform: none; filter: none; }
.stagger > * { animation: rise 0.8s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; } .stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; } .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.3s; }
.stagger > *:nth-child(n + 9) { animation-delay: 0.34s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.htmx-added.fade-in, .fade-in { animation: fade 0.6s var(--ease-out) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.htmx-request .when-loading { opacity: 1; }
.when-loading { opacity: 0; transition: opacity 0.3s; }
.htmx-request.dim-on-load, .htmx-request .dim-on-load { opacity: 0.45; transition: opacity 0.3s; }

.skeleton { position: relative; overflow: hidden; background: rgba(27, 24, 21, 0.7); border-radius: 4px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(237, 232, 224, 0.05), transparent); animation: sweep 1.6s infinite; }
@keyframes sweep { to { transform: translateX(100%); } }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(237, 232, 224, 0.2); border-top-color: currentColor; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* View transitions between steps (Chrome, Safari 18+) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: var(--ease); }

/* ── Modal & drawer ───────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 5, 4, 0); transition: background 0.5s var(--ease); }
@media (min-width: 640px) { .overlay { align-items: center; } }
.overlay.open { background: rgba(5, 5, 4, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.overlay .sheet { width: 100%; max-width: 420px; transform: translateY(40px) scale(0.98); opacity: 0; transition: transform 0.6s var(--ease-out), opacity 0.45s var(--ease-out); max-height: 92dvh; overflow-y: auto; }
.overlay.open .sheet { transform: none; opacity: 1; }
.drawer-overlay { justify-content: flex-end; align-items: stretch; }
.drawer-overlay .sheet { max-width: 520px; height: 100dvh; max-height: 100dvh; transform: translateX(40px); border-radius: 0; }
@media (max-width: 639px) { .drawer-overlay { align-items: flex-end; } .drawer-overlay .sheet { height: auto; max-height: 94dvh; transform: translateY(60px); border-radius: 14px 14px 0 0; } }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 0; }

/* ── Toasts ───────────────────────────────────────────────────────── */
#toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
@media (min-width: 1024px) { #toasts { bottom: 32px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1.1rem; border-radius: 999px; font-size: 13px; color: var(--ivory); background: rgba(27, 24, 21, 0.92); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9); animation: toast-in 0.6s var(--ease-out) both; }
.toast.out { animation: toast-out 0.45s var(--ease) forwards; }
.toast.error { border-color: rgba(217, 119, 107, 0.45); }
.toast.error .icon { color: var(--danger); }
.toast.ok .icon { color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* Saved indicator (admin autosave) */
.saved-pill { position: fixed; z-index: 85; top: calc(env(safe-area-inset-top) + 14px); right: 16px; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 12px; color: var(--success); background: rgba(20, 18, 16, 0.9); border: 1px solid rgba(127, 181, 154, 0.3); opacity: 0; transform: translateY(-8px); transition: all 0.45s var(--ease); pointer-events: none; }
.saved-pill.show { opacity: 1; transform: none; }
.saved-pill.saving { color: var(--muted); border-color: var(--line); }

/* ── Admin shell ──────────────────────────────────────────────────── */
.nav-link { display: flex; align-items: center; gap: 0.85rem; height: 2.75rem; padding: 0 0.9rem; border-radius: 6px; font-size: 13.5px; color: var(--muted); transition: all 0.35s var(--ease); }
.nav-link:hover { color: var(--ivory); background: rgba(237, 232, 224, 0.03); }
.nav-link.on { color: var(--ivory); background: rgba(237, 232, 224, 0.05); box-shadow: inset 2px 0 0 var(--gold); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; letter-spacing: 0.06em; color: var(--faint); transition: color 0.3s; flex: 1; height: 100%; }
.tabbar a .icon { width: 22px; height: 22px; stroke-width: 1.5; }
.tabbar a.on { color: var(--ivory); }
.tabbar a.on .icon { color: var(--gold); }
.fab { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 45; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ivory); color: var(--canvas); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1); transition: transform 0.5s var(--ease); }
.fab:active { transform: scale(0.94); }
@media (min-width: 1024px) { .fab { bottom: 32px; right: 32px; } }

.stat-num { font-family: var(--display); font-size: 34px; line-height: 1; color: var(--ivory); font-variant-numeric: lining-nums; }
.row-link { transition: background-color 0.3s var(--ease); }
.row-link:hover { background: rgba(237, 232, 224, 0.025); }

/* ── Calendar ─────────────────────────────────────────────────────── */
.cal { --hour: 64px; position: relative; }
.cal-col { position: relative; border-left: 1px solid var(--line-soft); touch-action: pan-x pan-y; }
.cal-col.today { background: linear-gradient(180deg, rgba(196, 168, 124, 0.04), transparent 60%); }
.cal-hour { height: var(--hour); border-top: 1px solid var(--line-soft); }
.cal-hour:nth-child(odd) { border-top-color: rgba(42, 37, 32, 0.55); }
.cal-closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(11, 10, 9, 0.75) 0 6px, rgba(20, 18, 16, 0.75) 6px 12px); pointer-events: none; }
.cal-break { position: absolute; left: 0; right: 0; background: rgba(237, 232, 224, 0.025); border-top: 1px dashed rgba(160, 152, 140, 0.2); border-bottom: 1px dashed rgba(160, 152, 140, 0.2); pointer-events: none; }
.cal-ev { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; text-align: left; position: absolute; left: 4px; right: 4px; border-radius: 4px; padding: 5px 7px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.cal-ev:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.9); z-index: 5; }
.cal-ev.appt { background: rgba(58, 129, 142, 0.22); border-left: 2px solid var(--accent); color: var(--ivory); }
.cal-ev.pending { background: rgba(216, 178, 106, 0.14); border-left: 2px solid var(--warning); }
.cal-ev.done { background: rgba(58, 129, 142, 0.1); border-left-color: rgba(58, 129, 142, 0.5); color: var(--muted); }
.cal-ev.ext { background: rgba(142, 134, 201, 0.18); border-left: 2px solid var(--phone); color: var(--ivory); }
.cal-ev.off { background: repeating-linear-gradient(135deg, rgba(217, 119, 107, 0.12) 0 8px, rgba(217, 119, 107, 0.05) 8px 16px); border: 1px solid rgba(217, 119, 107, 0.3); color: #e9b1a9; }
.cal-ev.clash { box-shadow: 0 0 0 1px var(--danger); }
.cal-select { position: absolute; left: 3px; right: 3px; border-radius: 4px; background: rgba(196, 168, 124, 0.18); border: 1px solid rgba(196, 168, 124, 0.7); pointer-events: none; z-index: 6; font-size: 11px; color: var(--ivory); padding: 4px 6px; }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--danger); z-index: 7; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.month-cell { min-height: 84px; border: 1px solid var(--line-soft); border-radius: 4px; padding: 6px; transition: all 0.3s var(--ease); cursor: pointer; user-select: none; position: relative; }
.month-cell:hover { border-color: rgba(196, 168, 124, 0.35); }
.month-cell.other { opacity: 0.35; }
.month-cell.closed { background: rgba(11, 10, 9, 0.6); }
.month-cell.blocked { background: repeating-linear-gradient(135deg, rgba(217, 119, 107, 0.12) 0 8px, rgba(217, 119, 107, 0.04) 8px 16px); border-color: rgba(217, 119, 107, 0.3); }
.month-cell.sel { background: rgba(196, 168, 124, 0.16); border-color: rgba(196, 168, 124, 0.75); }
.month-cell.today .mnum { color: var(--canvas); background: var(--gold); }
.mnum { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ── From dark to shine: the transition into the light confirmation ── */
html.shine-html, body.shine-page { background: #f6f1e9; color: #1a1715; color-scheme: light; }
.shine-page ::selection { background: rgba(139, 109, 63, 0.25); color: #1a1715; }
.shine-page .kb-logo { color: #1a1715; }
.shine-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--canvas); pointer-events: none;
  animation: shine-out 0.9s var(--ease) 2.75s forwards; }
.shine-bloom { position: absolute; inset: 0; clip-path: circle(0% at 50% 52%);
  background: radial-gradient(circle at 50% 52%, #fffdf8 0%, #f8f3ea 45%, #f1e9dc 100%);
  animation: shine-bloom 1.35s cubic-bezier(0.7, 0, 0.2, 1) 1.45s forwards; }
.shine-words { position: relative; text-align: center; font-family: var(--display); font-size: clamp(32px, 9vw, 52px); line-height: 1.1; color: var(--cream);
  animation: shine-ink 0.7s ease 1.75s forwards; }
.shine-words span { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(6px); }
.shine-words .w1 { animation: shine-word 1s var(--ease-out) 0.25s forwards; }
.shine-words .w2 { color: var(--gold); animation: shine-word 1s var(--ease-out) 0.8s forwards, shine-gold 0.7s ease 1.75s forwards; }
.shine-rule { display: block; height: 1px; width: 0; margin: 18px auto 0; background: linear-gradient(90deg, transparent, #c4a87c, transparent);
  animation: shine-rule 1.1s var(--ease-out) 1.2s forwards; }
@keyframes shine-word { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes shine-bloom { to { clip-path: circle(150% at 50% 52%); } }
@keyframes shine-ink { to { color: #1a1715; } }
@keyframes shine-gold { to { color: #8b6d3f; } }
@keyframes shine-rule { to { width: 140px; } }
@keyframes shine-out { to { opacity: 0; visibility: hidden; } }
.shine-page .after-shine > * { animation: rise 0.9s var(--ease-out) both; }
.shine-page.is-new .after-shine > * { animation-delay: calc(2.85s + var(--i, 0) * 90ms); }
.shine-page:not(.is-new) .after-shine > * { animation-delay: calc(var(--i, 0) * 70ms); }
.paper-card { background: #fffdf9; border: 1px solid #e6ded2; border-radius: 10px; box-shadow: 0 1px 0 rgba(26, 23, 21, 0.02), 0 24px 60px -32px rgba(26, 23, 21, 0.18); }
.btn-ink { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 3rem; padding: 0 1.25rem; border-radius: 8px;
  border: 1px solid #d9cfc0; color: #1a1715; font-size: 13.5px; transition: all 0.35s var(--ease); background: transparent; }
.btn-ink:hover { border-color: #8b6d3f; background: rgba(139, 109, 63, 0.05); }
.btn-ink-solid { background: #1a1715; color: #f6f1e9; border-color: #1a1715; }
.btn-ink-solid:hover { background: #2a2520; border-color: #2a2520; }

@media (prefers-reduced-motion: reduce) {
  .shine-overlay { display: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .grain::before { animation: none; }
}

[x-cloak], .hidden-until-ready { visibility: hidden; }
.tabular { font-variant-numeric: tabular-nums; }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
