:root {
  --navy: #15233f;
  --navy-deep: #0e182c;
  --navy-soft: #243556;
  --gold: #c4a15a;
  --gold-deep: #9e7d3a;
  --gold-soft: rgba(196, 161, 90, 0.22);
  --cream: #f6f1e6;
  --cream-deep: #ebe4d4;
  --sky: #d9e6ef;
  --leaf: #3d6b4f;
  --panel: rgba(255, 252, 246, 0.82);
  --line: rgba(21, 35, 63, 0.12);
  --text: #15233f;
  --muted: rgba(21, 35, 63, 0.62);
  --danger: #9b2c2c;
  --radius: 18px;
  --shadow: 0 14px 36px rgba(14, 24, 44, 0.1);
  --font: "Sora", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", "Noto Sans", Georgia, serif;
  --font-amount: "Noto Sans", "Sora", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
/* Author CSS (display:grid on .shell) must not override the hidden attribute */
[hidden] {
  display: none !important;
}
body.is-authed #gateView,
body.is-authed #landingView {
  display: none !important;
}
body:not(.is-authed) #appView {
  display: none !important;
}
body:not(.is-authed):not(.is-members-gate) #gateView {
  display: none !important;
}
body:not(.is-authed).is-members-gate #landingView {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--cream);
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(920px 520px at 50% -8%, rgba(196, 161, 90, 0.28), transparent 58%),
    radial-gradient(720px 420px at 0% 80%, rgba(61, 107, 79, 0.12), transparent 55%),
    radial-gradient(680px 400px at 100% 70%, rgba(36, 53, 86, 0.12), transparent 50%),
    linear-gradient(168deg, #f8f4eb 0%, #eef2f5 42%, #e8ece4 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(21, 35, 63, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 35, 63, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 18%, black, transparent 72%);
}

.shell { position: relative; z-index: 1; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.error { color: var(--danger); margin-top: 0.75rem; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  min-height: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-soft));
  color: #f7f3eb;
  box-shadow: 0 6px 16px rgba(14, 24, 44, 0.18);
}
.btn.secondary {
  background: var(--gold);
  color: var(--navy-deep);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--navy);
}
.btn.compact {
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.15;
}

.stack { display: grid; gap: 0.9rem; }
.stack.narrow { max-width: 420px; }
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}
label.check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  width: fit-content;
  max-width: 100%;
  justify-content: flex-start;
}
label.check input[type="checkbox"],
label.check input[type="radio"] {
  width: auto;
  min-width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--navy);
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font: inherit;
  background: rgba(255,255,255,0.92);
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid rgba(196, 161, 90, 0.28);
  border-color: var(--gold-deep);
}

/* Gate — seal-first composition */
.gate-shell {
  width: min(680px, calc(100% - 20px));
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 0 calc(40px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 20px;
  justify-items: center;
  text-align: center;
}
.gate-back-row {
  width: 100%;
  max-width: 440px;
  margin: 0;
  text-align: left;
}
.gate-back-row .btn {
  font-size: 0.8rem;
}

.gate-shell.auth-shell .seal-ring {
  width: clamp(120px, 32vw, 168px);
  animation: none;
}
.gate-shell.auth-shell .gate-card {
  max-width: 480px;
  text-align: left;
}
.auth-card-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}
.auth-card-mark img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.35rem;
}
.auth-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
}
.auth-tab.is-active {
  border-color: var(--gold-deep);
  color: var(--navy-deep);
  background: var(--gold-soft);
}
.status-pill {
  display: inline-block;
  margin: 0.15rem 0.25rem 0.15rem 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--navy);
  font-size: 0.75rem;
}
.status-pill.is-muted {
  background: rgba(21, 35, 63, 0.08);
  color: var(--muted);
}
.device-match-label {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.device-match-number {
  margin: 0.25rem 0 0.85rem;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.device-approve-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.device-approve-actions .btn { margin-top: 0; text-decoration: none; }
.device-qr-img {
  display: block;
  margin: 0.5rem 0;
  border-radius: 12px;
  background: #fff;
}
#authStatus { color: var(--leaf); margin-top: 0.75rem; }

/* Pre-login public landing — civic brand showcase */
.landing-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 calc(28px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 0;
}
.landing-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding:
    calc(0.7rem + env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    0.7rem
    max(1rem, env(safe-area-inset-left, 0px));
  background: rgba(14, 24, 44, 0.72);
  border-bottom: 1px solid rgba(196, 161, 90, 0.18);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.landing-shell.is-scrolled .landing-top {
  background: rgba(14, 24, 44, 0.92);
  border-bottom-color: rgba(196, 161, 90, 0.28);
  box-shadow: 0 10px 28px rgba(8, 14, 28, 0.28);
}
.landing-top-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.landing-top-seal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: contain;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(196, 161, 90, 0.45);
}
.landing-top-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #f4eee3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.landing-nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
  flex: 1 1 auto;
  justify-content: center;
}
@media (min-width: 981px) {
  .landing-nav { display: flex; }
}
.landing-nav a {
  color: rgba(247, 243, 235, 0.78);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.landing-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.landing-nav-connect {
  color: var(--gold) !important;
}
.landing-nav-city {
  color: #9fd4d8 !important;
}
.landing-signin {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(196, 161, 90, 0.45);
  border-radius: 999px;
  background: rgba(196, 161, 90, 0.14);
  color: #f7f3eb;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}
.landing-signin-arrow {
  font-size: 0.95em;
  color: var(--gold);
  transition: transform 0.18s ease;
}
.landing-signin:hover {
  transform: translateY(-1px);
  border-color: rgba(196, 161, 90, 0.8);
  background: rgba(196, 161, 90, 0.24);
}
.landing-signin:hover .landing-signin-arrow {
  transform: translateX(2px);
}
.landing-signin:focus-visible {
  outline: 3px solid rgba(196, 161, 90, 0.35);
  outline-offset: 2px;
}

.landing-hero {
  position: relative;
  isolation: isolate;
  min-height: min(92vh, 760px);
  display: grid;
  align-content: center;
  justify-items: center;
  padding:
    calc(1.5rem + env(safe-area-inset-top, 0px))
    max(1.1rem, env(safe-area-inset-right, 0px))
    3.5rem
    max(1.1rem, env(safe-area-inset-left, 0px));
  margin-top: calc(-1 * (0.7rem + 34px + 0.7rem + env(safe-area-inset-top, 0px)));
  padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
  background:
    radial-gradient(900px 480px at 18% 12%, rgba(196, 161, 90, 0.22), transparent 58%),
    radial-gradient(720px 520px at 88% 78%, rgba(61, 107, 79, 0.18), transparent 55%),
    linear-gradient(165deg, #0b1424 0%, #15233f 46%, #1a2d4d 100%);
  color: #f7f3eb;
  overflow: hidden;
}
.landing-hero-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(196, 161, 90, 0.16), transparent 65%);
  animation: landingGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
.landing-hero-inner {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  animation: rise 0.85s ease both;
}
.landing-hero-seal {
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  padding: 0.35rem;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.12), transparent 55%);
  box-shadow:
    0 0 0 1px rgba(196, 161, 90, 0.55),
    0 0 0 10px rgba(196, 161, 90, 0.08),
    0 28px 60px rgba(0, 0, 0, 0.35);
  animation: landSealIn 1s ease both, float 6s ease-in-out 1s infinite;
}
.landing-seal {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: contain;
}
.landing-hero-copy {
  text-align: left;
  display: grid;
  gap: 0.85rem;
  justify-items: start;
}
.landing-hero-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.landing-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.1rem, 5.2vw, 3.55rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #fffdf8;
  max-width: 12ch;
  text-wrap: balance;
}
.landing-greeting {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.02rem, 2.1vw, 1.22rem);
  line-height: 1.5;
  color: rgba(247, 243, 235, 0.78);
  animation: rise 0.9s 0.12s ease both;
}
.landing-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
  animation: rise 0.95s 0.2s ease both;
}
.landing-cta-primary {
  background: linear-gradient(135deg, var(--gold), #b8924a);
  color: var(--navy-deep);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  border: none;
}
.landing-cta-secondary {
  border-color: rgba(247, 243, 235, 0.28);
  color: #f7f3eb;
  background: rgba(255, 255, 255, 0.04);
}
.landing-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(196, 161, 90, 0.55);
}
.landing-cta-city {
  border-color: rgba(159, 212, 216, 0.42);
  color: #d7f4f6;
  background: rgba(26, 61, 66, 0.35);
}
.landing-cta-city:hover {
  background: rgba(26, 61, 66, 0.55);
  border-color: rgba(159, 212, 216, 0.7);
}

.landing-hero-login {
  min-height: 100vh;
  min-height: 100dvh;
  align-content: start;
}
.landing-hero-login .landing-hero-inner {
  align-items: center;
}
.landing-hero-login .landing-hero-seal {
  width: min(100%, 220px);
}
.landing-hero-login .landing-hero h1,
.landing-hero-login h1 {
  max-width: 16ch;
  color: #fffdf8;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.4vw, 3rem);
  line-height: 1.08;
  margin: 0;
}
.landing-login-card {
  width: 100%;
  max-width: 440px;
  margin-top: 0.35rem;
  padding: 1.15rem 1.2rem 1.3rem;
  border-radius: var(--radius);
  background: rgba(255, 252, 246, 0.95);
  border: 1px solid rgba(247, 243, 235, 0.16);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.32);
  color: var(--navy);
  text-align: left;
}
.landing-login-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--navy);
}
.landing-login-foot {
  width: min(1080px, 100%);
  margin: 1.25rem auto 0;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  text-align: center;
  color: rgba(247, 243, 235, 0.55);
  font-size: 0.72rem;
  line-height: 1.45;
}
.landing-login-foot .btn.ghost {
  color: #f7f3eb;
  border-color: rgba(247, 243, 235, 0.28);
  background: rgba(255, 255, 255, 0.04);
}
.landing-hero-login .gate-managed,
.landing-hero-login .gate-managed-note {
  color: inherit;
}
.landing-scroll-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(247, 243, 235, 0.55);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: landingHint 2.4s ease-in-out infinite;
}
.landing-scroll-hint::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.2rem;
}

.landing-shell:not(.board-open) .landing-hero {
  min-height: 100vh;
  min-height: 100dvh;
}
.landing-board[hidden],
.landing-connect-band[hidden] {
  display: none !important;
}
.landing-board {
  width: min(1180px, calc(100% - 2rem));
  margin: -2.5rem auto 0;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem 1.75rem;
  align-items: start;
  scroll-margin-top: calc(5.35rem + env(safe-area-inset-top, 0px));
}
.landing-side {
  position: sticky;
  top: calc(5.35rem + env(safe-area-inset-top, 0px));
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.88);
  border: 1px solid rgba(21, 35, 63, 0.1);
  box-shadow: 0 18px 40px rgba(14, 24, 44, 0.08);
}
.landing-side-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.landing-side-nav {
  display: grid;
  gap: 0.2rem;
}
.landing-side-nav a {
  color: var(--navy);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.landing-side-nav a:hover {
  background: rgba(21, 35, 63, 0.06);
}
.landing-side-card {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.35rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  text-decoration: none;
  color: #f7f3eb;
  background: linear-gradient(145deg, #15233f, #243556);
  box-shadow: 0 12px 28px rgba(14, 24, 44, 0.18);
  transition: transform 0.18s ease;
}
.landing-side-card:hover {
  transform: translateY(-2px);
}
.landing-side-card strong {
  font-size: 0.92rem;
}
.landing-side-card span {
  font-size: 0.78rem;
  color: rgba(247, 243, 235, 0.72);
  line-height: 1.35;
}
.landing-side-cards {
  display: grid;
  gap: 0.5rem;
}
.landing-side-card-city {
  background: linear-gradient(145deg, #1a3d42, #2a5a62);
}

.landing-main {
  display: grid;
  gap: 1.35rem;
  min-width: 0;
}
.landing-section {
  padding: 1.35rem 1.25rem 1.45rem;
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(21, 35, 63, 0.09);
  box-shadow: 0 16px 36px rgba(14, 24, 44, 0.06);
  animation: rise 0.7s 0.1s ease both;
  scroll-margin-top: calc(5.35rem + env(safe-area-inset-top, 0px));
}
.landing-section-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.05rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(21, 35, 63, 0.08);
}
.landing-section-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.landing-section h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  color: var(--navy);
  letter-spacing: -0.02em;
}
.landing-section-lede {
  margin: 0;
  font-size: 0.92rem;
  max-width: 46rem;
}
.landing-section-lede a {
  color: var(--navy);
  font-weight: 600;
}

.landing-grid {
  display: grid;
  gap: 0.85rem;
}
.landing-grid-news {
  grid-template-columns: 1fr;
}
.landing-grid-news .landing-card:first-child,
.landing-grid-news .landing-news-row:first-child {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(21, 35, 63, 0.04), rgba(196, 161, 90, 0.08)),
    #fffdf8;
}
.landing-news-row {
  display: grid;
  gap: 0.65rem;
}
.landing-news-head {
  display: grid;
  gap: 0.25rem;
}
.landing-news-content {
  display: grid;
  gap: 0.65rem;
}
.landing-news-content .landing-card-photo {
  margin-bottom: 0;
}
.landing-news-content p {
  margin: 0;
  white-space: pre-wrap;
}
@media (min-width: 640px) {
  .landing-news-content:has(.landing-card-photo) {
    grid-template-columns: minmax(140px, 240px) 1fr;
    align-items: start;
    gap: 1rem;
  }
}
.landing-grid-biz {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.landing-grid-ads,
.landing-grid-needs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.landing-card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: #fffdf8;
  border: 1px solid rgba(21, 35, 63, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.landing-card:hover {
  transform: translateY(-2px);
  border-color: rgba(158, 125, 58, 0.35);
  box-shadow: 0 14px 28px rgba(14, 24, 44, 0.08);
}
.landing-card strong {
  font-size: 1.02rem;
  color: var(--navy);
  font-weight: 650;
  line-height: 1.25;
}
.landing-card .landing-meta {
  font-size: 0.76rem;
  color: var(--muted);
}
.landing-card p {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(21, 35, 63, 0.78);
  white-space: pre-wrap;
}
.landing-phone {
  margin-top: 0.4rem !important;
}
.landing-contact {
  margin: 0.15rem 0 0 !important;
  font-size: 0.88rem;
}
.landing-contact a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.landing-card-photo,
.notice-photo,
.listing-photo-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
}
.landing-card-photo,
.notice-photo {
  margin-bottom: 0.45rem;
}
.listing-photo-preview {
  margin-top: 0.35rem;
  max-height: 180px;
}
.landing-phone a {
  color: var(--navy);
  font-weight: 650;
  text-decoration: none;
}
.landing-interest-form {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(21, 35, 63, 0.08);
  gap: 0.55rem;
}
.landing-interest-toggle {
  margin-top: 0.45rem;
  justify-self: start;
}
.landing-subhead {
  margin: 1.25rem 0 0.7rem;
  font-size: 1.05rem;
  color: var(--navy);
  font-weight: 650;
}

.landing-committee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.landing-bearer {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(21, 35, 63, 0.03), rgba(196, 161, 90, 0.08));
  border: 1px solid rgba(21, 35, 63, 0.08);
}
.landing-bearer .landing-title {
  font-weight: 650;
  color: var(--gold-deep);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.landing-bearer .landing-name {
  color: var(--navy);
  font-weight: 600;
  font-size: 1.02rem;
}

.landing-connect-band {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.75rem auto 0;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(600px 220px at 90% 0%, rgba(196, 161, 90, 0.25), transparent 60%),
    linear-gradient(135deg, #0e182c, #1f3358 55%, #243556);
  color: #f7f3eb;
  box-shadow: 0 22px 48px rgba(14, 24, 44, 0.18);
}
.landing-connect-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.6rem 1.5rem;
}
.landing-connect-band h2 {
  margin: 0.15rem 0 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: #fffdf8;
}
.landing-connect-band .muted {
  color: rgba(247, 243, 235, 0.72);
  max-width: 36rem;
  margin: 0;
}
.landing-connect-band .landing-section-kicker {
  color: var(--gold);
}
.landing-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.landing-connect-actions .btn.primary {
  background: linear-gradient(135deg, var(--gold), #b8924a);
  color: var(--navy-deep);
}
.landing-connect-actions .btn.ghost {
  border-color: rgba(247, 243, 235, 0.28);
  color: #f7f3eb;
}

.landing-foot {
  margin-top: 1.75rem;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.72rem;
  color: #8a8790;
  display: grid;
  gap: 0.55rem;
}
.landing-foot-brand {
  margin: 0;
  color: rgba(21, 35, 63, 0.55);
}
.landing-foot-brand a {
  color: #1a3d42;
  font-weight: 600;
}

@keyframes landSealIn {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes landingGlow {
  from { opacity: 0.55; transform: translateY(0); }
  to { opacity: 1; transform: translateY(12px); }
}
@keyframes landingHint {
  0%, 100% { opacity: 0.45; transform: translate(-50%, 0); }
  50% { opacity: 0.9; transform: translate(-50%, 4px); }
}

@media (max-width: 980px) {
  .landing-nav { display: none; }
  .landing-board {
    grid-template-columns: 1fr;
  }
  .landing-side {
    position: static;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .landing-side-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .landing-side-card {
    margin-top: 0;
    max-width: 16rem;
  }
  .landing-side-cards {
    justify-self: end;
  }
  .landing-grid-biz {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .landing-hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .landing-hero-copy {
    text-align: center;
    justify-items: center;
  }
  .landing-hero h1 {
    max-width: 14ch;
  }
  .landing-hero-cta {
    justify-content: center;
  }
  .landing-hero-seal {
    width: min(72vw, 220px);
  }
  .landing-top-name {
    max-width: 9.5rem;
  }
  .landing-side {
    grid-template-columns: 1fr;
  }
  .landing-side-card {
    max-width: none;
  }
  .landing-grid-news,
  .landing-grid-biz,
  .landing-grid-ads,
  .landing-grid-needs,
  .landing-committee-grid {
    grid-template-columns: 1fr;
  }
  .landing-section {
    padding: 1.15rem 1rem 1.2rem;
  }
}

.gate-brand {
  display: grid;
  gap: 18px;
  justify-items: center;
  padding: 12px 8px 0;
  animation: rise 0.7s ease both;
}
.seal-ring {
  width: clamp(176px, 44vw, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 2px;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
  box-shadow:
    0 0 0 2px rgba(196, 161, 90, 0.7),
    0 0 0 5px rgba(246, 241, 230, 0.95),
    0 22px 42px rgba(14, 24, 44, 0.16);
  animation: float 5.5s ease-in-out infinite;
}
.seal-ring picture {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}
.seal {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
  background: transparent;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.gate-brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3.8vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.gate-brand .lede {
  margin: 0.55rem auto 0;
  max-width: 28rem;
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.45;
}
.gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  text-align: left;
  animation: rise 0.8s 0.08s ease both;
}
.gate-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--navy);
}
.gate-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 1rem;
  padding: 4px;
  border-radius: 999px;
  background: rgba(21, 35, 63, 0.06);
}
.gate-tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.gate-tab.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(14, 24, 44, 0.08);
}
.gate-foot {
  font-size: 0.72rem;
  line-height: 1.45;
  padding: 0 8px;
  max-width: 36rem;
  color: #8a8790;
}
.gate-foot .btn {
  font-size: 0.72rem;
}
.gate-foot .app-refresh-row {
  color: #8a8790;
  font-size: 0.72rem;
}
.gate-foot .pwa-hint {
  font-size: 0.78rem;
}
.gate-managed,
.app-foot-managed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  flex-wrap: wrap;
}
.gate-managed-note {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  text-align: center;
}
.gate-managed-logo {
  width: auto;
  height: 19px;
  border-radius: 0;
  object-fit: contain;
  flex: 0 0 auto;
  box-shadow: none;
  background: transparent;
}
.app-foot .gate-managed-logo {
  height: 16px;
  width: auto;
  border-radius: 0;
}
.app-foot {
  margin: 0.55rem auto 0.15rem;
  padding: 0.2rem 0.25rem 0.1rem;
  text-align: center;
  font-size: 0.65rem;
  line-height: 1.2;
  color: #8a8790;
  letter-spacing: 0.01em;
}
.app-foot-managed {
  font-size: 0.65rem;
  gap: 0.3rem;
}
.app-foot a {
  color: #7a7782;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#smtpStatusLine,
.ec-desk-foot {
  margin-top: 1rem !important;
  font-size: 0.7rem !important;
  color: #8a8790 !important;
}
.pwa-hint {
  margin: 0 0 0.55rem;
  color: var(--navy);
  font-weight: 600;
}
.pwa-hint .btn {
  margin-top: 0.45rem;
}

/* App */
.app-shell {
  width: min(1180px, calc(100% - 16px));
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 calc(24px + env(safe-area-inset-bottom, 0px));
}
.app-top {
  display: grid;
  gap: 8px;
  padding: 8px 10px 10px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(14, 24, 44, 0.08);
}
.app-top-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}
.app-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.notify-bell {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(196, 161, 90, 0.58);
  background: linear-gradient(180deg, #fffdf8, #f4eee2);
  color: var(--navy);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 4px 10px rgba(14, 24, 44, 0.07);
}
.notify-bell:hover,
.notify-bell[aria-expanded="true"] {
  border-color: var(--gold-deep, #b8892d);
  color: var(--gold-deep, #b8892d);
}
.notify-bell-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 0.62rem;
  height: 0.62rem;
  min-width: 0.62rem;
  border-radius: 999px;
  background: #c2410c;
  border: 2px solid #fffdf8;
  box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.2);
  pointer-events: none;
}
.notify-bell.has-unread .notify-bell-mark:not([hidden]) {
  display: block;
}
.notify-bell.has-unread {
  animation: notify-pulse 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .notify-bell.has-unread { animation: none; }
}
@keyframes notify-pulse {
  0%, 100% { box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset, 0 4px 10px rgba(14,24,44,0.07); }
  50% { box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset, 0 0 0 4px rgba(194, 65, 12, 0.12); }
}
.notify-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100vw - 1.5rem));
  max-height: min(82dvh, 720px);
  box-shadow: 0 24px 64px rgba(15, 40, 80, 0.18);
  background: #fffdf8;
  color: inherit;
}
.notify-dialog::backdrop {
  background: rgba(15, 40, 80, 0.35);
}
.notify-dialog .dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.1rem 0.55rem;
}
.notify-dialog .dialog-head h3 { margin: 0; font-size: 1.08rem; }
.notify-dialog .dialog-head .muted { margin: 0.2rem 0 0; font-size: 0.82rem; }
.gate-authbuddy-about {
  margin: 0.15rem 0 0.35rem;
}
.authbuddy-help-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.authbuddy-help-link:hover {
  color: var(--gold-deep);
}
.authbuddy-help-body p,
.authbuddy-help-body li {
  line-height: 1.5;
}
.authbuddy-help-body ol,
.authbuddy-help-body ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}
.authbuddy-help-body a {
  color: var(--navy);
  font-weight: 600;
}
.authbuddy-help-dialog {
  width: min(560px, calc(100vw - 1.5rem));
  max-height: min(90dvh, 860px);
}
.authbuddy-help-dialog .notify-dialog-body {
  max-height: calc(min(90dvh, 860px) - 4.5rem);
}
.authbuddy-manual {
  margin: 0.1rem 0 0;
  border: 1px solid rgba(194, 65, 12, 0.38);
  border-radius: 12px;
  background: rgba(255, 247, 237, 0.92);
}
.authbuddy-manual > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  padding: 0.7rem 0.8rem;
  list-style: none;
}
.authbuddy-manual > summary::-webkit-details-marker {
  display: none;
}
.authbuddy-manual-title {
  min-width: 0;
  line-height: 1.3;
}
.authbuddy-imp-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex-shrink: 0;
  background: #c2410c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.48rem;
  border-radius: 999px;
  line-height: 1.2;
}
.authbuddy-manual-body {
  padding: 0.15rem 0.85rem 0.95rem;
  border-top: 1px solid rgba(194, 65, 12, 0.18);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.authbuddy-manual-body h4 {
  margin: 0.85rem 0 0.3rem;
  color: var(--navy);
  font-size: 0.88rem;
}
.authbuddy-manual-body p,
.authbuddy-manual-body ol,
.authbuddy-manual-body ul {
  margin: 0 0 0.55rem;
}
.authbuddy-manual-body ol,
.authbuddy-manual-body ul {
  padding-left: 1.15rem;
}
.authbuddy-manual-body li {
  margin: 0 0 0.25rem;
}
.authbuddy-manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0 0.8rem;
}
.profile-authbuddy-help-body .authbuddy-manual {
  margin-top: 0.75rem;
}
.notify-dialog-body {
  padding: 0.15rem 1.1rem 1.15rem;
  display: grid;
  gap: 0.7rem;
  overflow: auto;
  max-height: calc(min(82dvh, 720px) - 4.5rem);
}
.app-top-nav {
  position: relative;
  min-width: 0;
}
.app-top-nav::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 246, 0.95));
}
.brand-mini {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}
.brand-mini-text {
  min-width: 0;
  flex: 1 1 auto;
}
.brand-mini .seal-mini {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
  box-shadow:
    0 0 0 1.5px rgba(196, 161, 90, 0.75),
    0 0 0 3px rgba(246, 241, 230, 0.95);
  flex-shrink: 0;
}
.brand-mini strong {
  display: block;
  font-size: 0.95rem;
  color: var(--navy);
  line-height: 1.2;
}
.chip {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--gold-deep);
  font-weight: 600;
  line-height: 1.3;
  max-width: none;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}
