/* Zen Medical Network — site styles */
@font-face { font-family: 'Jost'; font-weight: 300; font-style: normal; font-display: swap; src: url('/vendor/fonts/jost-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 400; font-style: normal; font-display: swap; src: url('/vendor/fonts/jost-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-style: normal; font-display: swap; src: url('/vendor/fonts/jost-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: normal; font-display: swap; src: url('/vendor/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-style: normal; font-display: swap; src: url('/vendor/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('/vendor/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }

:root {
  --bg: #FCF7F1;
  --surface: #FFFDFA;
  --sand: #F3EAE0;
  --line: #E6D9CB;
  --ink: #3B2620;
  --ink-2: #6B5248;
  --ink-3: #8F7568;
  --accent: #7A4E36;
  --accent-deep: #5E3A27;
  --ok: #4F6B4A;
  --warn: #9A6A2C;
  --err: #9B3B2E;
  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(59,38,32,.05), 0 8px 28px rgba(59,38,32,.07);
  --header-h: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.65 var(--sans); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: #EAD7C6; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -.005em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5.2vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin-top: 1.6em; }
h3 { font-size: 1.4rem; font-weight: 600; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1.1em; }
.eyebrow { font: 500 .74rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1rem; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 40em; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: .6rem 1rem; z-index: 9999; }
.skip:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 1000; height: var(--header-h);
  background: rgba(252,247,241,.92); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 clamp(16px, 3vw, 36px); }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .wordmark { font: 500 1.42rem/1 var(--serif); letter-spacing: .01em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.8rem); }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .93rem; letter-spacing: .02em; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); }
.nav .btn { color: var(--bg); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; color: var(--ink-2); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .menu-panel { display: flex; }
.menu-panel { display: none; flex-direction: column; position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; min-width: 210px; }
.menu-panel a { padding: .65rem .9rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.menu-panel a:hover { background: var(--sand); }
@media (max-width: 760px) { .nav { display: none; } .menu { display: block; } .brand .wordmark { font-size: 1.25rem; } }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 500 .92rem/1 var(--sans); letter-spacing: .03em;
  padding: .8rem 1.3rem; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--bg); text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--sand); color: var(--accent-deep); }
.btn.sm { padding: .55rem .95rem; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: wait; }

label { display: block; font-size: .86rem; color: var(--ink-2); margin-bottom: .35rem; letter-spacing: .01em; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=search], input[type=date], select, textarea {
  width: 100%; font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .72rem .85rem;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(122,78,54,.12); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; color: var(--ink); }
