:root {
  --bg: #07111f;
  --bg-soft: #0d1a2b;
  --panel: rgba(15, 28, 46, 0.78);
  --panel-solid: #122038;
  --panel-alt: #172842;
  --text: #f2f6fb;
  --muted: #a8b7cd;
  --line: rgba(255, 255, 255, 0.10);
  --blue: #2f80ff;
  --blue-2: #1c64f2;
  --green: #31c267;
  --yellow: #ffcb4d;
  --danger: #ef5a5a;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(1, 8, 18, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body.light {
  --bg: #f2f6fb;
  --bg-soft: #e8eef7;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel-alt: #f8fbff;
  --text: #162336;
  --muted: #61748f;
  --line: rgba(20, 41, 71, 0.10);
  --blue: #2567ea;
  --blue-2: #1f58c9;
  --green: #21a453;
  --yellow: #c99500;
  --danger: #c83f3f;
  --shadow: 0 18px 40px rgba(21, 49, 89, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top right, rgba(47, 128, 255, 0.20), transparent 22%),
    radial-gradient(circle at bottom left, rgba(49, 194, 103, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%);
}

.hidden { display: none !important; }
.glass {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.soft-card,
.panel-card,
.metric-card,
.hero-side-card,
.resource-card,
.notice-card {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.login-screen,
.app-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 20px auto 34px;
}

.login-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 22px;
  min-height: calc(100vh - 54px);
  align-items: stretch;
}

.login-brand-panel,
.login-card,
.topbar,
.main-nav,
.footer {
  border-radius: var(--radius-xl);
}

.login-brand-panel,
.login-card {
  padding: 32px;
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: var(--white);
  font-weight: 800;
  font-size: 28px;
  flex-shrink: 0;
}
.brand-icon.small {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 21px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8fb6ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}
body.light .eyebrow { color: #1e63e6; }

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.1; }
h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.15; }
h3 { font-size: 20px; }
.large { font-size: 17px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.tiny-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.feature-list {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.feature-item {
  display: flex;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
}
body.light .feature-item { background: rgba(37, 103, 234, 0.03); }
.feature-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(47, 128, 255, 0.16);
  color: #9ac0ff;
  font-weight: 700;
  flex-shrink: 0;
}
body.light .feature-badge { color: var(--blue); }
.feature-item h3 { margin-bottom: 6px; }
.feature-item p { color: var(--muted); line-height: 1.55; }

.security-note { padding: 22px; }
.security-note h3 { margin-bottom: 10px; }
.security-note p { color: var(--muted); line-height: 1.7; }

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.role-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.role-pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 600;
}
.role-pill.active {
  background: rgba(47, 128, 255, 0.16);
  color: var(--white);
  border-color: rgba(47, 128, 255, 0.22);
}
body.light .role-pill.active { color: var(--blue); }