.user-chip-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}
.user-chip-row .chip {
  flex: 1 1 auto;
  min-width: 0;
}
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 28px 2px 2px;
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}
.tab-short { display: none; }
.tab.is-active {
  background: var(--navy);
  color: #f7f3eb;
}
.app-main {
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem 1.25rem;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-x: hidden;
  animation: rise 0.45s ease both;
}
.panel {
  min-width: 0;
  max-width: 100%;
}
.panel-head h2, .panel-head h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.03em;
  color: var(--navy);
}
.panel-head { margin-bottom: 0.75rem; min-width: 0; }
.panel-head p { margin: 0.25rem 0 0; word-wrap: break-word; }
.roster-toolbar .panel-head,
.mailbox-toolbar .panel-head,
.ledger-toolbar .panel-head,
.mobile-section > .panel-head {
  margin-bottom: 0;
}

.notice-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  width: 100%;
}
.notice {
  padding: 0.85rem 0.95rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #f5f1e8);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: break-word;
}
.notice.is-pinned {
  border-color: rgba(196, 161, 90, 0.55);
  box-shadow: inset 4px 0 0 var(--gold-deep);
  background: linear-gradient(145deg, #fff9ef, #f3ead7);
}
.notice.is-welcome {
  box-shadow: inset 4px 0 0 var(--navy);
}
.notice.is-recent:not(.is-welcome) {
  border-color: rgba(232, 93, 4, 0.45);
  box-shadow: inset 4px 0 0 #e85d04;
  background: linear-gradient(145deg, #fff8f2, #fff1e6);
}
.notice.is-recent.is-pinned:not(.is-welcome) {
  box-shadow: inset 4px 0 0 #e85d04;
}
.notice-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
  align-items: start;
  margin-bottom: 0.3rem;
  min-width: 0;
  width: 100%;
}
.notice-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.25;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.notice.is-pinned .notice-title {
  color: var(--navy-deep, var(--navy));
}
.notice-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  max-width: 100%;
}
.notice-pin-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(166, 124, 45, 0.16);
  color: var(--gold-deep, #8a5a12);
}
.notice-welcome-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(21, 35, 63, 0.12);
  color: var(--navy);
}
.notice-new-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a18, #e85d04);
  color: #fff8f2;
  box-shadow: 0 4px 12px rgba(232, 93, 4, 0.35);
}
.notice-draft-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.14);
  color: #1e3a8a;
}
.notice-draft-list {
  display: grid;
  gap: 0.75rem;
}
.notice-manage-form {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(21, 35, 63, 0.1);
}
.notice-draft-card {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(29, 78, 216, 0.35);
  background: linear-gradient(180deg, #f8fbff, #eef4fb);
}
.notice-draft-card h4 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--navy);
}
.notice-draft-card .meta {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.notice-draft-card .draft-excerpt {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
}
.notice-draft-card .btn-row { margin: 0; }
.notice-draft-card .draft-share-line {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #1e3a8a;
}
.notice-draft-card.is-view-only {
  border-style: solid;
  opacity: 0.95;
}
.draft-share-members {
  display: grid;
  gap: 0.45rem;
  max-height: min(48vh, 320px);
  overflow: auto;
  padding: 0.35rem 0.15rem;
}
.draft-share-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 40, 80, 0.08);
}
.draft-share-row .share-member-text {
  min-width: 0;
}
.draft-share-row .share-member-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}
.draft-share-row .share-access {
  min-width: 6.5rem;
  font-size: 0.85rem;
  padding: 0.35rem 0.45rem;
}
.draft-share-row:not(.is-selected) .share-access {
  opacity: 0.45;
}
.draft-share-members label.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 40, 80, 0.08);
}
.draft-share-members .share-member-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.notice .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.55rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.notice-body {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}
.notice-body p {
  margin: 0;
  line-height: 1.55;
  color: var(--ink, #1c2430);
}
.notice-body p.notice-subhead {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 0.15rem;
}
.notice-body p.notice-subhead + p {
  margin-top: -0.15rem;
}
.notice-body strong {
  font-weight: 700;
  color: var(--navy);
}
.notice-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  margin-top: 0.65rem;
  max-width: 100%;
  align-items: center;
}
.notice-action-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--navy);
  cursor: pointer;
}
.notice-action-btn:hover {
  background: #fff;
  border-color: rgba(21, 35, 63, 0.28);
}
.notice-action-btn.is-active {
  border-color: rgba(166, 124, 45, 0.55);
  background: rgba(166, 124, 45, 0.14);
  color: var(--gold-deep, #8a5a12);
}
.notice-action-btn.notice-delete:hover {
  border-color: rgba(155, 44, 44, 0.4);
  color: var(--danger);
  background: rgba(155, 44, 44, 0.08);
}
.notice-action-icon {
  display: inline-flex;
  pointer-events: none;
}
.notice-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.notice-engage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(21, 35, 63, 0.08);
  min-width: 0;
  max-width: 100%;
}
.notice-engage-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.notice-engage-btn:hover {
  border-color: rgba(21, 35, 63, 0.22);
  background: #fff;
}
.notice-engage-btn.is-active {
  color: #9b2c2c;
  border-color: rgba(155, 44, 44, 0.35);
  background: rgba(155, 44, 44, 0.08);
}
.notice-engage-icon {
  display: inline-flex;
  line-height: 0;
}
.notice-comments {
  margin-top: 0.55rem;
  padding: 0.65rem 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(21, 35, 63, 0.1);
  background: rgba(255, 255, 255, 0.55);
  min-width: 0;
  max-width: 100%;
}
.notice-comments-list {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  min-width: 0;
}
.notice-comment {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(21, 35, 63, 0.06);
  min-width: 0;
}
.notice-comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
  align-items: center;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}
.notice-comment-head strong {
  color: var(--navy);
}
.notice-comment p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.notice-comment-form {
  gap: 0.45rem;
}
.notice-comment-form textarea {
  min-height: 2.6rem;
  resize: vertical;
}
.notice-comment-form .btn {
  justify-self: start;
}

.member-pick-list {
  display: grid;
  gap: 0.45rem;
}
.member-pick-btn {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.member-pick-btn:hover {
  border-color: rgba(21, 35, 63, 0.28);
  background: #fff;
}
.member-pick-text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.authbuddy-mark {
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  border-radius: 6px;
}
.btn.primary .authbuddy-mark {
  background: rgba(255, 255, 255, 0.12);
}
.gate-auth-choice {
  gap: 0.85rem;
}
.gate-auth-note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
}
.gate-ab-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: #4f46e5;
}
.gate-ab-badge .authbuddy-mark {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 4px;
}
.household-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.chip-avatar,
.profile-avatar {
  position: relative;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, #ebe4d4, #d9e6ef);
  color: var(--navy-soft);
  border: 1px solid rgba(21, 35, 63, 0.12);
  display: grid;
  place-items: center;
}
.chip-avatar {
  width: 1.55rem;
  height: 1.55rem;
}
.chip-avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chip-avatar-placeholder,
.profile-avatar-placeholder {
  display: grid;
  place-items: center;
  opacity: 0.72;
}
.profile-photo-block {
  margin: 0 0 1.25rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(245, 241, 232, 0.75));
}
.profile-avatar-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  box-shadow: 0 8px 20px rgba(14, 24, 44, 0.1);
}
.profile-photo-actions {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.profile-photo-actions .btn-row,
.profile-photo-actions {
  align-content: start;
}
.profile-photo-hint {
  margin: 0.65rem 0 0;
  font-size: 0.86rem;
}
.profile-authbuddy .panel-head {
  margin-bottom: 0.65rem;
}
.profile-authbuddy .panel-head h3 {
  margin: 0;
}
.profile-authbuddy-body {
  gap: 0.75rem;
  max-width: 36rem;
}
.profile-authbuddy-lede {
  margin: 0;
  line-height: 1.5;
  color: var(--text);
  font-size: 0.95rem;
}
.profile-authbuddy-help {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.profile-authbuddy-help > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
  list-style-position: outside;
  padding-left: 0.15rem;
}
.profile-authbuddy-help > summary::-webkit-details-marker {
  color: var(--gold-deep);
}
.profile-authbuddy-help-body {
  margin: 0.7rem 0 0.15rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.profile-authbuddy-help-body p {
  margin: 0 0 0.65rem;
}
.profile-authbuddy-help-body p:last-child {
  margin-bottom: 0;
}
.profile-authbuddy-methods-label {
  margin: 0 0 0.35rem !important;
  font-weight: 600;
  color: var(--navy) !important;
  font-size: 0.88rem;
}
.profile-authbuddy-methods {
  margin: 0 0 0.65rem;
  padding: 0 0 0 1.2rem;
}
.profile-authbuddy-methods li {
  margin: 0.15rem 0;
}
.profile-authbuddy-actions {
  margin: 0.15rem 0 0;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.profile-authbuddy-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  min-height: 1.2em;
}
.profile-authbuddy-hint:empty {
  display: none;
}
.photo-crop-dialog {
  width: min(420px, 94vw);
}
.photo-crop-stage {
  display: grid;
  place-items: center;
  padding: 0.35rem 0;
}
.photo-crop-viewport {
  position: relative;
  width: min(280px, 78vw);
  height: min(280px, 78vw);
  border-radius: 50%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: #1a2438;
  box-shadow: inset 0 0 0 2px rgba(196, 161, 90, 0.55), 0 10px 28px rgba(14, 24, 44, 0.2);
}
.photo-crop-viewport.is-dragging { cursor: grabbing; }
.photo-crop-viewport img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
  max-width: none;
  max-height: none;
  z-index: 0;
}
.photo-crop-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(14, 24, 44, 0.35);
  pointer-events: none;
  z-index: 1;
}
.photo-crop-zoom {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--navy);
}
.photo-crop-zoom input[type="range"] {
  width: 100%;
}
.hh-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(160deg, #ebe4d4, #d9e6ef);
  color: var(--navy-soft);
  border: 1px solid rgba(21, 35, 63, 0.12);
  display: grid;
  place-items: center;
}
.hh-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.person-avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(160deg, #ebe4d4, #d9e6ef);
  color: var(--navy-soft);
  border: 1px solid rgba(21, 35, 63, 0.12);
  display: grid;
  place-items: center;
}
.person-avatar.is-md { width: 2.2rem; height: 2.2rem; }
.person-avatar.is-lg { width: 3.1rem; height: 3.1rem; }
.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.person-avatar-fallback {
  display: grid;
  place-items: center;
  opacity: 0.72;
  line-height: 0;
}
.person-avatar.is-sm .person-avatar-fallback svg { width: 14px; height: 14px; }
.person-avatar.is-md .person-avatar-fallback svg,
.hh-avatar .person-avatar-fallback svg { width: 18px; height: 18px; }
.person-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.person-cell > span { min-width: 0; }
.household-member-list {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.household-member-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.7rem;
  align-items: start;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.8);
  min-width: 0;
  max-width: 100%;
}
.household-member-card .hh-avatar { grid-row: 1 / span 4; }
.household-member-card .btn-row {
  grid-column: 2;
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.ec-delegate-form {
  margin-top: 0.35rem;
  max-width: 28rem;
}
.ec-delegate-form .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ec-plot-directory {
  margin-top: 1.1rem;
  display: grid;
  gap: 1.25rem;
}
.ec-plot-section {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.ec-plot-section h4 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.ec-plot-section h5 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.92rem;
}
.ec-plot-directory .settings-grid {
  margin-bottom: 0.35rem;
}
.ec-plot-directory .household-member-card.is-ended {
  opacity: 0.72;
}
body.is-view-only .mailbox-reply,
body.is-view-only #grievanceForm {
  display: none !important;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}
.obs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin-bottom: 1rem;
}
.obs-toolbar label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.obs-toolbar select,
.obs-toolbar input {
  min-width: 10rem;
}
.obs-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}
.obs-columns h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}
.obs-day-bar {
  display: flex;
  align-items: end;
  gap: 0.35rem;
  min-height: 72px;
  margin: 0.5rem 0 1rem;
  padding: 0.35rem 0;
}
.obs-day-bar .bar {
  flex: 1;
  min-width: 8px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #2f6fed, #1e3a8a);
  opacity: 0.85;
}
.obs-day-bar .bar span {
  display: none;
}

