:root {
  --bg: #f3f6f5;
  --card: #ffffff;
  --ink: #14201d;
  --muted: #5b6b67;
  --line: #dfe7e4;
  --accent: #1f7a6d;
  --accent-soft: #e2f1ee;
  --danger: #c0392b;
  --danger-soft: #fbe9e7;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* Header / nav */
.site-header { background: var(--ink); color: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #cfe0db; text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.site-footer { color: var(--muted); font-size: .85rem; padding: 32px 0 40px; text-align: center; }

main { padding: 24px 0 8px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.cta { display: inline-block; }

/* Buttons */
.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; border-radius: 14px; padding: 11px 18px; background: var(--ink); color: #fff; text-decoration: none; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.small { padding: 8px 14px; font-size: .9rem; }
.btn.danger { background: none; color: var(--danger); padding: 8px 10px; }
.btn.ghost { background: none; color: var(--accent); padding: 8px 10px; }
.btn.loading, .btn.loading:disabled { opacity: 1; cursor: progress; display: inline-flex; align-items: center; gap: 8px; }
.btn.loading::before { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.loading::before { animation-duration: 2s; } }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Booking page */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.pill.free .dot { background: var(--accent); }
.pill.busy .dot { background: var(--danger); }
.who { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px 6px 6px; margin: 4px 0 18px; cursor: pointer; font: inherit; text-align: left; }
.who .label { display: block; font-size: .65rem; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; line-height: 1.1; }
.who .value { font-weight: 700; line-height: 1.2; }
.mine:empty { display: none; }
.mine { margin-bottom: 14px; }
.mine h2 { margin: 0 0 8px; font-size: 1rem; }
.mine-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--danger); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.mine-item:hover { border-color: var(--accent); border-left-color: var(--danger); }
.mine-item .time { font-weight: 800; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.avatar.mine { background: var(--danger); }
.avatar.empty { background: none; border: 2px dashed var(--line); color: var(--muted); }

.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h2 { margin: 0; font-size: 1.1rem; text-transform: capitalize; }
.icon-btn { appearance: none; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 700; padding: 4px 0; text-transform: uppercase; }
.day { appearance: none; border: 1px solid transparent; background: var(--bg); border-radius: 12px; padding: 6px 0 5px; font: inherit; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; align-items: center; min-height: 52px; }
.day .n { font-weight: 700; }
.day .f { font-size: .66rem; color: var(--accent); font-weight: 700; }
.day.full .f { color: var(--danger); }
.day.past { opacity: .5; }
.day.today { border-color: var(--accent); }
.day.sel { background: var(--ink); color: #fff; }
.day.sel .f { color: #bfe3dc; }
.day.blank { visibility: hidden; }

.day-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px 10px; }
.day-head h2 { margin: 0; font-size: 1.1rem; }
.day-head span { color: var(--muted); font-size: .9rem; }
.slot { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.slot.now { border: 2px solid var(--accent); }
.slot.passed { opacity: .55; }
.slot .info { flex: 1; min-width: 0; }
.slot .time { font-weight: 800; font-size: 1.1rem; }
.slot .sub { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.badge { background: var(--accent); color: #fff; font-size: .65rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.actions { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.note { color: var(--muted); font-size: .85rem; text-align: center; margin: 14px 0; }
.banner { border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }
.banner.warn { background: var(--danger-soft); color: #7a2118; }
.banner.info { background: var(--accent-soft); color: #134c43; }

/* Modal */
.backdrop { position: fixed; inset: 0; background: rgba(20, 32, 29, .5); display: grid; place-items: center; padding: 16px; z-index: 10; backdrop-filter: blur(3px); }
.modal { background: #fff; border-radius: 24px; padding: 24px; width: 100%; max-width: 420px; }
.modal h2 { margin: 0 0 6px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal input { width: 100%; font: inherit; font-size: 1.05rem; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); }
.modal input:focus { border-color: var(--accent); outline: none; background: #fff; }
.modal .err { color: var(--danger); font-size: .9rem; min-height: 1.3em; margin-top: 6px; }
.modal .row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px); }
.hidden { display: none !important; }

/* Misc (kept here so the CSP can forbid inline styles) */
.flush { margin-top: 0; }
.prose h2 { font-size: 1.15rem; margin: 24px 0 6px; }
.prose p, .prose li { margin: 0 0 10px; }
.prose ul { padding-left: 20px; margin: 0 0 10px; }
.site-footer a { color: var(--muted); }