.login-form,
.form-grid,
.settings-grid,
.help-grid {
  display: grid;
  gap: 14px;
}
.login-form label,
.panel-card label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: -6px;
}
input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  outline: none;
}
body.light input,
body.light textarea,
body.light select { background: #fbfdff; }
input::placeholder,
textarea::placeholder { color: #9badc4; }
textarea { resize: vertical; min-height: 110px; }
select option { color: #111827; }

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-outline-btn,
.secondary-link-btn {
  border: none;
  border-radius: 14px;
  padding: 13px 18px;
  font-weight: 700;
  transition: 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.primary-btn {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
}
.primary-btn:hover { transform: translateY(-1px); }
.secondary-btn,
.secondary-link-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--line);
}
body.light .secondary-btn,
body.light .secondary-link-btn,
body.light .ghost-btn { background: rgba(34, 93, 195, 0.05); }
.ghost-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.danger-outline-btn {
  background: transparent;
  color: #ffb8b8;
  border: 1px solid rgba(239, 90, 90, 0.25);
}
body.light .danger-outline-btn { color: var(--danger); }
.full-width,
.link-btn-block { width: 100%; }

.login-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
.compact { padding: 18px; }
.compact h3 { margin-bottom: 8px; }
.compact p { color: var(--muted); line-height: 1.55; margin-top: 4px; }

.topbar {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-brand p { color: var(--muted); margin-top: 4px; }
.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.main-nav {
  display: flex;
  gap: 10px;
  padding: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-btn.active {
  background: rgba(47, 128, 255, 0.16);
  color: var(--white);
  border-color: rgba(47, 128, 255, 0.24);
}
body.light .nav-btn.active { color: var(--blue); }

.main-content { display: grid; gap: 18px; }
.page { display: none; }
.page.active { display: block; }
.section-head {
  margin-bottom: 18px;
  padding: 8px 2px;
}
.section-head h2 { margin-bottom: 8px; }
.section-head p { line-height: 1.65; }

.hero-card,
.panel-card,
.notice-card,
.metric-card,
.footer {
  padding: 24px;
}
.hero-card {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
}
.gradient-card {
  background:
    radial-gradient(circle at top right, rgba(49, 194, 103, 0.18), transparent 24%),
    radial-gradient(circle at left bottom, rgba(47, 128, 255, 0.18), transparent 22%),
    linear-gradient(135deg, rgba(16, 30, 52, 0.95), rgba(18, 39, 68, 0.92));
}
body.light .gradient-card {
  background:
    radial-gradient(circle at top right, rgba(49, 194, 103, 0.12), transparent 24%),
    radial-gradient(circle at left bottom, rgba(47, 128, 255, 0.12), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(246,250,255,0.96));
}
.hero-text { margin: 14px 0 20px; max-width: 720px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-side-card {
  padding: 20px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-side-card h3 { margin: 6px 0 8px; font-size: 30px; }

.metric-grid,
.resource-grid,
.dashboard-grid,
.help-grid,
.settings-grid {
  display: grid;
  gap: 16px;
}
.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}
.metric-card { border-radius: var(--radius-lg); }
.metric-card .metric-label { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.metric-card .metric-value { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.metric-card .metric-note { color: var(--muted); font-size: 14px; line-height: 1.5; }
.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(47,128,255,0.12);
  margin-bottom: 16px;
}

.dashboard-grid { grid-template-columns: 1.1fr 0.9fr; }
.dashboard-grid.secondary { grid-template-columns: 1fr 1fr; }
.section-inline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.text-link {
  border: none;
  background: none;
  color: #8fb6ff;
  font-weight: 700;
  padding: 0;
}
body.light .text-link { color: var(--blue); }

.stack-list,
.action-list,
.notice-grid,
.accordion-stack,
.button-stack {
  display: grid;
  gap: 14px;
}
.action-list .action-item,
.notice-card,
.resource-card {
  padding: 16px;
}
.action-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  align-items: center;
  background: rgba(255,255,255,0.02);
}
.action-item small { display: block; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.action-item .action-arrow { color: #8fb6ff; font-weight: 800; }
body.light .action-item .action-arrow { color: var(--blue); }

.notice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.notice-card h3 { margin: 10px 0 8px; }
.notice-card p { color: var(--muted); line-height: 1.65; }
.notice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.notice-badge,
.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(47,128,255,0.15);
  color: #9ec2ff;
}
body.light .notice-badge,
body.light .card-badge { color: var(--blue); }
.notice-delete {
  border: 1px solid rgba(239, 90, 90, 0.24);
  background: transparent;
  color: #ffbcbc;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
}
body.light .notice-delete { color: var(--danger); }

.resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.resource-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.resource-card small { color: var(--muted); }
.resource-icon {
  font-size: 24px;
  display: inline-flex;
  margin-bottom: 6px;
}

.info-panel p,
.panel-card p,
.panel-card li { line-height: 1.7; }
.clean-list,
.ordered-list {
  padding-left: 18px;
  color: var(--muted);
}
.clean-list li,
.ordered-list li { margin-bottom: 10px; }
.compact-top { margin-top: 12px; }

.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-actions { margin-top: 14px; display: flex; gap: 12px; flex-wrap: wrap; }

.payment-card { position: relative; overflow: hidden; }
.payment-amount {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  margin: 18px 0;
  color: var(--green);
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.details-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}
.details-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.soft-callout {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(49, 194, 103, 0.18);
  background: rgba(49, 194, 103, 0.08);
}
body.light .soft-callout { background: rgba(49, 194, 103, 0.06); }

.candidate-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 20px;
}
.candidate-chip {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-weight: 600;
}
body.light .candidate-chip { background: rgba(37, 103, 234, 0.03); }

.help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.button-stack { margin-top: 14px; }

.contact-list {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.contact-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list div:last-child { border-bottom: none; }
.contact-list span { color: var(--muted); }
.contact-list a { color: #8fb6ff; }
body.light .contact-list a { color: var(--blue); }
.compact-list div { padding: 10px 0; }

.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setting-row,
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.switch-row {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.switch-row:last-child { border-bottom: none; }
.switch-row span { display: grid; gap: 4px; }
.switch-row small { color: var(--muted); }
.switch-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}

.accordion-item {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-solid);
  overflow: hidden;
}
.accordion-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 700;
}
.accordion-content {
  padding: 0 20px 20px;
  color: var(--muted);
  display: none;
}
.accordion-item.open .accordion-content { display: block; }
.accordion-content p,
.accordion-content li { line-height: 1.75; }
.accordion-content ul { padding-left: 18px; }
.accordion-chevron {
  font-size: 20px;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  align-items: center;
}

@media (max-width: 1100px) {
  .login-layout,
  .hero-card,
  .dashboard-grid,
  .dashboard-grid.secondary,
  .settings-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice-grid,
  .resource-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .login-screen,
  .app-shell { width: min(100%, calc(100% - 18px)); margin: 10px auto 20px; }
  .login-brand-panel,
  .login-card,
  .topbar,
  .hero-card,
  .panel-card,
  .footer,
  .metric-card,
  .notice-card { padding: 18px; }
  .login-footer-grid,
  .metric-grid,
  .help-grid,
  .settings-grid,
  .form-grid.two-col,
  .details-grid { grid-template-columns: 1fr; }
  .topbar,
  .footer,
  .section-inline-head,
  .setting-row,
  .switch-row,
  .contact-list div {
    flex-direction: column;
    align-items: flex-start;
  }
  .role-pills,
  .hero-actions,
  .topbar-actions { width: 100%; }
  .topbar-actions .ghost-btn,
  .topbar-actions .danger-outline-btn,
  .hero-actions .primary-btn,
  .hero-actions .secondary-btn { width: 100%; }
  .main-nav { padding: 10px; }
}


/* Version 10 resident-specific dues additions */
.full-row { grid-column: 1 / -1; }
.dues-admin-form { margin-top: 18px; }
.dues-table-head { margin-top: 28px; }
.dues-list { display: grid; gap: 16px; margin: 16px 0; }
.resident-due-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(255,255,255,0.025);
}
body.light .resident-due-card { background: rgba(37, 103, 234, 0.025); }
.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--text); margin-bottom: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--text); font-size: 13px; background: rgba(255,255,255,0.04); }
.data-table td { color: var(--muted); }
.data-table small { color: var(--muted); opacity: 0.85; }
.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(49, 194, 103, 0.12);
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
}


