:root {
  --ink: #17202a;
  --muted: #607080;
  --line: #d9e2ea;
  --paper: #fbfcfa;
  --soft: #edf5f1;
  --green: #145a4a;
  --gold: #c89225;
  --blue: #2f6f9f;
  --red: #b3483c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }

/* Skip navigation link — visually hidden until focused */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }

/* Focus indicators — visible for keyboard users */
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 0;
  border-color: var(--green);
}
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible { outline-color: #fff; }
a { color: inherit; }
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(16px, 4vw, 56px); background: rgba(251,252,250,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; min-width: 210px; }
.brand-logo { display: block; width: auto; height: 120px; object-fit: contain; }
.brand-mark { display: none; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
nav { display: flex; gap: 4px; align-items: center; font-size: 14px; }
nav a { text-decoration: none; color: #263541; padding: 6px 10px; border-radius: 6px; }
.nav-toggle { display: none; }
.btn, button.btn { border: 0; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border-radius: 8px; background: var(--green); color: #fff; text-decoration: none; font-weight: 750; cursor: pointer; }
.btn.ghost { background: white; color: var(--green); border: 1px solid var(--line); }
.btn.danger { color: var(--red); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.hero { min-height: calc(100vh - 74px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 520px); align-items: center; gap: clamp(28px, 6vw, 80px); padding: clamp(28px, 7vw, 86px) clamp(16px, 5vw, 72px); }
.hero-copy h1, .page-head h1, .auth h1 { margin: 0; font-size: clamp(36px, 7vw, 72px); line-height: .98; letter-spacing: 0; max-width: 820px; }
.hero-copy p { max-width: 660px; font-size: 18px; color: #41515e; line-height: 1.6; }
.eyebrow { color: var(--gold); text-transform: uppercase; font-weight: 850; letter-spacing: .08em; font-size: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-media { background: linear-gradient(145deg, var(--soft), #f8efe0); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 24px 60px rgba(23,32,42,.12); }
.hero-media img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.band, .split, .page-head, .dashboard-head, .legal, .accordion, .form-panel, .tab-panel, .stats { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.band { padding: 34px 0; }
.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid article, .info-grid article, .mini-card, .stat { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.grid article strong { font-size: 20px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 56px 0 88px; }
.feature-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.feature-list li { background: var(--soft); border-left: 5px solid var(--green); padding: 14px 16px; border-radius: 8px; }
.page-head { padding: 54px 0 26px; }
.page-head p { max-width: 720px; color: var(--muted); line-height: 1.6; }
.gallery-panel { width: min(1200px, calc(100% - 32px)); margin: 0 auto 80px; display: grid; gap: 24px; }
.gallery-albums { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.album-card { display: grid; grid-template-rows: 160px auto; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: white; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.album-card:hover { transform: translateY(-2px); border-color: #aac2d3; box-shadow: 0 16px 40px rgba(23,32,42,.1); }
.album-card.active { border-color: var(--green); box-shadow: 0 20px 48px rgba(20,90,74,.12); }
.album-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-meta { padding: 16px; display: grid; gap: 6px; }
.album-meta strong { font-size: 18px; }
.album-meta span { color: var(--muted); font-size: 13px; }
.gallery-view { display: grid; gap: 18px; }
.gallery-title { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.gallery-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.gallery-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; background: white; }
.form-panel { background: white; border: 1px solid var(--line); border-radius: 8px; padding: clamp(18px, 3vw, 28px); margin-bottom: 32px; box-shadow: 0 12px 40px rgba(23,32,42,.06); }
.form-panel.compact { margin-top: 10px; }
label { display: grid; gap: 7px; font-weight: 700; color: #344451; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 118px; resize: vertical; }
.form-grid { display: grid; gap: 16px; }
.notice { color: var(--green); font-weight: 700; }
.muted { color: var(--muted); }
.auth { min-height: 72vh; display: grid; place-items: center; padding: 32px 16px; }
.auth .form-panel { width: min(520px, 100%); }
.accordion details { background: white; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; padding: 16px; }
summary { cursor: pointer; font-weight: 800; }

/* Accordion visual improvements */
.accordion details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.accordion details summary::-webkit-details-marker { display: none; }
.accordion details summary::marker { display: none; }
.accordion details summary::after {
  content: "▾";
  font-size: 14px;
  color: var(--muted);
  transition: transform .18s ease;
  margin-left: 10px;
}
.accordion details[open] summary::after { transform: rotate(-180deg); }
.accordion details p { margin: 10px 0 0; color: #41515e; }
.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 36px 0 16px; }
.dashboard-head h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); }
.tabs { width: min(1120px, calc(100% - 32px)); margin: 0 auto 18px; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.tabs button { white-space: nowrap; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 10px 14px; font-weight: 800; cursor: pointer; }
.tabs button.active, .tabs button[aria-selected="true"] { background: var(--green); color: white; }
.tab-panel { display: none; margin-bottom: 70px; }
.tab-panel.active { display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat strong { display: block; font-size: 32px; color: var(--green); }
.table-wrap { overflow-x: auto; margin: 14px 0 28px; border: 1px solid var(--line); border-radius: 8px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); font-size: 12px; text-transform: uppercase; color: #3a4a57; }
.badge { display: inline-flex; border-radius: 999px; background: #e7edf2; padding: 4px 9px; font-size: 12px; font-weight: 800; color: #31404b; }
.badge.open, .badge.new, .badge.missing, .badge.pending, .badge.invited { background: #fff3d7; color: #7a5200; }
.badge.closed, .badge.signed, .badge.approved, .badge.active, .badge.done { background: #dff4e9; color: #145a36; }
.badge.rejected, .badge.urgent { background: #fde4df; color: #8c2c20; }
.badge.in-progress, .badge.reviewing, .badge.waitlisted, .badge.waiting-on-renter { background: #e0edf8; color: #1a4a70; }
.badge.former { background: #ede7f6; color: #4a2080; }
.card-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mini-card span { display: block; color: var(--muted); margin: 7px 0; font-size: 13px; }
.inline-form { display: grid; gap: 8px; margin-top: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 14px 0; }
.check, .checks label { display: flex; align-items: center; gap: 8px; }
.check input, .checks input { width: auto; }
.search { margin: 6px 10px 8px 0; max-width: 340px; }
.editable-grid table { font-size: 13px; }
.editable-grid th, .editable-grid td { padding: 6px 8px; vertical-align: middle; }
.editable-grid th { white-space: nowrap; }
.editable-grid input, .editable-grid select, .editable-grid textarea {
  min-width: 130px;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}
.editable-grid textarea {
  width: 220px;
  min-height: 42px;
  max-height: 88px;
}
.editable-grid input[type="checkbox"] { min-width: 0; width: 18px; height: 18px; }
.editable-grid .actions-col { width: 118px; }
.grid-actions { display: flex; align-items: center; gap: 6px; position: sticky; left: 0; z-index: 1; background: white; }
.grid-actions form { margin: 0; }
.grid-actions .btn.small { min-height: 30px; padding: 0 10px; }
.editable-grid tbody tr:hover td, .editable-grid tbody tr:hover .grid-actions { background: #f8fbf9; }
.editable-grid .add-row td, .editable-grid .add-row .grid-actions { background: #fbf7ec; }
.table-link { color: var(--green); font-weight: 800; }
.info-frame { width: 100%; min-height: 680px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.payment-layout { width: min(1120px, calc(100% - 32px)); margin: 0 auto 80px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 24px; align-items: start; }
.payment-layout h2 { margin-top: 0; }
.payment-layout aside { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.deposit-list { display: grid; gap: 12px; }
.deposit-card { display: grid; gap: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.deposit-card div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid rgba(23,32,42,.12); padding-bottom: 8px; }
.deposit-card span { color: var(--muted); font-size: 13px; }
.deposit-card strong { text-align: right; }
.deposit-card p { margin: 0; color: #41515e; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(16px, 4vw, 56px); border-top: 1px solid var(--line); color: var(--muted); }
.site-footer p { margin: 0; max-width: 760px; }
.accessibility-statement { margin-top: 10px !important; font-size: 13px; }
.accessibility-statement a { color: var(--green); }
.counter { position: fixed; right: 12px; bottom: 12px; z-index: 20; background: rgba(20,90,74,.94); color: white; border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
/* Availability banner */
.availability-banner { background: var(--green); color: #fff; text-align: center; padding: 12px 20px; font-weight: 700; font-size: 15px; }
.availability-banner span { display: inline-block; }

/* Maintenance cards */
.maint-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.maint-responses { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.maint-response { background: var(--soft); border-radius: 8px; padding: 12px; }
.maint-response strong { font-size: 13px; }
.maint-response span { margin-left: 8px; font-size: 12px; }
.maint-response p { margin: 6px 0 0; font-size: 14px; }

/* Move-out / checklist view */
.checklist-view { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist-view li { display: flex; justify-content: space-between; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }

/* Payment summary */
.payment-summary { margin-bottom: 20px; }

/* Application status card */
.mini-card .badge + .badge { margin-left: 4px; }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.88); align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.6); }
.lightbox-close { position: absolute; top: 18px; right: 22px; color: #fff; font-size: 32px; cursor: pointer; line-height: 1; background: none; border: none; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 28px; background: rgba(255,255,255,.12); border: none; border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

/* Thumbnail in admin grid */
.thumb { height: 80px; width: auto; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); }

/* Print styles */
.no-print { display: flex; }
@media print {
  .site-header, .site-footer, .counter, .no-print { display: none !important; }
  body { background: white; color: black; }
  .band, .stats, .payment-summary, .page-head { width: 100%; }
  .table-wrap { border: none; overflow: visible; }
  table { font-size: 12px; }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; border: 1px solid var(--line); background: white; border-radius: 8px; font-size: 22px; width: 42px; height: 42px; }
  nav { display: none; position: absolute; left: 16px; right: 16px; top: 72px; flex-direction: column; align-items: stretch; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.14); }
  nav.open { display: flex; }
  .hero, .split, .grid.two, .grid.three, .form-grid, .payment-layout { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-media { order: -1; }
  .site-footer, .dashboard-head { flex-direction: column; align-items: flex-start; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #dde6ef;
    --muted: #7a96ae;
    --line: #243140;
    --paper: #0f1822;
    --soft: #172030;
    --green: #2ca888;
    --gold: #d9a840;
  }
  body { background: var(--paper); color: var(--ink); }
  .site-header { background: rgba(15,24,34,.94); border-color: var(--line); }
  .grid article, .mini-card, .stat, .form-panel, .payment-layout aside, .accordion details { background: #172030; border-color: var(--line); }
  .table-wrap { background: #172030; border-color: var(--line); }
  th { background: #0d1720; color: #8ba0b5; }
  td, th { border-color: var(--line); }
  .tabs button { background: #172030; color: var(--ink); border-color: var(--line); }
  .tabs button.active { background: var(--green); color: #fff; }
  input, textarea, select { background: #0d1720; color: var(--ink); border-color: var(--line); }
  .btn.ghost { background: #172030; color: var(--ink); border-color: var(--line); }
  .nav-toggle { background: #172030; border-color: var(--line); color: var(--ink); }
  nav { background: #172030; border-color: var(--line); }
  .feature-list li { background: var(--soft); }
  .deposit-card { background: #0d1720; }
  .deposit-card div { border-color: var(--line); }
  .grid-actions { background: #172030; }
  .editable-grid tbody tr:hover td, .editable-grid tbody tr:hover .grid-actions { background: #1e2e3e; }
  .editable-grid .add-row td, .editable-grid .add-row .grid-actions { background: #1a2a1a; }
  .maint-response { background: var(--soft); }
  .checklist-view li { background: var(--soft); border-color: var(--line); }
  .counter { background: rgba(44,168,136,.94); }
  .availability-banner { background: #1a4a38; }
  .hero-media { background: linear-gradient(145deg,#172030,#1a2820); border-color: var(--line); }
  .album-card { background: #172030; border-color: var(--line); }
}