.info-toolbar {
  margin-bottom: 1rem;
}
/* Folder sections stack full-width; cards wrap in rows inside each folder. */
.info-doc-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
  width: 100%;
}
.info-doc-list.is-cards,
.info-folder-docs {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  gap: 0.55rem;
  align-items: stretch;
  justify-content: start;
  width: 100%;
  min-width: 0;
}
.info-doc-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(15, 40, 80, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(155deg, #fffdf8 0%, #f3eee3 52%, #e8e0d0 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 6px 16px rgba(15, 39, 68, 0.08);
  overflow: hidden;
  text-align: left;
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}
.info-doc-card:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 10px 22px rgba(15, 39, 68, 0.12);
}
.info-doc-card.is-actions-open,
.info-doc-card.is-details-open {
  border-color: rgba(31, 77, 58, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 10px 22px rgba(15, 39, 68, 0.14);
}
.info-doc-card-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.45rem 0.55rem;
  padding: 0.55rem 0.65rem;
  min-width: 0;
}
.info-doc-tablet-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  font: 700 0.62rem/1 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f7f3ea;
  background: linear-gradient(135deg, #123054, #1f4d3a);
  box-shadow: 0 2px 8px rgba(18, 48, 84, 0.18);
}
.info-doc-card[data-doc-type="html"] .info-doc-tablet-mark {
  background: linear-gradient(135deg, #1a3f66, #2a5f8a);
}
.info-doc-card[data-doc-type="link"] .info-doc-tablet-mark {
  background: linear-gradient(135deg, #3a2a12, #7a5a28);
}
.info-doc-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(15, 40, 80, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  font: 700 0.78rem/1 Georgia, "Times New Roman", serif;
  font-style: italic;
  cursor: pointer;
  flex: 0 0 auto;
}
.info-doc-info-btn:hover,
.info-doc-card.is-details-open .info-doc-info-btn {
  border-color: rgba(31, 77, 58, 0.45);
  background: rgba(31, 77, 58, 0.1);
  color: #14532d;
}
.info-doc-card-details {
  display: grid;
  gap: 0.35rem;
  padding: 0 0.65rem 0.55rem;
  min-width: 0;
}
.info-doc-card-details[hidden] {
  display: none;
}
.info-doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  justify-content: flex-start;
  text-align: left;
}
.info-doc-card .info-doc-card-title {
  display: -webkit-box;
  margin: 0;
  min-width: 0;
  text-align: left;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: normal;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.info-doc-card .meta {
  margin: 0;
  width: 100%;
  text-align: left;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.info-doc-card .summary {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #3d4658;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.info-doc-card-actions-inline {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.tpl-card-actions {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.tpl-card-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}
.tpl-open-title {
  cursor: pointer;
}
.tpl-open-title:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.tpl-card-actions > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}
.tpl-card-actions > summary::-webkit-details-marker { display: none; }
.tpl-card-actions > summary::after {
  content: " ▾";
  opacity: 0.65;
}
.tpl-card-actions[open] > summary::after { content: " ▴"; }
.tpl-card-actions .btn-row {
  margin-top: 0.45rem;
}
.tpl-category-block {
  margin: 0 0 1.15rem;
}
.tpl-category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0 0 0.55rem;
}
.tpl-category-head h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
}
.tpl-category-head .muted {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
}
.templates-editor {
  margin-top: 0.65rem;
  border: 1px solid rgba(15, 40, 80, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.85rem 0.85rem;
  background: rgba(255, 255, 255, 0.55);
}
.templates-editor:not([open]) {
  padding-bottom: 0.45rem;
}
.tpl-compose-chrome-warn {
  margin: 0.35rem 0 0.15rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 90, 20, 0.35);
  background: rgba(255, 244, 220, 0.95);
  color: #5a3b12;
  font-size: 0.84rem;
  line-height: 1.4;
}
.tpl-ai-assist {
  margin: 0.45rem 0 0.55rem;
  padding: 0.55rem 0.7rem 0.65rem;
  border: 1px solid rgba(13, 27, 61, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 176, 255, 0.07), rgba(255, 176, 32, 0.08));
}
.tpl-ai-assist-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
  color: #0d1b3d;
}
.tpl-ai-assist textarea {
  width: 100%;
  min-height: 4.2rem;
  resize: vertical;
  border: 1px solid rgba(13, 27, 61, 0.18);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  line-height: 1.4;
  background: #fff;
}
.tpl-ai-assist-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin-top: 0.4rem;
}
.tpl-ai-assist-status {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
}
.tpl-stationery-versions {
  margin-top: 0.65rem;
  padding: 0.5rem 0.65rem;
  border: 1px dashed rgba(15, 40, 80, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.85);
}
.tpl-version-list {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--navy-muted, #5a6a80);
}
.templates-filters {
  margin-bottom: 0.35rem;
}
#templatesList {
  margin-top: 0.85rem;
}
.templates-print-options {
  margin: 0.35rem 0 0.15rem;
  border: 1px solid rgba(15, 40, 80, 0.1);
  border-radius: 8px;
  padding: 0.4rem 0.7rem 0.55rem;
  background: rgba(248, 250, 252, 0.8);
}
.templates-print-options > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  color: var(--navy);
  user-select: none;
}
.templates-print-options > summary::-webkit-details-marker { display: none; }
.templates-print-options > summary::after {
  content: " ▾";
  opacity: 0.55;
}
.templates-print-options[open] > summary::after { content: " ▴"; }
.templates-editor-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 0.25rem 0;
}
.templates-editor-summary::-webkit-details-marker { display: none; }
.templates-editor input[type="color"] {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.15rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 40, 80, 0.18);
  background: #fff;
}
.tpl-custom-size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 16rem;
}
.tpl-custom-size input {
  flex: 1;
  min-width: 0;
}
.info-doc-card .btn-row {
  margin: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.35rem;
}
.info-doc-actions-more {
  padding: 0 0.65rem 0.55rem;
}
.info-doc-actions-more:not([hidden]) {
  display: flex;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(15, 40, 80, 0.12);
}
.info-doc-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  margin-right: 0;
  background: rgba(15, 64, 40, 0.1);
  color: #14532d;
}
.info-doc-badge.is-draft {
  background: rgba(29, 78, 216, 0.12);
  color: #1e3a8a;
}
.info-doc-badge.is-file {
  background: rgba(120, 53, 15, 0.1);
  color: #7c2d12;
}
.info-doc-badge.is-ec {
  background: rgba(120, 53, 15, 0.12);
  color: #7c2d12;
}
.info-doc-badge.is-restricted {
  background: rgba(127, 29, 29, 0.12);
  color: #7f1d1d;
}
.info-doc-badge.is-all {
  background: rgba(15, 64, 40, 0.1);
  color: #14532d;
}
.info-access-picker {
  margin: 0.65rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(21, 35, 63, 0.12);
  border-radius: 12px;
  background: rgba(246, 241, 231, 0.55);
}
.info-access-picker label {
  display: grid;
  gap: 0.35rem;
}
.info-access-list {
  max-height: 14rem;
  overflow: auto;
  margin-top: 0.55rem;
  display: grid;
  gap: 0.25rem;
}
.info-access-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
}
.info-access-option:hover {
  background: rgba(21, 35, 63, 0.05);
}
.info-access-option input {
  margin-top: 0.2rem;
}
.info-folder-edit-access {
  margin-bottom: 0.85rem;
}
.info-folder-edit-access-title {
  margin: 0 0 0.55rem;
  font-weight: 650;
}
.info-folder-manage-row .info-doc-badge {
  margin-left: 0.35rem;
  vertical-align: middle;
}
.info-doc-badge.is-html {
  background: rgba(15, 40, 80, 0.1);
  color: #1e3a5f;
}
.info-doc-badge.is-link {
  background: rgba(3, 105, 161, 0.12);
  color: #0c4a6e;
}
.info-doc-badge.is-folder {
  background: rgba(15, 64, 40, 0.14);
  color: #0f3d28;
}
.info-folder-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-bottom: 1.1rem;
  border-bottom: 1px dashed rgba(15, 40, 80, 0.12);
}
.info-folder-section.is-nested {
  margin-left: calc(var(--info-depth, 1) * 0.75rem);
  padding-left: 0.55rem;
  border-left: 2px solid rgba(176, 138, 60, 0.28);
}
.info-folder-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.info-folder-head {
  text-align: left;
  width: 100%;
}
.info-folder-head-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  align-items: center;
  justify-content: space-between;
}
.info-folder-head h3 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--navy);
  text-align: left;
}
.info-folder-head .muted {
  margin: 0.1rem 0;
  font-size: 0.85rem;
  text-align: left;
}
@media (max-width: 520px) {
  .info-doc-card-row {
    gap: 0.35rem 0.4rem;
    padding: 0.45rem 0.5rem;
  }
  .info-doc-card .info-doc-card-title {
    font-size: 0.9rem;
  }
  .info-doc-list.is-cards,
  .info-folder-docs {
    gap: 0.45rem;
  }
}
.info-folder-manage {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(15, 40, 80, 0.12);
}
.info-folder-manage h4 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  color: var(--navy);
}
.info-folder-create-row {
  align-items: end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.info-folder-manage-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.info-folder-manage-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 40, 80, 0.08);
  background: rgba(255, 255, 255, 0.55);
}
.info-folder-manage-row.is-nested {
  margin-left: calc(var(--info-depth, 0) * 0.9rem);
  border-left: 3px solid rgba(176, 138, 60, 0.35);
}
.info-folder-manage-row .muted {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.info-manage {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(15, 40, 80, 0.15);
}
.info-manage-details {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.info-manage-details > summary {
  margin-bottom: 0.85rem;
}
.info-source {
  border: 1px solid rgba(15, 40, 80, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 0;
}
.info-source legend {
  padding: 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.info-source .check { margin: 0.35rem 0; }
.field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.works-toolbar { margin-bottom: 1rem; }
.works-list { display: grid; gap: 0.85rem; }
.works-card {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 40, 80, 0.1);
  background: linear-gradient(180deg, #fbfaf7, #eef3f0);
}
.works-card h3 {
  margin: 0.35rem 0;
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--navy);
}
.works-card .meta {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.works-card .summary { margin: 0 0 0.55rem; font-size: 0.9rem; line-height: 1.45; }
.works-card .detail-block {
  margin: 0.45rem 0;
  font-size: 0.84rem;
  line-height: 1.45;
}
.works-card .detail-block strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.works-card .btn-row { margin: 0.65rem 0 0; }
.works-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  margin: 0 0.3rem 0.3rem 0;
  background: rgba(15, 64, 40, 0.1);
  color: #14532d;
}
.works-badge.is-status-in_progress { background: rgba(29, 78, 216, 0.14); color: #1e3a8a; }
.works-badge.is-status-on_hold { background: rgba(180, 83, 9, 0.14); color: #9a3412; }
.works-badge.is-status-completed,
.works-badge.is-status-closed { background: rgba(21, 128, 61, 0.14); color: #166534; }
.works-badge.is-status-cancelled { background: rgba(127, 29, 29, 0.12); color: #7f1d1d; }
.works-badge.is-draft { background: rgba(29, 78, 216, 0.1); color: #1e3a8a; }
.works-manage {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(15, 40, 80, 0.15);
}
.works-fieldset {
  border: 1px solid rgba(15, 40, 80, 0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
}
.works-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.works-rows { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.works-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) auto;
  gap: 0.45rem;
  align-items: end;
  padding: 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 40, 80, 0.08);
}
.works-milestone-list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
}
.works-milestone-list li.done { text-decoration: line-through; opacity: 0.7; }
.works-quotes-block .works-quote-list,
.works-quotes-block .works-quote-invites {
  margin: 0.35rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.86rem;
}
.works-quotes-block .works-quote-list li {
  display: grid;
  gap: 0.12rem;
}
.works-quotes-block .works-quote-list p {
  margin: 0.15rem 0 0;
  white-space: pre-wrap;
}

.works-panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
}
.works-panel-tab {
  border: 1px solid rgba(15, 40, 80, 0.14);
  background: rgba(255, 255, 255, 0.65);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.works-panel-tab.is-active {
  background: linear-gradient(180deg, #1a4d36, #0f4028);
  color: #f7f4ec;
  border-color: transparent;
}
.works-tab-pane[hidden] { display: none !important; }

/* —— Campaigns & funding drives —— */
.campaigns-toolbar { margin-bottom: 1rem; }
.campaigns-list { display: grid; gap: 0.9rem; }
.campaign-card {
  padding: 1rem 1.15rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 40, 80, 0.1);
  background: linear-gradient(165deg, #fbfaf7 0%, #eef6f0 55%, #e8f0ea 100%);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.campaign-card:hover {
  box-shadow: 0 8px 24px rgba(15, 40, 80, 0.08);
  transform: translateY(-1px);
}
.campaign-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.campaign-card h3 {
  margin: 0.25rem 0 0;
  font-family: var(--display);
  font-size: 1.12rem;
  color: var(--navy);
  flex: 1 1 12rem;
}
.campaign-card .summary {
  margin: 0.45rem 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink);
}
.campaign-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.campaign-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 64, 40, 0.1);
  color: #14532d;
}
.campaign-badge.is-public { background: rgba(29, 78, 216, 0.12); color: #1e3a8a; }
.campaign-badge.is-draft { background: rgba(100, 116, 139, 0.15); color: #475569; }
.campaign-badge.is-active { background: rgba(21, 128, 61, 0.14); color: #166534; }
.campaign-badge.is-paused { background: rgba(180, 83, 9, 0.14); color: #9a3412; }
.campaign-badge.is-completed { background: rgba(15, 64, 40, 0.12); color: #14532d; }
.campaign-progress {
  margin: 0.55rem 0 0.35rem;
}
.campaign-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 40, 80, 0.1);
  overflow: hidden;
}
.campaign-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1a6b45, #22c55e);
  transition: width 0.35s ease;
}
.campaign-progress-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.campaign-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.campaign-detail {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(15, 40, 80, 0.12);
}
.campaign-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.campaign-detail-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.campaign-showcase {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 40, 80, 0.1);
  background: linear-gradient(180deg, #fbfaf7, #eef6f0);
  box-shadow: 0 12px 40px rgba(15, 40, 80, 0.06);
}
.campaign-showcase-hero {
  position: relative;
  min-height: 180px;
  background: linear-gradient(135deg, #0f4028 0%, #1a6b45 45%, #2d8f5e 100%);
  display: flex;
  align-items: flex-end;
}
.campaign-showcase-hero.has-image {
  min-height: 220px;
  background: #0f4028;
}
.campaign-showcase-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}
.campaign-showcase-hero-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.1rem 1.15rem 1rem;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 40, 80, 0.72) 100%);
  color: #f7f4ec;
}
.campaign-showcase-hero-overlay .campaign-badges { margin-bottom: 0.45rem; }
.campaign-showcase-hero-overlay .campaign-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #f7f4ec;
}
.campaign-showcase-hero-overlay h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.2;
  color: #fff;
}
.campaign-showcase-body { padding: 1rem 1.15rem 1.15rem; }
.campaign-showcase-summary {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}
.campaign-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}
.campaign-stat-card {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 40, 80, 0.08);
}
.campaign-stat-card strong {
  display: block;
  font-size: 1.15rem;
  color: var(--navy);
  font-family: var(--display);
}
.campaign-stat-card span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}
.campaign-stat-card.is-pledged strong { color: #1a6b45; }
.campaign-stat-card.is-raised strong { color: #1e3a8a; }
.campaign-dual-progress { display: grid; gap: 0.55rem; margin-bottom: 0.85rem; }
.campaign-dual-progress label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.campaign-participants-block {
  margin-top: 1.1rem;
}
.campaign-participants-block h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}
.campaign-participants-list { display: grid; gap: 0.45rem; }
.campaign-participant-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 40, 80, 0.08);
  font-size: 0.84rem;
}
.campaign-participant-row .amt {
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
.campaign-participant-row .meta {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.12rem;
}
.campaign-card.has-thumb {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.85rem;
  align-items: start;
}
.campaign-card-thumb {
  width: 96px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(135deg, #0f4028, #2d8f5e);
}
.campaign-card-thumb-placeholder {
  width: 96px;
  height: 72px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f4028, #2d8f5e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.campaign-detail-body {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 40, 80, 0.1);
  background: #fbfaf7;
}
.campaign-detail-body h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  color: var(--navy);
}
.campaign-detail-body .detail-section {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}
.campaign-detail-body .detail-section strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.campaign-contributions-block {
  margin-top: 1.1rem;
}
.campaign-contributions-block h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}
.campaign-contributions-list { display: grid; gap: 0.45rem; }
.campaign-contribution-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 40, 80, 0.08);
  font-size: 0.84rem;
}
.campaign-contribution-row.is-pending { border-color: rgba(180, 83, 9, 0.25); }
.campaign-contribution-row.is-rejected { opacity: 0.65; }
.campaign-contribution-main { flex: 1 1 10rem; }
.campaign-contribution-amt { font-weight: 700; color: var(--navy); }
.campaign-contribute-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(520px, calc(100vw - 2rem));
  box-shadow: 0 24px 64px rgba(15, 40, 80, 0.18);
}
.campaign-contribute-dialog::backdrop {
  background: rgba(15, 40, 80, 0.35);
}
.campaign-contribute-dialog form {
  padding: 1rem 1.1rem 1.15rem;
}
.campaign-contribute-dialog .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.campaign-contribute-dialog .dialog-head h3 { margin: 0; font-size: 1.05rem; }
.campaigns-manage {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(15, 40, 80, 0.15);
}

