:root {
  color-scheme: light;
  --navy: #102a43;
  --navy-deep: #0b2034;
  --teal: #87c7b5;
  --teal-dark: #4f9c89;
  --ink: #20364b;
  --muted: #718190;
  --paper: #f4f7f8;
  --white: #fff;
  --line: #e4e9ed;
  --font-body: "DM Sans", sans-serif;
  --font-heading: "Manrope", sans-serif;
  --shadow: 0 18px 50px rgba(16, 42, 67, .08);
}

* { box-sizing: border-box; }
body { min-width: 0; min-height: 100vh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--paper); font: 15px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 5; top: 10px; left: 10px; padding: 10px 16px; transform: translateY(-160%); background: var(--white); color: var(--navy); }
.skip-link:focus { transform: translateY(0); }
.portal-header { position: relative; z-index: 2; background: var(--white); border-bottom: 1px solid var(--line); }
.portal-header-inner { width: min(1160px, calc(100% - 48px)); min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); }
.brand-copy { display: grid; line-height: 1.3; }
.brand-copy strong { font: 800 15px var(--font-heading); letter-spacing: .1em; }
.brand-copy small { color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.back-link { color: var(--muted); font-size: 12px; font-weight: 600; }
.back-link:hover, .help-link:hover { color: var(--teal-dark); }
.portal-main { width: min(1080px, calc(100% - 48px)); flex: 1; margin: 58px auto 75px; }
.login-panel { min-height: 470px; display: grid; grid-template-columns: 1fr .8fr; align-items: center; gap: 70px; padding: clamp(34px, 7vw, 78px); background: var(--white); box-shadow: var(--shadow); }
.login-intro h1, .dashboard-top h1 { margin: 0 0 17px; color: var(--navy); font: 600 clamp(34px, 5vw, 49px)/1.15 var(--font-heading); letter-spacing: -.045em; }
.login-intro h1 em, .dashboard-top h1 em { color: var(--teal-dark); font-style: normal; }
.login-intro > p:not(.eyebrow) { max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; color: var(--teal-dark); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow > span { width: 21px; height: 1px; background: currentColor; }
.login-assurance { display: flex; align-items: center; gap: 9px; margin-top: 35px; color: var(--muted); font-size: 11px; }
.login-assurance span { color: var(--teal-dark); font-size: 20px; }
.login-form { display: grid; gap: 9px; }
.login-form h2 { margin: 0; color: var(--navy); font: 700 21px var(--font-heading); }
.login-form > p:not(.form-status) { margin: -5px 0 13px; color: var(--muted); font-size: 11px; }
.login-form label { margin-top: 6px; color: #42576a; font-size: 11px; font-weight: 700; }
.login-form input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #dfe5e9; border-radius: 2px; outline: 0; color: var(--ink); font-size: 12px; }
.login-form input:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgba(79,156,137,.13); }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; border: 1px solid transparent; border-radius: 3px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .2s, transform .2s; }
.button:hover { transform: translateY(-1px); }
.button-primary { margin-top: 10px; background: var(--navy); color: var(--white); }
.button-primary:hover { background: #1a4565; }
.button:disabled { opacity: .65; cursor: wait; transform: none; }
.help-link { margin-top: 9px; color: var(--muted); font-size: 10px; }
.form-status { min-height: 0; margin: 0; color: #a34239; font-size: 11px; }
.form-status.is-success { color: #347b67; }
.form-status:empty { display: none; }
.registration-panel { margin-top: 18px; padding: 18px 24px; background: var(--white); box-shadow: 0 8px 30px rgba(16,42,67,.035); }
.registration-panel > summary { color: var(--navy); font-size: 12px; cursor: pointer; }
.registration-panel > summary strong { color: var(--teal-dark); }
.registration-content { max-width: 640px; margin: 22px auto 8px; }
.registration-content h2 { margin: 0 0 8px; color: var(--navy); font: 700 24px/1.25 var(--font-heading); }
.registration-description { margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.registration-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.registration-form label { margin-top: 4px; color: #42576a; font-size: 10px; font-weight: 700; }
.registration-form input, .registration-form select { width: 100%; min-width: 0; min-height: 43px; padding: 9px 11px; border: 1px solid #dfe5e9; border-radius: 2px; outline: none; background: var(--white); color: var(--ink); font: inherit; font-size: 11px; }
.registration-form input:focus, .registration-form select:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgba(79,156,137,.12); }

.dashboard-top { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.dashboard-top h1 { margin-bottom: 0; font-size: clamp(32px, 4vw, 42px); }
.dashboard-top .eyebrow { margin-bottom: 12px; }
.button-outline { border-color: #d9e1e6; background: var(--white); color: var(--navy); }
.button-outline:hover { background: #f7fafb; }
.alert { margin-bottom: 20px; padding: 13px 16px; border: 1px solid #ebd8a7; background: #fff9e8; color: #765c1d; font-size: 12px; }
.alert.is-error { border-color: #e9c3bf; background: #fff4f2; color: #923d35; }
.resident-card { display: grid; grid-template-columns: 62px 1fr 1.15fr; align-items: center; gap: 21px; margin-bottom: 22px; padding: 25px 29px; background: var(--navy); color: var(--white); box-shadow: var(--shadow); }
.resident-avatar { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(135,199,181,.48); border-radius: 50%; color: var(--teal); font: 700 16px var(--font-heading); }
.card-kicker { margin: 0 0 5px; color: var(--teal-dark); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.resident-card .card-kicker { color: var(--teal); }
.resident-identity h2 { margin: 0; font: 700 17px var(--font-heading); }
.resident-identity > p:last-child { margin: 3px 0 0; color: rgba(255,255,255,.61); font-size: 10px; }
.resident-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) minmax(0, .7fr); gap: 20px; padding-left: 24px; border-left: 1px solid rgba(255,255,255,.16); }
.resident-details > div { display: grid; gap: 2px; }
.resident-details span { color: rgba(255,255,255,.53); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.resident-details strong { color: var(--white); font: 600 12px var(--font-heading); }
.resident-details small { color: rgba(255,255,255,.62); font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.widget { min-width: 0; padding: 25px 26px; background: var(--white); box-shadow: 0 8px 30px rgba(16,42,67,.035); }
.widget-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.widget-heading h2 { margin: 0; color: var(--navy); font: 700 17px var(--font-heading); }
.widget-heading-actions { display: flex; align-items: center; gap: 10px; }
.payment-download { min-height: 36px; padding: 0 11px; font-size: 10px; }
.widget-icon { display: grid; place-items: center; width: 35px; height: 35px; background: #edf6f3; color: var(--teal-dark); font-size: 17px; }
.widget-description { margin: 8px 0 15px; color: var(--muted); font-size: 10px; }
.document-list { display: grid; }
.document-row { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid #edf0f2; }
.document-symbol { display: grid; place-items: center; width: 33px; height: 36px; background: #f0f5f7; color: var(--blue, #174b70); font-size: 14px; }
.document-details { min-width: 0; display: grid; gap: 2px; }
.document-details strong { overflow: hidden; color: #31495d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.document-details small { color: var(--muted); font-size: 9px; }
.communications-list { display: grid; }
.communication-row { padding: 13px 0; border-top: 1px solid #edf0f2; }
.communication-audience { display: inline-block; margin-bottom: 6px; padding: 3px 7px; border-radius: 2px; background: #edf6f3; color: var(--teal-dark); font-size: 8px; font-weight: 700; letter-spacing: .04em; }
.communication-row h3 { margin: 0 0 3px; color: #31495d; font: 700 11px var(--font-heading); }
.communication-row time { display: block; margin-bottom: 7px; color: var(--teal-dark); font-size: 9px; }
.communication-row p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.download-link { padding: 6px; color: var(--teal-dark); font-size: 10px; font-weight: 700; }
.download-link:hover { text-decoration: underline; }
.assembly-date { display: flex; align-items: center; gap: 14px; margin: 22px 0 18px; padding: 16px; background: #f4f8f8; }
.date-block { min-width: 49px; display: grid; justify-items: center; padding: 5px; background: var(--white); color: var(--navy); }
.date-block strong { font: 800 20px var(--font-heading); line-height: 1.2; }
.date-block span { color: var(--teal-dark); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.assembly-date > div:last-child { display: grid; gap: 3px; }
.assembly-date time { color: var(--navy); font-size: 11px; font-weight: 700; }
.assembly-date small { color: var(--muted); font-size: 9px; }
.agenda-title { margin: 0 0 8px; color: var(--navy); font-size: 10px; font-weight: 700; }
.agenda-list { display: grid; gap: 7px; margin: 0; padding-left: 17px; color: var(--muted); font-size: 10px; }
.assembly-empty { padding: 13px; background: #f4f8f8; color: var(--muted); font-size: 11px; }
.payment-list { display: grid; }
.payment-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; padding: 13px 0; border-top: 1px solid #edf0f2; }
.payment-name { color: #31495d; font-size: 10px; font-weight: 700; }
.payment-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.payment-amount { color: var(--navy); font: 700 12px var(--font-heading); text-align: right; }
.payment-status { display: inline-flex; align-items: center; justify-self: start; gap: 5px; margin-top: 5px; padding: 3px 7px; border-radius: 20px; background: #edf6f3; color: #347b67; font-size: 8px; font-weight: 700; }
.payment-status.is-paid .payment-bullet { background: #22c55e; }
.payment-status.is-due { background: #fff6df; color: #8a671b; }
.payment-status.is-overdue { background: #fff0ed; color: #a34239; }
.payment-bullet { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.payment-actions { grid-column: 1 / -1; display: grid; justify-items: end; gap: 10px; }
.payment-cost-summary { width: min(100%, 330px); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; color: var(--muted); font-size: 9px; }
.payment-cost-summary dt, .payment-cost-summary dd { margin: 0; }
.payment-cost-summary dd { color: var(--ink); text-align: right; }
.payment-cost-summary .payment-total-label, .payment-cost-summary .payment-total-value { padding-top: 5px; border-top: 1px solid var(--line); color: var(--navy); font-weight: 700; }
.payment-pay-button { min-height: 36px; margin: 0; font-size: 10px; }
.direct-payment { display: grid; gap: 9px; margin-top: 18px; padding: 16px; border: 1px solid #dce8e4; background: #f5faf8; }
.direct-payment > label { color: var(--navy); font-size: 11px; font-weight: 700; }
.direct-payment-controls { display: flex; align-items: stretch; gap: 10px; }
.direct-payment-amount { position: relative; flex: 1; }
.direct-payment-amount input { width: 100%; height: 44px; padding: 0 34px 0 12px; border: 1px solid #dfe5e9; border-radius: 3px; color: var(--ink); font-size: 12px; }
.direct-payment-amount input:focus { border-color: var(--teal-dark); outline: 0; box-shadow: 0 0 0 3px rgba(79,156,137,.13); }
.direct-payment-amount > span { position: absolute; top: 50%; right: 12px; color: var(--muted); font-size: 12px; transform: translateY(-50%); }
.direct-payment-button { min-height: 44px; margin: 0; }
.direct-payment-fee, .direct-payment-total { margin: 0; color: var(--muted); font-size: 9px; }
.direct-payment-total:not(:empty) { color: var(--navy); font-weight: 700; }
.receipt-link { color: var(--teal-dark); font-size: 9px; font-weight: 700; }
.receipt-link:hover { text-decoration: underline; }
.loading-message, .empty-message { margin: 12px 0; color: var(--muted); font-size: 11px; }
.dashboard-footnote { margin: 22px 0 0; color: var(--muted); font-size: 10px; }
.app-error { max-width: 620px; margin: 60px auto; padding: 20px; border: 1px solid #e9c3bf; background: #fff4f2; color: #923d35; font-size: 13px; }
.portal-footer { width: min(1080px, calc(100% - 48px)); display: flex; justify-content: space-between; gap: 20px; margin: 0 auto 20px; color: #8b99a4; font-size: 9px; }
.portal-footer p { margin: 0; }
.portal-footer a { color: var(--navy); }
@media (max-width: 760px) {
  .portal-main { margin-top: 38px; }
  .login-panel { grid-template-columns: 1fr; gap: 32px; padding: 36px; }
  .registration-panel { padding: 17px 20px; }
  .login-assurance { margin-top: 18px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .resident-card { grid-template-columns: 54px 1fr; }
  .resident-details { grid-column: 1 / -1; padding: 16px 0 0; border-top: 1px solid rgba(255,255,255,.16); border-left: 0; }
}
@media (max-width: 480px) {
  .portal-header-inner, .portal-main, .portal-footer { width: calc(100% - 32px); }
  .portal-header-inner { min-height: 68px; }
  .back-link { font-size: 10px; }
  .portal-main { margin-block: 26px 45px; }
  .login-panel { gap: 25px; padding: 27px 21px; }
  .registration-panel { padding: 15px; }
  .login-intro h1 { font-size: 35px; }
  .dashboard-top { align-items: flex-start; }
  .dashboard-top h1 { font-size: 32px; }
  .dashboard-top .button { min-height: 40px; padding-inline: 11px; font-size: 10px; }
  .resident-card { gap: 14px; padding: 20px 17px; }
  .resident-details { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) minmax(0, .7fr); gap: 12px; }
  .resident-details strong { font-size: 10px; }
  .widget { padding: 21px 18px; }
  .payments-widget .widget-heading { align-items: flex-start; flex-wrap: wrap; }
  .payments-widget .widget-heading-actions { margin-left: auto; }
  .payments-widget .widget-icon { display: none; }
  .direct-payment-controls { flex-direction: column; }
  .portal-footer { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
