/* NAB CAMAS — design system
   Contemporary Scandinavian minimalism: white and warm neutral surfaces, restrained green accents,
   thin borders instead of shadows, Manrope throughout. Every colour and size below is a token;
   components further down use only these tokens. */

/* ------------------------------------------------------------------ tokens */
:root {
  /* brand palette */
  --woodland: #243D32;   /* sidebar, deepest accent */
  --fern: #597561;       /* primary actions */
  --fern-dark: #46604E;  /* primary hover, green text on light fills */
  --sage: #E5EBE2;       /* soft accent fills */
  --limestone: #F5F5F0;  /* page background */
  --chalk: #FFFFFF;      /* cards */
  --graphite: #303833;   /* text */
  --border: #DFE4DC;     /* one-pixel rules */

  /* semantic roles */
  --bg: var(--limestone);
  --surface: var(--chalk);
  --surface-2: #F3F5F0;      /* table headers, quiet panels */
  --line: var(--border);
  --ink: var(--graphite);
  --ink-2: #59625C;          /* secondary text, 6.4:1 on white */
  --ink-3: #6E7771;          /* tertiary text, 4.7:1 on white */
  --accent: var(--fern);
  --accent-ink: #FFFFFF;
  --accent-soft: var(--sage);
  --focus: rgba(89, 117, 97, .35);

  /* muted status colours: always paired with a text label */
  --st-yours: var(--woodland);   --st-yours-soft: #E1E9E3;  --st-yours-ink: var(--woodland);
  --st-available: #6E9A78;       --st-available-soft: #E7F0E8; --st-available-ink: #3D6447;
  --st-pending: #B89A5E;         --st-pending-soft: #F4EEE1;   --st-pending-ink: #765D29;
  --st-booked: #6F8592;          --st-booked-soft: #E8EDF0;    --st-booked-ink: #435763;
  --st-other: #C3CAC1;           --st-other-soft: #F1F3EF;     --st-other-ink: #59625C;
  --st-alert: #A0503F;           --st-alert-soft: #F6E9E5;     --st-alert-ink: #8A3F2F;

  /* older names used throughout the views, mapped onto the palette */
  --green: var(--st-available-ink); --green-soft: var(--st-available-soft);
  --amber: var(--st-pending-ink);   --amber-soft: var(--st-pending-soft);
  --blue: var(--st-booked-ink);     --blue-soft: var(--st-booked-soft);
  --red: var(--st-alert-ink);       --red-soft: var(--st-alert-soft);

  /* seasons (muted) */
  --school: var(--fern); --summer: #C2A56E; --shoulder: #8FA896; --winter: #93A1AA;

  /* type */
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 13px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 30px; --fs-3xl: 42px;

  /* shape and space */
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --radius: var(--r-lg);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --control-h: 44px; --control-h-sm: 36px;
  --sidebar-w: 264px;
  --shadow: none;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 var(--fs-md)/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--font); font-weight: 500; color: var(--ink); letter-spacing: -.01em; margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); }
b, strong { font-weight: 600; }
a { color: var(--fern-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--woodland); }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .92em; }
:focus-visible { outline: 2px solid var(--fern); outline-offset: 2px; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.muted { color: var(--ink-2); } .small { font-size: var(--fs-sm); } .tiny { font-size: var(--fs-xs); } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .between { justify-content: space-between; }
.stack > * + * { margin-top: var(--sp-4); }
.eyebrow { font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--fern-dark); font-weight: 500; }