.landing-campaigns-list { display: grid; gap: 0.75rem; }
.landing-campaign-card {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 40, 80, 0.1);
  background: rgba(255, 255, 255, 0.55);
}
.landing-campaign-card strong {
  display: block;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.landing-campaign-card .landing-meta {
  font-size: 0.75rem;
  color: var(--muted);
}
.landing-campaign-card.has-cover {
  display: grid;
  gap: 0.45rem;
}
.landing-campaign-cover {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
}
.landing-campaign-detail {
  padding: 1rem;
  background: var(--surface, #fff);
  border-radius: 10px;
  border: 1px solid rgba(15, 40, 80, 0.08);
}
.landing-campaign-hero {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}
.landing-campaign-detail h3 { margin: 0 0 0.4rem; }
.landing-campaign-detail .campaign-desc { margin: 0.5rem 0; color: var(--muted, #555); font-size: 0.92rem; }
.landing-campaign-detail .campaign-payment-info {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(34, 197, 94, 0.08);
  border-radius: 6px;
  font-size: 0.88rem;
}
.public-pledge-form {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(15, 40, 80, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(15, 40, 80, 0.08);
}
.public-pledge-form h4 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.public-pledge-form .form-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.public-pledge-form input, .public-pledge-form select {
  flex: 1; min-width: 120px; padding: 0.5rem 0.65rem;
  border: 1px solid rgba(15, 40, 80, 0.15); border-radius: 6px; font-size: 0.9rem;
}
.public-pledge-form button {
  margin-top: 0.5rem; padding: 0.55rem 1.2rem;
  background: var(--primary, #1a6b45); color: #fff; border: 0; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.landing-campaign-progress {
  margin-top: 0.45rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 40, 80, 0.1);
  overflow: hidden;
}
.landing-campaign-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1a6b45, #22c55e);
  border-radius: inherit;
}

/* —— Proceedings register (paper ledger UX) —— */
.proceedings-register-shell {
  border: 3px solid #6b4a2e;
  border-radius: 4px;
  background: linear-gradient(180deg, #ebe3d4 0%, #f7f2e8 12%, #fdfaf3 100%);
  box-shadow: inset 0 0 0 1px rgba(107, 74, 46, 0.25), 0 8px 24px rgba(26, 18, 8, 0.08);
  overflow: hidden;
}
.proceedings-register-tabs {
  display: flex;
  gap: 0;
  background: #4a3728;
  border-bottom: 2px solid #6b4a2e;
}
.proceedings-register-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(253, 246, 232, 0.82);
  font: 600 0.82rem/1.2 var(--font-sans, system-ui, sans-serif);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.72rem 0.85rem;
  cursor: pointer;
  border-right: 1px solid rgba(253, 246, 232, 0.12);
}
.proceedings-register-tab:last-child { border-right: 0; }
.proceedings-register-tab.is-active {
  background: #fdf6e8;
  color: #3d2914;
  box-shadow: inset 0 3px 0 #c9a227;
}
.proceedings-register-cover { padding: 1rem 1.05rem 1.15rem; }
.proceedings-register-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(107, 74, 46, 0.35);
}
.proceedings-register-toolbar label {
  margin: 0;
  display: grid;
  gap: 0.28rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b4a2e;
}
.proceedings-register-toolbar input,
.proceedings-register-toolbar select {
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  min-width: 9rem;
}
.proceedings-list { display: grid; gap: 0; }
.proceedings-ledger-head,
.proceedings-ledger-row {
  display: grid;
  grid-template-columns: 5.5rem 6.5rem 1fr 8rem 5.5rem;
  gap: 0.55rem;
  align-items: center;
  text-align: left;
}
.proceedings-ledger-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b4a2e;
  padding: 0.35rem 0.55rem 0.45rem;
  border-bottom: 2px solid #6b4a2e;
}
.proceedings-ledger-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(107, 74, 46, 0.22);
  background: repeating-linear-gradient(
    transparent,
    transparent calc(100% - 1px),
    rgba(107, 74, 46, 0.08) calc(100% - 1px),
    rgba(107, 74, 46, 0.08) 100%
  );
  padding: 0.62rem 0.55rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.proceedings-ledger-row:hover,
.proceedings-ledger-row:focus-visible {
  background-color: rgba(201, 162, 39, 0.12);
  outline: none;
}
.proceedings-ledger-row .reg-no {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #3d2914;
}
.proceedings-ledger-row .reg-title {
  font-weight: 600;
  line-height: 1.35;
}
.proceedings-ledger-row .reg-date,
.proceedings-ledger-row .reg-chair {
  font-size: 0.86rem;
  color: var(--muted, #5a6a80);
}
.proceedings-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
}
.proceedings-badge.is-published { background: rgba(21, 128, 61, 0.14); color: #166534; }
.proceedings-badge.is-draft { background: rgba(29, 78, 216, 0.12); color: #1e3a8a; }
.proceedings-badge.is-archived { background: rgba(107, 74, 46, 0.12); color: #6b4a2e; }
.proceedings-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-style: italic;
}
.proceedings-page {
  border: 2px solid #6b4a2e;
  background: #fdfaf3;
  border-radius: 2px;
  box-shadow: 0 6px 20px rgba(26, 18, 8, 0.06);
}
.proceedings-detail .proceedings-page {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.proceedings-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.proceedings-detail-actions { display: flex; gap: 0.45rem; align-items: end; flex-wrap: wrap; }
.proceedings-paper-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #5a6a80);
}
.proceedings-paper-label select {
  font: 600 0.85rem/1.2 system-ui, sans-serif;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(11, 42, 86, 0.22);
  background: #fff;
  color: inherit;
}
#proceedingsDetailBody .mom-print-root {
  max-width: 100%;
}
#proceedingsDetailBody .sheet {
  max-width: 100%;
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
}
@media print {
  #proceedingsDetailBody .sheet {
    height: var(--mom-print-h, 277mm);
    min-height: var(--mom-print-h, 277mm);
    max-height: var(--mom-print-h, 277mm);
  }
}
@media (max-width: 900px) {
  #proceedingsDetailBody .sheet {
    width: 100%;
    height: auto;
    min-height: 280mm;
    max-height: none;
  }
}
.proceedings-page-inner {
  position: relative;
  padding: 1.25rem 1.35rem 1.5rem;
  font-family: "Times New Roman", Times, Georgia, serif;
  color: #1a1208;
}
.proceedings-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #6b4a2e;
  pointer-events: none;
}
.proceedings-corner.c-tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.proceedings-corner.c-tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.proceedings-corner.c-bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.proceedings-corner.c-br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.proceedings-page-head {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.85rem;
  align-items: start;
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid #6b4a2e;
}
.proceedings-seal {
  width: 52px;
  height: auto;
  border: 1.5px solid #9e7d3a;
}
.proceedings-org {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b4a2e;
}
.proceedings-page-head h3 {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  color: #3d2914;
  line-height: 1.2;
}
.proceedings-reg-meta {
  font-size: 0.88rem;
  text-align: right;
  line-height: 1.45;
}
.proceedings-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
}
.proceedings-page-inner section {
  margin: 0.85rem 0;
}
.proceedings-page-inner section h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b4a2e;
  border-bottom: 1px solid rgba(107, 74, 46, 0.35);
  padding-bottom: 0.2rem;
}
.proceedings-multiline {
  line-height: 1.55;
  font-size: 0.95rem;
  background: repeating-linear-gradient(
    transparent,
    transparent 1.45rem,
    rgba(107, 74, 46, 0.1) 1.45rem,
    rgba(107, 74, 46, 0.1) calc(1.45rem + 1px)
  );
  padding-left: 0.35rem;
}
.proceedings-resolutions,
.proceedings-actions {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.5;
}
.proceedings-actions li.is-done { text-decoration: line-through; opacity: 0.65; }
.proceedings-page-foot {
  margin-top: 1rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(107, 74, 46, 0.35);
  font-size: 0.9rem;
}
.proceedings-manage {
  margin-top: 1.25rem;
  border: 1px dashed rgba(107, 74, 46, 0.35);
  background: rgba(253, 250, 243, 0.65);
}
.proceedings-rows { display: grid; gap: 0.55rem; margin-top: 0.5rem; }
.proceedings-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.45rem;
  align-items: end;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.proceedings-row .span-2 { grid-column: 1 / -1; }
.proceedings-row label { margin: 0; font-size: 0.78rem; }
.proceedings-vote-bar {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(26, 79, 122, 0.18);
  border-radius: 12px;
  background: #f7fafc;
}
.proceedings-vote-bar h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}
.proceedings-vote-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line, rgba(15, 40, 80, 0.12));
}
.proceedings-vote-item:first-of-type { border-top: 0; padding-top: 0.15rem; }
.proceedings-vote-item p { margin: 0; font-size: 0.88rem; }
.proceedings-vote-meta { color: var(--muted, #5a6a80); font-size: 0.8rem; }
.proceedings-vote-voters {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line, rgba(15, 40, 80, 0.12));
  border-radius: 8px;
  background: #fff;
  font-size: 0.86rem;
}
.proceedings-vote-voters label { display: flex; gap: 0.45rem; align-items: center; margin: 0; font-weight: 500; }
.resolution-votes-list { display: grid; gap: 0.7rem; }
.resolution-vote-card {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line, rgba(15, 40, 80, 0.12));
  border-radius: 12px;
  background: #fff;
}
.resolution-vote-card h4 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.resolution-vote-card .vote-text { margin: 0 0 0.55rem; font-size: 0.9rem; white-space: pre-wrap; }
.resolution-vote-card .btn-row { margin-top: 0.45rem; }
.resolution-vote-card .vote-recorded { color: #166534; font-weight: 600; font-size: 0.88rem; }
.notify-empty {
  margin: 0.4rem 0 0.2rem;
  padding: 1.1rem 0.85rem;
  text-align: center;
  color: var(--muted, #5a6a80);
  font-size: 0.9rem;
}
.notify-alerts-list {
  display: grid;
  gap: 0.65rem;
}
.notify-alert-card {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line, rgba(15, 40, 80, 0.12));
  border-radius: 12px;
  background: #fff;
}
.notify-alert-card h4 { margin: 0 0 0.2rem; font-size: 0.95rem; }
.notify-alert-card p { margin: 0 0 0.2rem; font-size: 0.88rem; }
.notify-alert-card .muted { margin: 0; }
.notify-alert-kind {
  margin: 0 0 0.28rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep, #b8892d);
}
.notify-alert-card.is-unread {
  border-color: rgba(184, 137, 45, 0.45);
  background: linear-gradient(180deg, #fffdf8, #fff);
  box-shadow: 0 0 0 1px rgba(184, 137, 45, 0.08);
}
.notify-alert-card:hover,
.notify-alert-card:focus-visible {
  border-color: var(--gold-deep, #b8892d);
  outline: none;
}
@media (max-width: 720px) {
  .proceedings-ledger-head { display: none; }
  .proceedings-ledger-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 0.75rem 0.65rem;
  }
  .proceedings-ledger-row .reg-no::before { content: "Reg. "; font-weight: 400; color: var(--muted); }
  .proceedings-page-head { grid-template-columns: 48px 1fr; }
  .proceedings-reg-meta { grid-column: 1 / -1; text-align: left; }
}
@media print {
  .proceedings-register-shell,
  .proceedings-detail-head,
  .proceedings-manage,
  .panel-head { display: none !important; }
  .proceedings-page { border: 0; box-shadow: none; }
}
.stat-group {
  margin-bottom: 1rem;
}
.stat-group-label {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.stat {
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--navy-deep), var(--navy-soft));
  color: #f3f1ea;
}
.stat > span { display: block; font-size: 0.72rem; opacity: 0.75; }
.stat strong {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-amount);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.dues-card-wrap {
  margin-bottom: 1rem;
}
.dues-bill,
.ledger-card {
  padding: 0.95rem 1rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf8, #f5f1e8);
  box-shadow: 0 8px 22px rgba(14, 24, 44, 0.06);
  min-width: 0;
}
.dues-bill-head,
.ledger-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.dues-bill-head span,
.ledger-card-due span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.dues-bill-head strong,
.ledger-card-due strong {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-amount);
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  color: var(--navy-deep);
  line-height: 1.15;
  text-align: right;
}
.dues-bill.is-cleared .dues-bill-head strong,
.ledger-card.is-cleared .ledger-card-due strong {
  color: #2f6b46;
}
.dues-bill-metrics,
.ledger-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
}
.dues-bill-metrics > div,
.ledger-card-metrics > div {
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(21, 35, 63, 0.045);
}
.dues-bill-metrics dt,
.ledger-card-metrics dt {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dues-bill-metrics dd,
.ledger-card-metrics dd {
  margin: 0.18rem 0 0;
  font-family: var(--font-amount);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--navy);
  overflow-wrap: anywhere;
}
.dues-bill-meta,
.ledger-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.85rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.ledger-cards {
  display: none;
}
.ledger-cards-empty {
  margin: 0;
  padding: 1rem 0.2rem;
}
.ledger-card-who {
  min-width: 0;
  flex: 1 1 auto;
}
.ledger-card-plot {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}
.ledger-card-name {
  margin: 0.2rem 0 0;
  font-weight: 650;
  color: var(--navy);
  overflow-wrap: anywhere;
}
.ledger-card-due {
  flex: 0 0 auto;
  text-align: right;
}
.ledger-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.ledger-card-actions .btn {
  flex: 1 1 calc(50% - 0.4rem);
  width: auto;
  min-width: 0;
}
@media (min-width: 901px) {
  .dues-bill {
    max-width: 42rem;
  }
  .dues-bill-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.ledger-table,
#ledgerSummary,
#ledgerEditDerived,
.payment-record-card,
.payment-records-list {
  font-variant-numeric: tabular-nums;
}
.ledger-table td,
.payment-record-head strong {
  font-family: var(--font-amount);
}
.info-card {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px dashed rgba(196, 161, 90, 0.55);
  background: var(--gold-soft);
  margin-bottom: 1.25rem;
}
.payment-records-block {
  margin: 1.25rem 0;
}
.payment-record-form {
  margin-bottom: 1rem;
}
.payment-records-list {
  display: grid;
  gap: 0.65rem;
}
.payment-record-card {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.85);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.payment-record-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.noc-plot-finance {
  margin: 0.35rem 0 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(46, 90, 68, 0.06);
  border: 1px solid rgba(46, 90, 68, 0.12);
}
.noc-plot-finance p {
  margin: 0.15rem 0;
}
.payment-record-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
  margin-bottom: 0.25rem;
}
.payment-status {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.payment-status.is-submitted {
  background: rgba(196, 161, 90, 0.18);
  border-color: rgba(196, 161, 90, 0.45);
  color: var(--navy);
}
.payment-status.is-verified {
  background: rgba(40, 120, 70, 0.12);
  border-color: rgba(40, 120, 70, 0.35);
  color: #1f5a35;
}
.payment-status.is-rejected {
  background: rgba(140, 40, 40, 0.1);
  border-color: rgba(140, 40, 40, 0.3);
  color: #7a2424;
}
.payment-status.is-reimbursed {
  background: rgba(30, 70, 160, 0.1);
  border-color: rgba(30, 70, 160, 0.3);
  color: #1e3a8a;
}
.payment-status.is-requested {
  background: rgba(140, 100, 20, 0.12);
  border-color: rgba(140, 100, 20, 0.35);
  color: #7a5a12;
}
.payment-status.is-issued {
  background: rgba(40, 110, 70, 0.12);
  border-color: rgba(40, 110, 70, 0.35);
  color: #1f5a35;
}
.treasury-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.72rem;
  line-height: 1.2;
  vertical-align: middle;
  font-family: var(--font);
}
.treasury-seal-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.treasury-seal-icon::before,
.treasury-seal-icon::after {
  content: "";
  position: absolute;
}
.treasury-seal.is-pending {
  color: #9a7b2f;
}
.treasury-seal.is-pending .treasury-seal-icon {
  background: rgba(196, 161, 90, 0.15);
  border-style: dashed;
}
.treasury-seal.is-validated {
  color: #1e4f8a;
}
.treasury-seal.is-validated .treasury-seal-icon {
  background: rgba(30, 79, 138, 0.12);
}
.treasury-seal.is-validated .treasury-seal-icon::before {
  width: 0.28rem;
  height: 0.48rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(40deg);
  top: 0.12rem;
}
.treasury-seal.is-confirmed {
  color: #1f5a35;
}
.treasury-seal.is-confirmed .treasury-seal-icon {
  background: rgba(40, 120, 70, 0.14);
}
.treasury-seal.is-confirmed .treasury-seal-icon::before,
.treasury-seal.is-confirmed .treasury-seal-icon::after {
  width: 0.22rem;
  height: 0.42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(40deg);
  top: 0.16rem;
}
.treasury-seal.is-confirmed .treasury-seal-icon::before {
  left: 0.22rem;
}
.treasury-seal.is-confirmed .treasury-seal-icon::after {
  left: 0.42rem;
}
.treasury-seal-label {
  color: var(--muted);
  font-weight: 500;
}
.treasury-queue-section {
  margin-bottom: 1rem;
}
.treasury-queue-section h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}
.no-dues-resident-block {
  margin: 1rem 0 1.25rem;
}
.no-dues-purpose-label {
  display: grid;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
  font-size: 0.88rem;
  color: var(--navy);
}
.no-dues-purpose-label textarea {
  width: 100%;
  max-width: 36rem;
  box-sizing: border-box;
  resize: vertical;
  min-height: 3.2rem;
}
.no-dues-purpose-label textarea[readonly] {
  background: rgba(21, 35, 63, 0.04);
  color: var(--ink, #1a1a1a);
  cursor: default;
}
.no-dues-download-dialog .no-dues-download-options {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}
.no-dues-download-dialog .no-dues-download-options .btn {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
  text-align: left;
  padding: 0.85rem 1rem;
  white-space: normal;
  height: auto;
  line-height: 1.35;
}
.no-dues-download-dialog .no-dues-download-options .btn .muted {
  font-size: 0.78rem;
  font-weight: 500;
}
.payment-files {
  margin: 0.35rem 0 0.45rem;
  font-size: 0.86rem;
}
.payment-file-link {
  color: var(--navy);
}
.pay-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 18px;
  border: 1px solid rgba(196, 161, 90, 0.45);
  background:
    linear-gradient(160deg, rgba(246, 241, 230, 0.95), rgba(255, 252, 246, 0.98)),
    var(--gold-soft, #f3ead7);
  margin-bottom: 1.25rem;
}
.pay-card-compact { margin-top: 0.75rem; }
.pay-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.25rem;
  align-items: start;
}
.pay-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.15rem;
}
.pay-card .pay-meta {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.pay-card .pay-meta span {
  display: block;
}
.pay-qr {
  width: min(168px, 42vw);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.35rem;
}
.pay-card .btn-row { margin: 0; }
.bank-qr-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.bank-qr-preview img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
}
@media (max-width: 560px) {
  .pay-card-body { grid-template-columns: 1fr; }
  .pay-qr { width: min(200px, 70vw); justify-self: start; }
}

.ledger-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.75rem;
}
.ledger-search { margin: 0; flex: 1 1 220px; max-width: 320px; }
.ledger-search input { margin: 0; }
.ledger-wrap { max-height: min(56vh, 560px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.ledger-table .btn.compact { padding: 0.26rem 0.6rem; font-size: 0.78rem; }
.doc-viewer-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  padding: 0;
  background: #0e182c;
  color: #f3f1ea;
  overflow: hidden;
  /* Non-modal fullscreen sheet — Chrome PDF scroll/toolbar breaks in showModal() top-layer. */
  z-index: 1400;
}
.doc-viewer-dialog[open] {
  display: flex;
  flex-direction: column;
}
.doc-viewer-dialog::backdrop {
  background: rgba(14, 24, 44, 0.72);
}
.doc-viewer-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}
.doc-viewer-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
  padding: 0.65rem 0.75rem;
  padding-top: calc(0.65rem + env(safe-area-inset-top));
  background: #15233f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 5;
  position: relative;
}
.doc-viewer-back {
  display: inline-flex !important;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  background: #fff !important;
  color: #15233f !important;
  border-color: transparent !important;
  font-weight: 700;
}
.doc-viewer-mobile-bar {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  padding: 0.65rem 0.75rem;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
  background: #15233f;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 5;
  position: relative;
}
.doc-viewer-mobile-bar .btn {
  width: 100%;
  justify-content: center;
  font-weight: 700;
  background: #fff !important;
  color: #15233f !important;
  border-color: transparent !important;
  min-height: 2.6rem;
  text-decoration: none;
}
.doc-viewer-mobile-actions {
  display: flex;
  gap: 0.45rem;
}
.doc-viewer-mobile-actions .btn {
  flex: 1 1 0;
}
.doc-viewer-mobile-actions .btn[hidden] {
  display: none !important;
}
.doc-viewer-bar #docViewerPrintBtn,
.doc-viewer-bar #docViewerDownloadBtn {
  background: #fff !important;
  color: #15233f !important;
  border-color: transparent !important;
  font-weight: 700;
}
.doc-viewer-mobile-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(243, 241, 234, 0.72);
  text-align: center;
}
.doc-viewer-titles {
  flex: 1 1 10rem;
  min-width: 0;
}
.doc-viewer-titles strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-viewer-titles .muted {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: rgba(243, 241, 234, 0.72);
}
.doc-viewer-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: #1a2438;
  overflow: hidden;
  /* Let wheel/touch reach the PDF viewer inside the frame/embed. */
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.doc-viewer-stage iframe,
.doc-viewer-stage .doc-viewer-embed,
.doc-viewer-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  /* Critical: definite box so Chrome PDF plugin can scroll pages */
  min-height: 0;
}
.doc-viewer-stage iframe.is-html-doc {
  background: #e8eef5;
}
.doc-viewer-stage img {
  object-fit: contain;
  background: #0e182c;
  padding: 0.5rem;
}
.doc-viewer-loading {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: rgba(14, 24, 44, 0.72);
  color: rgba(243, 241, 234, 0.92);
  font-size: 0.88rem;
  pointer-events: none;
}
.doc-viewer-fallback {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1.25rem;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(243, 241, 234, 0.8);
}
@media (max-width: 820px) {
  .doc-viewer-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .doc-viewer-mobile-bar {
    display: flex;
  }
  /* New-tab PDF viewers often trap users in the PWA / iOS PDF chrome. */
  #docViewerNewTabBtn {
    display: none !important;
  }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  .doc-viewer-mobile-bar {
    display: flex;
  }
  #docViewerNewTabBtn {
    display: none !important;
  }
}

