/* ==========================================================================
   Northern Cape Society of Advocates
   iOS-style design system: system font, grouped lists, glass bars, sheets.
   Light and dark mode follow the visitor's device setting.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* iOS system colours (light) */
  --bg: #f2f2f7;
  --bg-2: #ffffff;
  --bg-3: #f2f2f7;
  --card: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .29);
  --fill-1: rgba(120, 120, 128, .2);
  --fill-2: rgba(120, 120, 128, .16);
  --fill-3: rgba(118, 118, 128, .12);
  --fill-4: rgba(116, 116, 128, .08);
  --highlight: #d1d1d6;

  --tint: #0b5fd6;
  --tint-rgb: 11, 95, 214;
  --tint-soft: rgba(11, 95, 214, .11);

  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --green: #34c759;
  --teal: #30b0c7;
  --blue: #007aff;
  --indigo: #5856d6;
  --purple: #af52de;
  --pink: #ff2d55;
  --gray: #8e8e93;
  --draft: #c25e00;

  /* materials */
  --glass: rgba(255, 255, 255, .68);
  --glass-solid: rgba(250, 250, 252, .96);
  --glass-edge: rgba(255, 255, 255, .75);
  --glass-shine: rgba(255, 255, 255, .9);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .09), 0 2px 6px rgba(0, 0, 0, .05);
  --bar: rgba(242, 242, 247, .8);
  --tab-active: rgba(120, 120, 128, .14);
  --tab-knock: #eeeef2;
  --seg-thumb: #ffffff;
  --switch-off: #e9e9ea;
  --sheet-bg: #f2f2f7;
  --sheet-cell: #ffffff;
  --avatar: linear-gradient(180deg, #a5abb8, #858994);

  --map-bg: #efe9de;
  --map-park: #cfe6c3;
  --map-road: #ffffff;
  --map-main: #f6d27a;
  --map-block: #e5ddcf;

  /* shape and motion */
  --r-list: 22px;
  --r-card: 26px;
  --r-widget: 24px;
  --r-sheet: 34px;
  --gutter: 16px;
  --nav-h: 54px;
  --side-w: 300px;
  --max: 1120px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --bounce: cubic-bezier(.34, 1.4, .64, 1);
  --ease: cubic-bezier(.25, .1, .25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #1c1c1e;
    --bg-3: #2c2c2e;
    --card: #1c1c1e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .65);
    --fill-1: rgba(120, 120, 128, .36);
    --fill-2: rgba(120, 120, 128, .32);
    --fill-3: rgba(118, 118, 128, .24);
    --fill-4: rgba(118, 118, 128, .18);
    --highlight: #3a3a3c;

    --tint: #4f95ff;
    --tint-rgb: 79, 149, 255;
    --tint-soft: rgba(79, 149, 255, .18);

    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --green: #30d158;
    --teal: #40c8e0;
    --blue: #0a84ff;
    --indigo: #5e5ce6;
    --purple: #bf5af2;
    --pink: #ff375f;
    --gray: #8e8e93;
    --draft: #ffb340;

    --glass: rgba(42, 42, 46, .62);
    --glass-solid: rgba(28, 28, 30, .97);
    --glass-edge: rgba(255, 255, 255, .1);
    --glass-shine: rgba(255, 255, 255, .14);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
    --bar: rgba(0, 0, 0, .74);
    --tab-active: rgba(255, 255, 255, .1);
    --tab-knock: #2f2f33;
    --seg-thumb: #636366;
    --switch-off: #39393d;
    --sheet-bg: #1c1c1e;
    --sheet-cell: #2c2c2e;
    --avatar: linear-gradient(180deg, #8e939f, #686b74);

    --map-bg: #252528;
    --map-park: #263d2a;
    --map-road: #3e3e43;
    --map-main: #73602f;
    --map-block: #2e2e31;
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--nav-h) + var(--safe-t) + 12px);
  scrollbar-gutter: stable;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -.011em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--tint); text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
address { font-style: normal; }
code { font-family: var(--mono); font-size: .9em; background: var(--fill-3); padding: .12em .45em; border-radius: 6px; }
:focus-visible { outline: 3px solid rgba(var(--tint-rgb), .5); outline-offset: 2px; }
::selection { background: rgba(var(--tint-rgb), .25); }
[hidden] { display: none !important; }
html.modal-open { overflow: hidden; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 999; left: 12px; top: -60px; padding: 10px 16px; border-radius: 999px;
  background: var(--tint); color: #fff; font-weight: 600; transition: top .2s;
}
.skip-link:focus { top: calc(10px + var(--safe-t)); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 1.2em; height: 1.2em; flex: none; display: inline-block; vertical-align: -.22em;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 3. Materials ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-shine), var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

/* ---------- 4. App shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 calc(var(--gutter) + var(--safe-r)) 24px calc(var(--gutter) + var(--safe-l));
}
@media (min-width: 420px) { :root { --gutter: 20px; } }
@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) {
  :root { --gutter: 40px; }
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
}

/* sidebar (iPad and desktop) */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { display: block; position: sticky; top: 0; height: 100vh; height: 100dvh; padding: clamp(8px, 1.4vh, 12px) 0 clamp(8px, 1.4vh, 12px) 12px; z-index: 30; }
}
/* Everything in the sidebar scales with the window height so it fits without scrolling.
   Scrolling stays available only as a last resort on very short windows. */