/* Navigation preference: top tabs or side menu */
.menu-toggle {
  display: none;
  margin: 0 0 14px 0;
  border: 1px solid var(--border);
  background: rgba(18, 35, 58, 0.85);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.side-menu-overlay {
  display: none;
}

.segmented-control {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(7, 18, 32, 0.45);
}

.segment-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.segment-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 24px rgba(0, 146, 255, 0.25);
}

.setting-row.stacked {
  align-items: flex-start;
  gap: 16px;
  flex-direction: column;
}

body.side-nav-enabled {
  padding-left: 286px;
}

body.side-nav-enabled .menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.side-nav-enabled .main-nav {
  position: fixed;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 250px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  overflow-y: auto;
  padding: 18px;
  border-radius: 24px;
  backdrop-filter: blur(22px);
}

body.side-nav-enabled .main-nav .nav-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

body.side-nav-enabled header.app-header {
  margin-top: 0;
}

body.side-nav-enabled main.app-shell {
  max-width: 100%;
}

body.side-nav-enabled .side-menu-overlay {
  display: none;
}

body.side-nav-enabled .menu-toggle::before {
  content: "☰";
}

@media (max-width: 980px) {
  body.side-nav-enabled {
    padding-left: 0;
  }

  body.side-nav-enabled .menu-toggle,
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  body.side-nav-enabled .main-nav {
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    left: 14px;
    top: 14px;
    bottom: 14px;
    width: min(84vw, 320px);
  }

  body.side-nav-enabled.side-menu-open .main-nav {
    transform: translateX(0);
  }

  body.side-nav-enabled.side-menu-open .side-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 850;
  }
}

@media (max-width: 720px) {
  .main-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .segmented-control {
    width: 100%;
  }

  .segment-btn {
    flex: 1;
  }
}

/* Simple content cards for workflow/legal/payment additions */
.full-width-card {
  grid-column: 1 / -1;
}

.compact-grid {
  margin-top: 18px;
}

.mini-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: rgba(9, 23, 39, 0.45);
}

.mini-card h4,
.panel-card h4 {
  margin: 0 0 10px;
}

.code-callout {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  overflow-wrap: anywhere;
}

.ordered-list.compact-list {
  margin-top: 8px;
  padding-left: 20px;
}

.workflow-section {
  margin-top: 20px;
}