/* Information Centre — view-only / anti-capture deterrents (only when master admin enables) */
body.info-protect-enforced .panel-info-protected,
body.info-protect-enforced .panel-info-protected .info-doc-list,
body.info-protect-enforced .panel-info-protected .info-doc-card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.info-protect-enforced.is-info-capture-guard #panel-info:not([hidden]) {
  position: relative;
}
body.info-protect-enforced.is-info-capture-guard #panel-info:not([hidden])::after {
  content: "Return to this screen to continue reading Information Centre content.";
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: #0e182c;
  color: #f3f1ea;
  font: 600 0.95rem/1.45 "IBM Plex Sans", system-ui, sans-serif;
  border-radius: 16px;
}
.doc-viewer-dialog.is-content-protected {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.doc-viewer-dialog.is-content-protected #docViewerDownloadBtn,
.doc-viewer-dialog.is-content-protected #docViewerMobileDownloadBtn,
.doc-viewer-dialog.is-content-protected #docViewerNewTabBtn {
  display: none !important;
}
.doc-viewer-protect-shield {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: #0e182c;
  color: #f3f1ea;
  font: 600 0.95rem/1.45 system-ui, sans-serif;
}
.doc-viewer-dialog.is-content-protected.is-capture-guard .doc-viewer-protect-shield {
  display: flex;
}
.doc-viewer-dialog.is-content-protected.is-capture-guard .doc-viewer-stage iframe,
.doc-viewer-dialog.is-content-protected.is-capture-guard .doc-viewer-stage img,
.doc-viewer-dialog.is-content-protected.is-capture-guard .doc-viewer-stage .doc-viewer-embed {
  visibility: hidden;
}
/* Personal watermark — iOS/Android cannot block screenshots in a PWA; mark the reader. */
.doc-viewer-watermark {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.22;
  display: none;
}
.doc-viewer-dialog.is-content-protected .doc-viewer-watermark {
  display: block;
}
body:not(.info-protect-enforced) .doc-viewer-watermark,
body:not(.info-protect-enforced) .panel-info-watermark {
  display: none !important;
}
.doc-viewer-watermark::before {
  content: attr(data-mark);
  position: absolute;
  left: -20%;
  top: -20%;
  width: 140%;
  height: 140%;
  color: #0e182c;
  font: 700 13px/2.4 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.04em;
  white-space: pre;
  transform: rotate(-28deg);
  background-image: repeating-linear-gradient(
    -28deg,
    transparent 0 52px,
    rgba(14, 24, 44, 0.04) 52px 53px
  );
}
.doc-viewer-watermark-tiles {
  position: absolute;
  inset: -10%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 1rem;
  transform: rotate(-28deg);
  color: #0e182c;
  font: 700 12px/1.35 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-align: center;
}
.doc-viewer-watermark-tiles span {
  white-space: nowrap;
}
.panel-info-watermark {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.14;
  display: none;
}
.panel-info-protected {
  position: relative;
}
.panel-info-protected.is-watermarked .panel-info-watermark {
  display: none;
}
body.info-protect-enforced .panel-info-protected.is-watermarked .panel-info-watermark {
  display: block;
}
.panel-info-watermark .doc-viewer-watermark-tiles {
  color: #15233f;
}
@media print {
  .panel-info-protected,
  .doc-viewer-dialog.is-content-protected,
  .doc-viewer-watermark,
  .panel-info-watermark {
    display: none !important;
  }
  body.is-printing-info::before {
    content: "Printing Information Centre documents is not allowed.";
    display: block;
    padding: 2rem;
    font: 600 1rem/1.4 system-ui, sans-serif;
  }
}
.ledger-dialog {
  width: min(560px, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: min(90dvh, 720px);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--paper, #fffaf2);
  color: inherit;
  box-shadow: 0 24px 60px rgba(21, 35, 63, 0.28);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.vault-dialog {
  width: min(720px, calc(100vw - 1.25rem));
  max-height: min(92dvh, 860px);
}
.vault-dialog-body {
  gap: 0.75rem;
}
.vault-ledger-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.9);
  font-size: 0.86rem;
}
.vault-upload {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed rgba(21, 35, 63, 0.22);
  border-radius: 12px;
}
.vault-doc-list {
  display: grid;
  gap: 0.55rem;
}
.vault-doc-card {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  display: grid;
  gap: 0.35rem;
}
.vault-doc-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}
.vault-doc-card strong {
  color: var(--navy);
  font-size: 0.92rem;
}
.vault-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.vault-badge.is-shared_ec,
.vault-badge.is-under_review {
  background: rgba(30, 79, 138, 0.1);
  border-color: rgba(30, 79, 138, 0.28);
  color: #1e4f8a;
}
.vault-badge.is-verified,
.vault-badge.is-confirmed {
  background: rgba(40, 120, 70, 0.12);
  border-color: rgba(40, 120, 70, 0.3);
  color: #1f5a35;
}
.vault-badge.is-private,
.vault-badge.is-uploaded {
  background: rgba(196, 161, 90, 0.14);
  border-color: rgba(196, 161, 90, 0.35);
  color: #7a5a12;
}
.vault-badge.is-rejected {
  background: rgba(140, 40, 40, 0.1);
  border-color: rgba(140, 40, 40, 0.28);
  color: #7a2424;
}
.btn.vault-open {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}
.btn.vault-open svg {
  flex: 0 0 auto;
}
.ledger-dialog[open] {
  display: block;
}
.ledger-dialog::backdrop {
  background: rgba(21, 35, 63, 0.45);
}
.ledger-dialog .panel-head { margin-bottom: 0.35rem; }
.ledger-dialog .panel-head h3 { margin: 0; }
.ledger-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 0.9rem;
}
.ledger-edit-grid label { margin: 0; display: grid; gap: 0.35rem; font-size: 0.84rem; font-weight: 600; }
.ledger-edit-grid input { font-weight: 500; }
.ledger-edit-grid .span-2 { grid-column: 1 / -1; }
.ledger-custom-edit {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line, #d7d0c4);
}
.ledger-columns-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.35rem 0 0.75rem;
}
.ledger-column-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem auto auto auto;
  gap: 0.45rem;
  align-items: end;
}
.ledger-column-row input,
.ledger-column-row select { width: 100%; }
@media (max-width: 640px) {
  .ledger-column-row { grid-template-columns: 1fr 1fr; }
  .ledger-column-row .btn { justify-self: start; }
}
.field-hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted, #6b7280);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
@media (max-width: 560px) {
  .ledger-edit-grid { grid-template-columns: 1fr; }
  .ledger-edit-grid .span-2 { grid-column: auto; }
}

.app-refresh-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
  justify-content: center;
  margin: 0.35rem 0 0.75rem;
}
.app-refresh-row #appRefreshStatus {
  font-size: 0.78rem;
}
.pwa-hint { margin-bottom: 0.5rem; }
.grievance-form { margin-bottom: 1.25rem; }
.mailbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin: 0.5rem 0 0.85rem;
}
.mailbox-toolbar .panel-head { flex: 1 1 180px; margin: 0; }
.mailbox-toolbar label { margin: 0; }
.mailbox-toolbar select { min-width: 9rem; }
.grievance-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  min-width: 0;
  width: 100%;
}
.grievance-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 252, 246, 0.72);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}
.grievance-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem 0.55rem;
  align-items: center;
  margin-bottom: 0.35rem;
  min-width: 0;
  width: 100%;
}
.grievance-card h4 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--display);
}
.grievance-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted, #6b7280);
}
.msg-trail {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 0.35rem;
}
.msg-bubble {
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(21, 35, 63, 0.08);
}
.msg-bubble.is-ec {
  background: rgba(21, 35, 63, 0.06);
  border-left: 3px solid var(--gold-deep, #a67c2d);
}
.msg-bubble header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  align-items: center;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
}
.msg-bubble header strong { color: inherit; font-size: 0.82rem; }
.msg-bubble p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}
.mailbox-reply {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.mailbox-reply textarea { min-height: 3.5rem; }
.mailbox-status-pick { max-width: 12rem; }
.grievance-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(21, 35, 63, 0.08);
}
.grievance-badge.is-open { background: rgba(180, 83, 9, 0.14); color: #9a3412; }
.grievance-badge.is-in_progress { background: rgba(29, 78, 216, 0.12); color: #1e3a8a; }
.grievance-badge.is-resolved { background: rgba(21, 128, 61, 0.14); color: #14532d; }
.grievance-badge.is-closed { background: rgba(75, 85, 99, 0.14); color: #374151; }
.grievance-ec-block { margin-bottom: 1.5rem; }
.grievance-ext { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.3rem; font-size: 0.82rem; }
.complaint-ext-block { border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.7rem 0.8rem; display: grid; gap: 0.6rem; }
.complaint-ext-block legend { font-weight: 700; font-size: 0.85rem; padding: 0 0.35rem; }
.check-row { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.9rem; }
.check-row input[type="checkbox"] { margin-top: 0.2rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.directory-toolbar {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}
@media (max-width: 900px) {
  .directory-toolbar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 0.15rem 0 0.55rem;
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 252, 246, 0.92));
  }
}
.directory-lookup {
  max-width: 36rem;
  width: 100%;
}
.directory-lookup input {
  min-height: 2.6rem;
  font-size: 1rem;
}
.directory-list {
  display: grid;
  gap: 0.75rem;
}
.dir-card {
  padding: 0.9rem 0.95rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf8, #f5f1e8);
  box-shadow: 0 8px 22px rgba(14, 24, 44, 0.06);
  min-width: 0;
}
.dir-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  padding-bottom: 0.7rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.dir-card-head-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.dir-plot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.dir-hh {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.dir-role {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.dir-fields {
  display: grid;
  gap: 0.55rem 0.85rem;
  margin: 0;
}
.dir-field {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}
.dir-field dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.dir-field dd {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.dir-name {
  font-weight: 650;
  line-height: 1.35;
}
.dir-contact {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
  word-break: break-word;
  cursor: pointer;
}
button.dir-contact {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.2rem 0;
  margin: 0;
  font: inherit;
  font-weight: 650;
  color: var(--navy);
  text-align: left;
  min-height: 2.5rem;
}
a.dir-contact {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  font-weight: 650;
}
.dir-contact:hover { color: var(--leaf); }

.dir-contact-sheet {
  width: min(24rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  margin: auto 0.75rem max(0.75rem, env(safe-area-inset-bottom, 0px));
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}
.dir-contact-sheet::backdrop {
  background: rgba(14, 24, 44, 0.45);
}
.dir-contact-sheet-group {
  background: rgba(255, 252, 246, 0.96);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.dir-contact-sheet-kicker {
  margin: 0;
  padding: 0.7rem 1rem 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dir-contact-sheet-title {
  margin: 0;
  padding: 0.15rem 1rem 0.7rem;
  text-align: center;
  font-weight: 650;
  font-size: 0.95rem;
}
.dir-sheet-btn {
  display: block;
  width: 100%;
  padding: 0.95rem 1rem;
  text-align: center;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 600;
  color: #1d6fd8;
  background: rgba(255, 252, 246, 0.96);
  border: 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
}
.dir-sheet-cancel {
  border-radius: 14px;
  font-weight: 700;
  color: var(--navy);
}
.dir-seat {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.dir-folds {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.dir-fold {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  min-width: 0;
}
.dir-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.dir-fold summary::-webkit-details-marker { display: none; }
.dir-fold summary::after {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-left: 0.35rem;
  flex: 0 0 auto;
}
.dir-fold[open] summary::after { transform: rotate(-135deg); }
.dir-fold summary span:first-child { flex: 1 1 auto; min-width: 0; }
.dir-count {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 1.4rem;
  text-align: center;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(21, 35, 63, 0.08);
  color: var(--navy);
  flex: 0 0 auto;
}
.dir-fold-list {
  margin: 0;
  padding: 0 0.75rem 0.65rem 1.35rem;
}
.dir-fold-list li {
  padding: 0.18rem 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dir-plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 650;
  letter-spacing: 0.03em;
}
.dir-fold-empty {
  margin: 0;
  padding: 0 0.75rem 0.65rem;
  font-size: 0.82rem;
}
@media (min-width: 720px) {
  .dir-fields {
    grid-template-columns: 1fr 1fr;
  }
  .dir-field:nth-child(1),
  .dir-field:nth-child(2) {
    grid-column: 1 / -1;
  }
}
@media (min-width: 980px) {
  .directory-list {
    grid-template-columns: 1fr 1fr;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* EC roster */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.colony-services-wrap {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.board-head {
  margin-bottom: 0.55rem;
  min-width: 0;
}
.board-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title tools"
    "tabs tabs";
  align-items: center;
  gap: 0.38rem 0.5rem;
}
.board-head-title {
  grid-area: title;
  margin: 0;
  min-width: 0;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.board-panel-tabs {
  grid-area: tabs;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin: 0;
  min-width: 0;
}
.board-panel-tab {
  border: 1px solid rgba(15, 40, 80, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.28rem 0.68rem;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.board-panel-tab.is-active {
  background: linear-gradient(180deg, #1a4d36, #0f4028);
  color: #f7f4ec;
  border-color: transparent;
}
.board-head-tools {
  grid-area: tools;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  justify-self: end;
  flex: 0 0 auto;
}
.board-head-lead {
  margin: 0.28rem 0 0.45rem;
  font-size: 0.8rem;
  line-height: 1.35;
  min-width: 0;
}
.board-lang-toggle {
  padding: 0.12rem;
  gap: 0.16rem;
}
.board-lang-toggle .lang-btn {
  min-width: 1.72rem;
  height: 1.58rem;
  padding: 0 0.38rem;
  font-size: 0.66rem;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.board-lang-toggle .lang-glyph {
  font-size: 0.72rem;
}
.board-edit-btn {
  min-height: 1.58rem;
  padding: 0.22rem 0.58rem !important;
  font-size: 0.74rem !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.board-tab-pane[hidden] { display: none !important; }
#panel-home > .board-head + .board-tab-pane .notice-list {
  margin-top: 0;
}
@media (min-width: 720px) {
  .board-head-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "title tabs tools";
    gap: 0.35rem 0.65rem;
  }
  .board-panel-tabs {
    justify-content: flex-start;
  }
}
@media (max-width: 719px) {
  .board-head-title {
    font-size: 0.96rem;
  }
  .board-head-lead {
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
  }
  .board-panel-tabs {
    display: flex;
    width: 100%;
    padding: 0.16rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 40, 80, 0.12);
    background: rgba(255, 255, 255, 0.82);
    box-sizing: border-box;
  }
  .board-panel-tab {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.44rem 0.5rem;
    min-height: 2.35rem;
    font-size: 0.76rem;
  }
  .board-lang-toggle .lang-btn {
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0 0.42rem;
  }
  .board-edit-btn {
    min-height: 2.35rem;
    padding: 0.32rem 0.72rem !important;
  }
}
@media (max-width: 380px) {
  .board-head-title {
    font-size: 0.9rem;
  }
  .board-lang-toggle .lang-label {
    display: none;
  }
  .board-lang-toggle .lang-btn {
    min-width: 2.1rem;
    padding: 0 0.35rem;
  }
}
.colony-services-head {
  margin-bottom: 0.85rem;
}
.colony-services-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}
.colony-services-column-title {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: #1e3a8a;
}
.colony-services-cards {
  display: grid;
  gap: 0.65rem;
}
.colony-service-card {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(21, 35, 63, 0.1);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(14, 24, 44, 0.04);
  min-width: 0;
}
.colony-service-card p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.colony-service-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
}
.colony-service-card-head strong {
  font-size: 0.95rem;
}
.colony-service-name,
.colony-service-when {
  font-size: 0.78rem;
  color: #475569;
}
.colony-service-issue {
  color: #334155;
  font-weight: 500;
}
.colony-service-meta {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0;
  font-size: 0.84rem;
}
.colony-service-meta div {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.45rem;
  align-items: start;
}
.colony-service-meta dt {
  margin: 0;
  color: #64748b;
  font-weight: 500;
}
.colony-service-meta dd {
  margin: 0;
}
.colony-service-meta a {
  color: #1d4ed8;
  text-decoration: none;
}
.colony-service-notes {
  margin-top: 0.45rem !important;
  font-size: 0.8rem !important;
}
.colony-services-editor {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 0.95rem 1rem 1.05rem;
  border-radius: 16px;
  border: 1px dashed rgba(30, 58, 138, 0.22);
  background: rgba(248, 250, 252, 0.92);
}
.colony-services-editor-lead {
  margin: 0;
}
.colony-services-editor-section {
  display: grid;
  gap: 0.55rem;
}
.colony-services-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.colony-services-editor-head h4 {
  margin: 0;
  font-size: 0.95rem;
}
.colony-services-rows {
  display: grid;
  gap: 0.65rem;
}
.colony-services-edit-row {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(21, 35, 63, 0.1);
  background: #fff;
}
.colony-services-edit-fields {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.colony-services-edit-fields label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
}
.colony-services-edit-fields label span {
  color: #475569;
  font-weight: 500;
}
.colony-services-edit-fields input,
.colony-services-edit-fields textarea {
  width: 100%;
  font: inherit;
}
.colony-services-edit-fields label:has(textarea) {
  grid-column: 1 / -1;
}
@media (min-width: 900px) {
  .colony-services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 640px) and (max-width: 899px) {
  .colony-services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 639px) {
  .colony-services-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .colony-services-column-title {
    font-size: 0.88rem;
  }
  .colony-service-card {
    padding: 0.68rem 0.75rem;
  }
  .colony-service-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .colony-service-meta div {
    grid-template-columns: 3.75rem minmax(0, 1fr);
    gap: 0.35rem;
  }
  .colony-service-meta a {
    word-break: break-word;
  }
  .colony-services-editor {
    padding: 0.75rem 0.8rem 0.85rem;
  }
  .colony-services-editor-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .colony-services-editor-head .btn {
    width: 100%;
    justify-content: center;
  }
  .colony-services-edit-fields {
    grid-template-columns: 1fr;
  }
  .colony-services-edit-row .colony-services-remove {
    width: 100%;
  }
  #colonyServicesEditor > .btn-row {
    flex-direction: column;
  }
  #colonyServicesEditor > .btn-row .btn {
    width: 100%;
  }
}
@media (max-width: 640px) {
  .colony-services-edit-fields {
    grid-template-columns: 1fr;
  }
}
.roster-block {
  margin: 0 0 1rem;
  padding: 0.95rem 1.05rem 1.1rem;
  border: 1px solid rgba(21, 35, 63, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(255, 250, 242, 0.9));
  box-shadow: 0 10px 28px rgba(14, 24, 44, 0.05);
  min-width: 0;
  max-width: 100%;
}
.roster-block:last-child {
  margin-bottom: 0.35rem;
}
.desk-tablet {
  margin: 0 0 1rem;
  padding: 0.95rem 1.05rem 1.1rem;
  border: 1px solid rgba(21, 35, 63, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(255, 250, 242, 0.9));
  box-shadow: 0 10px 28px rgba(14, 24, 44, 0.05);
}
#panel-admin {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  max-width: 100%;
}
#panel-admin > .ec-desk-head {
  margin-bottom: 0.85rem;
}
.desk-section-body {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.mobile-section-toggle,
.desk-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(21, 35, 63, 0.22);
  border-radius: 999px;
  background: rgba(21, 35, 63, 0.1);
  color: var(--navy);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 24, 44, 0.08);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.mobile-section-toggle:hover,
.desk-section-toggle:hover,
.mobile-section-toggle:focus-visible,
.desk-section-toggle:focus-visible {
  background: rgba(21, 35, 63, 0.16);
  border-color: rgba(21, 35, 63, 0.35);
  outline: none;
}
.mobile-section-chevron,
.desk-section-chevron {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  margin-top: -0.15rem;
}
.mobile-section-chevron::before,
.desk-section-chevron::before {
  content: none;
}
.mobile-section.is-section-collapsed .mobile-section-chevron,
.mobile-section.is-section-collapsed .desk-section-chevron {
  transform: rotate(-45deg);
  margin-top: 0.1rem;
}
.mobile-section.is-section-collapsed .mobile-section-body,
.mobile-section.is-section-collapsed .desk-section-body {
  display: none;
}
.mobile-section > .roster-toolbar > div:first-child,
.mobile-section > .panel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.1rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.mobile-section-toggle,
.desk-section-toggle {
  grid-column: 1;
  grid-row: 1;
}
.mobile-section > .roster-toolbar > div:first-child > h3,
.mobile-section > .panel-head > h2,
.mobile-section > .panel-head > h3 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  min-width: 0;
}
.mobile-section > .roster-toolbar > div:first-child > .muted,
.mobile-section > .panel-head > p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  padding-left: calc(2rem + 0.5rem);
}
.mobile-section > .roster-toolbar,
.mobile-section > .panel-head,
.mobile-section > .ledger-toolbar {
  cursor: default;
}
.mobile-section > .roster-toolbar > div:first-child,
.mobile-section > .panel-head {
  cursor: pointer;
}
.mobile-section.is-section-collapsed {
  padding-bottom: 0.9rem;
}
.mobile-section.is-section-collapsed > .roster-toolbar,
.mobile-section.is-section-collapsed > .panel-head {
  margin-bottom: 0;
}
.roster-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.roster-toolbar > div:first-child {
  flex: 1 1 12rem;
  min-width: 0;
}
.roster-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 16rem;
  max-width: 100%;
  min-width: 0;
}
.roster-toolbar h3 {
  margin: 0;
  font-family: var(--display);
  color: var(--navy);
  font-size: 1.2rem;
}
.roster-toolbar .muted { margin: 0.25rem 0 0; }
.roster-search {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.roster-search input,
.roster-search select {
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.roster-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  max-width: 100%;
  white-space: normal;
  font-size: 0.86rem;
  line-height: 1.25;
  flex: 0 1 auto;
  width: auto;
}
.roster-filter input[type="checkbox"] {
  width: auto;
  min-width: 1rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border-radius: 4px;
}
.roster-filter span {
  min-width: 0;
  flex: 0 1 auto;
}
.roster-wrap { max-height: min(52vh, 520px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.roster-table { font-size: 0.84rem; width: 100%; }
.roster-table th {
  position: sticky;
  top: 0;
  background: #f7f3eb;
  z-index: 1;
}
.roster-table td { vertical-align: top; white-space: normal; }
.roster-table .plot-cell {
  font-weight: 700;
  color: var(--navy);
  white-space: normal;
}
.roster-table .plot-section {
  font-weight: 500;
  font-size: 0.7rem;
  margin-top: 0.15rem;
}
.roster-table input,
.roster-table select {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  font-size: 0.84rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.roster-table .btn.compact { padding: 0.26rem 0.55rem; font-size: 0.78rem; }
.roster-table tr.is-dirty { background: rgba(196, 161, 90, 0.12); }
.roster-table tr.is-missing-phone td.plot-cell::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--gold-deep);
  vertical-align: middle;
}
.row-status {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
  min-height: 1em;
}
.revision-summary {
  max-width: 28rem;
  white-space: normal;
  line-height: 1.4;
}
.ledger-table th {
  position: sticky;
  top: 0;
  background: #f7f3eb;
  z-index: 1;
}
.ledger-table .row-actions,
.roster-table .row-actions { white-space: normal; }

/* Desktop / iPad: wrap each resident into a labeled field grid (no clipped columns) */
@media (min-width: 901px) {
  .roster-wrap {
    max-height: min(70vh, 780px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .roster-table.cardable-table {
    border-collapse: separate;
    border-spacing: 0 0.85rem;
  }
  .roster-table.cardable-table thead { display: none; }
  .roster-table.cardable-table tbody { display: block; }
  .roster-table.cardable-table tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.65rem 0.85rem;
    align-items: start;
    padding: 1rem 1.05rem;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #fffdf8, #f5f1e8);
    box-shadow: 0 8px 22px rgba(14, 24, 44, 0.06);
  }
  .roster-table.cardable-table tr.is-dirty {
    border-color: rgba(196, 161, 90, 0.55);
    background: rgba(196, 161, 90, 0.1);
  }
  .roster-table.cardable-table tr.is-empty-row {
    display: block;
    padding: 1rem;
    background: #fffdf8;
    box-shadow: none;
  }
  .roster-table.cardable-table tr.is-empty-row td {
    display: block;
    border: none;
    padding: 0;
  }
  .roster-table.cardable-table tr.is-empty-row td::before { content: none; }
  .roster-table.cardable-table td {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
    border: none;
    padding: 0;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .roster-table.cardable-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }
  .roster-table.cardable-table td.plot-cell {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding-bottom: 0.45rem;
    margin-bottom: 0.1rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.02rem;
  }
  .roster-table.cardable-table td.plot-cell::before { display: none; }
  .roster-table.cardable-table td.row-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding-top: 0.45rem;
    margin-top: 0.1rem;
    border-top: 1px solid var(--line);
  }
  .roster-table.cardable-table td.row-actions::before { display: none; }
  .roster-table.cardable-table input,
  .roster-table.cardable-table select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

#panel-admin .stack { max-width: 100%; }

.settings-block {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.settings-block h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  color: var(--navy);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 0.85rem 1rem;
  margin-top: 0.85rem;
  min-width: 0;
}
.settings-grid .span-2 { grid-column: 1 / -1; }
.inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.ops-status-panel {
  margin: 0.65rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.85);
  font-size: 0.88rem;
}
.ops-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr));
  gap: 0.55rem 0.85rem;
}
.ops-status-grid div {
  display: grid;
  gap: 0.12rem;
}
.ops-status-grid strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
}
.ops-settings-block h3 { margin-top: 0; }

.report-form fieldset.report-fields {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 0;
}
.report-form legend {
  padding: 0 0.35rem;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.9rem;
}
.report-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.45rem 0.75rem;
}
.report-field-grid .check {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin: 0;
}
.report-filters {
  margin-top: 0.25rem;
}

.ec-desk-head {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.1rem;
  align-items: stretch;
  margin-bottom: 1.35rem;
  padding: 1.15rem 1.25rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(196, 161, 90, 0.35);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(196, 161, 90, 0.16), transparent 52%),
    linear-gradient(135deg, #1a2a4a 0%, var(--navy) 48%, #1e3358 100%);
  box-shadow: 0 12px 28px rgba(14, 24, 44, 0.14);
  overflow: hidden;
  color: #f4efe4;
}
.ec-desk-head::after {
  content: "";
  position: absolute;
  inset: auto -12% -40% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 161, 90, 0.18), transparent 68%);
  pointer-events: none;
}
.ec-desk-head-mark {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  box-shadow: 0 0 0 1px rgba(196, 161, 90, 0.25);
}
.ec-desk-head-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.ec-desk-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.35rem;
}
.ec-desk-head .eyebrow {
  margin: 0;
  color: rgba(244, 220, 170, 0.92);
  letter-spacing: 0.16em;
}
.ec-desk-role-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 161, 90, 0.45);
  background: rgba(196, 161, 90, 0.16);
  color: #f7e7c2;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.panel-head.ec-desk-head h2 {
  margin: 0;
  color: #fffaf0;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ec-desk-colony {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(244, 239, 228, 0.78);
}
.ec-desk-motto {
  margin: 0.85rem 0 0;
  padding: 0.55rem 0 0.55rem 0.85rem;
  border-left: 2px solid rgba(196, 161, 90, 0.65);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  color: #f3e2b8;
  letter-spacing: 0.01em;
  line-height: 1.35;
}
.ec-desk-lede {
  margin: 0.75rem 0 0 !important;
  color: rgba(244, 239, 228, 0.68) !important;
  max-width: 54ch;
  line-height: 1.45;
}
.ec-desk-head a {
  color: #f0d79a;
  text-underline-offset: 2px;
}
.ec-desk-head a:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .ec-desk-head {
    padding: 1rem 1rem 1.05rem;
    gap: 0 0.85rem;
  }
  .ec-desk-motto {
    font-size: 0.98rem;
  }
}