.sidebar-panel {
  height: 100%; display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 14px);
  padding: clamp(12px, 2vh, 18px) 12px clamp(8px, 1.4vh, 12px); border-radius: 30px; overflow-y: auto; scrollbar-width: none;
}
.sidebar-panel::-webkit-scrollbar { display: none; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 2px; color: var(--label); }
.side-brand .app-icon { --s: clamp(38px, 5.4vh, 46px); }
.side-brand-small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--label-2); }
.side-brand-name { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.search.side-search { margin: 0 2px; height: clamp(34px, 4.6vh, 40px); flex: none; }
.side-head { font-size: 13px; font-weight: 600; color: var(--label-2); padding: clamp(6px, 1.4vh, 12px) 12px clamp(3px, .7vh, 6px); }
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-list a {
  display: flex; align-items: center; gap: 12px; height: clamp(36px, 5.4vh, 44px); padding: 0 12px; border-radius: 13px;
  color: var(--label); font-size: 17px; font-weight: 500; transition: background .15s;
}
.side-list .ico { width: 23px; height: 23px; color: var(--tint); stroke-width: 1.8; }
.side-list a:hover { background: var(--fill-4); }
.side-list a:active { background: var(--fill-3); }
.side-list a[aria-current] { background: var(--tint); color: #fff; box-shadow: 0 6px 16px -6px rgba(var(--tint-rgb), .7); }
.side-list a[aria-current] .ico { color: #fff; fill: currentColor; --knock: var(--tint); }
.side-foot {
  margin-top: auto; padding: 14px; border-radius: 20px; background: var(--fill-4);
  font-size: 13px; line-height: 1.4; color: var(--label-2);
}
.side-foot-title { font-size: 15px; font-weight: 600; color: var(--label); }
.side-foot .btn { margin-top: 10px; }
/* shorter windows: the chambers card shrinks to its call button, then the section labels go */
@media (max-height: 720px) {
  .side-foot { padding: 0; background: none; }
  .side-foot p { display: none; }
  .side-foot .btn { margin-top: 0; width: 100%; min-height: 38px; }
}
@media (max-height: 470px) { .side-head { display: none; } }

/* app icon */
.app-icon {
  --s: 40px;
  width: var(--s); height: var(--s); flex: none; display: grid; place-items: center;
  border-radius: 23%;
  background: radial-gradient(120% 95% at 30% 8%, #3a5fa6 0%, #1b2f5c 52%, #0c1630 100%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2), 0 2px 8px rgba(12, 22, 48, .25);
}
.app-icon svg { width: 68%; height: 68%; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35)); }

/* navigation bar */
.navbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-t));
  padding: var(--safe-t) calc(var(--gutter) + var(--safe-r) - 4px) 0 calc(var(--gutter) + var(--safe-l) - 4px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.navbar::before {
  content: ""; position: absolute; inset: 0 0 -20px; z-index: -1; pointer-events: none;
  background: var(--bar);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 30px), transparent);
  opacity: 0; transition: opacity .25s var(--ease);
}
.navbar.is-scrolled::before { opacity: 1; }
.navbar-lead { justify-self: start; display: flex; }
.navbar-trail { justify-self: end; display: flex; gap: 8px; }
.navbar-home .app-icon { --s: 36px; }
@media (min-width: 1024px) { .navbar-home { display: none; } }
.navbar-title {
  font-size: 17px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 56vw;
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .35s var(--spring);
}
.navbar.show-title .navbar-title { opacity: 1; transform: none; }
.glass-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--label); transition: transform .3s var(--bounce);
}
.glass-btn .ico { width: 19px; height: 19px; stroke-width: 2.1; }
.glass-btn:active { transform: scale(.88); }

/* demo notice */
.demo-note {
  width: calc(min(100%, var(--max)) - 2 * var(--gutter));
  margin: 2px auto 14px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px 12px 14px; border-radius: 20px; background: var(--bg-2);
  font-size: 13px; line-height: 1.4; color: var(--label-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.demo-note p { flex: 1; min-width: 0; }
.demo-note strong { display: block; font-size: 15px; font-weight: 600; color: var(--label); }
.demo-close {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill-3); color: var(--label-2);
}
.demo-close .ico { width: 14px; height: 14px; stroke-width: 2.6; }
/* desktop: the notice becomes a slim capsule in the empty top bar, so the page starts higher */
@media (min-width: 1024px) {
  .content { position: relative; }
  .demo-note {
    position: absolute; z-index: 41; top: calc(var(--safe-t) + 7px); left: calc(var(--gutter) + var(--safe-l));
    width: auto; max-width: calc(100% - 2 * var(--gutter) - 60px); height: 40px; margin: 0;
    gap: 8px; padding: 0 5px 0 6px; border-radius: 999px;
  }
  .demo-note .tile { width: 28px; height: 28px; border-radius: 50%; }
  .demo-note .tile .ico { width: 16px; height: 16px; }
  .demo-note p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .demo-note strong { display: inline; margin-right: 4px; font-size: 13px; }
  .demo-close { width: 28px; height: 28px; }
}

/* tab bar (phones and small tablets) */
.tabbar {
  position: fixed; z-index: 50; left: 50%; bottom: calc(10px + var(--safe-b));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 470px); height: 64px; padding: 5px; border-radius: 999px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 999px; color: var(--label); font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  transition: color .2s, background .3s, transform .3s var(--bounce);
}
.tab .ico { width: 25px; height: 25px; stroke-width: 1.75; }
.tab[aria-current] { color: var(--tint); background: var(--tab-active); }
.tab[aria-current] .ico { fill: currentColor; --knock: var(--tab-knock); }
.tab:active { transform: scale(.9); }
@media (min-width: 1024px) { .tabbar { display: none; } }

/* footer */
.site-foot {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 36px calc(var(--gutter) + var(--safe-r)) calc(110px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  text-align: center; font-size: 13px; line-height: 1.6; color: var(--label-2);
}
.site-foot strong { color: var(--label); font-weight: 600; }
.site-foot a { color: inherit; }
.site-foot a:hover { color: var(--tint); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 14px; }
.foot-links a { color: var(--tint); font-size: 15px; }
.foot-small { margin-top: 8px; font-size: 12px; }
@media (min-width: 1024px) { .site-foot { padding-bottom: 36px; } }

/* ---------- 5. Typography and page heads ---------- */
.page-head { padding: 4px 0 22px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--label-2); margin-bottom: 2px;
}
.large-title {
  font-family: var(--font-display); font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.022em;
}
.page-sub { margin-top: 8px; max-width: 62ch; font-size: 17px; line-height: 1.42; color: var(--label-2); }
@media (min-width: 768px) { .large-title { font-size: 40px; } }
@media (min-width: 1024px) { .page-head { padding-top: 10px; } .large-title { font-size: 44px; } }