/* AI HOA Assistant voice + text chat */
.ai-hero-card {
  margin-bottom: 18px;
}

.ai-status-card {
  padding: 20px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.ai-chat-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.ai-chat-panel,
.ai-tips-panel {
  padding: 24px;
}

.hoa-chat-window {
  min-height: 210px;
  max-height: 360px;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.035);
  margin-bottom: 14px;
}

.bot-message,
.user-message {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  max-width: 92%;
  line-height: 1.5;
  font-size: 14px;
  border: 1px solid var(--line);
}

.bot-message {
  background: rgba(47, 128, 255, 0.12);
  margin-right: auto;
}

.user-message {
  background: rgba(49, 194, 103, 0.13);
  margin-left: auto;
  text-align: right;
}

.hoa-ai-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.voice-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.suggestion-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  padding: 16px;
  display: grid;
  gap: 8px;
  min-height: 142px;
}

.suggestion-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(47, 128, 255, 0.14);
  font-size: 20px;
}

.suggestion-card small {
  color: var(--muted);
  line-height: 1.45;
}

.suggestion-card:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 128, 255, 0.35);
}

@media (max-width: 1100px) {
  .ai-chat-layout,
  .suggestion-grid {
    grid-template-columns: 1fr;
  }
}


/* v18 mobile clean-up: keep Help/Forms resource buttons consistent.
   This changes only the Help Center resource/action buttons that looked overly blue on mobile.
   Main submit/login/payment buttons elsewhere remain unchanged. */
#helpCenter .help-grid .primary-btn,
#helpCenter .help-grid .secondary-link-btn,
#helpCenter .help-grid a.primary-btn,
#helpCenter .help-grid a.secondary-link-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

#helpCenter .help-grid .primary-btn:hover,
#helpCenter .help-grid .secondary-link-btn:hover,
#helpCenter .help-grid a.primary-btn:hover,
#helpCenter .help-grid a.secondary-link-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(47, 128, 255, 0.28);
  transform: translateY(-1px);
}

body.light #helpCenter .help-grid .primary-btn,
body.light #helpCenter .help-grid .secondary-link-btn,
body.light #helpCenter .help-grid a.primary-btn,
body.light #helpCenter .help-grid a.secondary-link-btn {
  background: #fbfdff;
  color: var(--text);
  border: 1px solid var(--line);
}


/* FINAL FIX: keep Help / Forms page buttons consistent on mobile.
   Blue remains for true main actions elsewhere; Help Center resource links use the dark card style. */
#helpCenter .help-grid .primary-btn,
#helpCenter .help-grid .secondary-link-btn,
#helpCenter .help-grid a.primary-btn,
#helpCenter .help-grid a.secondary-link-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

#helpCenter .help-grid .primary-btn:hover,
#helpCenter .help-grid .secondary-link-btn:hover,
#helpCenter .help-grid a.primary-btn:hover,
#helpCenter .help-grid a.secondary-link-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(47, 128, 255, 0.28);
  transform: translateY(-1px);
}

body.light #helpCenter .help-grid .primary-btn,
body.light #helpCenter .help-grid .secondary-link-btn,
body.light #helpCenter .help-grid a.primary-btn,
body.light #helpCenter .help-grid a.secondary-link-btn {
  background: #fbfdff;
  color: var(--text);
  border: 1px solid var(--line);
}

/* FINAL FIX: AI Assistant helper text on iPhone */
.iphone-voice-tip {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}


/* V20 global AI assistant on all tabs */
.global-ai-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  border: 1px solid rgba(47, 128, 255, 0.35);
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(6, 20, 42, 0.38);
}

.global-ai-launcher:hover {
  transform: translateY(-1px);
}

.global-ai-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 18, 0.56);
  z-index: 1250;
}

.global-ai-modal {
  position: fixed;
  right: 18px;
  bottom: 78px;
  width: min(460px, calc(100% - 24px));
  max-height: calc(100vh - 110px);
  overflow: auto;
  z-index: 1300;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.global-ai-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.global-ai-modal-body {
  padding: 18px 20px 20px;
}

.global-ai-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.compact-suggestion {
  min-height: auto;
  padding: 14px;
}

.compact-suggestion strong {
  display: block;
}

.compact-suggestion small {
  display: block;
}

@media (max-width: 700px) {
  .global-ai-launcher {
    right: 14px;
    bottom: 14px;
    padding: 13px 16px;
  }

  .global-ai-modal {
    right: 12px;
    left: 12px;
    bottom: 74px;
    width: auto;
    max-height: calc(100vh - 94px);
  }

  .global-ai-quick-grid {
    grid-template-columns: 1fr;
  }
}


/* Simplified login page cleanup */
.simple-login-screen {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 32px;
}

.simple-login-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 28px;
  border-radius: var(--radius-xl);
}