.panel-head-lang {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.panel-head-copy {
  min-width: 0;
  flex: 1 1 12rem;
}
.lang-toggle,
.author-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.9);
  flex: 0 0 auto;
}
.lang-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-width: 2.2rem;
  height: 2rem;
  padding: 0 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn .lang-glyph {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}
.lang-btn.is-active {
  background: var(--navy);
  color: #f7f3eb;
}
.lang-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.form-lang-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
}
.form-lang-row h3 { margin: 0; }
.lang-section-wrap { position: relative; }
.lang-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: stretch;
  min-height: 12rem;
}
.lang-overlay[hidden] { display: none !important; }
.lang-overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(14, 24, 44, 0.28);
  backdrop-filter: blur(1.5px);
}
.lang-overlay-panel {
  position: relative;
  z-index: 1;
  margin: 0.35rem;
  max-height: min(72vh, 100%);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(196, 161, 90, 0.45);
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 18px 40px rgba(14, 24, 44, 0.18);
  padding: 0.85rem 0.95rem 1rem;
}
.lang-overlay-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.lang-overlay-head h3 {
  margin: 0;
  font-family: var(--display);
  color: var(--navy);
  font-size: 1.05rem;
}
.lang-overlay-body { display: grid; gap: 0.75rem; }
.lang-overlay-card {
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(245, 241, 232, 0.92));
}
.lang-overlay-card h4 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  color: var(--navy);
  font-size: 1.02rem;
}
.lang-overlay-card .meta {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.lang-overlay-card .body { white-space: pre-wrap; line-height: 1.45; }
.lang-overlay-empty { margin: 0; color: var(--muted); font-style: italic; }
.lang-missing { color: var(--muted); font-size: 0.88rem; }
.lang-auto-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 161, 90, 0.45);
  background: rgba(196, 161, 90, 0.14);
  color: var(--gold-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.mailbox-reply .author-lang-toggle { margin-bottom: 0.35rem; }

@media (max-width: 640px) {
  .lang-btn .lang-label { display: none; }
  .lang-overlay-panel {
    margin: 0.2rem;
    max-height: min(78vh, 100%);
  }
}

.sensitive-ops {
  margin: 0 0 1rem;
  padding: 0.95rem 1.05rem 1.1rem;
  border: 1px solid rgba(21, 35, 63, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(255, 250, 242, 0.9));
  box-shadow: 0 10px 28px rgba(14, 24, 44, 0.05);
}
.sensitive-ops > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  color: var(--navy);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
  align-items: baseline;
}
.sensitive-ops > summary::-webkit-details-marker { display: none; }
.sensitive-ops > summary::before {
  content: "";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-right: 0.15rem;
  border-radius: 999px;
  border: 1px solid rgba(21, 35, 63, 0.16);
  background: rgba(21, 35, 63, 0.08);
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 0.55rem 2px, 2px 0.55rem;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--navy);
  flex-shrink: 0;
  transition: transform 0.18s ease, background-size 0.18s ease;
}
.sensitive-ops[open] > summary::before {
  background-size: 0.55rem 2px, 0 0;
  transform: none;
}
.sensitive-ops:not([open]) > summary::before {
  transform: none;
}
.sensitive-ops > summary .muted {
  font-size: 0.78rem;
  font-family: var(--sans, inherit);
}
.roles-members-list {
  display: grid;
  gap: 1rem;
}
.roles-member-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.roles-member-head {
  margin-bottom: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
}
.roles-member-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  align-items: baseline;
  min-width: 0;
}

.notice-title {
  display: block;
}
.info-doc-card-title,
.notice-draft-card-title,
.grievance-card-title {
  display: block;
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mobile-fold {
  min-width: 0;
  max-width: 100%;
}
.mobile-fold-body {
  min-width: 0;
  max-width: 100%;
}
.mobile-fold-head {
  display: contents;
}
.mobile-fold-chevron {
  display: none;
}
.mobile-section-body {
  display: block;
}
.is-list-hidden {
  display: none !important;
}
.list-show-more {
  width: 100%;
  margin: 0.35rem 0 0.15rem;
}

@media (max-width: 900px) {
  body.is-authed {
    height: 100dvh;
    overflow: hidden;
  }
  body.is-authed .app-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
  }
  body.is-authed .app-top {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    z-index: 30;
    margin-bottom: 8px;
  }
  body.is-authed .app-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  html {
    scroll-padding-top: calc(var(--app-top-offset, 118px) + env(safe-area-inset-top, 0px) + 6px);
  }
  .app-main > .panel > .panel-head,
  .mobile-section-body,
  .mobile-fold-body,
  .ledger-dialog {
    scroll-margin-top: calc(var(--app-top-offset, 118px) + env(safe-area-inset-top, 0px) + 8px);
  }
  .app-top {
    background: rgba(255, 252, 246, 0.96);
  }

  .mobile-fold-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-fold-head-main {
    flex: 1 1 auto;
    min-width: 0;
  }
  .mobile-fold-chevron {
    display: inline-flex;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    margin-top: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(21, 35, 63, 0.12);
    border: 1px solid rgba(21, 35, 63, 0.18);
    color: var(--navy);
    box-shadow: 0 2px 8px rgba(14, 24, 44, 0.08);
    transition: transform 0.18s ease, background 0.18s ease;
  }
  .mobile-fold-chevron::before {
    content: "";
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -0.12rem;
  }
  .mobile-fold.is-open .mobile-fold-chevron {
    transform: none;
  }
  .mobile-fold.is-open .mobile-fold-chevron::before {
    transform: rotate(225deg);
    margin-top: 0.12rem;
  }
  .mobile-fold:not(.is-open) .mobile-fold-body {
    display: none;
  }
  .mobile-fold.is-open .mobile-fold-body {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
  }

  .info-doc-card .info-doc-card-title,
  .info-doc-card-row,
  .info-doc-badges,
  .info-doc-card .meta {
    text-align: left;
    justify-items: start;
    justify-content: flex-start;
  }

  .roster-block,
  .desk-tablet {
    margin-bottom: 0.7rem;
    padding: 0.75rem 0.8rem 0.85rem;
    border-radius: 14px;
  }
  .roster-toolbar,
  .mailbox-toolbar,
  .ledger-toolbar,
  .obs-toolbar,
  .info-toolbar,
  .works-toolbar {
    gap: 0.28rem 0.4rem;
    margin: 0 0 0.28rem;
    padding: 0.28rem 0.38rem 0.32rem;
    border-radius: 10px;
    background: rgba(21, 35, 63, 0.035);
    align-items: end;
  }
  .roster-toolbar h3,
  .mailbox-toolbar h3 {
    font-size: 0.96rem;
    line-height: 1.15;
    margin: 0;
  }
  .roster-toolbar .muted,
  .mailbox-toolbar .panel-head p,
  .mailbox-toolbar .muted {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.2;
  }
  .mailbox-toolbar .panel-head {
    margin: 0;
    padding: 0;
  }
  .roster-toolbar label,
  .mailbox-toolbar label,
  .ledger-toolbar label,
  .obs-toolbar label,
  .info-toolbar label,
  .works-toolbar label {
    gap: 0.06rem;
    font-size: 0.65rem;
    margin: 0;
    line-height: 1.1;
  }
  .roster-toolbar input,
  .roster-toolbar select,
  .mailbox-toolbar input,
  .mailbox-toolbar select,
  .ledger-toolbar input,
  .obs-toolbar input,
  .obs-toolbar select,
  .info-toolbar input,
  .info-toolbar select,
  .works-toolbar input,
  .works-toolbar select {
    padding: 0.32rem 0.48rem;
    font-size: 0.8rem;
    min-height: 32px;
    border-radius: 8px;
  }
  .roster-toolbar > button,
  .mailbox-toolbar > button,
  .ledger-toolbar > button,
  .obs-toolbar > button,
  .info-toolbar > button,
  .works-toolbar > button {
    min-height: 32px;
    padding: 0.34rem 0.62rem;
    font-size: 0.78rem;
  }

  .mailbox-toolbar,
  .obs-toolbar,
  .info-toolbar,
  .works-toolbar,
  .proceedings-register-toolbar,
  .grievance-ec-block > .roster-toolbar,
  .roster-toolbar:has(> .roster-search + .roster-search) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
  .mailbox-toolbar .panel-head {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 0.06rem;
    margin: 0;
    padding: 0;
    grid-column: 1 / -1;
  }
  .mailbox-toolbar .panel-head h3 {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.96rem;
    line-height: 1.15;
  }
  .mailbox-toolbar .panel-head p {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.2;
  }
  .mailbox-toolbar .panel-head,
  .mailbox-toolbar > button,
  .obs-toolbar > button,
  .info-toolbar > button,
  .works-toolbar > button,
  .grievance-ec-block > .roster-toolbar > div:first-child,
  .grievance-ec-block > .roster-toolbar > button,
  .roster-toolbar > div:first-child,
  .roster-toolbar > button:only-of-type,
  .ledger-toolbar > .ledger-search,
  .ledger-toolbar > p {
    grid-column: 1 / -1;
  }
  .roster-toolbar-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.45rem;
    align-items: end;
  }
  .roster-toolbar-actions .roster-search {
    grid-column: 1 / -1;
  }
  .roster-toolbar > *,
  .roster-toolbar-actions > * {
    width: auto;
    max-width: none;
  }

  .mobile-fold-head-main .notice-head {
    display: block;
    width: 100%;
  }
  .mobile-fold-head-main .grievance-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.4rem 0.55rem;
    align-items: start;
    width: 100%;
  }
  .mobile-fold-head-main .grievance-card-head .person-avatar {
    grid-row: 1 / span 2;
  }
  .mobile-fold-head-main .grievance-card-head .grievance-badge {
    grid-column: 2;
    justify-self: start;
  }
  .mobile-fold-head-main .notice-title,
  .mobile-fold-head-main .grievance-card-title {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-fold-head-main .notice-badges,
  .mobile-fold-head-main .grievance-badge,
  .mobile-fold-head-main .meta,
  .mobile-fold-head-main .grievance-meta {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notice-list,
  .grievance-list,
  .info-doc-list,
  .works-list,
  .notice-draft-list {
    gap: 0.65rem;
  }
  .notice,
  .grievance-card,
  .info-doc-card,
  .works-card,
  .notice-draft-card {
    padding: 0.65rem 0.72rem;
    min-width: 0;
    max-width: 100%;
  }
  .grievance-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

@media (min-width: 901px) {
  .tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-right: 2px;
    scroll-snap-type: none;
  }
  .app-top-nav::after { display: none; }
  .tab-long { display: inline; }
  .tab-short { display: none; }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100%, calc(100% - 8px));
    padding: 6px 0 calc(20px + env(safe-area-inset-bottom));
  }
  body.is-authed .app-shell {
    width: min(100%, calc(100% - 4px));
    padding: max(4px, env(safe-area-inset-top)) 2px max(2px, env(safe-area-inset-bottom));
  }
  .app-foot {
    margin: 0.35rem auto 0;
    padding: 0.1rem 0.2rem 0;
  }
  .app-foot .gate-managed-logo {
    height: 14px;
  }
  .app-top {
    position: sticky;
    top: max(0px, env(safe-area-inset-top));
    z-index: 30;
    gap: 6px;
    padding: 6px 8px 8px;
    margin-bottom: 8px;
  }
  body.is-authed .app-top {
    position: relative;
    top: auto;
    margin-bottom: 6px;
  }
  .app-top-bar { gap: 8px; }
  .app-top-actions .btn.compact {
    padding: 0.28rem 0.65rem;
    font-size: 0.76rem;
  }
  .notify-bell {
    width: 34px;
    height: 34px;
  }
  .tab {
    padding: 0.4rem 0.7rem;
    min-height: 34px;
    font-size: 0.78rem;
  }
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .app-main {
    padding: 0.75rem 0.7rem 1rem;
    border-radius: 14px;
    min-width: 0;
  }
  body.is-authed .app-main {
    border-radius: 12px;
  }
  .stack,
  .stack.narrow,
  #settingsForm,
  .settings-block,
  .settings-grid {
    min-width: 0;
    max-width: 100%;
  }
  .stack.narrow {
    max-width: 100%;
  }
  .app-main .stack > .btn,
  .app-main form > .btn,
  .app-main .btn-row .btn,
  .settings-block .btn,
  #settingsForm .btn,
  #noticeForm .btn,
  #grievanceForm .btn,
  #ledgerImportForm .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
  }
  .app-main code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .panel-head h2, .panel-head h3 {
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  }
  .seal-ring { width: clamp(168px, 58vw, 228px); }
  .seal { width: 100%; }


  .pay-card-body { grid-template-columns: 1fr; }
  .pay-qr { width: min(160px, 55vw); justify-self: start; }
  .dues-bill-head strong,
  .ledger-card-due strong {
    font-size: 1.5rem;
  }
  .bank-qr-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span-2 { grid-column: auto; }
  .works-row {
    grid-template-columns: 1fr;
  }
  .works-row .btn.compact {
    width: 100%;
    justify-self: stretch;
  }

  .ledger-dialog {
    width: min(560px, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1rem);
    margin: max(0.5rem, env(safe-area-inset-top)) auto max(0.5rem, env(safe-area-inset-bottom));
    padding: 1rem 0.95rem 1.1rem;
  }
  .draft-share-row {
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "check avatar text"
      "access access access";
    gap: 0.45rem 0.55rem;
  }
  .draft-share-row input[type="checkbox"] { grid-area: check; }
  .draft-share-row .person-avatar { grid-area: avatar; }
  .draft-share-row .share-member-text { grid-area: text; }
  .draft-share-row .share-access {
    grid-area: access;
    width: 100%;
    min-width: 0;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .btn-row .btn {
    width: 100%;
    flex: none;
    min-height: 34px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }
  .notice-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }
  .notice-action-btn {
    width: 2.05rem;
    height: 2.05rem;
  }
  .mailbox-status-pick {
    max-width: none;
    width: 100%;
  }
  .grievance-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .obs-columns { grid-template-columns: 1fr; }

  /* Wide tables → stacked labeled cards */
  .roster-wrap {
    max-height: none;
    overflow: visible;
    border: none;
    border-radius: 0;
    background: transparent;
  }
  .ledger-wrap { display: none; }
  .ledger-cards {
    display: grid;
    gap: 0.75rem;
  }
  .table-wrap {
    overflow-x: visible;
    margin-left: 0;
    margin-right: 0;
  }
  .cardable-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
  }
  .cardable-table thead { display: none; }
  .cardable-table tbody { display: block; }
  .cardable-table tr {
    display: grid;
    gap: 0.55rem;
    padding: 0.9rem 0.95rem 1rem;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #fffdf8, #f5f1e8);
    box-shadow: 0 8px 22px rgba(14, 24, 44, 0.06);
  }
  .cardable-table tr.is-dirty {
    border-color: rgba(196, 161, 90, 0.55);
    box-shadow: inset 3px 0 0 var(--gold-deep);
  }
  .cardable-table tr.is-empty-row {
    display: block;
    padding: 1rem;
    background: transparent;
    box-shadow: none;
    border-style: dashed;
  }
  .cardable-table tr.is-empty-row td {
    display: block;
    padding: 0;
    border: 0;
  }
  .cardable-table tr.is-empty-row td::before { content: none; }
  .cardable-table td {
    display: grid;
    grid-template-columns: minmax(5.5rem, 32%) minmax(0, 1fr);
    gap: 0.45rem 0.7rem;
    align-items: center;
    padding: 0;
    border: 0;
    white-space: normal;
    min-width: 0;
  }
  .cardable-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.25;
  }
  .cardable-table td.plot-cell {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding-bottom: 0.35rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
  }
  .cardable-table td.row-actions {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding-top: 0.35rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--line);
  }
  .cardable-table td.row-actions::before { display: none; }
  .cardable-table td.row-actions .btn {
    width: 100%;
  }
  .cardable-table input,
  .cardable-table select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  .cardable-table .revision-summary {
    max-width: none;
    font-size: 0.82rem;
  }
}

