:root {
  color-scheme:dark; font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --base:#090b0f; --rail:#0e1117; --surface:#11151b; --raised:#171c23; --input:#0b0e13;
  --line:#303641; --text:#edf0f4; --muted:#aeb6c2; --gold:#dfbf84; --gold-ink:#17202c;
  --accent:#dfbf84; --active:#2f2920; --danger:#ffb3ae; --green:#bce5d0;
  --rail-width:218px; --radius:8px; --top:68px;
}
:root[data-theme="light"] {
  color-scheme:light; --base:#f5f5f1; --rail:#fff; --surface:#fff; --raised:#f5f5f1;
  --input:#fff; --line:#cbd0d3; --text:#122238; --muted:#526071; --accent:#73551b;
  --active:#f6ead0; --danger:#a53e3e; --green:#216648;
}
:root.large {font-size:112.5%}
:root.contrast {--line:currentColor; --muted:var(--text)}
* {box-sizing:border-box;min-inline-size:0}
body {margin:0;background:var(--base);color:var(--text);font-size:.9rem;line-height:1.55}
a {color:var(--accent);text-underline-offset:3px}
:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
h1,h2,h3,p {margin:0 0 .65rem}
h1 {font-size:clamp(1.7rem,4vw,2.2rem);letter-spacing:-.035em;line-height:1.16}
h2 {font-size:1.09rem;line-height:1.3}
h3 {font-size:1rem;margin-top:1rem}
small,.muted,.page-head p {color:var(--muted)}
.pre {white-space:pre-wrap}
.sr,.skip:not(:focus) {position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
.skip:focus {position:fixed;top:.5rem;left:.5rem;z-index:10;background:var(--surface);padding:.6rem}
.sidebar {position:fixed;inset:0 auto 0 0;width:var(--rail-width);background:var(--rail);border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:4}
.brand {display:flex;gap:11px;align-items:center;text-decoration:none;color:var(--text);line-height:1.15}
.sidebar .brand {padding:1rem}
.brand strong {font-size:1.2rem;letter-spacing:.12em}
.brand small {display:block;font-size:.6rem;letter-spacing:.12em;margin-top:5px}
.monogram,.avatar {display:grid;place-items:center;background:var(--active);color:var(--accent);border:1px solid var(--line);border-radius:50%;width:38px;height:38px;flex:none;font-weight:700}
.monogram {font-family:Georgia,serif;font-size:1.4rem;border-color:var(--accent)}
nav {flex:1;overflow:auto;padding:0 8px 10px}
.nav-label {padding:.9rem .63rem .25rem;text-transform:uppercase;font-size:.61rem;font-weight:700;letter-spacing:.14em;color:var(--muted)}
nav a,nav .unavailable {display:flex;align-items:center;gap:.5rem;min-height:40px;padding:.35rem .55rem;border-radius:5px;margin:2px 0;font-size:.78rem;text-decoration:none;color:var(--text)}
nav a span,nav .unavailable span {display:inline-block;width:1.05rem;text-align:center;font-size:1rem;color:var(--muted)}
nav a:hover,nav a[aria-current] {background:var(--active);color:var(--accent)}
nav a[aria-current] {box-shadow:inset 2px 0 var(--accent);font-weight:680}
.unavailable small {font-size:.57rem;margin-left:auto}
.account {display:flex;gap:8px;align-items:center;padding:.8rem;border-top:1px solid var(--line)}
.account strong,.account small {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.69rem}
.top,.public-top {min-height:var(--top);display:flex;justify-content:space-between;align-items:center;gap:.65rem;position:sticky;top:0;z-index:3;background:var(--rail);padding:.55rem clamp(.75rem,3vw,2rem);border-bottom:1px solid var(--line)}
.top {margin-left:var(--rail-width)}
.utility,.actions,.checks {display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.utility form,.search {margin:0}
.search {display:flex;gap:4px;width:min(100%,275px)}
.search input {min-height:42px}
.utility-link {display:grid;place-items:center;width:42px;height:42px;color:var(--muted);text-decoration:none;font-size:1.15rem}
#menu {display:none}
main {max-width:1500px;margin:auto;padding:clamp(1rem,4vw,2.4rem)}
.portal main {margin-left:var(--rail-width)}
.standalone main {max-width:760px}
.standalone main.auth-main {max-width:490px;margin:clamp(1rem,6vw,5rem) auto}
.page-head,.section-head {display:flex;justify-content:space-between;align-items:center;gap:.8rem;flex-wrap:wrap}
.page-head {margin-bottom:1.45rem}
.section-head {margin-bottom:.7rem}
.section-head h2,.section-head form {margin:0}
.section-head a {font-size:.8rem}
.page-head .eyebrow {color:var(--accent);font-weight:690;font-size:.63rem;letter-spacing:.15em;margin-bottom:.45rem}
.card {border:1px solid var(--line);background:var(--surface);border-radius:var(--radius);padding:clamp(.85rem,2.2vw,1.28rem);margin-bottom:1rem;overflow-wrap:anywhere}
.card > :last-child {margin-bottom:0}
.metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.9rem}
.metric {min-height:100px;display:flex;align-items:center;gap:.75rem;color:var(--muted)}
.metric strong {display:block;font-size:1.7rem;color:var(--text);line-height:1.25}
.metric-icon,.event-mark {background:var(--active);color:var(--accent);display:grid;place-items:center;border-radius:6px;width:35px;height:35px;flex:none;font-size:1.1rem}
.split {display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:1rem}
.mini-date {padding:1rem;background:var(--raised);border:1px solid var(--line);border-radius:6px;margin-bottom:.75rem}
.mini-date strong {font-size:2.3rem;display:block;line-height:1.15}
.mini-date span {color:var(--muted)}
.empty {padding:2rem .6rem;text-align:center;color:var(--muted);border-top:1px solid var(--line)}
.empty span,.empty strong {display:block}
.empty span {font-size:1.5rem;color:var(--accent)}
.empty p {margin-bottom:0}
.row,.event {display:flex;gap:.7rem;align-items:center;justify-content:space-between;padding:.64rem 0;border-top:1px solid var(--line)}
.event {color:var(--text);text-decoration:none;justify-content:flex-start}
.event > span:nth-child(2) {flex:1}
.event:hover strong {color:var(--accent);text-decoration:underline}
.row small,.event small {display:block}
.status {font-size:.67rem;border:1px solid var(--line);padding:.14rem .53rem;border-radius:5px;color:var(--muted);white-space:nowrap}
.status.confirmed {color:var(--green)}
.status.pending {color:var(--accent)}
.status.cancelled {color:var(--danger)}
form {margin:.65rem 0}
label {display:block;font-weight:600;margin:.55rem 0}
input,select,textarea,button,.button {font:inherit;color:inherit;border:1px solid var(--line);border-radius:6px}
input,select,textarea {display:block;background:var(--input);width:100%;min-height:44px;padding:.45rem .65rem;margin-top:.25rem}
textarea {min-height:92px;resize:vertical}
button,.button {background:var(--raised);cursor:pointer;text-decoration:none;min-height:42px;display:inline-flex;align-items:center;justify-content:center;padding:.44rem .74rem;font-weight:650}
button:hover,.button:hover {border-color:var(--accent)}
.primary,.selected {background:var(--gold);border-color:var(--gold);color:var(--gold-ink)}
.danger {color:var(--danger)}
.icon {min-width:42px;padding:.3rem}
.quiet {color:var(--muted)}
.full {width:100%;margin-top:.45rem}
.form-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.2rem .8rem;align-items:end}
.form-grid button {justify-self:start}
.booking-slots {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr));gap:.3rem}
.booking-slots label {margin:0;padding:0 .55rem;border:1px solid var(--line);cursor:pointer}
.booking-slots label:has(:checked) {border-color:var(--gold)}
#booking-local-zone[hidden] {display:none}
.form-card {max-width:760px}
fieldset {border:1px solid var(--line);border-radius:6px}
.check {display:inline-flex;align-items:center;gap:.45rem;min-height:42px;margin:0 .4rem 0 0}
.check input {width:18px;height:18px;min-height:0;margin:0;accent-color:var(--accent)}
dl {display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem}
dd {margin:0}
dt {color:var(--muted)}
dialog {width:min(420px,calc(100% - 2rem));background:var(--surface);border:1px solid var(--line);color:var(--text);border-radius:10px;padding:1.2rem}
dialog::backdrop {background:#000a}
dialog .check {display:flex}
.secret {display:block;background:var(--input);padding:.5rem;border:1px solid var(--line)}
.calendar {display:grid;gap:3px}
.calendar:is(.week,.month) {grid-template-columns:repeat(7,minmax(0,1fr))}
.day {min-height:85px;background:var(--raised);padding:.5rem;border:1px solid var(--line);overflow-wrap:anywhere}
.calendar-item {display:block;margin:.35rem 0;padding:.35rem;background:var(--active);border-left:2px solid var(--accent);text-decoration:none;font-size:.78rem}
.calendar-item small {display:block}
summary {cursor:pointer;padding:.5rem 0}
@media (max-width:1060px) {.metrics {grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px) {
  .sidebar {display:none;top:var(--top);width:min(275px,90vw)}
  .sidebar.open {display:flex}
  .top,.portal main {margin-left:0}
  #menu {display:inline-flex}
  .split {grid-template-columns:1fr;gap:0}
  .calendar:is(.week,.month) {grid-template-columns:1fr}
  .day {min-height:auto}
}
@media (max-width:420px) {
  .form-grid {grid-template-columns:1fr}
  .metrics {gap:.45rem}
  .metric {padding:.48rem;gap:.35rem}
  .metric-icon {width:28px;height:28px}
  .utility {gap:.12rem}
  .utility-link,.icon {width:auto;min-width:36px}
  .top .utility-link {display:none}
}
@media (prefers-reduced-motion:no-preference) {
  button,a {transition:background-color .15s,border-color .15s,color .15s}
}

pre.pre { overflow-wrap: anywhere; }
@media print {
  .restricted-preview { display: none; }
}

.signing-preview { position: relative; width: fit-content; max-width: 100%; touch-action: none; }
.signing-preview img, .restricted-preview img { display: block; max-width: 100%; height: auto; }
.restricted-preview { user-select:none }
.signing-preview [data-placement-marker] {
  position: absolute; pointer-events: none; width: .8rem; height: .8rem;
  border: 2px solid #8c6627; border-radius: 50%; transform: translate(-50%, -50%);
  background: #f0d39e;
}

.vault-media { display: block; width: min(100%, 65rem); margin-block: .8rem; }

.signing-preview [data-placement-marker] { transform: none; border-radius: 0; background: #e5c78950; }
.signing-preview [data-resize-handle] {
  position: absolute; right: 0; bottom: 0; pointer-events: auto;
  width: 1rem; height: 1rem; background: #8c6627; cursor: nwse-resize;
}