.simple-login-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.simple-login-card {
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .simple-login-screen {
    padding: 16px;
  }
  .simple-login-intro {
    flex-direction: column;
  }
}

/* Floating AI Help widget */
.floating-ai-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
}

.floating-ai-widget.hidden {
  display: none;
}

.floating-ai-button {
  width: 72px;
  height: 72px;
  border: 1px solid rgba(69, 183, 255, 0.65);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(47,128,255,0.96), rgba(49,194,103,0.86));
  color: #fff;
  box-shadow: 0 18px 45px rgba(0,0,0,0.32);
  display: grid;
  place-items: center;
  gap: 0;
  font-weight: 900;
}

.floating-ai-button span {
  font-size: 20px;
  line-height: 1;
}

.floating-ai-button small {
  font-size: 12px;
  line-height: 1;
}

.floating-ai-panel {
  position: absolute;
  right: 0;
  bottom: 86px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 120px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.floating-ai-panel.hidden {
  display: none;
}

.floating-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.floating-ai-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.floating-ai-head button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.floating-ai-messages {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.035);
}

.floating-ai-messages .bot-message,
.floating-ai-messages .user-message {
  padding: 11px 12px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 14px;
}

.floating-ai-messages .user-message {
  justify-self: end;
  background: rgba(47,128,255,0.22);
  border: 1px solid rgba(47,128,255,0.28);
}

.floating-ai-messages .bot-message {
  justify-self: start;
  background: rgba(255,255,255,0.055);
  border: 1px solid var(--line);
}

.floating-ai-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.floating-ai-input textarea {
  min-height: 58px;
  resize: vertical;
}

@media (max-width: 640px) {
  .floating-ai-widget {
    right: 14px;
    bottom: 14px;
  }

  .floating-ai-button {
    width: 64px;
    height: 64px;
    border-radius: 22px;
  }

  .floating-ai-panel {
    right: -4px;
    bottom: 78px;
    width: calc(100vw - 28px);
  }

  .floating-ai-input {
    grid-template-columns: 1fr;
  }
}

/* V23 light login landing page */
.login-landing-screen {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 40px 48px 54px;
  background:
    radial-gradient(circle at top left, rgba(37, 103, 234, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(49, 194, 103, 0.07), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  color: #111c31;
}

.login-landing-screen .login-landing-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.login-landing-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 34px;
}

.login-landing-header h1 {
  color: #111c31;
  font-size: clamp(28px, 3vw, 42px);
}

.login-landing-header p {
  margin-top: 8px;
  color: #5f708c;
  font-size: 16px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(37, 103, 234, 0.22);
}

.login-landing-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: stretch;
}

.login-welcome-card,
.login-access-card {
  min-height: 720px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(40, 63, 98, 0.12);
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(31, 77, 136, 0.10);
  overflow: hidden;
}

.login-welcome-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.welcome-content {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 26px;
  padding: 38px 36px 0;
  position: relative;
  z-index: 2;
}

.welcome-icon {
  width: 104px;
  height: 104px;
  border-radius: 52px;
  display: grid;
  place-items: center;
  color: #117a90;
  background: #eef5ff;
}

.welcome-icon svg {
  width: 68px;
  height: 68px;
}

.welcome-copy h2 {
  color: #111c31;
  font-size: clamp(27px, 2.3vw, 34px);
  margin: 16px 0 14px;
}

.welcome-copy p {
  max-width: 470px;
  color: #5f708c;
  font-size: 17px;
  line-height: 1.55;
}

.welcome-mini-list {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}

.welcome-mini-list div {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #111c31;
}

.mini-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef5ff;
}

.community-illustration {
  position: relative;
  flex: 1;
  min-height: 390px;
  margin-top: auto;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #eaf6ff 26%, #dff1ff 100%);
}

.community-illustration .sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.95), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(211,235,255,0.72));
}

.community-illustration .sun {
  position: absolute;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  right: 100px;
  top: 42px;
  background: rgba(255, 223, 135, 0.36);
  filter: blur(2px);
}

.tree {
  position: absolute;
  width: 150px;
  height: 240px;
  border-radius: 55% 55% 45% 45%;
  background: linear-gradient(145deg, #7fb16f, #3f8f57);
  bottom: 132px;
}

.tree::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 128px;
  left: 66px;
  bottom: -72px;
  background: #8a6a4c;
  border-radius: 10px;
}