@media (max-width: 640px) {
  .gate-shell {
    width: min(100%, calc(100% - 16px));
    padding: 24px 0 40px;
  }
  /* Roster: drop section under plot on phones */
  .roster-table .plot-section {
    display: none;
  }
  .gate-card {
    padding: 1.15rem 1rem 1.35rem;
  }
  .brand-mini .seal-mini {
    width: 36px;
    height: 36px;
  }
  .brand-mini strong { font-size: 0.88rem; }
  .chip {
    max-width: min(16rem, 52vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dues-bill-head strong,
  .ledger-card-due strong {
    font-size: 1.42rem;
  }
  .info-source .check,
  label.check {
    align-items: flex-start;
    width: 100%;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .cardable-table td {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* —— Messages + push —— */
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.28rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.msg-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
  gap: 0;
  min-height: min(70vh, 640px);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 252, 246, 0.9);
}
.msg-sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(245, 240, 230, 0.55);
}
.msg-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.4rem;
}
.msg-sidebar-head h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--navy);
}
.msg-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.msg-official-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5c3d12;
  background: #f0d9a8;
  vertical-align: middle;
}
.msg-group-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  background: #dfe8f2;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  flex: 0 0 auto;
}
.msg-manage-menu,
.msg-cleanup-menu {
  position: relative;
}
.msg-manage-menu > summary {
  list-style: none;
  cursor: pointer;
}
.msg-manage-menu > summary::-webkit-details-marker { display: none; }
.msg-manage-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 8;
  display: grid;
  gap: 0.25rem;
  min-width: 11rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 10px 28px rgba(14, 24, 44, 0.12);
}
.msg-manage-panel .btn {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}
.msg-channel-dialog {
  max-width: 28rem;
  width: calc(100vw - 1.5rem);
}
.msg-people-results {
  max-height: 10rem;
  overflow: auto;
  border: 1px solid rgba(20, 40, 70, 0.12);
  border-radius: 0.4rem;
  background: #fff;
}
.msg-people-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}
.msg-people-results button:hover {
  background: rgba(20, 40, 70, 0.06);
}
.msg-people-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}
.msg-chip {
  border: 1px solid rgba(20, 40, 70, 0.18);
  background: #f4f1ea;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.msg-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
}
.msg-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.2rem;
  border-bottom: 1px solid rgba(20, 40, 70, 0.08);
}
.msg-group-icon {
  object-fit: cover;
  border-radius: 0.45rem;
}
.msg-theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}
.msg-theme-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(21, 35, 63, 0.14);
  background: rgba(255, 252, 246, 0.75);
  color: #3a465c;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.msg-theme-chip:hover {
  background: rgba(255, 252, 246, 0.95);
  border-color: rgba(21, 35, 63, 0.28);
}
.msg-theme-chip.is-active {
  border-color: var(--navy);
  color: var(--navy);
  background: rgba(21, 35, 63, 0.08);
  box-shadow: 0 0 0 1px rgba(21, 35, 63, 0.2);
}
.msg-theme-chip[data-theme="notice"].is-active { color: #2f5f8a; border-color: #3b6ea5; }
.msg-theme-chip[data-theme="urgent"].is-active { color: #9a3030; border-color: #b33a3a; }
.msg-theme-chip[data-theme="celebrate"].is-active { color: #9a6a12; border-color: #c48a1a; }
.msg-theme-chip[data-theme="official"].is-active { color: #2a5a38; border-color: #2f5d3a; }
.msg-theme-chip[data-theme="thanks"].is-active { color: #5a3f8a; border-color: #6b4ea2; }
.msg-card-theme-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-bottom: 0.3rem;
  border-radius: 999px;
  color: inherit;
  background: rgba(20, 40, 70, 0.1);
}
.msg-card-theme-badge svg {
  display: block;
}
.msg-bubble {
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid rgba(21, 35, 63, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.msg-bubble.is-mine {
  background: rgba(255, 246, 225, 0.82);
  border-color: rgba(196, 161, 90, 0.22);
}
.msg-bubble.theme-notice {
  border-left: 3px solid #3b6ea5;
  background: rgba(238, 245, 251, 0.88);
}
.msg-bubble.theme-urgent {
  border-left: 3px solid #b33a3a;
  background: rgba(252, 238, 238, 0.9);
}
.msg-bubble.theme-celebrate {
  border-left: 3px solid #c48a1a;
  background: rgba(255, 246, 228, 0.9);
}
.msg-bubble.theme-official {
  border-left: 3px solid #2f5d3a;
  background: rgba(234, 244, 236, 0.9);
}
.msg-bubble.theme-thanks {
  border-left: 3px solid #6b4ea2;
  background: rgba(243, 238, 249, 0.9);
}
.msg-feed {
  position: relative;
  isolation: isolate;
  background-color: transparent;
  background-size: cover;
  background-position: center;
}
.msg-feed > * {
  position: relative;
  z-index: 1;
}
.msg-feed.has-room-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 246, 0.52),
    rgba(255, 250, 242, 0.62) 45%,
    rgba(248, 244, 236, 0.7)
  );
}
.msg-feed.msg-bg-soft {
  background-image: linear-gradient(160deg, rgba(232, 238, 245, 0.55), rgba(250, 246, 238, 0.6));
}
.msg-feed.msg-bg-dots {
  background-image: radial-gradient(rgba(20, 40, 70, 0.08) 1.2px, transparent 1.3px);
  background-size: 14px 14px;
  background-color: #f7f4ee;
}
.msg-feed.msg-bg-grid {
  background-image:
    linear-gradient(rgba(20, 40, 70, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 40, 70, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  background-color: #f8f6f1;
}
.msg-feed.msg-bg-tiles {
  background-image:
    linear-gradient(45deg, rgba(20, 40, 70, 0.03) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(20, 40, 70, 0.03) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(20, 40, 70, 0.03) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(20, 40, 70, 0.03) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  background-color: #f5f1e8;
}
.msg-feed.msg-bg-diagonal {
  background-image: repeating-linear-gradient(
    -35deg,
    rgba(20, 40, 70, 0.035),
    rgba(20, 40, 70, 0.035) 8px,
    transparent 8px,
    transparent 16px
  );
  background-color: #f6f3ec;
}
.msg-feed.msg-bg-leaves {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(70, 120, 80, 0.08), transparent 42%),
    radial-gradient(circle at 80% 0%, rgba(120, 140, 70, 0.07), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(60, 100, 70, 0.06), transparent 45%);
  background-color: #f3f6f1;
}
.msg-feed.msg-bg-custom {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.msg-feed.msg-bg-custom.has-room-bg::before {
  background: linear-gradient(
    180deg,
    rgba(255, 252, 246, 0.58),
    rgba(255, 250, 242, 0.68) 40%,
    rgba(248, 244, 236, 0.76)
  );
}
.msg-feed.has-room-bg .msg-bubble {
  background: rgba(255, 252, 246, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 6px 18px rgba(14, 24, 44, 0.06);
}
.msg-feed.has-room-bg .msg-bubble.is-mine {
  background: rgba(255, 246, 225, 0.9);
}
.msg-feed.has-room-bg .msg-bubble.theme-notice { background: rgba(238, 245, 251, 0.92); }
.msg-feed.has-room-bg .msg-bubble.theme-urgent { background: rgba(252, 238, 238, 0.93); }
.msg-feed.has-room-bg .msg-bubble.theme-celebrate { background: rgba(255, 246, 228, 0.93); }
.msg-feed.has-room-bg .msg-bubble.theme-official { background: rgba(234, 244, 236, 0.93); }
.msg-feed.has-room-bg .msg-bubble.theme-thanks { background: rgba(243, 238, 249, 0.93); }
.msg-look-section {
  display: grid;
  gap: 0.55rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(20, 40, 70, 0.08);
}
.msg-look-section h4 {
  margin: 0;
  font-size: 0.9rem;
}
.msg-look-icon-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.msg-channel-icon-preview,
.msg-channel-icon-fallback {
  width: 3rem;
  height: 3rem;
  border-radius: 0.55rem;
  object-fit: cover;
}
.msg-channel-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dfe8f2;
  color: var(--navy);
  font-weight: 700;
}
.msg-bg-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.msg-bg-preset {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(20, 40, 70, 0.14);
  border-radius: 0.45rem;
  background: #fff;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.8rem;
}
.msg-bg-preset.is-active {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
}
.msg-bg-swatch {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.3rem;
  border: 1px solid rgba(20, 40, 70, 0.12);
  flex: 0 0 auto;
}
.msg-bg-swatch.msg-bg-none { background: #fff; }
.msg-bg-swatch.msg-bg-soft { background: linear-gradient(160deg, #e8eef5, #faf6ee); }
.msg-bg-swatch.msg-bg-dots {
  background-color: #f7f4ee;
  background-image: radial-gradient(rgba(20, 40, 70, 0.25) 1px, transparent 1.2px);
  background-size: 6px 6px;
}
.msg-bg-swatch.msg-bg-grid {
  background-color: #f8f6f1;
  background-image:
    linear-gradient(rgba(20, 40, 70, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 40, 70, 0.18) 1px, transparent 1px);
  background-size: 8px 8px;
}
.msg-bg-swatch.msg-bg-tiles { background: repeating-conic-gradient(#e7e0d2 0% 25%, #f5f1e8 0% 50%) 50% / 10px 10px; }
.msg-bg-swatch.msg-bg-diagonal {
  background: repeating-linear-gradient(-35deg, #ddd6c8, #ddd6c8 3px, #f6f3ec 3px, #f6f3ec 7px);
}
.msg-bg-swatch.msg-bg-leaves { background: radial-gradient(circle at 30% 30%, #cfe0d1, #f3f6f1 70%); }
.msg-bg-swatch.msg-bg-custom {
  background: linear-gradient(135deg, #9aa7b8, #d7c7a8);
}
.msg-new-dm {
  display: block;
  position: relative;
  padding: 0 0.75rem 0.55rem;
}
.msg-peer-search-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.msg-peer-search-row input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.msg-peer-cancel {
  flex: 0 0 auto;
}
.msg-peer-results {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  margin-top: 2px;
  max-height: 240px;
  overflow: auto;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(14, 24, 44, 0.12);
}
.msg-peer-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: #f7f2e8;
  position: sticky;
  top: 0;
  z-index: 1;
}
.msg-peer-results-head .muted {
  font-size: 0.72rem;
}
.msg-peer-results button[data-house-id] {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.7rem;
  font: inherit;
  cursor: pointer;
  color: var(--navy);
}
.msg-peer-results button[data-house-id]:hover,
.msg-peer-results button[data-house-id]:focus-visible {
  background: rgba(21, 35, 63, 0.06);
}
.msg-peer-results .msg-peer-empty {
  padding: 0.65rem 0.7rem;
  margin: 0;
}
.msg-thread-list {
  flex: 1;
  overflow: auto;
  padding: 0.25rem 0.45rem 0.75rem;
}
.msg-thread-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.msg-thread-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.msg-thread-item:hover,
.msg-thread-item.is-active {
  background: rgba(21, 35, 63, 0.07);
}
.msg-thread-item strong {
  font-size: 0.86rem;
  color: var(--navy);
}
.msg-thread-item .msg-preview {
  font-size: 0.72rem;
  color: var(--ink-muted, #5c6578);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-thread-item .msg-unread {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-deep);
}
.msg-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.msg-conversation-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(21, 35, 63, 0.08);
  background: rgba(255, 252, 246, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 4;
}
.msg-head-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0 !important;
  border-radius: 999px !important;
  flex: 0 0 auto;
}
.msg-conversation-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}
.msg-head-avatar {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.65rem;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #dfe8f2, #c9d7e8);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
}
.msg-head-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.msg-head-avatar .person-avatar {
  width: 100%;
  height: 100%;
  border: 0;
  box-shadow: none;
}
.msg-head-avatar.is-round {
  border-radius: 999px;
}
.msg-conversation-titles {
  flex: 1 1 auto;
  min-width: 0;
}
.msg-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.msg-conversation-head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-official-chip {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(47, 93, 58, 0.14);
  color: #2a5a38;
}
.msg-conversation-meta,
#msgConversationMeta {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-channel-tools {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem;
  justify-content: flex-end;
}
.msg-more-menu {
  position: relative;
}
.msg-more-menu > summary {
  list-style: none;
  cursor: pointer;
}
.msg-more-menu > summary::-webkit-details-marker { display: none; }
.msg-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 12;
  display: grid;
  gap: 0.15rem;
  min-width: 13.5rem;
  max-width: min(18rem, 80vw);
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 12px 32px rgba(14, 24, 44, 0.14);
}
.msg-more-panel .btn {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}
.msg-more-divider {
  height: 1px;
  margin: 0.25rem 0.15rem;
  background: rgba(21, 35, 63, 0.1);
}
.msg-more-label {
  margin: 0.15rem 0.35rem 0.05rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted, #5c6578);
}
.msg-cleanup-menu {
  position: relative;
}
.msg-cleanup-menu > summary {
  list-style: none;
  cursor: pointer;
}
.msg-cleanup-menu > summary::-webkit-details-marker { display: none; }
.msg-cleanup-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 8;
  display: grid;
  gap: 0.25rem;
  min-width: 13.5rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 10px 28px rgba(14, 24, 44, 0.12);
}
.msg-cleanup-panel .btn {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}
.msg-cleanup-danger {
  color: #8a2f2f;
}
.msg-author-actions,
.msg-mod-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
}
.msg-edit-form {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.msg-edit-form textarea {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  border-radius: 10px;
  border: 1px solid rgba(45, 110, 130, 0.28);
  padding: 0.45rem 0.55rem;
  box-sizing: border-box;
}
.msg-pinned {
  margin: 0.55rem 0.9rem 0;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--gold-deep);
  background: rgba(196, 161, 90, 0.12);
  font-size: 0.82rem;
}
.msg-feed {
  position: relative;
  isolation: isolate;
  flex: 1;
  overflow: auto;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  max-width: 100%;
}
.msg-row.is-mine {
  flex-direction: row-reverse;
  align-self: stretch;
}
.msg-row .msg-avatar {
  flex: 0 0 auto;
  margin-bottom: 0.15rem;
}
.msg-ai-glyph {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.person-avatar.is-ai-avatar {
  background: transparent;
  border: 0;
  box-shadow:
    0 0 0 1.5px rgba(232, 200, 120, 0.55),
    0 2px 8px rgba(26, 58, 82, 0.22);
  overflow: hidden;
}
.person-avatar.is-ai-avatar .ai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.msg-thread-item.is-ai-thread .is-ai-avatar {
  box-shadow:
    0 0 0 1.5px rgba(232, 200, 120, 0.65),
    0 0 10px rgba(45, 110, 130, 0.28);
}
.msg-bubble {
  max-width: min(34rem, calc(100% - 2.4rem));
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.82);
  border: 1px solid rgba(21, 35, 63, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.msg-bubble.is-mine {
  background: rgba(255, 246, 225, 0.88);
  border-color: rgba(196, 161, 90, 0.24);
}
.msg-bubble.is-ai {
  background: linear-gradient(160deg, rgba(214, 232, 242, 0.9), rgba(232, 244, 236, 0.88));
  border-color: rgba(45, 110, 130, 0.18);
}
.msg-row.is-ai .msg-meta {
  color: #2d5a6a;
}
.msg-bubble.is-hidden {
  opacity: 0.55;
  font-style: italic;
}
.msg-bubble .msg-meta {
  font-size: 0.68rem;
  color: var(--ink-muted, #5c6578);
  margin-bottom: 0.2rem;
}
.msg-bubble .msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.35;
}
.msg-bubble .msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.msg-bubble .msg-attachments a {
  display: block;
}
.msg-bubble .msg-attachments img {
  max-width: min(220px, 70vw);
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
}
.msg-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.msg-like {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--ink-muted, #5c6578);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.2rem;
  cursor: pointer;
  border-radius: 6px;
}
.msg-like:hover,
.msg-like.is-active {
  color: var(--gold-deep);
}
.msg-like:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.msg-thread-item.is-ai-thread strong {
  color: #2d5a6a;
}
.msg-attachments .msg-att-open {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
}
.msg-attachments .msg-att-open img {
  display: block;
  max-width: min(220px, 70vw);
  max-height: 180px;
  object-fit: cover;
}
.msg-compose {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0.9rem 0.85rem;
  display: grid;
  gap: 0.4rem;
}
.msg-leave-bar {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #f7f2e8);
}
.msg-back-bottom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.55rem;
  padding: 0.35rem 0.95rem 0.35rem 0.65rem;
  border: 1px solid rgba(21, 35, 63, 0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(14, 24, 44, 0.08);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
}
.msg-back-bottom:hover,
.msg-back-bottom:focus-visible {
  background: var(--navy);
  color: #fffdf8;
  border-color: var(--navy);
  outline: none;
}
.msg-back-bottom:active {
  transform: scale(0.98);
}
.msg-compose textarea {
  width: 100%;
  resize: vertical;
  min-height: 2.6rem;
}
.msg-compose-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.msg-attach-label {
  cursor: pointer;
}
.msg-attach-hint {
  font-size: 0.72rem;
  line-height: 1.25;
  max-width: min(100%, 18rem);
}
.msg-attach-hint.is-error {
  color: #8a2f2f;
}
.msg-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  max-height: 120px;
  overflow: auto;
}
.msg-emoji-picker button {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.2rem;
  cursor: pointer;
  border-radius: 6px;
}
.msg-emoji-picker button:hover {
  background: rgba(21, 35, 63, 0.06);
}
.push-prefs {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  display: grid;
  gap: 0.35rem;
}
.push-prefs legend {
  padding: 0 0.35rem;
  font-weight: 600;
  color: var(--navy);
}
@media (max-width: 820px) {
  .msg-layout {
    grid-template-columns: 1fr;
    min-height: min(75vh, 700px);
  }
  .msg-layout.is-thread-open .msg-sidebar { display: none; }
  .msg-layout:not(.is-thread-open) .msg-main { display: none; }
  .msg-sidebar { border-right: 0; }
  .msg-layout.is-thread-open .msg-leave-bar {
    display: flex;
  }
  .msg-layout.is-thread-open .msg-compose {
    border-top: 0;
    padding-top: 0.35rem;
  }
  .msg-layout.is-thread-open .msg-leave-bar + .msg-compose:not([hidden]) {
    padding-top: 0.35rem;
  }
}

/* Visitor parking pass — plastic card in Pass area */
.parking-card-list {
  display: grid;
  gap: 1.1rem;
  justify-items: center;
}
.parking-card {
  position: relative;
  width: min(100%, 22.6rem);
  aspect-ratio: 1.586 / 1;
  border-radius: 18px;
  color: var(--cream);
  box-shadow: 0 18px 40px rgba(14, 24, 44, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden;
  padding: 0.85rem 1rem 0.9rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}
/* Member — navy + gold */
.parking-card.is-member {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(232, 213, 154, 0.38), transparent 48%),
    linear-gradient(145deg, #3a2e16 0%, #1a2744 38%, #0e182c 100%);
}
.parking-card.is-member .parking-card-brand { color: #e8d59a; }
.parking-card.is-member .parking-card-chip {
  background: linear-gradient(135deg, #f3e6b8, #c4a15a 40%, #8d6b2e);
}
.parking-card.is-member .parking-card-badge { background: #c4a15a; color: #15233f; }
.parking-card.is-member .parking-card-stripe {
  background: repeating-linear-gradient(
    90deg,
    #3a2e16 0 10px,
    #c4a15a 10px 12px,
    #1a1408 12px 22px
  );
}
/* Tenant — forest green */
.parking-card.is-tenant {
  background:
    radial-gradient(120% 80% at 0% 100%, rgba(146, 196, 150, 0.32), transparent 50%),
    linear-gradient(145deg, #1e3d2a 0%, #143322 42%, #0b1f16 100%);
}
.parking-card.is-tenant .parking-card-brand { color: #b7ddb8; }
.parking-card.is-tenant .parking-card-chip {
  background: linear-gradient(135deg, #cfe8d0, #5a9a62 40%, #2d5c36);
}
.parking-card.is-tenant .parking-card-badge { background: #4d8f57; color: #f6f1e6; }
.parking-card.is-tenant .parking-card-stripe {
  background: repeating-linear-gradient(
    90deg,
    #143322 0 10px,
    #5a9a62 10px 12px,
    #0b1f16 12px 22px
  );
}
/* Visitor — copper / terracotta */
.parking-card.is-visitor {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(232, 168, 124, 0.34), transparent 46%),
    linear-gradient(145deg, #5a2a1c 0%, #3d1c18 42%, #1c1010 100%);
}
.parking-card.is-visitor .parking-card-brand { color: #f0c4a8; }
.parking-card.is-visitor .parking-card-chip {
  background: linear-gradient(135deg, #f3d0b8, #c46a3a 40%, #8a3d22);
}
.parking-card.is-visitor .parking-card-badge { background: #c46a3a; color: #fff8f2; }
.parking-card.is-visitor .parking-card-stripe {
  background: repeating-linear-gradient(
    90deg,
    #3d1c18 0 10px,
    #c46a3a 10px 12px,
    #1c1010 12px 22px
  );
}
/* Ad-hoc gate — slate / amber */
.parking-card.is-adhoc {
  background:
    radial-gradient(120% 80% at 100% 100%, rgba(212, 175, 90, 0.28), transparent 48%),
    linear-gradient(145deg, #3a3428 0%, #252018 42%, #14110d 100%);
}
.parking-card.is-adhoc .parking-card-brand { color: #e8d4a0; }
.parking-card.is-adhoc .parking-card-chip {
  background: linear-gradient(135deg, #efe0b8, #b8923f 40%, #6f5520);
}
.parking-card.is-adhoc .parking-card-badge { background: #b8923f; color: #1a150c; }
.parking-card.is-adhoc .parking-card-stripe {
  background: repeating-linear-gradient(
    90deg,
    #2a2418 0 10px,
    #b8923f 10px 12px,
    #14110d 12px 22px
  );
}
/* Household staff — plum */
.parking-card.is-staff {
  background:
    radial-gradient(120% 80% at 100% 100%, rgba(196, 168, 220, 0.32), transparent 48%),
    linear-gradient(145deg, #3a2a48 0%, #241830 42%, #140e1c 100%);
}
.parking-card.is-staff .parking-card-brand { color: #d4b8e8; }
.parking-card.is-staff .parking-card-chip {
  background: linear-gradient(135deg, #ead6f4, #7a5a9e 40%, #3d2a52);
}
.parking-card.is-staff .parking-card-badge { background: #7a5a9e; color: #f6f1e6; }
.parking-card.is-staff .parking-card-stripe {
  background: repeating-linear-gradient(
    90deg,
    #241830 0 10px,
    #7a5a9e 10px 12px,
    #140e1c 12px 22px
  );
}
.parking-staff-selfie {
  display: grid;
  gap: 0.45rem;
  margin: 0.35rem 0 0.15rem;
}
.parking-staff-preview {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1220;
}
.parking-staff-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.parking-card-face {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.55);
  flex-shrink: 0;
}
.parking-detail-face {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 0 0.65rem;
  border: 2px solid var(--line);
}
.parking-gate-poster {
  margin: 0.35rem 0 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
}
.parking-gate-poster-body {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}
.parking-gate-qr {
  width: 9.5rem;
  height: 9.5rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.35rem;
}
.parking-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
  pointer-events: none;
}
.parking-card.is-expired,
.parking-card.is-revoked {
  filter: grayscale(0.55);
  opacity: 0.82;
}
.parking-card.is-pending {
  box-shadow: 0 18px 40px rgba(14, 24, 44, 0.28), 0 0 0 2px rgba(196, 161, 90, 0.7);
}
.parking-card-stripe {
  height: 22px;
  margin: 0 -1rem 0.55rem;
  background: repeating-linear-gradient(
    90deg,
    #1a1a1a 0 10px,
    #2a2a2a 10px 12px,
    #111 12px 22px
  );
}
.parking-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  z-index: 1;
}
.parking-card-brand {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.parking-card-title {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0.1rem 0 0;
}
.parking-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.15rem;
}
.parking-card-title-row .parking-card-title {
  margin: 0;
}
.parking-card-title-row .parking-card-face {
  width: 2.85rem;
  height: 2.85rem;
  transform: none;
}
.parking-card-chip {
  width: 34px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e8d59a, #c4a15a 40%, #8d6b2e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}
.parking-card-plate {
  z-index: 1;
  font-family: var(--font-amount);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.14em;
  color: #fff8e8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  align-self: center;
}
.parking-card-meta {
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.7rem;
  align-items: end;
  font-size: 0.72rem;
  color: rgba(246, 241, 230, 0.82);
}
.parking-card-meta strong {
  display: block;
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 600;
}
.parking-card-meta span {
  display: block;
}
.parking-card-qr {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}
.parking-card-badge {
  position: absolute;
  top: 2.35rem;
  right: 0.85rem;
  z-index: 2;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(61, 107, 79, 0.92);
  color: #fff;
}
.parking-card.is-expired .parking-card-badge { background: rgba(90, 90, 90, 0.92); color: #fff; }
.parking-card.is-pending .parking-card-badge { background: rgba(158, 125, 58, 0.95); color: #fff; }
.parking-card.is-revoked .parking-card-badge { background: rgba(155, 44, 44, 0.95); color: #fff; }
.tenant-card-ended { opacity: 0.72; }
.parking-card-actions {
  width: min(100%, 22.6rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.parking-upgrade-staff {
  width: min(100%, 22.6rem);
  margin: 0.55rem auto 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  padding: 0;
}
.parking-upgrade-staff > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  font-weight: 650;
}
.parking-upgrade-staff > summary::-webkit-details-marker { display: none; }
.parking-upgrade-staff-form {
  display: grid;
  gap: 0.55rem;
  padding: 0 0.75rem 0.75rem;
}
.parking-upgrade-staff-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
}
.parking-upgrade-staff-status {
  margin: 0;
  font-size: 0.85rem;
}
a.parking-wallet {
  background: #111;
  color: #fff;
  border: 0;
  text-decoration: none;
}
a.parking-wallet:hover {
  background: #000;
  color: #fff;
}
a.parking-wallet-google {
  background: #1a73e8;
  color: #fff;
  border: 0;
  text-decoration: none;
}
a.parking-wallet-google:hover {
  background: #1557b0;
  color: #fff;
}
.parking-validate-actions {
  flex-wrap: wrap;
  gap: 0.45rem;
}
.parking-lookup-result,
.parking-pending-list {
  display: grid;
  gap: 0.75rem;
}
.parking-detail {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  padding: 0.85rem 1rem;
}
.parking-detail-general {
  text-align: center;
}
.parking-validity-flag {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.parking-detail-general.is-valid .parking-validity-flag { color: #1f6b3a; }
.parking-detail-general.is-invalid .parking-validity-flag { color: #9b2c2c; }
.parking-detail-general dl {
  grid-template-columns: 6rem 1fr;
  text-align: left;
  justify-content: center;
}
.parking-detail h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.parking-detail dl {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.2rem 0.6rem;
  margin: 0;
  font-size: 0.9rem;
}
.parking-detail dt {
  color: var(--muted);
}
.parking-detail dd {
  margin: 0;
  font-weight: 600;
}
.parking-hours-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.parking-ocr-options {
  margin: 0.85rem 0 0.35rem;
  padding: 0.75rem 0.85rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 0.45rem;
}
.parking-ocr-options legend {
  font-weight: 650;
  padding: 0 0.35rem;
}
.parking-ocr-options .check {
  margin: 0;
}
.parking-ocr-options .muted {
  font-weight: 400;
}
@media (max-width: 520px) {
  .parking-detail dl { grid-template-columns: 1fr; }
  .parking-detail dt { font-size: 0.75rem; }
}

.parking-ocr-note {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #fff6e5;
  border: 1px solid #e6d2a8;
  color: #5c4a1f;
  font-size: 0.9rem;
}
.parking-scan-dialog {
  width: min(100vw - 1rem, 28rem);
  max-width: 100%;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: #0f1724;
  color: #f4efe6;
  overflow: hidden;
}
.parking-scan-dialog::backdrop {
  background: rgba(8, 12, 20, 0.72);
}
.parking-scan-shell {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 0.9rem 1rem;
}
.parking-scan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.parking-scan-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  color: #fff8ee;
}
.parking-scan-head .muted {
  margin: 0;
  color: rgba(244, 239, 230, 0.72);
  font-size: 0.82rem;
  line-height: 1.35;
}
.parking-scan-stage {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: min(68vh, 28rem);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.parking-scan-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.parking-scan-frame {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 48%;
  height: 14%;
  border: 2px solid #f0d36a;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}
.parking-scan-frame[data-mode="qr"] {
  left: 22%;
  right: 22%;
  top: 28%;
  height: 36%;
  border-radius: 12px;
  border-color: #8ec5ff;
}
.parking-scan-live {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.65rem;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.78);
  color: #fff8ee;
  font-size: 0.82rem;
  text-align: center;
}
.parking-scan-actions {
  flex-wrap: wrap;
  gap: 0.45rem;
}
.parking-scan-actions .btn.primary {
  background: #c4a15a;
  border-color: #c4a15a;
  color: #15233f;
}
.parking-scan-dialog .btn.ghost {
  color: #f4efe6;
  border-color: rgba(244, 239, 230, 0.28);
}

/* EC desk + cards: keep content inside the phone viewport */
@media (max-width: 900px) {
  #panel-admin,
  #panel-admin .roster-block,
  #panel-admin .desk-tablet,
  #panel-admin .sensitive-ops,
  #panel-admin .templates-editor,
  #panel-admin .mhws-composer-shell,
  #panel-admin .mhws-composer-paper-wrap,
  #panel-admin .settings-grid,
  #panel-admin .stack,
  #panel-admin .info-doc-list,
  #panel-admin .payment-records-list {
    min-width: 0;
    max-width: 100%;
  }
  #panel-admin {
    overflow-x: clip;
  }
  #panel-admin .ec-desk-head-copy,
  #panel-admin .ec-desk-motto,
  #panel-admin .ec-desk-lede,
  #panel-admin .ec-desk-colony {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  #panel-admin .inline-pair {
    grid-template-columns: 1fr;
  }
  #panel-admin table {
    width: 100%;
    max-width: 100%;
  }
  #panel-admin input,
  #panel-admin select,
  #panel-admin textarea {
    max-width: 100%;
    min-width: 0;
  }

  .info-doc-card,
  .roles-member-card {
    min-width: 0;
    max-width: 100%;
  }
  .info-doc-card-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "mark title info"
      "actions actions actions";
    align-items: center;
  }
  .info-doc-card-row > :only-child {
    grid-column: 1 / -1;
  }
  .info-doc-tablet-mark { grid-area: mark; }
  .info-doc-card-row > .info-doc-card-title { grid-area: title; }
  .info-doc-info-btn { grid-area: info; }
  .info-doc-card-actions-inline {
    grid-area: actions;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
  .info-doc-card .btn-row,
  .tpl-card-toolbar,
  .payment-record-card .btn-row,
  .household-member-card .btn-row,
  .roles-member-card .btn-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .info-doc-card .btn-row .btn,
  .tpl-card-toolbar .btn,
  .tpl-card-actions-summary,
  .payment-record-card .btn-row .btn,
  .household-member-card .btn-row .btn,
  #panel-admin .btn-row .btn {
    width: auto;
    flex: 1 1 calc(50% - 0.4rem);
    min-width: min(100%, 8rem);
    max-width: 100%;
    white-space: normal;
  }
  .tpl-card-toolbar {
    width: 100%;
  }
  .tpl-card-actions {
    flex: 1 1 auto;
    min-width: 0;
  }
  .tpl-card-actions .btn-row .btn {
    flex: 1 1 calc(50% - 0.4rem);
  }
}

@media (max-width: 640px) {
  #panel-admin .ec-desk-head {
    grid-template-columns: 3px minmax(0, 1fr);
    padding: 0.85rem 0.85rem 0.95rem;
  }
  #panel-admin .roster-block,
  #panel-admin .desk-tablet,
  #panel-admin .sensitive-ops,
  #panel-admin .templates-editor {
    padding: 0.7rem 0.72rem 0.8rem;
  }
  #panel-admin .roster-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
  #panel-admin .roster-toolbar > *,
  #panel-admin .roster-search,
  #panel-admin .roster-search select,
  #panel-admin .roster-toolbar > button {
    width: 100%;
    max-width: 100%;
  }
  #panel-admin .roster-toolbar > div:first-child {
    grid-column: 1 / -1;
  }
  .mailbox-toolbar select,
  .obs-toolbar select,
  .obs-toolbar input {
    min-width: 0;
    width: 100%;
  }
}
