:root { --brand: #b0547a; --ink: #1f1a1d; --muted: #75696f; --line: #ece4e7; --bg: #f7f3f2; --card: #fff; }
* { box-sizing: border-box; }
/* Elements with the hidden attribute must never show or catch clicks. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.t-left { display: flex; flex-direction: column; line-height: 1.2; } .t-left b { font-size: 17px; } .t-left span { color: var(--muted); font-size: 12.5px; }
.t-nav { display: flex; align-items: center; gap: 6px; }
.t-nav h1 { font-size: 17px; margin: 0 0 0 10px; }
.nb { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 11px; cursor: pointer; font-weight: 600; }
.nb:hover { border-color: var(--ink); }
#datePick { border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; font: inherit; }
.t-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat { color: var(--muted); margin-right: 6px; } .stat b { color: var(--ink); }
.btn { border: 1px solid transparent; background: var(--brand); color: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 650; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn.danger { background: #fff; color: #a61b1b; border-color: #f2cccc; }
.btn.wide { width: 100%; margin-top: 16px; padding: 12px; }
.demo { background: linear-gradient(110deg, #7c5cff, #22d3ee); color: #fff; padding: 9px 18px; font-weight: 600; font-size: 13.5px; }
.loading { padding: 40px; color: var(--muted); text-align: center; }

.cal { padding: 14px 18px 40px; overflow-x: auto; }
.grid { position: relative; display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(170px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 14px; min-width: max-content; }
.col-head { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 700; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.col-head small { margin-left: auto; color: var(--muted); font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.col { border-left: 1px solid var(--line); }
.hours-body, .col-body { position: relative; }
.hr { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.hr:first-child span { top: 3px; }
.hr span { position: absolute; top: -8px; right: 8px; font-size: 11.5px; color: var(--muted); background: #fff; padding: 0 2px; }
.col-body { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(60 * 1.6px - 1px), var(--line) calc(60 * 1.6px - 1px), var(--line) calc(60 * 1.6px)); cursor: copy; }
.off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f6f1f2 0 8px, #efe8ea 8px 16px); cursor: default; display: grid; place-items: center; color: var(--muted); }
.appt { position: absolute; left: 4px; right: 4px; border: 0; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); border-radius: 8px; padding: 4px 8px; text-align: left; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 1px; line-height: 1.25; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .15s, transform .15s; }
.appt:hover { box-shadow: 0 6px 16px -8px rgba(0,0,0,.35); z-index: 3; }
.appt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-svc { font-size: 12px; color: #5a4e54; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.short { padding: 2px 8px; justify-content: center; }
.a-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.a-line b { font-size: 12.5px; }
.appt.block { background: repeating-linear-gradient(135deg, #f1edef 0 6px, #e9e3e6 6px 12px); border-left-color: #9a8e94; }
.appt.done { opacity: .6; }
.appt.noshow { background: #fdeeee; border-left-color: #d64545; }
.appt.noshow b { text-decoration: line-through; }
.appt.fresh { animation: pop 1.6s ease 2; }
@keyframes pop { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 45%, transparent); } }
.tag { font-style: normal; background: var(--c); color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; margin-left: 4px; }
.now { position: absolute; left: 56px; right: 0; height: 2px; background: #e03131; z-index: 4; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e03131; }

.scrim { position: fixed; inset: 0; background: rgba(20,10,15,.35); z-index: 40; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; z-index: 50; padding: 24px; overflow-y: auto; box-shadow: -20px 0 50px -20px rgba(0,0,0,.35); animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.panel .x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; }
.panel h2 { margin: 0 40px 4px 0; font-size: 22px; }
.panel h3 { margin: 22px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); margin: 0; }
.panel dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 18px 0 0; font-size: 15px; }
.panel dt { color: var(--muted); } .panel dd { margin: 0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.panel label { display: block; font-weight: 600; margin-top: 12px; }
.panel input, .panel select { display: block; width: 100%; margin-top: 5px; font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; }
.panel .r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; }
.svc-list .chk { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }
.svc-list .chk input { width: auto; margin: 0; }
.svc-list small { color: var(--muted); margin-left: auto; }
.err { margin-top: 12px; background: #fdecec; color: #8f1d1d; padding: 10px 12px; border-radius: 9px; font-weight: 600; }

@media (max-width: 700px) {
  .top { gap: 10px; } .t-nav h1 { width: 100%; margin: 6px 0 0; } .t-nav { flex-wrap: wrap; }
  .t-right { margin-left: 0; width: 100%; }
  .cal { padding: 10px; }
}