.tree-left { left: 46px; transform: scale(.82); }
.tree-right { right: 54px; transform: scale(1.04); }

.house {
  position: absolute;
  left: 122px;
  bottom: 104px;
  width: 250px;
  height: 165px;
}

.roof {
  position: absolute;
  left: 16px;
  top: 10px;
  width: 218px;
  height: 82px;
  background: linear-gradient(160deg, #8b8f96, #d2d4d8);
  clip-path: polygon(50% 0%, 100% 74%, 0% 74%);
  filter: drop-shadow(0 8px 10px rgba(53, 73, 92, .18));
}

.home-body {
  position: absolute;
  left: 44px;
  bottom: 0;
  width: 162px;
  height: 104px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #f2eadf, #d8c4ab);
  border: 1px solid rgba(91, 70, 53, 0.16);
}

.window {
  position: absolute;
  width: 38px;
  height: 34px;
  right: 24px;
  top: 22px;
  border-radius: 5px;
  background: #cfe8ff;
  border: 3px solid #ffffff;
}

.door {
  position: absolute;
  width: 38px;
  height: 64px;
  left: 24px;
  bottom: 0;
  border-radius: 15px 15px 0 0;
  background: #9a7b5d;
}

.gate-post {
  position: absolute;
  bottom: 82px;
  width: 62px;
  height: 118px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #d7c3a8, #b89773);
  border: 1px solid rgba(95, 67, 43, 0.18);
  z-index: 3;
}

.gate-post.left { left: 70px; }
.gate-post.right { left: 420px; }

.neighborhood-sign {
  position: absolute;
  left: 112px;
  bottom: 66px;
  width: 352px;
  height: 110px;
  border-radius: 50% 50% 10px 10px / 62% 62% 10px 10px;
  display: grid;
  place-items: center;
  align-content: center;
  background: linear-gradient(180deg, #f2e6d1, #d2b892);
  border: 6px solid #b69267;
  box-shadow: 0 12px 22px rgba(73, 55, 38, 0.18);
  z-index: 4;
}

.neighborhood-sign span {
  color: #5e4028;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 25px;
  letter-spacing: .04em;
}

.neighborhood-sign small {
  color: #725338;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
}

.road {
  position: absolute;
  right: -70px;
  bottom: -40px;
  width: 520px;
  height: 185px;
  background: linear-gradient(180deg, #d2d4d7, #aeb4bd);
  clip-path: polygon(38% 0, 100% 0, 86% 100%, 0 100%);
  opacity: .92;
}

.flowers {
  position: absolute;
  left: 60px;
  bottom: 42px;
  width: 480px;
  height: 48px;
  background:
    radial-gradient(circle, #f280b7 0 4px, transparent 5px) 0 0/36px 18px,
    radial-gradient(circle, #ffffff 0 4px, transparent 5px) 18px 8px/42px 20px,
    linear-gradient(180deg, #4d9a55, #2f7e45);
  border-radius: 50% 50% 0 0;
  z-index: 6;
}

.login-access-card {
  padding: 38px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-access-card .eyebrow {
  color: #1f63e6;
  margin-bottom: 14px;
}

.login-access-card h2 {
  color: #111c31;
  font-size: clamp(30px, 3vw, 42px);
  margin-bottom: 14px;
}

.login-subtitle {
  color: #5f708c;
  font-size: 16px;
  line-height: 1.45;
  margin-bottom: 26px;
}

.login-role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid rgba(40, 63, 98, 0.13);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
  background: #fff;
}

.login-role-tabs .role-pill {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111c31;
  padding: 14px 12px;
}

.login-role-tabs .role-pill.active {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #2567ea;
  color: #1f63e6;
  border-radius: 10px;
}

.login-access-card .login-form {
  gap: 14px;
}

.login-access-card .login-form label {
  color: #111c31;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: -4px;
}

.login-access-card input,
.login-access-card select {
  background: #fff;
  color: #111c31;
  border: 1px solid rgba(40, 63, 98, 0.14);
  box-shadow: none;
  min-height: 52px;
}

.login-access-card input::placeholder {
  color: #9aa9bd;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  color: #4a5d78;
  background: transparent;
  border-radius: 10px;
}

.login-submit-btn {
  min-height: 52px;
  border-radius: 10px;
  margin-top: 6px;
}

.request-access-btn {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border-radius: 10px;
  background: #fff;
  color: #1f63e6;
  border: 1px solid rgba(40, 63, 98, 0.14);
  font-weight: 800;
}

.login-note {
  margin-top: 22px;
  color: #5f708c;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .login-landing-screen {
    padding: 24px 18px 34px;
  }

  .login-landing-grid {
    grid-template-columns: 1fr;
  }

  .login-welcome-card,
  .login-access-card {
    min-height: auto;
  }

  .community-illustration {
    min-height: 330px;
  }
}

@media (max-width: 640px) {
  .login-landing-header {
    align-items: flex-start;
  }

  .welcome-content {
    grid-template-columns: 1fr;
    padding: 28px 24px 0;
  }

  .welcome-icon {
    width: 82px;
    height: 82px;
  }

  .welcome-icon svg {
    width: 52px;
    height: 52px;
  }

  .login-access-card {
    padding: 28px 24px;
  }

  .neighborhood-sign {
    left: 72px;
    width: 285px;
  }

  .gate-post.right {
    left: 356px;
  }
}

/* V24 fixes: one smaller AI button, hidden on login */
body:not(.is-logged-in) #floatingAiWidget {
  display: none !important;
}

.floating-ai-widget {
  right: 18px !important;
  bottom: 18px !important;
  z-index: 3000 !important;
}

.floating-ai-button {
  width: auto !important;
  min-width: 104px !important;
  height: 54px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  font-size: 16px !important;
}

.floating-ai-button span {
  font-size: 16px !important;
  line-height: 1 !important;
}

.floating-ai-button small {
  display: inline !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

.floating-ai-panel {
  bottom: 66px !important;
  width: min(360px, calc(100vw - 28px)) !important;
  max-height: min(560px, calc(100vh - 110px)) !important;
}

#globalAiOverlay,
#globalAiModal {
  display: none !important;
}

/* Firebase login message */
.login-message {
  margin: 8px 0 0;
  min-height: 20px;
  font-size: 13px;
  color: #44607d;
  line-height: 1.4;
}

.login-message.error {
  color: #c83f3f;
  font-weight: 700;
}


/* SAFE BASE V1 FIX: Hide AI Assistant / AI Help on login page.
   Firebase config and login JavaScript were not changed. */
#loginScreen:not(.hidden) ~ #floatingAiWidget,
#loginScreen:not(.hidden) ~ #floatingAiWidget #floatingAiPanel,
#loginScreen:not(.hidden) ~ .floating-ai-widget,
#loginScreen:not(.hidden) ~ .floating-ai-panel,
#loginScreen:not(.hidden) ~ #appShell #aiAssistant {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body:not(.is-logged-in) #floatingAiWidget,
body:not(.is-logged-in) #floatingAiPanel,
body:not(.is-logged-in) .floating-ai-widget,
body:not(.is-logged-in) .floating-ai-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#floatingAiPanel.hidden,
#floatingAiWidget.hidden {
  display: none !important;
}


/* SAFE FEATURE ADDITIONS: Committee page + notice attachment styling */
.committee-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.committee-card { display: grid; grid-template-columns: 82px 1fr; gap: 16px; padding: 20px; border-radius: var(--radius-lg, 18px); border: 1px solid var(--line, rgba(40,63,98,.14)); background: var(--panel, #fff); box-shadow: var(--shadow-soft, 0 10px 30px rgba(15,35,70,.08)); }
.committee-photo, .committee-avatar { width: 72px; height: 72px; border-radius: 22px; object-fit: cover; }
.committee-avatar { display: grid; place-items: center; background: rgba(47,128,255,.18); color: var(--text, #142033); font-weight: 800; }
.committee-role { margin: 4px 0 8px; color: var(--blue-2, #2867d9); font-weight: 700; }
.committee-contact { display: grid; gap: 4px; margin-top: 10px; }
.committee-contact a { color: var(--blue-2, #2867d9); }
.notice-attachment { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--blue-2, #2867d9); font-weight: 700; text-decoration: none; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 980px) { .committee-grid { grid-template-columns: 1fr; } }


/* V1 PLUS FIX: Login page role control cleanup.
   Firebase config and login JavaScript are not changed.
   Keep the Access Type dropdown and hide the duplicate top Resident/Committee/Admin tabs. */
#loginScreen .login-tabs,
#loginScreen .role-tabs,
#loginScreen .login-role-tabs,
#loginScreen .portal-tabs,
#loginScreen .segmented-control,
#loginScreen [data-login-role],
#loginScreen .login-role-tab,
#loginScreen .role-tab {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Keep the actual Access Type dropdown visible because existing login logic uses it. */
#loginScreen #loginRole,
#loginScreen label[for="loginRole"] {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* V1 PLUS FIX: Stronger AI Help hiding on login page.
   Hides bottom AI Help button and any AI panel while login screen is visible. */
#loginScreen:not(.hidden) ~ #floatingAiWidget,
#loginScreen:not(.hidden) ~ #floatingAiPanel,
#loginScreen:not(.hidden) ~ * #floatingAiWidget,
#loginScreen:not(.hidden) ~ * #floatingAiPanel,
#loginScreen:not(.hidden) ~ * .floating-ai-widget,
#loginScreen:not(.hidden) ~ * .floating-ai-panel,
body:not(.is-logged-in) #floatingAiWidget,
body:not(.is-logged-in) #floatingAiPanel,
body:not(.is-logged-in) .floating-ai-widget,
body:not(.is-logged-in) .floating-ai-panel,
body:not(.is-logged-in) .ai-help,
body:not(.is-logged-in) .ai-help-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* v1.2 fix: remove stray embedded global AI panel from all normal pages. */
#globalAiLauncher,
#globalAiOverlay,
#globalAiModal,
.global-ai-launcher,
.global-ai-overlay,
.global-ai-modal,
.global-ai-modal-body {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* V1.4 notice attachment/image display fix */
.notice-attachment-wrap {
  margin: 12px 0 4px;
}

.notice-image-preview {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(37, 63, 100, 0.12);
  margin-bottom: 10px;
}

.notice-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-2, #2867d9);
  font-weight: 700;
  text-decoration: none;
}

.notice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}


/* Combined Final: remove stray bottom global AI panel from all pages.
   Keeps regular AI Assistant tab/page and floating AI widget. */
#globalAiLauncher,
#globalAiOverlay,
#globalAiModal,
.global-ai-launcher,
.global-ai-overlay,
.global-ai-modal,
.global-ai-modal-body {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* v1.2 login page basic information cards */
.login-basic-info {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  width: min(1280px, calc(100% - 48px));
  margin: 22px auto 38px;
}

.login-info-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(37, 63, 100, 0.12);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(15, 35, 70, 0.06);
}

.login-info-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.login-info-card p {
  margin: 3px 0;
  color: var(--muted, #62718a);
  line-height: 1.45;
  font-size: 0.92rem;
}

@media (max-width: 1100px) {
  .login-basic-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(920px, calc(100% - 30px));
  }
}

@media (max-width: 620px) {
  .login-basic-info {
    grid-template-columns: 1fr;
  }
}


/* V1.4 AUTO ROLE LOGIN UI
   Role is now assigned automatically from the Firebase email.
   Residents cannot choose Admin/Committee from the login screen. */
#loginScreen label[for="loginRole"],
#loginScreen #loginRole,
#loginScreen .login-tabs,
#loginScreen .role-tabs,
#loginScreen .login-role-tabs,
#loginScreen .portal-tabs,
#loginScreen .segmented-control,
#loginScreen [data-login-role],
#loginScreen .login-role-tab,
#loginScreen .role-tab {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.auto-role-login-note {
  margin: 10px 0 0;
  color: var(--muted, #62718a);
  font-size: 0.9rem;
  line-height: 1.45;
}


/* V1.5 notice attachment visible display */
.notice-attachment-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.06);
  border-radius: 16px;
}

.notice-attachment-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-2, #2867d9);
  margin-bottom: 4px;
}

.notice-attachment-title {
  font-weight: 800;
  color: var(--text, #142033);
  margin-bottom: 8px;
}

.notice-image-preview {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(37, 63, 100, 0.14);
  margin: 8px 0 10px;
}

.notice-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--blue-2, #2867d9);
  text-decoration: none;
  margin-top: 4px;
}

.notice-attachment-url {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted, #62718a);
  word-break: break-all;
}

.notice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}


/* V1.6 committee image visible display */
.committee-image-wrap {
  display: grid;
  gap: 8px;
  align-content: start;
}

.committee-photo-large,
.committee-avatar-large {
  width: 88px;
  height: 88px;
  border-radius: 22px;
}

.committee-photo-large {
  object-fit: cover;
  border: 1px solid rgba(37, 63, 100, 0.14);
  background: rgba(37, 99, 235, 0.06);
}

.committee-avatar-large {
  display: grid;
  place-items: center;
  background: rgba(47, 128, 255, 0.18);
  color: var(--text, #142033);
  font-weight: 900;
}

.committee-image-link {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--blue-2, #2867d9);
  text-decoration: none;
}

.committee-image-url {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted, #62718a);
  word-break: break-all;
}

.committee-card-body {
  min-width: 0;
}
