:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --ink: #0f1a2a;
  --muted: #5b6676;
  --line: #e3e7ee;
  --accent: #1b2a37;
  --accent-ink: #ffffff;
  --accent-soft: #eef1f4;
  --accent-hover: #2b3f50;
  --ok: #157f3c;
  --err: #c0262d;
  --warn-bg: #fff6e0;
  --warn-ink: #7a5300;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 26, 42, .05), 0 8px 28px rgba(15, 26, 42, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.err { color: var(--err); }
.ok { color: var(--ok); }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px; border-radius: 8px; }
.note { background: var(--accent-soft); padding: 8px 12px; border-radius: 8px; }

.shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 16px; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.card.narrow { max-width: 640px; padding: 40px 36px; }
.card.loading { max-width: 640px; min-height: 320px; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { color: var(--muted); font-size: 13px; }

/* Avatars */
.avatar { border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, #1b2a37, #a28254); color: #fff; font-weight: 600; flex: none; }
.avatar.lg { width: 88px; height: 88px; font-size: 30px; margin: 0 auto 14px; }
.avatar.md { width: 56px; height: 56px; font-size: 20px; margin-bottom: 10px; }
.avatar.sm { width: 44px; height: 44px; font-size: 16px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }

/* Home + person */
.intro { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.intro .title { font-weight: 500; margin-top: 4px; }
.intro .bio { margin: 10px auto 0; max-width: 46ch; }
.list, .events { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.row-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.row-link:hover, .row-link:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.row-text { display: grid; flex: 1; }
.chev { color: var(--muted); }

.event { display: grid; gap: 6px; padding: 18px 20px 18px 22px; border: 1px solid var(--line); border-left: 5px solid var(--ev); border-radius: 10px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.event:hover, .event:focus-visible { box-shadow: 0 6px 18px rgba(15, 26, 42, .08); transform: translateY(-1px); outline: none; border-color: var(--ev); }
.event-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; }
.pill { font-size: 12px; font-weight: 600; color: var(--ev); background: color-mix(in srgb, var(--ev) 12%, white); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.meta svg { width: 16px; height: 16px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; margin: 0 4px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }

/* Scheduler */
.card.sched { max-width: 1000px; display: grid; grid-template-columns: 320px 1fr; min-height: 560px; }
.card.sched:not(.has-times) { max-width: 820px; }
.side { position: relative; padding: 28px 28px 32px; border-right: 1px solid var(--line); }
.back { position: absolute; top: 20px; right: 20px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.back:hover { background: var(--accent-soft); }
.host { font-weight: 600; font-size: 14px; }
.ev-title { font-size: 26px; margin: 4px 0 18px; }
.facts { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; color: var(--muted); font-weight: 500; }
.facts li { display: flex; gap: 10px; align-items: flex-start; }
.facts li.hl { color: var(--ink); }
.desc { font-size: 14px; white-space: pre-line; }

.pick { padding: 28px 32px 32px; }
.pick h2 { margin-bottom: 22px; }
.pick-body { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 28px; }
.calendar { min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 14px; }
.cal-head b { min-width: 150px; text-align: center; font-weight: 500; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.icon-btn:disabled { background: transparent; color: #b7bfcc; cursor: default; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dow span { font-size: 11px; color: var(--muted); padding: 6px 0; letter-spacing: .04em; }
.grid { row-gap: 6px; transition: opacity .2s; }
.grid.is-loading { opacity: .35; }
.day { width: 44px; height: 44px; margin: auto; border-radius: 50%; display: grid; place-items: center; color: #9aa3b2; font: inherit; border: 0; background: none; position: relative; }
.day.open { background: var(--accent-soft); color: var(--accent); font-weight: 700; cursor: pointer; }
.day.open:hover { background: #d6e3fd; }
.day.sel { background: var(--accent); color: var(--accent-ink); }
.day.today::after { content: ""; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.tz { margin-top: 22px; display: flex; align-items: center; gap: 8px; }
.tz label { display: flex; color: var(--muted); }
.tz select { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 6px 0; cursor: pointer; }

.times { width: 220px; }
.times-date { margin: 10px 0 16px; font-weight: 500; }
.times ul { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.slot { display: flex; gap: 8px; }
.slot .time { flex: 1; height: 50px; border: 1px solid #a9c1f5; color: var(--accent); background: #fff; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; transition: all .15s; }
.slot .time:hover { border: 2px solid var(--accent); }
.slot .next { display: none; }
.slot.active .time { flex: .5; background: #4b5565; border-color: #4b5565; color: #fff; }
.slot.active .next { display: block; flex: .5; height: 50px; }

/* Buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 22px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg); }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.form { display: grid; gap: 18px; max-width: 460px; }
.form label, .stack label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.form input, .form textarea, .stack input { font: inherit; font-weight: 400; border: 1px solid #c9d0db; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fff; }
.form input:focus, .form textarea:focus, .stack input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-actions { display: flex; gap: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form select { font: inherit; font-weight: 400; border: 1px solid #c9d0db; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fff; }
.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choices legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.choice { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; font-weight: 400 !important; font-size: 15px !important; cursor: pointer; }
.choice input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }

/* Confirmation */
.confirm { text-align: center; display: grid; gap: 14px; justify-items: center; }
.badge { width: 56px; height: 56px; border-radius: 50%; background: #e3f5ea; color: var(--ok); display: grid; place-items: center; }
.badge svg { width: 28px; height: 28px; stroke-width: 2.4; }
.summary { width: 100%; max-width: 420px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-top: 8px; }
.summary b { display: block; font-size: 17px; margin-bottom: 12px; }
.summary .facts { margin: 0; }

/* Admin */
body.admin .admin-card { max-width: 640px; margin: 48px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; display: grid; gap: 18px; }
.stack { display: grid; gap: 14px; }
.admin-person { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 12px; }
.admin-person h2 a { font-size: 14px; font-weight: 400; margin-left: 6px; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-actions { display: flex; gap: 8px; }
.admin-row form { margin: 0; }

/* Phones + tablets */
@media (max-width: 820px) {
  .shell { padding: 16px 12px; }
  .card.narrow { padding: 28px 20px; }
  .card.sched { grid-template-columns: 1fr; min-height: 0; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 20px; }
  .ev-title { font-size: 22px; margin-bottom: 14px; }
  .pick { padding: 24px 16px; }
  .pick-body { grid-template-columns: 1fr; }
  .times { width: 100%; }
  .times ul { max-height: none; }
  .day { width: 40px; height: 40px; }
}
@media (max-width: 380px) {
  .day { width: 36px; height: 36px; }
}
.admin-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.admin-table th, .admin-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