.section { margin-top: 36px; }
.section-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2;
}
.group + .group, .group + .contact-form, .group + .map-card { margin-top: 30px; }
.list-head {
  display: block; margin: 0; padding: 0 16px 7px;
  font-size: 13px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; color: var(--label-2);
}
.list-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px 7px; }
.list-head-row .list-head { padding: 0; }
.list-foot { padding: 7px 16px 0; font-size: 13px; line-height: 1.38; color: var(--label-2); }
.list-foot:empty { display: none; }
.list-total { margin-top: 14px; text-align: center; font-size: 13px; color: var(--label-2); }
.list-total:empty { display: none; }

/* ---------- 6. Grouped lists and rows ---------- */
.list { background: var(--bg-2); border-radius: var(--r-list); overflow: hidden; }
.list > * { position: relative; --inset: 16px; }
.list > *:has(.tile) { --inset: 58px; }
.list > *:has(.avatar) { --inset: 66px; }
.list > * + *::before {
  content: ""; position: absolute; z-index: 1; top: 0; left: var(--inset); right: 0; height: 1px;
  background: var(--sep); transform: scaleY(.5); transform-origin: top; pointer-events: none;
}
.row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px;
  color: var(--label); text-align: left;
}
a.row, button.row { width: 100%; transition: background .3s; }
a.row:active, button.row:active { background: var(--highlight); transition: none; }
@media (hover: hover) { a.row:hover, button.row:hover { background: var(--fill-4); } }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-size: 17px; line-height: 1.3; color: var(--label); }
.row-sub { margin-top: 1px; font-size: 15px; line-height: 1.33; color: var(--label-2); }
.row-detail { flex: none; max-width: 55%; font-size: 17px; color: var(--label-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-action { min-height: 50px; color: var(--tint); font-size: 17px; }
.row-action.is-red { color: var(--red); }
.row.is-muted .row-title { color: var(--label-2); }
.row[aria-current] .row-title { color: var(--tint); font-weight: 600; }
.chev { width: 14px; height: 14px; flex: none; margin-right: -4px; color: var(--label-3); stroke-width: 2.8; }

/* coloured icon tiles (Settings-style) */
.tile {
  --c: var(--gray);
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px;
  color: #fff; background: var(--c);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c));
}
.tile .ico { width: 19px; height: 19px; stroke-width: 2; }
.tile-lg { width: 46px; height: 46px; border-radius: 13px; }
.tile-lg .ico { width: 26px; height: 26px; stroke-width: 1.9; }
.tile-xl { width: 68px; height: 68px; border-radius: 19px; box-shadow: 0 10px 24px -10px var(--c); }
.tile-xl .ico { width: 36px; height: 36px; stroke-width: 1.8; }
.t-red { --c: var(--red); }
.t-orange { --c: var(--orange); }
.t-yellow { --c: var(--yellow); }
.t-green { --c: var(--green); }
.t-teal { --c: var(--teal); }
.t-blue { --c: var(--blue); }
.t-indigo { --c: var(--indigo); }
.t-purple { --c: var(--purple); }
.t-pink { --c: var(--pink); }
.t-gray { --c: var(--gray); }
.t-glass { background: rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }

/* cards */
.card { background: var(--bg-2); border-radius: var(--r-card); padding: 20px; }
@media (min-width: 768px) { .card { padding: 26px 28px; } }
.card-lead { font-size: 17px; line-height: 1.45; color: var(--label-2); max-width: 70ch; }

/* pills */
.pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  background: var(--fill-3); color: var(--label-2);
}
.pill-new { background: var(--green); color: #fff; }
.pill-draft { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--draft); }
.tbc { color: var(--label-3); }

/* ---------- 7. Controls ---------- */
.btn {
  --btn-bg: var(--fill-3); --btn-fg: var(--tint);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 17px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap;
  -webkit-user-select: none; user-select: none;
  transition: transform .3s var(--bounce), opacity .15s, background .2s, filter .2s;
}
.btn .ico { width: 19px; height: 19px; stroke-width: 2.1; }
.btn:active { transform: scale(.96); opacity: .82; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
@media (hover: hover) { .btn:not(:disabled):hover { filter: brightness(1.06); } }
.btn-filled { --btn-bg: var(--tint); --btn-fg: #fff; box-shadow: 0 8px 20px -10px rgba(var(--tint-rgb), .9); }
.btn-tinted { --btn-bg: var(--tint-soft); --btn-fg: var(--tint); }
.btn-gray { --btn-bg: var(--fill-3); --btn-fg: var(--label); }
.btn-white { --btn-bg: #fff; --btn-fg: #111; }
.btn-sm { min-height: 34px; padding: 0 14px; gap: 5px; font-size: 15px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-lg { min-height: 52px; padding: 0 26px; }
.btn-block { width: 100%; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy .ico { opacity: 0; }
.btn.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0), #fff);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: spin .8s linear infinite;
}
.btn-text { padding: 6px 4px; color: var(--tint); font-size: 17px; font-weight: 400; }
.btn-text.is-done { font-weight: 600; }

/* search field */
.search {
  display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px 0 12px; border-radius: 999px;
  background: var(--fill-3); color: var(--label-2); transition: box-shadow .2s;
}
.search > .ico { width: 18px; height: 18px; stroke-width: 2.3; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--label); font-size: 17px; -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--label-2); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(var(--tint-rgb), .28); }
.search-clear { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: var(--label-3); --knock: var(--bg-2); }
.search-clear .ico { width: 18px; height: 18px; }

/* segmented control */
.seg-scroll {
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter);
}
.seg-scroll::-webkit-scrollbar { display: none; }
.segmented { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--fill-3); isolation: isolate; vertical-align: top; }
.segmented button {
  position: relative; z-index: 1; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  height: 32px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--label); white-space: nowrap;
}
.segmented button::after { content: attr(data-label); height: 0; overflow: hidden; visibility: hidden; font-weight: 650; }
.segmented button[aria-pressed="true"] { font-weight: 650; }
.seg-thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px;
  background: var(--seg-thumb); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
  transition: transform .45s var(--spring), width .45s var(--spring);
}