.check input { margin-top: .3rem; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.field { margin-bottom: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 1rem; }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: .3rem; }
.req { color: var(--accent); }
.notice { padding: .9rem 1.1rem; border-radius: 12px; background: var(--sand); border: 1px solid var(--line); font-size: .95rem; }
.notice.err { background: #F7E6E1; border-color: #E7C6BD; color: var(--err); }
.notice.ok { background: #E9EFE5; border-color: #CFDCC8; color: var(--ok); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Content pages */
.page { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 7vw, 96px) clamp(16px, 4vw, 40px) 64px; }
.prose { max-width: 720px; }
.prose li { margin-bottom: .45em; }
.hero { padding-bottom: clamp(24px, 4vw, 48px); border-bottom: 1px solid var(--line); margin-bottom: clamp(24px, 4vw, 48px); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin: 1.5rem 0 2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.5rem 1.2rem; }
.card h3 { margin-top: 0; }
.card .num { font: 500 2.4rem/1 var(--serif); color: var(--accent); margin-bottom: .6rem; }
.pledge { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.4rem 1.6rem; margin: 1.5rem 0; }
.pledge ol { padding-left: 1.2rem; margin: 0; }
.pledge li { margin-bottom: .6em; }
.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3vw, 36px); box-shadow: var(--shadow); }
.form-card fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
.form-card legend { font: 500 1.35rem/1.2 var(--serif); margin-bottom: .9rem; padding: 0; }
details.faq { border-bottom: 1px solid var(--line); padding: 1rem 0; }
details.faq summary { cursor: pointer; font: 500 1.25rem/1.3 var(--serif); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::after { content: '+'; color: var(--accent); font-family: var(--sans); font-weight: 300; }
details.faq[open] summary::after { content: '–'; }
details.faq p { margin: .8rem 0 0; color: var(--ink-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--sand); color: var(--ink-2); font-size: .88rem; }
.site-footer .inner { max-width: 1120px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 40px) 28px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: flex-end; align-content: flex-start; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .disclaimer { grid-column: 1 / -1; font-size: .8rem; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 1rem; }
@media (max-width: 700px) { .site-footer .inner { grid-template-columns: 1fr; } .site-footer nav { justify-content: flex-start; } }

/* ---------- Map page ---------- */
body.map-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.map-shell { flex: 1; display: grid; grid-template-columns: minmax(340px, 400px) 1fr; min-height: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.panel-head { padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.panel-head h1 { font-size: 1.95rem; margin-bottom: .25rem; }
.panel-head p { color: var(--ink-2); font-size: .92rem; margin-bottom: 1rem; }
.search { display: flex; gap: .5rem; }
.search input { border-radius: 999px; padding-left: 1.05rem; }
.search .btn { flex: none; }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .85rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .38rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-msg { font-size: .82rem; margin-top: .55rem; min-height: 1.1em; color: var(--ink-3); }
.search-msg.err { color: var(--err); }
.panel-body { flex: 1; overflow-y: auto; padding: 8px 0 18px; scrollbar-width: thin; }
.count { padding: 10px 22px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.list { list-style: none; margin: 0; padding: 0; }
.list li button {
  all: unset; box-sizing: border-box; display: block; width: 100%; padding: 14px 22px; cursor: pointer;
  border-bottom: 1px solid var(--line); transition: background .15s;
}
.list li button:hover, .list li button.hover { background: var(--sand); }
.list li button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.li-name { font: 500 1.22rem/1.2 var(--serif); color: var(--ink); }
.li-doc { font-size: .88rem; color: var(--ink-2); margin-top: .15rem; }
.li-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--ink-3); margin-top: .35rem; }
.empty { padding: 26px 22px; color: var(--ink-2); font-size: .95rem; }
.empty h2 { font-size: 1.45rem; margin: 0 0 .4rem; }
.panel-foot { border-top: 1px solid var(--line); padding: 12px 22px; font-size: .82rem; color: var(--ink-3); display: flex; justify-content: space-between; gap: 1rem; }

.detail { padding: 6px 22px 24px; }
.back { all: unset; cursor: pointer; font-size: .85rem; color: var(--accent); padding: 10px 0; display: inline-flex; gap: .4rem; }
.back:focus-visible { outline: 2px solid var(--accent); }
.detail h2 { font-size: 2rem; margin: .3rem 0 .2rem; }
.detail .doc { color: var(--ink-2); margin-bottom: .9rem; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.1rem; }
.badge { font-size: .74rem; letter-spacing: .04em; padding: .3rem .65rem; border-radius: 999px; background: var(--sand); color: var(--ink-2); border: 1px solid var(--line); }
.badge.accent { background: transparent; color: var(--accent); border-color: var(--accent); }
.badge.ok { background: #E9EFE5; color: var(--ok); border-color: #CFDCC8; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.3rem; }
.facts { display: grid; grid-template-columns: 8.5rem 1fr; gap: .55rem 1rem; margin: 0 0 1.2rem; font-size: .93rem; }
.facts dt { color: var(--ink-3); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; padding-top: .15rem; }
.facts dd { margin: 0; }
.detail .about { color: var(--ink-2); }
.fine { font-size: .78rem; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: .9rem; margin-top: 1.2rem; }

.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #F1E8DD; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: .9rem; }
.locate { position: absolute; z-index: 500; right: 12px; bottom: 28px; }

/* Leaflet theming */
.leaflet-container { font-family: var(--sans); background: #F1E8DD; }
.leaflet-tile-pane { filter: sepia(.32) saturate(.85) hue-rotate(-8deg) brightness(1.02) contrast(.94); }
.leaflet-control-zoom a { color: var(--ink) !important; background: var(--surface) !important; border-color: var(--line) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-attribution { background: rgba(252,247,241,.85) !important; color: var(--ink-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.pin { width: 30px; height: 30px; }
.pin span {
  display: block; width: 18px; height: 18px; margin: 6px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent), 0 4px 10px rgba(59,38,32,.3);
  transition: transform .15s;
}
.pin.ffs_cash span { background: #A88A6F; box-shadow: 0 0 0 1px #A88A6F, 0 4px 10px rgba(59,38,32,.3); }
.pin.active span, .pin.hover span { transform: scale(1.35); background: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 4px 12px rgba(59,38,32,.4); }
.leaflet-tooltip.zmn-tip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font: 500 1rem/1.2 var(--serif); padding: .45rem .7rem; }
.leaflet-tooltip.zmn-tip::before { display: none; }

@media (max-width: 860px) {
  body.map-page { height: auto; overflow: auto; }
  .map-shell { grid-template-columns: 1fr; grid-template-rows: auto 52vh auto; }
  .panel { display: contents; }
  .panel-head { order: 1; border-bottom: 0; padding: 18px 16px 12px; }
  .map-wrap { order: 2; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .panel-body { order: 3; overflow: visible; }
  .panel-foot { order: 4; }
  .count, .list li button, .empty, .detail, .panel-foot { padding-left: 16px; padding-right: 16px; }
  .panel-head h1 { font-size: 1.7rem; }
}

/* ---------- Admin ---------- */
.admin { max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 32px) 80px; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin: 1rem 0 1.5rem; overflow-x: auto; }
.tabs button { all: unset; cursor: pointer; padding: .8rem 1.1rem; font-size: .95rem; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .pill { background: var(--accent); color: var(--bg); border-radius: 999px; font-size: .72rem; padding: .1rem .45rem; margin-left: .35rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.data th, table.data td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-weight: 500; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: var(--sand); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.status { font-size: .74rem; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--line); background: var(--sand); }
.status.published, .status.approved { background: #E9EFE5; color: var(--ok); border-color: #CFDCC8; }
.status.new { background: #F6EBDD; color: var(--warn); border-color: #EAD4B7; }
.status.rejected, .status.hidden { color: var(--ink-3); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; }
.stat .v { font: 500 2rem/1 var(--serif); }
.stat .k { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: .35rem; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem; }
.usage-grid h3 { margin: 0 0 .6rem; font-size: 1.2rem; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 1.5rem; }
.bars div { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(59,38,32,.35); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.dlg-head h2 { margin: 0; font-size: 1.6rem; }
.dlg-body { padding: 20px 24px; }
.dlg-foot { display: flex; justify-content: space-between; gap: .6rem; padding: 14px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg); }
.kv { display: grid; grid-template-columns: 11rem 1fr; gap: .4rem 1rem; font-size: .92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .7rem 1.2rem; border-radius: 999px; font-size: .9rem; z-index: 3000; box-shadow: var(--shadow); }
.foot-brand { font: 500 1.3rem/1 var(--serif); color: var(--ink); margin-bottom: .5rem; }
.locate.btn.ghost { background: var(--surface); box-shadow: var(--shadow); }
.locate.btn.ghost:hover { background: var(--sand); }
.nav a.btn, .nav a.btn[aria-current="page"] { color: var(--bg); box-shadow: none; }
@media (min-width: 861px) {
  .panel-head { padding: 18px 22px 12px; }
  .panel-head h1 { font-size: 1.75rem; }
  .panel-head p { margin-bottom: .8rem; }
  .filters { margin-top: .7rem; gap: .35rem; }
  .chip { font-size: .76rem; padding: .32rem .65rem; }
}