/* ------------------------------------------------------------------ shell: sidebar + content */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--woodland); color: #CBD6CE; display: flex; flex-direction: column; padding: var(--sp-6) var(--sp-4) var(--sp-5); z-index: 30; overflow-y: auto; }
.wordmark { display: block; color: #fff; text-decoration: none; font-weight: 500; font-size: 15px; letter-spacing: .34em; text-transform: uppercase; padding: 0 var(--sp-3); }
.wordmark:hover { color: #fff; }
.place { display: block; color: #9FB3A6; font-size: 12px; letter-spacing: .02em; padding: 6px var(--sp-3) 0; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: var(--sp-5); }
.side-nav a { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--control-h); padding: 0 var(--sp-3); border-radius: var(--r-md); color: #CBD6CE; text-decoration: none; font-size: 15px; position: relative; }
.side-nav a .ico { width: 20px; height: 20px; color: #9FB3A6; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.on { background: rgba(229,235,226,.12); color: #fff; }
.side-nav a.on .ico { color: var(--sage); }
.side-nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--sage); color: var(--woodland); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
/* menu groups: a header opens and closes each one; the current page's group stays open */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-head { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 36px; margin-top: var(--sp-2); padding: 0 var(--sp-3); border: 0; border-radius: var(--r-md); background: none; color: #9FB3A6; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; text-align: left; }
.nav-head:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-head:focus-visible { outline: 2px solid var(--sage); outline-offset: -2px; }
.nav-head .ico { width: 16px; height: 16px; margin-left: auto; transition: transform .15s ease; }
.nav-head .count { margin-left: auto; }
.nav-head .count + .ico { margin-left: var(--sp-2); }
.nav-group.open .nav-head .ico { transform: rotate(180deg); }
.nav-group.open .nav-head .count { display: none; }
.nav-group.open .nav-head .count + .ico { margin-left: auto; }
.nav-group.here .nav-head { cursor: default; }
.nav-group.here .nav-head:hover { background: none; color: #9FB3A6; }
.nav-group.here .nav-head .ico { visibility: hidden; }
.nav-items { display: none; flex-direction: column; gap: 2px; }
.nav-group.open .nav-items { display: flex; }
@media (prefers-reduced-motion: reduce) { .nav-head .ico { transition: none; } }
.side-foot { margin-top: auto; padding-top: var(--sp-5); border-top: 1px solid rgba(229,235,226,.14); }
/* who is logged in: always at the top of the sidebar, and under the header on tablets and phones */
.whoami { margin: var(--sp-6) 0 0; padding: var(--sp-3) var(--sp-3) 14px; border: 1px solid rgba(229,235,226,.16); border-radius: var(--r-lg); background: rgba(255,255,255,.04); }
.whoami-label { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9FB3A6; margin-bottom: var(--sp-2); }
.whoami-row { display: flex; align-items: center; gap: var(--sp-3); }
.whoami .who { min-width: 0; line-height: 1.35; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.whoami .who b { color: #fff; font-weight: 500; font-size: 15px; max-width: 100%; overflow-wrap: anywhere; }
.whoami .role-pill { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--sage); color: var(--woodland); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.whoami .house { font-size: var(--fs-sm); color: #CBD6CE; }
.side-actions { display: flex; gap: var(--sp-1); padding: 0 var(--sp-1); }
.side-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 40px; border: 1px solid rgba(229,235,226,.16); background: transparent; color: #CBD6CE; border-radius: var(--r-md); font: inherit; font-size: var(--fs-sm); cursor: pointer; position: relative; }
.side-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-btn .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sage); color: var(--woodland); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sage); color: var(--woodland); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-xs); flex: none; letter-spacing: .04em; }
.mobilebar { display: none; }
main { margin-left: var(--sidebar-w); padding: var(--sp-7) 56px 96px; max-width: calc(var(--sidebar-w) + 1240px); }
.menu-scrim { display: none; }

/* ------------------------------------------------------------------ page header */
.page-head { margin-bottom: var(--sp-6); }
.page-head h1 { margin-bottom: var(--sp-2); }
.page-head p { margin: 0; color: var(--ink-2); max-width: 70ch; }

/* ------------------------------------------------------------------ cards, panels, grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-5); }
.card.flat { background: var(--surface); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--sp-5); }
.grid-2 > *, .grid-3 > * { min-width: 0; }   /* let wide content (forms, tables) shrink instead of pushing the page sideways */
.stat { font-size: 34px; font-weight: 400; line-height: 1.15; letter-spacing: -.02em; margin-top: var(--sp-1); }
.stat .small { font-size: var(--fs-sm); letter-spacing: 0; }
.stat.credit { color: var(--fern-dark); } .stat.owes { color: var(--st-alert-ink); }
.empty { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--ink-2); }
.section { border-top: 1px solid var(--line); padding-top: var(--sp-5); margin-top: var(--sp-5); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; }
.notice { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: var(--fs-sm); }
.notice.warn { background: var(--st-pending-soft); border-color: #E8DCC2; }
.swatch { display: none; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--control-h); padding: 0 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: #C6CEC4; background: var(--surface-2); color: var(--ink); }
.btn.primary, .btn.green { background: var(--fern); border-color: var(--fern); color: #fff; }
.btn.primary:hover, .btn.green:hover { background: var(--fern-dark); border-color: var(--fern-dark); color: #fff; }
.btn.danger { color: var(--st-alert-ink); }
.btn.danger:hover { border-color: #E3C7BF; background: var(--st-alert-soft); }
.btn.sm { min-height: var(--control-h-sm); padding: 0 14px; font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); position: relative; }
.iconbtn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.iconbtn .ico { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ forms */
label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: var(--control-h); font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid #CFD6CC; border-radius: var(--r-sm); padding: 8px 12px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 88px; line-height: 1.5; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2359625C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fern); box-shadow: 0 0 0 3px var(--focus); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--fern); margin: 2px 0 0; flex: none; }
input[type=color] { padding: 4px; }
input[type=file] { padding: 9px 12px; }
.field { margin-bottom: var(--sp-4); }
.check { display: flex; gap: var(--sp-3); align-items: flex-start; padding: 14px var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; color: var(--ink); font-weight: 400; font-size: var(--fs-sm); background: var(--surface); }
.check:has(input:checked) { border-color: var(--fern); background: #F4F8F3; }
.check b { display: block; font-weight: 600; margin-bottom: 2px; }

/* ------------------------------------------------------------------ tags (status labels) */
.badge, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 500; line-height: 1.5; background: var(--st-other-soft); color: var(--st-other-ink); white-space: nowrap; border: 1px solid transparent; text-decoration: none; }
.badge.green, .tag.available { background: var(--st-available-soft); color: var(--st-available-ink); }
.badge.amber, .tag.pending { background: var(--st-pending-soft); color: var(--st-pending-ink); }
.badge.blue, .tag.booked { background: var(--st-booked-soft); color: var(--st-booked-ink); }
.badge.red, .tag.alert { background: var(--st-alert-soft); color: var(--st-alert-ink); }
.badge.accent, .tag.yours { background: var(--st-yours-soft); color: var(--st-yours-ink); }
.tag.outline { background: transparent; border-color: var(--line); color: var(--ink-2); }
.tag.off { background: transparent; color: var(--ink-2); padding-right: 4px; }   /* a trusted friend's "Unavailable": plain text, not a button */
.season { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: 1px; }
.season.summer { background: var(--summer); } .season.school { background: var(--school); } .season.shoulder { background: var(--shoulder); } .season.winter { background: var(--winter); }

/* ------------------------------------------------------------------ segmented controls and sub-navigation */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: var(--r-sm); font: inherit; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button.on { background: var(--sage); color: var(--woodland); font-weight: 500; }
.subtabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-5); overflow-x: auto; }
.subtabs a { padding: var(--sp-3) var(--sp-4); text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; font-size: 15px; }
.subtabs a.on { color: var(--ink); border-bottom-color: var(--fern); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: var(--fs-xs); letter-spacing: .02em; background: var(--surface-2); }
th, td { padding: 14px var(--sp-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td input, td select { min-height: 38px; padding: 6px 10px; }
td select { padding-right: 32px; }
table[style*=fixed] td { padding-left: 8px; padding-right: 8px; } table[style*=fixed] td:first-child { padding-left: var(--sp-4); }
tfoot td { font-weight: 500; background: var(--surface-2); }
.card table th { background: transparent; } .card table td, .card table th { padding-left: 0; padding-right: 0; }
.card table td + td, .card table th + th { padding-left: var(--sp-3); }
table.myweeks td { vertical-align: top; } table.myweeks .plan-sel { width: 210px; }
table.myweeks .sale-opts { margin-top: var(--sp-2) !important; } table.myweeks .sale-opts .row { flex-wrap: wrap; } table.myweeks .sale-opts input { max-width: 160px; }
tr.past-row { opacity: .5; }

/* ------------------------------------------------------------------ drawers, modals, toasts */
.scrim { position: fixed; inset: 0; background: rgba(36,61,50,.32); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 41; border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer header { padding: var(--sp-5) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: var(--sp-3); }
.drawer header h2 { font-size: var(--fs-xl); }
.drawer .body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(580px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); z-index: 41; padding: var(--sp-6); }
.modal.wide { width: min(980px, calc(100vw - 32px)); }
.modal h2 { margin-bottom: var(--sp-4); }
@keyframes fade { from { opacity: 0; } } @keyframes slide { from { transform: translateX(32px); opacity: 0; } }
#toast { position: fixed; left: 50%; bottom: var(--sp-5); transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100vw - 32px); }
#toast div { background: var(--woodland); color: #fff; padding: 12px 18px; border-radius: var(--r-md); margin-top: var(--sp-2); font-size: var(--fs-sm); animation: fade .2s; }
#toast div.err { background: var(--st-alert-ink); }
.pay-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4) 18px; font-size: var(--fs-sm); }
.pay-box .kv { grid-template-columns: 120px 1fr; } .pay-box code { font-size: 15px; font-weight: 600; }
.note-list a { display: block; padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: var(--fs-sm); }
.note-list a.unread { font-weight: 500; }
.note-list a.unread::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fern); margin-right: 8px; vertical-align: 1px; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); background: var(--bg); }
.login-art { position: relative; background: var(--woodland) center/cover no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: var(--sp-7); overflow: hidden; }
.login-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(36,61,50,.25), rgba(36,61,50,.7)); }
.login-art > * { position: relative; z-index: 1; }
.login-art .wordmark { padding: 0; }
.login-art h2 { color: #fff; font-size: var(--fs-3xl); font-weight: 400; line-height: 1.15; max-width: 14ch; margin: 0 0 var(--sp-3); }
.login-art p { color: #D7E0DA; margin: 0; max-width: 36ch; }
.login-form { display: grid; place-items: center; padding: var(--sp-7) var(--sp-5); }
.login-form form { width: min(400px, 100%); }
.login-form h1 { margin-bottom: var(--sp-2); }

/* ------------------------------------------------------------------ overview (home) */
.welcome { margin-bottom: var(--sp-6); }
.welcome h1 { font-size: var(--fs-3xl); font-weight: 400; letter-spacing: -.02em; margin: var(--sp-2) 0 var(--sp-2); }
.welcome p { margin: 0; color: var(--ink-2); font-size: var(--fs-lg); }
.hero-img { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--radius); margin: 0 0 var(--sp-6); background: var(--sage); }
.residence { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-5); margin-bottom: var(--sp-6); }
.residence .card { display: flex; flex-direction: column; gap: var(--sp-2); }
.residence .who { font-size: var(--fs-xl); font-weight: 500; line-height: 1.3; }
.residence .when { color: var(--ink-2); font-size: var(--fs-sm); }
.residence .tag { align-self: flex-start; }
.residence .res-foot { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-2); }
.contact-btns { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.contact-btns .btn { gap: 6px; }
.contact-btns .ico { width: 16px; height: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.section-title h2 { margin: 0; }
.todo { display: flex; gap: var(--sp-4); align-items: center; padding: 18px var(--sp-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.todo-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--st-other-soft); color: var(--ink-2); }
.todo-ico .ico { width: 20px; height: 20px; }
.todo.urgent .todo-ico { background: var(--st-alert-soft); color: var(--st-alert-ink); }
.todo.action .todo-ico { background: var(--st-pending-soft); color: var(--st-pending-ink); }
.todo.info .todo-ico { background: var(--sage); color: var(--fern-dark); }
.todo-title { font-weight: 500; margin-bottom: 2px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--sp-5); align-items: start; }
.panel h3 { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.panel h3 .ico { color: var(--fern); width: 20px; height: 20px; }
.panel-foot { margin-top: var(--sp-4); font-size: var(--fs-sm); }
.list-row { display: flex; gap: var(--sp-3); align-items: center; width: 100%; min-height: 56px; text-align: left; padding: var(--sp-3) 0; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.list-row:first-of-type { border-top: 0; }
.list-row b { font-weight: 500; }
.list-row:hover b { color: var(--fern-dark); }
.list-row.unread { font-weight: 500; }
.quick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ------------------------------------------------------------------ counts and keys */

/* ------------------------------------------------------------------ calendar */
/* top of every page: year picker (and filters) left, page actions right */
.page-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin: 0 0 var(--sp-5); }
.page-bar > .row { gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-6) var(--sp-5); }
.month h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); display: flex; justify-content: space-between; align-items: baseline; }
.week { display: grid; grid-template-columns: 52px 1fr auto; gap: var(--sp-3); align-items: center; width: 100%; min-height: 64px; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--st-other); background: var(--surface); border-radius: var(--r-md); padding: 10px 14px 10px 12px; margin-bottom: var(--sp-2); cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, background .15s; }
.week:hover { border-color: #C6CEC4; background: #FCFDFB; }
.week .no { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.3; }
.week .no b { display: block; font-size: var(--fs-md); font-weight: 500; color: var(--ink); }
.week .who { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .when { font-size: var(--fs-xs); color: var(--ink-2); }
.week .cmt { font-size: var(--fs-xs); color: var(--fern-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week.st-yours { border-left-color: var(--st-yours); background: #FAFCFA; }
.week.st-available { border-left-color: var(--st-available); }
.week.st-pending { border-left-color: var(--st-pending); }
.week.st-booked { border-left-color: var(--st-booked); }
.week.st-other, .week.st-syndicate { border-left-color: var(--st-other); }
.week.st-other .tag { background: transparent; border-color: var(--line); color: var(--ink-2); }
.week .tag.off { border-color: transparent; }
.week .cal-cta { padding: 0 12px; white-space: nowrap; }
.week.dim { opacity: .35; }
.week.past { opacity: .5; }

/* ------------------------------------------------------------------ enquiries */
ol.queue { list-style: none; margin: var(--sp-3) 0 0; padding: 0; counter-reset: q; }
ol.queue > li { padding: var(--sp-3) 0 var(--sp-3) 36px; border-top: 1px solid var(--line); position: relative; counter-increment: q; }
ol.queue > li::before { content: counter(q); position: absolute; left: 0; top: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--sage); color: var(--woodland); font-size: var(--fs-xs); font-weight: 500; display: grid; place-items: center; }
ol.queue > li.done { opacity: .55; }
.table-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: 12px 16px; margin-bottom: -1px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.table-bar + .table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.offer { margin-top: var(--sp-2); padding: var(--sp-3) 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }

/* "View as" (site admin testing): picker in the sidebar, banner above the page */
.viewas { display: block; margin-top: var(--sp-3); }
.viewas .whoami-label { display: flex; align-items: center; gap: 6px; margin: 0 0 6px var(--sp-1); }
.viewas .whoami-label .ico { width: 14px; height: 14px; }
.viewas select { width: 100%; min-height: 40px; padding: 0 36px 0 12px; border-radius: var(--r-md); border: 1px solid rgba(229,235,226,.22); background-color: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: var(--fs-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23CBD6CE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.viewas select option, .viewas select optgroup { color: var(--ink); background: #fff; }
.viewas-bar { margin-left: var(--sidebar-w); position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: var(--sp-3); padding: 10px 56px; background: var(--st-pending-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.viewas-bar[hidden] { display: none; }
.viewas-bar .ico { width: 20px; height: 20px; flex: none; }

/* short laptop screens: keep the whole sidebar, Sign out included, in view */
@media (min-width: 1024px) and (max-height: 860px) {
  .sidebar { padding-top: var(--sp-5); }
  .whoami { margin-top: var(--sp-4); padding-bottom: var(--sp-3); }
  .side-nav { margin-top: var(--sp-3); }
  .side-nav a { min-height: 38px; }
  .side-foot { padding-top: var(--sp-3); }
}

/* ------------------------------------------------------------------ tablet and mobile */
@media (max-width: 1100px) {
  main { padding: var(--sp-6) var(--sp-5) 80px; }
}
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .menu-scrim { display: block; position: fixed; inset: 0; background: rgba(36,61,50,.32); z-index: 29; }
  .mobilebar { display: block; position: sticky; top: 0; z-index: 20; background: var(--woodland); }
  .mb-row { display: flex; align-items: center; gap: var(--sp-2); height: 60px; padding: 0 var(--sp-3); }
  .mb-who { padding: 7px var(--sp-4) 8px; border-top: 1px solid rgba(229,235,226,.14); color: #CBD6CE; font-size: 13px; line-height: 1.4; text-align: center; }
  .mb-who b { color: #fff; font-weight: 500; }
  .mb-who b, .mb-who span { white-space: nowrap; }
  .mobilebar .wordmark { flex: 1; text-align: center; padding: 0; font-size: 14px; }
  .mobilebar .iconbtn { color: #CBD6CE; }
  .mobilebar .iconbtn:hover { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
  .mobilebar .count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sage); color: var(--woodland); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
  main { margin-left: 0; }
  .viewas-bar { margin-left: 0; position: static; padding: 10px var(--sp-4); flex-wrap: wrap; }
  .viewas-bar .grow { flex-basis: calc(100% - 40px); }
  .viewas-bar .btn { margin-left: 32px; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 260px; padding: var(--sp-6) var(--sp-5); }
  .login-art h2 { font-size: var(--fs-2xl); }
}
@media (max-width: 640px) {
  main { padding: var(--sp-5) var(--sp-4) 72px; }
  h1 { font-size: 26px; } .welcome h1 { font-size: 32px; }
  .card { padding: 20px; } .modal { padding: var(--sp-5); }
  .grid-2, .grid-3, .home-grid, .residence { grid-template-columns: 1fr; }
  .todo { flex-wrap: wrap; } .todo .btn { width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: var(--sp-2); }
  .months { grid-template-columns: 1fr; }
}

/* a maintenance report's photo: a thumbnail that opens the full picture */
.issue-photo { display: inline-block; margin-top: 10px; }
.issue-photo img { display: block; max-width: min(100%, 320px); max-height: 200px; border-radius: var(--r-md); border: 1px solid var(--line); object-fit: cover; }

/* house guide: each guide opens in place; search sits in the page bar */
.guide { padding: 0; }
.guide > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary svg { flex: none; transition: transform .15s; color: var(--ink-2); }
.guide[open] > summary svg { transform: rotate(90deg); }
.guide > :not(summary) { margin-left: 16px; margin-right: 16px; }
.guide > :last-child { margin-bottom: 16px; }
.guide-body { white-space: pre-line; max-width: 75ch; line-height: 1.55; }
.guide-body a { overflow-wrap: anywhere; }
.search-box { position: relative; display: flex; align-items: center; flex: 1; max-width: 360px; }
.search-box svg { position: absolute; left: 10px; pointer-events: none; opacity: .6; }
.search-box input { padding-left: 32px; width: 100%; }

/* a family's colour beside its name (share register) */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* the manifesto: each block has a comment button; threads sit under the block they're on */
.manifesto { max-width: 860px; padding: var(--sp-6) var(--sp-5); }
.mblock { position: relative; padding: 4px 44px 4px 8px; border-radius: var(--r-sm); }
.mblock:hover { background: var(--surface-2); }
.mblock p { margin: 0; line-height: 1.6; }
.mblock h1 { margin: 0 0 4px; font-size: 1.7rem; } .mblock h2 { margin: 18px 0 2px; } .mblock h3 { margin: 12px 0 2px; }
.mblock.li { padding-left: 30px; } .mblock.li::before { content: '•'; position: absolute; left: 14px; top: 4px; line-height: 1.6; color: var(--ink-2); }
.mblock.li.l2 { padding-left: 52px; } .mblock.li.l2::before { left: 36px; }
.mblock.li[data-num]::before { content: attr(data-num); }
.mblock .table-wrap { margin: 8px 0; }
.mblock .mcom { position: absolute; right: 4px; top: 4px; opacity: .3; display: inline-flex; align-items: center; gap: 2px; }
.mblock:hover .mcom, .mblock .mcom.has, .mblock .mcom:focus-visible { opacity: 1; }
.mcount { font-size: 11px; font-weight: 600; }
.mthreads { display: grid; gap: 8px; margin: 6px 44px 10px 8px; }
.mthread { border: 1px solid var(--line); border-left: 3px solid var(--st-booked); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface); }
.mthread.suggestion { border-left-color: var(--st-available); }
.mthread.accepted, .mthread.declined, .mthread.resolved { opacity: .8; }
.msuggest { margin-top: 6px; padding: 8px 10px; background: var(--st-available-soft); border-radius: var(--r-sm); }
.mreply { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); }
.mquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--ink-2); }
@media (max-width: 640px) { .manifesto { padding: var(--sp-4) var(--sp-2); } .mthreads { margin-right: 8px; } }

/* the questionnaire: a page of its own (no login), one card per section */
:root { --gen-founder: #257de0; --gen-second: #f47230; --gen-third: #00b894; }
.survey-page { min-height: 100vh; background: var(--bg); }
.survey-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px max(16px, calc((100vw - 860px) / 2)); background: var(--woodland); }
.survey-head .wordmark { color: #fff; padding: 0; }
.survey-main { max-width: 860px; margin: 0 auto; padding: var(--sp-6) 16px var(--sp-7); }
.survey-main .lead { font-size: var(--fs-lg, 1.1rem); color: var(--ink-2); max-width: 70ch; }
.sq { border: 0; padding: 0; margin: 0; min-width: 0; }
.sq legend { font-weight: 600; padding: 0; margin-bottom: 6px; line-height: 1.45; }
.sq .qnum { color: var(--ink-2); font-weight: 500; }
.sopts { display: grid; gap: 6px; }
.sopt { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.sopt:has(input:checked) { border-color: var(--woodland); background: var(--st-yours-soft); }
.sopt > input { margin-top: 3px; }
.sopt > span { flex: 1; min-width: 200px; }
.sopt .sinput { max-width: 140px; }
.sopt .ohint { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; }
.qotable .ohint-in { margin-top: 4px; font-size: var(--fs-sm); }
.gens { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.gen { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--surface); }
.gen:has(input:checked) { border-color: var(--woodland); background: var(--st-yours-soft); }
.gen > span { display: flex; flex-direction: column; gap: 2px; }
.alloc input { width: 100%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.survey-cta { display: flex; flex-direction: column; gap: 6px; margin-top: var(--sp-6); text-decoration: none; color: inherit; border-color: var(--woodland); }
.survey-cta:hover { background: var(--st-yours-soft); }

/* questionnaire results: stat tiles, then one card per question with thin horizontal bars (square at the baseline, rounded at the end) */
:root { --chart-single: var(--woodland); --chart-track: #EEF1EC; }
.qstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; margin-top: 4px; }
.qstats .stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.qstats .stat b { font-size: var(--fs-2xl); font-weight: 500; line-height: 1.1; }
.gdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; }
.qcard { margin-bottom: 12px; }
.qchart { display: grid; gap: 10px; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4px 16px; align-items: center; }
.qbar { display: flex; align-items: center; gap: 10px; }
.qtrack { flex: 1; display: flex; gap: 2px; height: 12px; background: var(--chart-track); border-radius: 0 4px 4px 0; overflow: hidden; }
.qtrack .seg { height: 100%; min-width: 2px; }
.qtrack .seg:last-child { border-radius: 0 4px 4px 0; }
.qval { min-width: 64px; text-align: right; color: var(--ink); }
.qquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; white-space: pre-line; }
@media (max-width: 640px) { .qrow { grid-template-columns: 1fr; } }

/* a question asked of one generation only: marked in its colour */
.badge.only { background: color-mix(in srgb, var(--gc) 14%, white); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gc) 45%, white); }
.qcard.one-gen { border-left: 4px solid var(--gc); }
.qotable input, .qotable select { min-width: 110px; }

/* the public home page: about NAB's future (the questionnaire, then the manifesto); signing in is secondary */
.landing { min-height: 100vh; background: var(--bg); }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn.ghost-light:hover { background: rgba(255,255,255,.12); }
.btn.lg { padding: 12px 22px; font-size: var(--fs-md); }
.hero { position: relative; background: var(--woodland) center/cover no-repeat; color: #fff; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(36,61,50,.55), rgba(36,61,50,.85)); }
.hero-inner { position: relative; max-width: 960px; margin: 0 auto; padding: clamp(48px, 9vw, 110px) 16px clamp(40px, 7vw, 80px); }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 6vw, var(--fs-3xl)); font-weight: 400; margin: 6px 0 14px; }
.hero .eyebrow { color: rgba(255,255,255,.85); }
.hero .lead { color: rgba(255,255,255,.92); font-size: var(--fs-lg); max-width: 62ch; margin: 0 0 22px; line-height: 1.55; }
.hero .btn:not(.primary) { background: rgba(255,255,255,.95); }
.landing-main { max-width: 960px; margin: 0 auto; padding: var(--sp-7) 16px; display: grid; gap: var(--sp-7); }
.manifesto-preview { border-left: 4px solid var(--woodland); padding: var(--sp-6); }
.owners { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: var(--sp-5) 0; border-top: 1px solid var(--line); }
.lf-compact { display: flex; gap: 8px; flex-wrap: wrap; }
.lf-compact input { width: 200px; max-width: 100%; }
.future { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: var(--sp-6); border-left: 4px solid var(--woodland); }
@media (max-width: 640px) { .lf-compact input, .lf-compact .btn { width: 100%; } }
.landing .survey-head { padding-left: max(16px, calc((100vw - 960px) / 2 + 16px)); padding-right: max(16px, calc((100vw - 960px) / 2 + 16px)); }
.q-cta { border-left: 4px solid var(--gen-second); padding: var(--sp-6); }
.q-cta[data-survey="future"] { border-left-color: var(--woodland); }
.gen-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.gen-link { display: inline-block; font-size: var(--fs-sm); color: inherit; text-decoration: none; padding: 4px 0; }
@media (max-width: 600px) { .gen-links { flex-direction: column; align-items: flex-start; gap: 2px; } }
.gen-link b { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.gen-link:hover b { text-decoration-color: currentColor; }
.famtable th, .famtable td { white-space: nowrap; }

/* meetings: the next meeting's agenda, polls, and past minutes */
.meeting-next { border-left: 4px solid var(--woodland); }
.agenda { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.agenda > li { padding-left: 4px; }
.agenda-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.agenda-acts { display: flex; gap: 4px; }
.agenda-acts:empty { display: none; }
@media (max-width: 600px) { .agenda-row { grid-template-columns: 1fr; } }
.past-meeting { padding: 0; }
.past-meeting > summary { list-style: none; cursor: pointer; padding: 14px 16px; }
.past-meeting > summary::-webkit-details-marker { display: none; }
.past-meeting .minutes { padding: 0 16px 16px; max-width: 75ch; line-height: 1.55; }
.minutes h4 { margin: 14px 0 4px; }