/* switch */
.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; margin: 0;
  width: 51px; height: 31px; border-radius: 999px; background: var(--switch-off); cursor: pointer;
  transition: background .25s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 999px; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06);
  transition: transform .35s var(--bounce), width .2s var(--ease);
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch:active::after { width: 33px; }
.switch:checked:active::after { transform: translateX(14px); }
.switch[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--red); }

/* form rows */
.form-list .field-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; }
.field-row > label { flex: none; width: 92px; font-size: 17px; color: var(--label); }
.field-row input:not(.switch), .field-row select, .field-row textarea {
  flex: 1; min-width: 0; width: 100%; padding: 14px 0; border: 0; outline: 0; border-radius: 0;
  background: transparent; color: var(--label); font-size: 17px; -webkit-appearance: none; appearance: none;
}
.field-row input::placeholder, .field-row textarea::placeholder { color: var(--label-3); }
.field-row:has(:focus-visible) { background: var(--fill-4); }
.field-row:has([aria-invalid="true"]) > label { color: var(--red); }
.field-area { padding: 0 !important; }
.field-area textarea { display: block; min-height: 150px; padding: 14px 16px; line-height: 1.42; resize: vertical; }
.select { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.select select { padding-right: 24px; text-align: right; text-align-last: right; color: var(--label-2); cursor: pointer; text-overflow: ellipsis; }
.select .ico { position: absolute; right: 0; width: 16px; height: 16px; color: var(--label-2); stroke-width: 2.3; pointer-events: none; }
.date-pill {
  flex: none !important; width: auto !important; margin-left: auto; padding: 7px 12px !important;
  border-radius: 9px !important; background: var(--fill-3) !important; font-size: 16px !important; font-variant-numeric: tabular-nums;
}
.switch-row label { flex: 1; width: auto; padding: 12px 0; font-size: 15px; line-height: 1.38; }
.field-error { color: var(--red); }
.field-error:empty { display: none; }
.form-error { color: var(--red); }
.form-note { margin-top: 12px; text-align: center; font-size: 13px; color: var(--label-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* avatars */
.avatar {
  --s: 40px;
  width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: var(--avatar); color: #fff;
  font-size: calc(var(--s) * .38); font-weight: 600; letter-spacing: .02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { --s: 34px; }
.avatar-lg { --s: 108px; }
.avatar-dashed { background: var(--fill-3); color: var(--label-2); box-shadow: inset 0 0 0 1.5px var(--label-3); font-size: 14px; }

/* empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 24px; text-align: center; color: var(--label-2); }
.empty-state > .ico { width: 54px; height: 54px; margin-bottom: 8px; color: var(--label-3); stroke-width: 1.5; }
.empty-state h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--label); }
.empty-state p { max-width: 42ch; }
.empty-state .btn { margin-top: 14px; }
.empty-card { background: var(--bg-2); border-radius: var(--r-card); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.empty-actions .btn { margin-top: 0; }

/* skeleton */
.skel {
  min-height: 46px; border-radius: 10px;
  background: linear-gradient(90deg, var(--fill-3) 25%, var(--fill-4) 50%, var(--fill-3) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.skel-row { min-height: 64px; border-radius: 0; }

/* ---------- 8. Sheets ---------- */
dialog.sheet {
  --bg-2: var(--sheet-cell);
  position: fixed; inset: auto 8px calc(8px + var(--safe-b)) 8px; margin: 0;
  width: auto; max-width: none; max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 28px);
  padding: 0; border: 0; border-radius: var(--r-sheet);
  background: var(--sheet-bg); color: var(--label);
  box-shadow: 0 -6px 50px rgba(0, 0, 0, .22);
  overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .55s var(--spring); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .3); animation: fade-in .35s ease; }
dialog.sheet.is-closing { animation: sheet-down .34s cubic-bezier(.4, 0, 1, 1) forwards; }
dialog.sheet.is-closing::backdrop { animation: fade-out .34s ease forwards; }
@media (prefers-color-scheme: dark) { dialog.sheet::backdrop { background: rgba(0, 0, 0, .55); } }
.sheet-head {
  position: relative; flex: none; height: 60px; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 12px; touch-action: none; cursor: grab;
}
.sheet-head:active { cursor: grabbing; }
.grabber { position: absolute; top: 6px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--label-3); }
.sheet-title { position: absolute; left: 64px; right: 64px; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.sheet-close { width: 38px; height: 38px; }
.sheet-close .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.sheet-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(24px + var(--safe-b));
}
@media (min-width: 768px) {
  dialog.sheet {
    inset: 0; margin: auto; width: min(560px, calc(100% - 64px)); height: fit-content;
    max-height: min(820px, calc(100dvh - 64px)); border-radius: 32px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .06);
  }
  dialog.sheet[open] { animation: pop-in .5s var(--spring); }
  dialog.sheet.is-closing { animation: pop-out .22s ease-in forwards; }
  .grabber { display: none; }
  .sheet-head { cursor: default; touch-action: auto; }
  .sheet-body { padding: 0 26px 28px; }
}

/* toast: a Dynamic Island-style capsule */
.island {
  position: fixed; z-index: 2147483000; top: calc(10px + var(--safe-t)); left: 50%; right: auto; bottom: auto;
  margin: 0; border: 0; overflow: visible;
  display: flex; align-items: center; gap: 10px; min-height: 46px; max-width: min(calc(100% - 24px), 440px);
  padding: 8px 20px 8px 8px; border-radius: 999px; background: #000; color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none; transform: translate(-50%, -6px) scale(.35, .5);
  transition: transform .6s var(--bounce), opacity .25s;
}
.island:not(:popover-open):not(.is-shown)[popover] { display: none; }
.island.is-shown { opacity: 1; transform: translate(-50%, 0) scale(1); }
.island-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--green); }
.island-icon.is-info { background: var(--blue); }
.island-icon.is-error { background: var(--red); }
.island-icon .ico { width: 17px; height: 17px; color: #fff; stroke-width: 2.8; }
@media (prefers-color-scheme: dark) { .island { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 14px 40px rgba(0, 0, 0, .7); } }

/* ---------- 9. Home ---------- */
.today {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 540px; padding: 26px 22px 100px; border-radius: 30px; color: #fff;
  background: linear-gradient(180deg, #0b1430 0%, #1b2552 28%, #47396f 50%, #9c5872 66%, #df8659 80%, #f3b36a 100%);
  box-shadow: 0 30px 60px -28px rgba(40, 26, 80, .7);
}
.today::before {
  content: ""; position: absolute; inset: 0 0 50%; z-index: -2; opacity: .75;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 14%, #fff 50%, transparent 55%),
    radial-gradient(1px 1px at 22% 32%, #fff 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 37% 9%, #fff 50%, transparent 55%),
    radial-gradient(1px 1px at 51% 24%, #fff 50%, transparent 55%),
    radial-gradient(1.6px 1.6px at 66% 12%, #fff 50%, transparent 55%),
    radial-gradient(1px 1px at 78% 30%, #fff 50%, transparent 55%),
    radial-gradient(1.3px 1.3px at 90% 8%, #fff 50%, transparent 55%),
    radial-gradient(1px 1px at 95% 40%, #fff 50%, transparent 55%),
    radial-gradient(1px 1px at 72% 46%, #fff 50%, transparent 55%);
}
.today-land { position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; overflow: visible; }
.today-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.today-title {
  margin-top: 8px; max-width: 13ch; text-wrap: balance;
  font-family: var(--font-display); font-size: 36px; line-height: 1.04; font-weight: 800; letter-spacing: -.035em;
}
.today-text { margin-top: 14px; max-width: 36ch; font-size: 16px; line-height: 1.45; color: rgba(255, 255, 255, .84); }
.today-search {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 9px 0 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 30px rgba(0, 0, 0, .25);
  color: rgba(255, 255, 255, .85);
}
.today-search > .ico { width: 19px; height: 19px; stroke-width: 2.3; }
.today-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: #fff; font-size: 17px; -webkit-appearance: none; appearance: none;
}
.today-search input::placeholder { color: rgba(255, 255, 255, .72); }
.today-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.today-search:has(input:focus-visible) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 3px rgba(255, 255, 255, .45); }
.today-search .btn { min-height: 42px; padding: 0 18px; }
@media (min-width: 768px) {
  .today { min-height: 520px; padding: 44px 44px 120px; border-radius: 34px; }
  .today-title { font-size: 54px; max-width: 12ch; }
  .today-text { font-size: 18px; max-width: 34ch; }
  .today-land { height: 70%; }
  .today-search { left: 32px; right: auto; bottom: 32px; width: min(470px, calc(100% - 64px)); }
}
/* desktop: the whole hero card, search bar included, fits on the first screen */
@media (min-width: 1024px) {
  .today { min-height: clamp(400px, calc(100dvh - 200px), 560px); padding: clamp(28px, 5vh, 44px) 44px 112px; }
  .today-title { font-size: clamp(40px, 6.6vh, 56px); }
  .today-text { margin-top: clamp(8px, 1.6vh, 14px); font-size: clamp(16px, 2.2vh, 18px); }
}

/* widgets */
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 720px) { .widgets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.widget {
  position: relative; isolation: isolate; overflow: hidden; min-width: 0; aspect-ratio: 1;
  display: flex; flex-direction: column; padding: 16px; border-radius: var(--r-widget);
  background: var(--bg-2); color: var(--label); box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: transform .35s var(--bounce);
}
a.widget:active { transform: scale(.95); }
.w-head { display: flex; align-items: center; justify-content: space-between; }
.w-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.w-chev { width: 13px; height: 13px; color: var(--label-3); stroke-width: 3; }
.w-big { margin-top: auto; font-family: var(--font-display); font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.w-cap { margin-top: 4px; font-size: 13px; line-height: 1.3; color: var(--label-2); }
.w-link { display: inline-flex; align-items: center; gap: 3px; font-size: 15px; font-weight: 600; color: var(--label); }
.w-link .ico { width: 12px; height: 12px; color: var(--label-3); stroke-width: 3.2; }
.w-foot { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--label-2); }
.w-foot .ico { width: 13px; height: 13px; stroke-width: 2.2; }

/* court rolls widget (calendar style) */
.w-cal {
  grid-column: span 2; aspect-ratio: auto;
  display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px 14px;
  padding: 16px 16px 14px;
}
.cal-date { grid-row: span 2; display: flex; flex-direction: column; }
.cal-weekday { font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--red); }
.cal-day { font-family: var(--font-display); font-size: 46px; line-height: 1; font-weight: 400; letter-spacing: -.04em; margin: 2px 0 auto; font-variant-numeric: tabular-nums; }
.cal-date .w-link { margin-top: 12px; }
.events { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.events .skel { min-height: 44px; }
.event {
  --ev: var(--blue);
  display: flex; align-items: stretch; gap: 9px; padding: 7px 10px 7px 7px; border-radius: 11px;
  background: color-mix(in srgb, var(--ev) 13%, transparent); color: var(--label);
  transition: transform .3s var(--bounce);
}
.event:active { transform: scale(.97); }
.event-bar { width: 4px; flex: none; border-radius: 2px; background: var(--ev); }
.event-text { min-width: 0; display: flex; flex-direction: column; }
.event-title { font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-sub { font-size: 12px; line-height: 1.3; color: var(--label-2); }
.events-empty { font-size: 14px; color: var(--label-2); padding: 8px 0; }
.ev-motion { --ev: var(--blue); }
.ev-trial { --ev: var(--orange); }
.ev-criminal { --ev: var(--red); }
.ev-appeal { --ev: var(--purple); }
.ev-notice { --ev: var(--gray); }
.week-strip { display: none; }
@media (min-width: 720px) {
  .w-cal { grid-row: span 2; grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; gap: 12px; padding: 18px; }
  .week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 2px 0 4px; text-align: center; }
  .week-strip li { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--label-2); }
  .week-strip b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; font-weight: 500; color: var(--label); font-variant-numeric: tabular-nums; }
  .week-strip .is-weekend b { color: var(--label-2); }
  .week-strip .is-today b { background: var(--red); color: #fff; font-weight: 700; }
  .cal-date { grid-row: auto; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; }
  .cal-weekday { grid-column: 1; }
  .cal-day { grid-column: 1; font-size: 54px; }
  .cal-date .w-link { grid-column: 2; grid-row: 1 / span 2; align-self: start; justify-self: end; margin-top: 0; }
  .events { gap: 8px; }
  .event { padding: 10px 12px 10px 8px; }
  .event-title { font-size: 15px; }
  .event-sub { font-size: 13px; }
}

/* members widget */
.avatar-stack { display: flex; margin-top: 12px; }
.avatar-stack .avatar { --s: 34px; font-size: 12px; box-shadow: 0 0 0 2.5px var(--bg-2); }
.avatar-stack .avatar + .avatar { margin-left: -9px; }
.avatar-stack .avatar-more { background: var(--tint); }

/* map widget and place card */
.map-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.map-pin {
  position: absolute; left: 50%; top: 46%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  background: var(--red); border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3), 0 0 0 0 rgba(255, 59, 48, .45);
  animation: pin-pulse 2.6s ease-out infinite;
}
.map-pin::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.w-map { padding: 10px; justify-content: flex-end; }
.w-map-label {
  display: flex; flex-direction: column; padding: 8px 12px; border-radius: 16px;
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 4px 14px rgba(0, 0, 0, .1);
  font-size: 12px; line-height: 1.3; color: var(--label-2);
}
.w-map-label strong { font-size: 14px; font-weight: 600; color: var(--label); }

/* pupillage widget */
.w-pup { background: linear-gradient(155deg, #6d5cf6 0%, #8a4fe3 55%, #b14cc9 100%); color: #fff; }
.w-pup .w-cap { color: rgba(255, 255, 255, .8); }
.ring { position: relative; width: 64%; max-width: 92px; aspect-ratio: 1; margin: auto 0 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: rgba(255, 255, 255, .2); }
.ring-fill { stroke: #fff; stroke-dasharray: 13.6 3.155; stroke-linecap: butt; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

/* call widget */
.w-call { background: linear-gradient(155deg, #3ed36e 0%, #22a24b 100%); color: #fff; }
.w-call .w-cap { color: rgba(255, 255, 255, .85); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.w-call .w-title { margin-top: auto; font-size: 17px; }
.w-call-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .24); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.w-call-icon .ico { width: 22px; height: 22px; stroke-width: 2.1; }

/* about card */
.about-lead { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 10px; }
.about-card > p:not(.about-lead) { max-width: 72ch; line-height: 1.5; }
.about-card > p + p { margin-top: 10px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.stat { padding: 12px 14px 14px; border-radius: 16px; background: var(--bg-3); min-width: 0; }
.stat dt { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--c); }
.stat dt .ico { width: 15px; height: 15px; stroke-width: 2.2; }
.stat dd { margin-top: 6px; font-family: var(--font-display); font-size: clamp(19px, 5.2vw, 30px); font-weight: 700; letter-spacing: -.025em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .unit { margin-left: 3px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--label-2); }

/* brief steps */
.feature-list { display: grid; gap: 22px; margin-top: 22px; }
.feature-list li { display: flex; align-items: flex-start; gap: 14px; }
.feature-step { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--label-2); }
.feature-list h3 { margin-top: 2px; font-size: 17px; font-weight: 600; }
.feature-list li p:last-child { margin-top: 3px; font-size: 15px; line-height: 1.42; color: var(--label-2); }
@media (min-width: 900px) {
  .feature-list { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .feature-list li { flex-direction: column; }
}

/* place card */
.place-card { display: grid; overflow: hidden; border-radius: var(--r-card); background: var(--bg-2); }
.place-map { position: relative; isolation: isolate; display: block; min-height: 190px; overflow: hidden; }
.place-body { padding: 20px; }
.place-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.place-sub { margin-top: 4px; font-size: 15px; line-height: 1.4; color: var(--label-2); }
.place-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.place-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 64px;
  border-radius: 16px; background: var(--fill-3); color: var(--tint); font-size: 12px; font-weight: 600;
  transition: transform .3s var(--bounce), background .2s;
}
.place-btn .ico { width: 22px; height: 22px; stroke-width: 2; }
.place-btn:active { transform: scale(.94); }
.place-btn.is-primary { background: var(--tint); color: #fff; }
@media (min-width: 900px) {
  .place-card { grid-template-columns: 1.15fr 1fr; }
  .place-map { min-height: 260px; }
  .place-body { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
}

/* ---------- 10. Members ---------- */
.member-search { margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.chip { height: 32px; padding: 0 14px; border-radius: 999px; background: var(--fill-3); color: var(--label); font-size: 14px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--tint); color: #fff; }
.az-section + .az-section { margin-top: 22px; }
.az-letter { padding: 0 16px 6px; font-size: 15px; font-weight: 700; color: var(--label-2); }
.member-row .row-title b { font-weight: 700; }
.member-row[aria-current="true"] { background: var(--tint); }
.member-row[aria-current="true"] .row-title, .member-row[aria-current="true"] .row-sub, .member-row[aria-current="true"] .chev { color: #fff; }
.member-row[aria-current="true"] .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.list > *:has(.member-row[aria-current="true"])::before, .list > *:has(.member-row[aria-current="true"]) + *::before { opacity: 0; }
.az-index {
  position: fixed; z-index: 20; right: calc(1px + var(--safe-r)); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; padding: 6px 0; touch-action: none; -webkit-user-select: none; user-select: none;
}
.az-index a { width: 18px; font-size: 11px; font-weight: 600; line-height: 1.32; text-align: center; color: var(--tint); }
body[data-page="members"] main { padding-right: calc(var(--gutter) + var(--safe-r) + 12px); }
@media (min-width: 1200px) { body[data-page="members"] main { padding-right: calc(var(--gutter) + var(--safe-r)); } }
.contact-pane { display: none; }
@media (min-width: 1200px) {
  .contacts { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .contact-pane {
    display: block; position: sticky; top: calc(var(--nav-h) + var(--safe-t) + 4px);
    max-height: calc(100dvh - var(--nav-h) - var(--safe-t) - 24px); overflow-y: auto; scrollbar-width: thin;
    padding: 24px 28px 28px; border-radius: 30px; background: var(--card);
    --bg-2: var(--bg-3);
  }
  .az-index { display: none !important; }
}

/* profile (contact card) */
.profile { display: flex; flex-direction: column; gap: 24px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.profile-head .avatar { margin-bottom: 10px; box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .35); }
.profile-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.022em; line-height: 1.15; }
.profile-role { font-size: 15px; color: var(--label-2); }
.profile-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qa {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 64px;
  border-radius: 16px; background: var(--bg-2); color: var(--tint); font-size: 12px; font-weight: 500;
  transition: transform .3s var(--bounce), background .2s;
}
.qa .ico { width: 23px; height: 23px; stroke-width: 1.9; }
.qa:active { transform: scale(.94); background: var(--highlight); }
.kv { display: flex; flex-direction: column; gap: 2px; padding: 11px 16px; color: var(--label); }
a.kv { transition: background .3s; }
a.kv:active { background: var(--highlight); transition: none; }
.kv-label { font-size: 14px; color: var(--label); }
.kv-value { font-size: 17px; line-height: 1.35; color: var(--tint); overflow-wrap: anywhere; }
.kv-value.is-plain { color: var(--label); }
.profile-bio { font-size: 16px; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--tint-soft); color: var(--tint); font-size: 13px; font-weight: 600; }

/* ---------- 11. Court rolls ---------- */
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); font-size: 15px; font-weight: 600;
}
.status-chip .ico { width: 17px; height: 17px; stroke-width: 2.2; }
.admin { margin-bottom: 36px; }
.upload-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .upload-grid { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 210px; padding: 24px; border-radius: var(--r-list); text-align: center; cursor: pointer;
  background: var(--bg-2); border: 2px dashed rgba(var(--tint-rgb), .35);
  transition: background .2s, border-color .2s, transform .35s var(--bounce);
}
.drop:hover { border-color: rgba(var(--tint-rgb), .6); }
.drop.is-over { background: var(--tint-soft); border-color: var(--tint); transform: scale(1.015); }
.drop-icon { width: 62px; height: 62px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 18px; background: var(--tint-soft); color: var(--tint); }
.drop-icon .ico { width: 32px; height: 32px; stroke-width: 1.8; }
.drop-title { font-size: 17px; font-weight: 600; }
.drop-help { font-size: 15px; color: var(--label-2); }
.link { color: var(--tint); }
.drop.has-file { border-style: solid; border-color: transparent; cursor: default; }
.drop.has-file > :not(.file-chip):not(input) { display: none; }
.file-chip { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; animation: pop-in .45s var(--spring); }
.file-chip .tile { width: 52px; height: 52px; border-radius: 14px; }
.file-chip .tile .ico { width: 28px; height: 28px; }
.file-chip .row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-clear { width: 34px; height: 34px; flex: none; display: grid; place-items: center; color: var(--label-3); --knock: var(--bg-2); }
.icon-clear .ico { width: 22px; height: 22px; }
.upload-side { display: flex; flex-direction: column; }
.upload-side .btn { margin-top: 16px; }
.progress { height: 4px; margin: 14px 4px 0; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.progress span { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--tint); transition: width .9s var(--ease); }
.admin .group { margin-top: 22px; }

.rolls-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.rolls-bar .seg-scroll { flex: 1; min-width: 0; }
.rolls-bar .btn-text { flex: none; }
.week + .week { margin-top: 28px; }
.week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 16px 7px; }
.week-head .list-head { padding: 0; }
.week-head .list-head.is-now { color: var(--red); font-weight: 600; }
.week-range { font-size: 13px; color: var(--label-2); white-space: nowrap; }
.roll { display: flex; align-items: center; overflow: hidden; }
.roll-minus {
  flex: none; width: 0; margin-left: 0; opacity: 0; overflow: hidden; display: grid; place-items: center;
  transition: width .35s var(--spring), margin .35s var(--spring), opacity .2s;
}
.roll-minus span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--red); transition: transform .3s var(--spring); }
.roll-minus .ico { width: 13px; height: 13px; color: #fff; stroke-width: 3.4; }
.rolls.is-editing .roll-minus { width: 26px; margin-left: 14px; opacity: 1; }
.roll.is-armed .roll-minus span { transform: rotate(-90deg); }
.roll-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 6px 11px 16px; color: var(--label); transition: background .3s; }
.roll-link:active { background: var(--highlight); transition: none; }
@media (hover: hover) { .roll-link:hover { background: var(--fill-4); } }
.roll-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 17px; font-weight: 500; line-height: 1.3; }
.roll-note { margin-top: 1px; font-size: 14px; line-height: 1.35; color: var(--label); }
.roll-sub { margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--label-2); }
.roll-dl { width: 44px; height: 44px; margin-right: 8px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--tint); transition: background .2s, transform .3s var(--bounce); }
.roll-dl .ico { width: 27px; height: 27px; stroke-width: 1.7; }
.roll-dl:active { background: var(--fill-3); transform: scale(.9); }
.rolls.is-editing .roll-dl { display: none; }
.rolls.is-editing .roll-link { pointer-events: none; }
.roll-delete {
  flex: none; align-self: stretch; width: 0; overflow: hidden; background: var(--red); color: #fff;
  font-size: 17px; font-weight: 500; white-space: nowrap; transition: width .35s var(--spring);
}
.roll.is-armed .roll-delete { width: 92px; }
.roll.is-flash { animation: flash 2.6s ease; }
.roll.is-removing { transition: height .35s var(--spring), opacity .25s, transform .3s var(--spring); opacity: 0; transform: translateX(-24px); }
.note-card {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 30px; padding: 14px 16px; border-radius: 18px;
  background: var(--fill-4); font-size: 13px; line-height: 1.45; color: var(--label-2);
}
.note-card .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--label-2); }

/* sign-in sheet */
.signin { display: flex; flex-direction: column; align-items: center; text-align: center; }
.signin .tile-xl { margin-top: 4px; }
.signin-title { margin-top: 16px; font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.signin-sub { margin: 6px 0 22px; font-size: 15px; color: var(--label-2); }
.signin .list { width: 100%; text-align: left; }
.signin .list-foot { align-self: stretch; text-align: left; }
.signin .btn { margin-top: 20px; }
.signin-hint { margin-top: 14px; font-size: 13px; color: var(--label-2); }
.shake { animation: shake .45s ease; }

/* ---------- 12. Pupillage, committees, contact ---------- */
.split { display: grid; gap: 30px; }
.split-main, .split-side { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.split > *, .split-main > *, .split-side > * { margin-top: 0 !important; }
@media (min-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); align-items: start; gap: 30px; }
  .split-council { grid-template-columns: minmax(280px, .85fr) minmax(0, 1.5fr); }
  .split-contact { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); }
}
/* the side column only sticks when the window is tall enough to show all of it */
@media (min-width: 1100px) and (min-height: 820px) {
  .split-side { position: sticky; top: calc(var(--nav-h) + var(--safe-t) + 8px); }
}
.steps { padding: 6px 20px; }
.steps li { position: relative; display: flex; gap: 16px; padding: 16px 0; }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 15px; top: 52px; bottom: -14px; width: 2px; border-radius: 1px; background: var(--fill-2);
}
.step-num {
  position: relative; z-index: 1; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--tint); color: #fff; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px var(--bg-2);
}
.step-num.is-done { background: var(--green); }
.step-num .ico { width: 17px; height: 17px; stroke-width: 3; }
.steps h3 { margin-top: 5px; font-size: 17px; font-weight: 600; }
.steps p { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--label-2); }
.faq details > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px;
  font-size: 17px; cursor: pointer; transition: background .3s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:active { background: var(--highlight); transition: none; }
.faq summary .chev { margin-left: auto; transition: transform .35s var(--spring); }
.faq details[open] summary .chev { transform: rotate(90deg); }
.faq details p { padding: 0 16px 16px; font-size: 15px; line-height: 1.5; color: var(--label-2); animation: fade-in .3s ease; }
.promo-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 22px; border-radius: var(--r-card); color: #fff;
  background: linear-gradient(150deg, #5b5be8 0%, #8a4fe0 58%, #b44fd0 100%);
  box-shadow: 0 22px 44px -22px rgba(100, 70, 220, .75);
}
.promo-card h3 { margin-top: 6px; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.promo-card p { font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, .86); }
.promo-card .btn { margin-top: 8px; }

.court-grid { display: grid; gap: 18px; }
@media (min-width: 860px) {
  .court-grid { grid-template-columns: 1fr 1fr; }
  .court-feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
  .court-feature .court-art { aspect-ratio: auto; min-height: 300px; }
}
.court-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-card); background: var(--bg-2); }
.court-art {
  aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--art-ink);
  background: radial-gradient(120% 110% at 50% 0%, var(--art-a), var(--art-b));
}
.court-art svg { width: 84%; height: auto; overflow: visible; }
.art-blue { --art-a: #e3eeff; --art-b: #bcd3fb; --art-ink: #1d4fa8; }
.art-orange { --art-a: #fff0dd; --art-b: #fbd2a6; --art-ink: #9a4c12; }
.art-green { --art-a: #e2f5e8; --art-b: #bde6ca; --art-ink: #1f7442; }
@media (prefers-color-scheme: dark) {
  .art-blue { --art-a: #1d2b47; --art-b: #111a2d; --art-ink: #8fb6ff; }
  .art-orange { --art-a: #3a2816; --art-b: #22170c; --art-ink: #ffb871; }
  .art-green { --art-a: #17321f; --art-b: #0d1d12; --art-ink: #7fdc9c; }
}
.court-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; }
.court-kind { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--label-2); }
.court-body h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.court-body > p:not(.court-kind):not(.court-addr) { font-size: 15px; line-height: 1.45; color: var(--label-2); }
.court-addr { display: flex; align-items: flex-start; gap: 7px; margin-top: 2px; font-size: 15px; line-height: 1.4; }
.court-addr .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--red); stroke-width: 2.1; }
.court-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 12px; }

.committee-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .committee-grid { grid-template-columns: 1fr 1fr; } }
.committee { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r-list); background: var(--bg-2); }
.committee h3 { margin-top: 6px; font-size: 17px; font-weight: 600; }
.committee > p { font-size: 15px; line-height: 1.45; color: var(--label-2); }
.committee-foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px;
  border-top: .5px solid var(--sep); font-size: 13px; color: var(--label-2);
}
.committee-foot .ico { width: 15px; height: 15px; }
.committee-foot a { color: var(--tint); }

.success {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 24px; text-align: center;
  border-radius: var(--r-card); background: var(--bg-2);
}
.success-icon { width: 76px; height: 76px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; animation: pop-in .6s var(--bounce); }
.success-icon .ico { width: 40px; height: 40px; stroke-width: 2.6; }
.success h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; outline: none; }
.success p { max-width: 44ch; color: var(--label-2); }
.success-demo { font-size: 13px; }
.success .btn { margin-top: 12px; }
.map-card { overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--r-list); background: var(--fill-3); }
.map-card iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (prefers-color-scheme: dark) { .map-card iframe { filter: invert(.9) hue-rotate(180deg) saturate(.8); } }

/* ---------- 13. Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .8s var(--spring); }
.js .reveal.is-in { opacity: 1; transform: none; }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(calc(100% + 40px)); } }
@keyframes sheet-down { to { transform: translateY(calc(100% + 40px)); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92) translateY(10px); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.96); } }
@keyframes pin-pulse {
  0% { box-shadow: 0 4px 10px rgba(0, 0, 0, .3), 0 0 0 0 rgba(255, 59, 48, .45); }
  70%, 100% { box-shadow: 0 4px 10px rgba(0, 0, 0, .3), 0 0 0 20px rgba(255, 59, 48, 0); }
}
@keyframes flash { 0%, 35% { background: rgba(var(--tint-rgb), .16); } 100% { background: transparent; } }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 14. Print ---------- */
@media print {
  .sidebar, .navbar, .tabbar, .demo-note, .island, .today-search, .rolls-bar, .admin, dialog { display: none !important; }
  body { background: #fff; color: #000; }
  .app { display: block; }
  .site-foot { padding-bottom: 0; }
}
