/* Fixed application frame; long records scroll inside their own panels. */
html { height: 100%; }
body { height: 100vh; height: 100dvh; overflow: hidden; font-size: 14px; }
body > .sidebar { width: 224px; padding: 18px 14px; border-radius: 0 22px 22px 0; }
body > main { height: 100%; max-width: none; margin-left: 224px; padding: 0 24px; display: flex; flex-direction: column; min-height: 0; }
.brand { padding-bottom: 16px; }
.brand img { width: 68px; height: 68px; margin: 0 auto 10px; }
.brand strong { font-size: 20px; line-height: 1.3; }
.brand span { font-size: 9px; margin-top: 8px; }
.nav-label { font-size: 9px; margin-bottom: 8px; }
nav { gap: 5px; }
nav button { min-height: 38px; font-size: 13px; padding: 9px 8px; border-radius: 12px; }
nav button span { font-size: 16px; width: 22px; }
.navigation-picker { display: none; }
.provider-brand { height: 116px; min-height: 116px; width: 100%; margin: 16px 0 4px; padding: 22px 10px 32px; gap: 6px; }
.provider-brand img { width: 44px; height: 44px; }
.provider-brand > div { padding-top: 5px; }
.provider-brand b { font-size: 19px; }
.provider-brand span { bottom: 25px; left: 25px; right: 25px; font-size: 7px; letter-spacing: 1px; }
.side-bottom { margin-top: auto; }
.side-bottom p { font-size: 11px; margin: 5px 0; }
.rule-symbol { font-size: 21px; }
.local-dot { font-size: 9px; padding-top: 8px; margin-top: 8px; }
.topbar { flex: 0 0 auto; min-height: 50px; padding: 8px 0; gap: 10px; font-size: 10px; }
.topbar button { font-size: 12px; padding: 6px 10px; }
.heading { flex: 0 0 auto; min-height: 0; padding: 14px 0; gap: 12px; flex-wrap: nowrap; }
.heading h1 { font-size: 29px; line-height: 1.15; margin: 4px 0; }
.heading p { font-size: 13px; }
.heading .eyebrow { font-size: 10px; }
.heading .primary, .heading .secondary { white-space: nowrap; font-size: 13px; padding: 10px 12px; }
.primary, .secondary { border-radius: 11px; font-size: 13px; padding: 9px 13px; }
.eyebrow { font-size: 10px; }
h2 { font-size: 23px; }
input, select, textarea, .field input, .field textarea, .officer-field input { font-size: 14px; padding: 8px 10px; border-radius: 9px; min-height: 0; }
.field { font-size: 13px; gap: 5px; margin-bottom: 0; }
body > main > .page { flex: 1 1 0; min-height: 0; overflow: hidden; }
body > main > footer { flex: 0 0 auto; padding: 9px 0; font-size: 10px; }
.panel { border-radius: 16px; margin: 0; }
.panel-heading { padding: 11px 15px; gap: 10px; flex-shrink: 0; }
.panel-heading h2 { font-size: 21px; margin: 3px 0; line-height: 1.15; }
.panel-foot { padding: 9px 15px; font-size: 11px; flex-shrink: 0; }
.empty { padding: 15px; font-size: 13px; }
#dashboard { display: flex; flex-direction: column; gap: 12px; }
.hero { min-height: 92px; height: 92px; flex: 0 0 auto; padding: 12px 24px; border-radius: 18px; }
.hero h2 { font-size: 27px; line-height: 1.12; margin: 7px 0; }
.hero h2 br { display: none; }
.hero .eyebrow { font-size: 9px; }
.hero .gold-link { padding: 2px 0; font-size: 12px; }
.hero-art { margin-right: 4px; flex-direction: row; gap: 18px; }
.hero-art img { width: 72px; height: 72px; }
.hero-art span { margin: 0; font-size: 9px; }
.stats { flex: 0 0 auto; gap: 12px; margin: 0; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 11px 15px; border-radius: 15px; }
.stat-value { font-size: 30px; line-height: 1.05; margin: 5px 0; }
.stat-label { font-size: 12px; }
.stat-detail { font-size: 10px; }
#dashboard > .two-col { flex: 1 1 0; min-height: 112px; gap: 14px; grid-template-columns: 1fr 1fr; }
#dashboard > .two-col > .panel { min-height: 0; display: flex; flex-direction: column; }
#due-list, #upcoming-list { min-height: 0; overflow: auto; flex: 1; }
.person-row { padding: 10px 15px; gap: 10px; }
.person-name { font-size: 13px; }
.person-sub { font-size: 11px; }
.avatar { width: 31px; height: 31px; font-size: 12px; }
#dashboard > .history-panel { min-height: 80px; flex: 0 0 110px; display: flex; flex-direction: column; }
#dashboard > .history-panel .eyebrow { display: none; }
#dashboard > .history-panel .panel-heading { padding: 8px 15px; }
#dashboard > .history-panel h2 { font-size: 20px; }
#recent-history { overflow: auto; min-height: 0; }
.change-row { padding: 9px 15px; gap: 12px; }
.change-description { font-size: 12px; }
#missing-note:empty { display: none; }
#missing-note { max-height: 54px; overflow: auto; flex-shrink: 0; margin: 0; }
#missing-note .notice { margin: 0; padding: 8px; }
#members > .panel, #history > .panel { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.toolbar { padding: 12px 15px; gap: 10px; flex-shrink: 0; }
.table-wrap { flex: 1; min-height: 0; overflow: auto; }
th { position: sticky; top: 0; z-index: 1; font-size: 11px; padding: 11px 13px; }
td { font-size: 13px; padding: 12px 13px; }
#history-list { flex: 1; min-height: 0; overflow: auto; }
.history-pagination { padding: 10px 15px; flex-shrink: 0; }
#calendar { display: flex; flex-direction: column; }
#calendar > .notice { margin: 0 0 8px; padding: 9px 12px; font-size: 12px; }
#timeline { flex: 1; min-height: 0; overflow: auto; }
.timeline-group h2 { font-size: 23px; margin: 12px 0; }
.timeline-item { padding: 14px; gap: 14px; }
.date-tile { width: 58px; font-size: 11px; }
.date-tile b { font-size: 25px; }
.officers-panel { height: 100%; margin: 0; display: flex; flex-direction: column; border-width: 2px; }
.officer-toolbar { padding: 12px 16px; gap: 12px; }
.officer-toolbar .eyebrow { font-size: 12px; }
.officer-toolbar select { font-size: 15px; min-width: 145px; }
#officers-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.officer-grid { flex: 1; min-height: 0; overflow: auto; grid-template-columns: 1fr 1fr; gap: 10px 20px; padding: 15px 18px; align-content: start; }
.officer-field { gap: 3px; }
.office-label { font-size: 13px; }
.officer-footer { padding: 10px 16px; flex-shrink: 0; gap: 12px; }
.officer-footer span { font-size: 12px; }
#settings { display: flex; flex-direction: column; gap: 10px; }
#settings .settings-pinned { flex: 0 0 auto; padding: 14px 20px; }
#settings .settings-pinned h2 { font-size: 21px; margin: 0 0 5px; }
#settings .settings-pinned p { margin: 5px 0 10px; font-size: 13px; }
#lodge-form { display: flex; align-items: end; gap: 12px; }
#lodge-form .field { flex: 1; }
#lodge-form button { flex: 0 0 auto; }
@media (max-width: 750px) { #lodge-form { flex-wrap: wrap; } #lodge-form .field { flex-basis: 100%; } }
.settings-picker { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.settings-picker select { flex: 1; max-width: 400px; }
#commercial-settings, #settings > .two-col { display: contents; }
#settings .settings-card { flex: 1; min-height: 0; overflow: auto; padding: 20px; margin: 0; }
#settings .settings-card.settings-inactive { display: none; }
.settings-card h2 { font-size: 24px; margin: 0 0 10px; }
.settings-card h3 { font-size: 16px; }
.settings-card p, .settings-card p.small-muted { font-size: 13px; line-height: 1.5; margin: 9px 0; }
#commercial-settings form { gap: 9px; max-width: 680px; }
#commercial-settings button { margin: 4px 6px 4px 0; }
#commercial-settings textarea { min-height: 72px; padding: 9px; font-size: 14px; }
dialog { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); max-width: calc(100vw - 32px); width: min(850px, calc(100vw - 32px)); border-width: 2px; border-radius: 18px; }
#member-dialog { width: min(780px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
#member-form { max-height: min(630px, calc(100vh - 40px)); max-height: min(630px, calc(100dvh - 40px)); display: flex; flex-direction: column; }
.member-tabs { display: flex; flex: 0 0 auto; gap: 5px; padding: 8px 20px; border-bottom: 1px solid #d5c39e; }
.member-tabs button { border: 1px solid transparent; background: transparent; color: var(--ink); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.member-tabs button[aria-selected=true] { background: var(--navy); color: #fff0ce; border-color: var(--gold); }
.dialog-heading { padding: 14px 20px; flex-shrink: 0; }
.dialog-heading h2 { font-size: 25px; margin: 3px 0; }
.dialog-scroll { flex: 1; min-height: 0; max-height: none; padding: 0 20px 16px; overflow: auto; }
.form-section-title { font-size: 20px; margin: 12px 0 10px; padding-bottom: 6px; }
.form-grid { gap: 11px 16px; }
.dialog-scroll [hidden] { display: none; }
#import-dialog { width: min(960px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 0; overflow: hidden; }
#import-dialog[open] { display: flex; flex-direction: column; }
#import-dialog .dialog-heading { padding: 14px 20px; }
#import-dialog .dialog-scroll { flex: 1; min-height: 0; max-height: none; padding: 12px 20px; }
#import-dialog .dialog-footer { flex-shrink: 0; padding: 10px 20px; }
.dialog-footer { padding: 10px 20px; flex-shrink: 0; gap: 10px; }
.dialog-footer span { font-size: 11px; }
.identity-dialog { padding: 22px; width: min(440px, calc(100vw - 32px)); }
.identity-dialog h2 { font-size: 24px; }
.identity-dialog form { gap: 10px; }
#pairing-dialog { width: min(460px, calc(100vw - 32px)); padding: 20px; }
body.signed-out { display: grid; place-items: center; padding: 12px; }
.signed-out > .login-panel, .startup-panel { width: min(420px, 100%); max-width: 420px; max-height: 100%; overflow: auto; margin: 0; padding: 22px 26px; border-radius: 20px; }
.login-panel > img, .startup-panel > img { width: 52px; height: 52px; }
.login-panel h1, .startup-panel h1 { font-size: 27px; line-height: 1.2; margin: 9px 0 5px; }
.login-panel > p { font-size: 12px; line-height: 1.4; margin: 7px 0; }
.login-brand { gap: 8px; font-size: 13px; margin: 10px 0 14px; }
.login-brand img { width: 38px; height: 38px; }
.login-panel form { margin: 0; }
.login-panel .field { gap: 4px; }
.login-panel .field input { margin: 0; padding: 9px 11px; font-size: 14px; }
.commercial-login { gap: 10px; }
.commercial-login form { gap: 9px; }
.commercial-login p { margin: 0; font-size: 12px; line-height: 1.4; }
.commercial-login details { padding-top: 9px; margin-top: 0; }
.commercial-login summary { margin: 0 0 6px; font-size: 13px; }
.commercial-login a, .legacy-login summary { font-size: 12px; }
.legacy-login { margin-top: 12px; }
.login-panel .small-muted { font-size: 11px; margin-top: 10px; }
#login-panel:has(.commercial-login) > .small-muted { display: none; }
.login-panel:has(#invitation-details[open]) { width: min(540px, 100%); max-width: 540px; }
.login-panel:has(#invitation-details[open]) .legacy-login { display: none; }
.login-panel:has(#invitation-details[open]) { width: min(440px, 100%); max-width: 440px; padding: 16px 22px; }
.login-panel:has(#invitation-details[open]) > img, .login-panel:has(#invitation-details[open]) > p, .login-panel:has(#invitation-details[open]) .login-brand, .login-panel:has(#invitation-details[open]) #pwa-uninstall-panel { display: none; }
.login-panel:has(#invitation-details[open]) h1 { font-size: 23px; margin: 0 0 8px; }
#invitation-details > summary { font-weight: 600; }
#invitation-details #invitation-form { gap: 7px; }
#invitation-info { margin-top: 10px; }
#login-panel #pwa-uninstall-panel { border: 0; border-radius: 0; padding: 0; margin-top: 8px; background: transparent; box-shadow: none; }
#login-panel #pwa-uninstall-panel > h2, #login-panel #pwa-uninstall-panel > p { display: none; }
#login-panel #pwa-uninstall-panel > details { margin: 6px 0; padding: 8px 10px; font-size: 12px; }
#login-panel #pwa-uninstall-panel > details > summary { margin: 0; font-size: 12px; }
#login-panel #pwa-uninstall-panel > button { margin: 6px 0; min-height: 34px; padding: 7px 12px; font-size: 12px; }
.admin-page > main { display: block; overflow: auto; }
.password-toggle, .commercial-login .password-toggle, #commercial-settings .password-toggle { width: auto; justify-self: start; margin: -3px 0 1px; padding: 3px 0; min-height: 25px; text-align: left; font-size: 12px; border: 0; background: none; color: #14506b; }
#commercial-login-error, #admin-login-error { color: #922c24; font-size: 13px; line-height: 1.4; padding: 9px 11px; border: 1px solid #cf938a; border-radius: 9px; background: #fff0ed; margin: 0; }
#commercial-login-error:empty { display: none; }
#commercial-login-status { color: #345875; }
#update-banner { margin: 8px 0 0; padding: 8px 12px; flex-shrink: 0; }
#global-error { margin: 0 0 8px; max-height: 80px; overflow: auto; flex-shrink: 0; }
@media (max-width: 1050px) {
  body > .sidebar { width: 196px; padding: 14px 10px; }
  body > main { margin-left: 196px; padding: 0 16px; }
  .brand strong { font-size: 18px; }
  .heading h1 { font-size: 25px; }
  .heading p { font-size: 12px; }
  .heading { flex-wrap: wrap; }
  .heading > div { flex: 1 1 100%; }
  .heading .primary, .heading .secondary { padding: 7px 10px; }
  .hero-art span { display: none; }
  .session-controls { gap: 6px; }
  #today { display: none; }
}
@media (max-width: 750px) {
  body:not(.signed-out) { display: flex; flex-direction: column; }
  body > .sidebar { position: static; width: 100%; flex: 0 0 auto; padding: 9px 12px; border-radius: 0 0 15px 15px; overflow: hidden; }
  .sidebar .brand { display: flex; gap: 10px; align-items: center; text-align: left; padding: 0 0 6px; }
  .sidebar .brand img { width: 32px; height: 32px; margin: 0; }
  .sidebar .brand strong { font-size: 16px; }
  .sidebar .brand span { display: none; }
  .sidebar .provider-brand, .sidebar .nav-label, .sidebar .side-bottom { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 0; gap: 4px; }
  .sidebar nav { display: none; }
  .sidebar .navigation-picker { display: block; width: 100%; padding: 6px 9px; background: #153047; color: #fff0ce; border-color: #b8a17a; font-size: 12px; }
  .sidebar nav button { font-size: 12px; min-height: 33px; padding: 7px 10px; flex-shrink: 0; }
  body > main { margin: 0; padding: 0 12px; height: auto; flex: 1 1 0; min-height: 0; }
  .topbar { min-height: 40px; padding: 6px 0; }
  .topbar > div:first-child { display: none; }
  .session-controls { width: 100%; justify-content: space-between; }
  #connection-status { font-size: 10px; }
  .heading { padding: 9px 0; gap: 6px; }
  .heading h1 { font-size: 23px; }
  .heading p { display: none; }
  .heading .eyebrow { display: none; }
  #import-members { margin: 0; }
  .hero { height: 76px; min-height: 76px; padding: 11px 16px; }
  .hero h2 { font-size: 21px; margin: 3px 0; }
  .hero .eyebrow { display: none; }
  .stats { gap: 6px; }
  .stat { padding: 8px; border-radius: 12px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 25px; }
  .stat-detail { font-size: 9px; }
  #dashboard { gap: 8px; }
  #dashboard > .two-col { gap: 8px; min-height: 94px; }
  .panel-heading { padding: 9px 10px; }
  .panel-heading { flex-wrap: nowrap; }
  .panel-heading h2 { font-size: 17px; }
  .panel-heading .eyebrow { display: none; }
  #dashboard .panel-foot { font-size: 10px; padding: 7px 10px; }
  .empty, .person-row { padding: 10px; font-size: 12px; }
  .toolbar { padding: 8px; gap: 6px; flex-wrap: wrap; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar select, .toolbar button { padding: 7px; font-size: 12px; }
  .officer-grid { gap: 10px 12px; padding: 12px; }
  .officer-toolbar { padding: 10px 12px; }
  .office-label { font-size: 12px; }
  .officer-footer span { display: none; }
  .settings-picker { gap: 7px; }
  #settings .settings-card { padding: 14px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field.wide { grid-column: span 2; }
  .dialog-heading, .dialog-footer { padding: 11px 14px; }
  .member-tabs { padding: 7px 14px; }
  .member-tabs button { font-size: 12px; padding: 7px; }
  .dialog-scroll { padding: 0 14px 14px; }
  .dialog-heading h2 { font-size: 23px; }
  .form-section-title { font-size: 18px; }
  .dialog-footer span { display: none; }
  body > main > footer { padding: 5px 0; font-size: 9px; }
}
@media (max-height: 680px) {
  .brand img { width: 48px; height: 48px; }
  .brand { padding-bottom: 10px; }
  .provider-brand { height: 95px; min-height: 95px; padding-top: 15px; margin-top: 10px; }
  .provider-brand span { bottom: 20px; }
  .hero { height: 82px; min-height: 82px; padding-top: 9px; padding-bottom: 9px; }
  .hero h2 { font-size: 24px; }
  .stat { padding-top: 7px; padding-bottom: 7px; }
  #dashboard > .history-panel { flex-basis: 100px; }
  .login-panel > img { display: none; }
  .signed-out > .login-panel { padding: 16px 22px; }
  .login-brand { margin: 7px 0 10px; }
}
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .officer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 750px) and (max-height: 680px) {
  #dashboard > .hero { display: none; }
  #dashboard .stat-detail, #dashboard .panel-foot { display: none; }
  #dashboard .panel-heading { padding: 6px 10px; }
  #dashboard .panel-heading h2 { font-size: 16px; }
  #dashboard > .history-panel { flex-basis: 80px; }
  .heading { padding: 7px 0; }
  .heading h1 { font-size: 21px; }
  .login-panel > p:first-of-type:not(#pwa-access-status) { display: none; }
  .login-panel:has(#invitation-details[open]) h1 { font-size: 24px; margin: 5px 0; }
  .login-panel:has(#invitation-details[open]) .login-brand { margin: 4px 0; }
  .login-panel:has(#invitation-details[open]) .login-brand img { width: 30px; height: 30px; }
  #invitation-details[open] > p { display: none; }
}

/* Participant panels: compact workspace, one settings card and bounded dialogs. */
.participant-app > main { max-width: 1240px; }
.participant-app .heading h1 { font-size: 25px; }
.participant-app .panel { border-radius: 12px; }
.participant-app .panel-heading h2 { font-size: 20px; }
.participant-app .finance-panel .panel-heading { padding: 10px 14px; }
.participant-app .finance-panel .panel-heading h2 { font-size: 20px; }
.participant-app .finance-table td { font-size: 13px; padding: 9px 11px; }
.participant-app .finance-form input,.participant-app .finance-form select { min-height: 36px; }
.participant-app .finance-form > button,.participant-app .finance-actions button,.participant-app .finance-table .secondary { min-height: 36px; }
.participant-app .finance-rule-settings { margin: 4px 14px 12px; }
.participant-app .finance-rule-settings summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.participant-app #settings .settings-card { padding: 16px; }
.participant-app #settings .settings-card h2 { font-size: 21px; margin-top: 0; }
.participant-app #pwa-install-help { max-height: none !important; }
.participant-app dialog { width: min(640px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); border-radius: 14px; box-sizing: border-box; }
.participant-app dialog[open] { display: flex; flex-direction: column; }
.participant-app #member-dialog { width: min(680px, calc(100vw - 28px)); }
.participant-app #member-dialog > form { min-height: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.participant-app .finance-dialog-wide,.participant-app #import-dialog { width: min(860px, calc(100vw - 28px)); }
.participant-app #restore-preview { width: min(640px, calc(100vw - 28px)); padding: 18px; overflow: auto; }
.participant-app dialog .dialog-heading,.participant-app dialog .dialog-footer { flex: 0 0 auto; padding: 12px 16px; }
.participant-app dialog .dialog-heading h2 { font-size: 22px; }
.participant-app dialog .dialog-scroll { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; padding: 12px 16px; }
.participant-app dialog .field { min-width: 0; overflow-wrap: anywhere; }
.participant-app dialog .finance-form { padding: 4px 0 12px; gap: 10px 12px; }
.participant-app [hidden] { display: none !important; }
@media (min-width: 751px) { .participant-app > main { width: calc(100% - 224px); } }
@media (max-width: 750px) { .participant-app > main { width: 100%; }.participant-app .heading h1 { font-size: 22px; } }
@media (max-width: 520px) {
 .participant-app .officer-grid { grid-template-columns: 1fr; }
 .participant-app .dialog-footer { gap: 7px; flex-wrap: wrap; }
 .participant-app .settings-picker { flex-wrap: wrap; }
 .participant-app .settings-picker select { width: 100%; max-width: none; flex-basis: 100%; }
 .participant-app .finance-form { grid-template-columns: 1fr; }
}

.participant-app > main > .finance-page { overflow: auto; }

@media (max-width: 1100px) { .participant-app .finance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .participant-app .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.participant-app > main > #dashboard { overflow: auto; }

.participant-app .session-controls { flex-wrap:wrap; }
.participant-app #help-support { white-space:nowrap; }

/* Shared visual treatment for Agentoria and the three Lodge panels. */
:root {
  --heritage-reading: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --heritage-heading: "Goudy Old Style", "Palatino Linotype", Georgia, serif;
  --heritage-gold: #b79556;
  --heritage-corner: 22px;
}
body { font-family: var(--heritage-reading); font-weight: 600; }
body :where(*) { font-family: var(--heritage-reading) !important; font-weight: 600 !important; }
body :where(h1, h2, h3, h4, .brand strong, .lodge-motto, .stat-value, .form-section-title) {
  font-family: var(--heritage-heading) !important;
  font-weight: 700 !important;
  line-height: 1.18;
}
body :where(strong, b, th, button, .primary, .secondary, nav a, .eyebrow, .field, .office-label) { font-weight: 700 !important; }
body :where(pre, code, pre *) { font-family: Consolas, "Courier New", monospace !important; }
body :where(input, select, textarea) { line-height: 1.4; }
body :where(input, textarea)::placeholder { font-weight: 600; }

/* Rounded frames also cover the controls created dynamically by each role. */
body :where(.panel, .settings-card, .stat, .admin-card, .notice, .error, .login-panel,
  .timeline-item, .admin-explanation, .finance-preview, .finance-allocations,
  .finance-status:not(:empty), .admin-menu-grid a, .provider-brand, .merge-comparison) {
  border-width: 3px !important;
  border-radius: var(--heritage-corner) !important;
}
body :where(.primary, .secondary, .navigation-picker, .settings-picker select,
  input:not([type=checkbox]):not([type=radio]), select, textarea, fieldset,
  .member-tabs button, nav button, .sidebar nav a) {
  border-width: 3px !important;
  border-radius: 16px !important;
}
body :where(dialog, .admin-action-dialog, .finance-dialog) { border: 3px solid var(--heritage-gold); border-radius: 26px !important; }
body :where(.badge, .admin-badge, .date-tile, .toast, .device-row, .dialog-heading,
  .dialog-footer, .panel-heading, .panel-foot, .toolbar, .officer-toolbar,
  .officer-footer, .admin-list article, .member-tabs, pre, iframe) { border-radius: 14px !important; }
body :where(img) { border-radius: 16px; }
body :where(.person-row, .change-row, .device-row, .panel-foot, td, th) { border-bottom-width: 2px; }
body :where(.person-row, .change-row, .dialog-heading, .dialog-footer, .officer-toolbar, .officer-footer, .member-tabs) { border-top-width: 2px; }
body table { border-collapse: separate; border-spacing: 0; border-radius: 16px; }
body th:first-child { border-top-left-radius: 13px; }
body th:last-child { border-top-right-radius: 13px; }
body tbody tr:last-child td:first-child { border-bottom-left-radius: 13px; }
body tbody tr:last-child td:last-child { border-bottom-right-radius: 13px; }
body .contact-help-sign { border-radius: 50% !important; font-weight: 800 !important; }
body .icon-button { border-radius: 14px !important; }
body :focus-visible { outline: 3px solid var(--heritage-gold); outline-offset: 3px; border-radius: 8px; }

/* More room for the blue Lodge identity, without narrowing the work area. */
body > .sidebar, body.admin-page #admin-sidebar {
  width: 252px;
  left: 10px;
  top: 10px;
  bottom: 10px;
  padding: 22px 16px;
  border: 3px solid var(--heritage-gold);
  border-radius: 28px !important;
}
body > main, body.participant-app > main, body.admin-page #admin-app { margin-left: 272px; max-width: none; padding-left: 26px; padding-right: 26px; }
body.participant-app > main { width: calc(100% - 272px); }
body .brand strong, body.admin-page #admin-sidebar .brand strong { font-size: 25px; }
body .brand img, body.admin-page #admin-sidebar .brand img { width: 80px; height: 80px; }
body .brand span { font-size: 12px; letter-spacing: 1.15px; line-height: 1.45; }
body .sidebar nav :is(button, a), body.admin-page #admin-sidebar nav a { font-size: 15px; padding: 11px 10px; min-height: 42px; }
body .sidebar .provider-brand {
  min-height: 108px;
  height: auto;
  padding: 18px 12px 30px;
  background: linear-gradient(145deg, #fffef9, #eee6d6);
  border: 3px solid var(--heritage-gold) !important;
  border-radius: 22px !important;
  filter: none;
  box-shadow: 0 4px 12px #0003;
}
body .provider-brand span { bottom: 11px; left: 12px; right: 12px; }
body .sidebar .provider-brand img { border-radius: 14px; }
body .provider-brand b { font-size: 21px; }

/* The central blue banner and its right-hand emblem grow together. */
body .hero { height: auto; min-height: 138px; padding: 22px 30px; border-width: 3px; border-radius: 28px !important; }
body .hero h2 { font-size: clamp(31px, 2.4vw, 42px); margin: 9px 0; }
body .hero .eyebrow { font-size: 11px; }
body .hero .gold-link { font-size: 15px; }
body .hero-art { gap: 22px; }
body .hero-art img { width: 106px; height: 106px; }
body .hero-art span { font-size: 12px; max-width: 220px; }
body .heading h1, body.participant-app .heading h1, body.admin-page #admin-app .heading h1 { font-size: 32px; line-height: 1.16; }
body :where(.panel-heading h2, .finance-panel .panel-heading h2, .admin-workspace-heading h2) { font-size: 25px; }
body :where(.small-muted, .stat-detail, .finance-note, .panel-foot, .admin-card p, .admin-source, .member-status, .person-sub) { font-size: 13px; line-height: 1.45; }
body .stat-value { font-size: 35px; }
body #dashboard { overflow-y: auto; }
body #dashboard > .two-col { flex: 1 0 150px; }
body .topbar { row-gap: 10px; }
body .session-controls { flex-wrap: wrap; row-gap: 8px; }
body.admin-page #admin-app :where(.primary, .secondary, .admin-menu-grid a) { border-radius: 16px !important; min-height: 40px; }
body.admin-page #admin-app :where(.panel, .admin-card, .notice, .error, .admin-explanation) { border-radius: 22px !important; }
body.admin-page #admin-app .heading { min-height: 105px; }

@media (max-width: 1100px) and (min-width: 751px) {
  body > .sidebar { width: 228px; padding: 16px 12px; }
  body > main, body.participant-app > main { margin-left: 248px; padding-left: 18px; padding-right: 18px; }
  body.participant-app > main { width: calc(100% - 248px); }
  body .brand strong { font-size: 23px; }
  body.admin-page #admin-sidebar { width: auto; margin: 8px 8px 0; padding: 12px; }
  body.admin-page #admin-app { margin-left: 0; padding-left: 18px; padding-right: 18px; }
  body.admin-page #admin-sidebar .brand strong { font-size: 23px; }
  body .hero-art span { display: none; }
  body .hero { min-height: 122px; padding: 18px 24px; }
}
@media (max-width: 750px) {
  body > .sidebar, body.admin-page #admin-sidebar { position: static; width: auto; margin: 8px 8px 0; padding: 12px; border-radius: 22px !important; overflow: auto; flex-shrink: 0; }
  body > main, body.participant-app > main, body.admin-page #admin-app { margin-left: 0; padding-left: 14px; padding-right: 14px; }
  body.participant-app > main { width: 100%; }
  body .sidebar .brand img, body.admin-page #admin-sidebar .brand img { width: 46px; height: 46px; margin: 0; }
  body .sidebar .brand strong, body.admin-page #admin-sidebar .brand strong { font-size: 22px; }
  body .sidebar .brand span { display: block; font-size: 11px; margin-top: 4px; }
  body .heading h1, body.participant-app .heading h1, body.admin-page #admin-app .heading h1 { font-size: 28px; }
  body .hero { min-height: 106px; padding: 15px 18px; }
  body .hero h2 { font-size: 28px; }
  body .hero .gold-link { font-size: 13px; }
  body .hero-art { display: none; }
  body #dashboard > .two-col { grid-template-columns: 1fr; flex-basis: auto; }
  body #dashboard > .two-col > .panel { min-height: 138px; }
  body :where(.panel-heading h2, .finance-panel .panel-heading h2, .admin-workspace-heading h2) { font-size: 23px; }
  body .session-controls { gap: 7px; }
  body .topbar button, body .topbar a { font-size: 12px; }
  body .finance-toolbar { gap: 10px; }
  body.admin-page #admin-app .heading { min-height: 84px; }
}
@media (max-height: 680px) and (min-width: 751px) {
  body .hero { min-height: 110px; padding-top: 15px; padding-bottom: 15px; }
  body .hero h2 { font-size: 30px; }
  body .hero-art img { width: 82px; height: 82px; }
}

/* Compact workspaces: visible navigation, summaries first, long detail in dialogs. */
body > .sidebar, body.admin-page #admin-sidebar {
  position: fixed; left: 8px; top: 8px; bottom: 8px; width: 236px;
  height: calc(100dvh - 16px); padding: 12px; margin: 0;
  display: flex; flex-direction: column; gap: 9px; overflow: hidden;
}
body .sidebar .brand, body.admin-page #admin-sidebar .brand {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 0 0 8px; text-align: left; flex: 0 0 auto;
}
body .sidebar .brand > div { flex: 1; min-width: 0; }
body .sidebar .brand img, body.admin-page #admin-sidebar .brand img { width: 44px; height: 44px; margin: 0; }
body .sidebar .brand strong, body.admin-page #admin-sidebar .brand strong { font-size: 18px; line-height: 1.15; letter-spacing: .3px; }
body.admin-page #admin-sidebar .brand strong { flex: 1; }
body .sidebar .brand span, body.admin-page #admin-sidebar .brand span { display: block; font-size: 10px; line-height: 1.2; letter-spacing: .4px; margin: 4px 0 0; }
body.admin-page #admin-sidebar .brand > span { flex-basis: 100%; }
body .sidebar nav, body.admin-page #admin-sidebar nav { display: grid; gap: 3px; overflow: visible; padding: 0; flex: 0 0 auto; }
body .sidebar nav :is(button,a), body.admin-page #admin-sidebar nav a {
  font-size: 13px; padding: 6px 8px; min-height: 34px; line-height: 1.2;
  white-space: normal; border-radius: 11px !important; margin: 0;
}
body .sidebar nav button span { font-size: 14px; width: 18px; }
body .sidebar .navigation-picker { display: none; }
body .sidebar .provider-brand { display: flex; align-items: center; height: 42px; min-height: 42px; padding: 4px 8px; margin: auto 0 0; gap: 8px; }
body .sidebar .provider-brand img { width: 28px; height: 28px; }
body .sidebar .provider-brand > div { padding: 0; }
body .sidebar .provider-brand b { font-size: 15px; }
body .sidebar .provider-brand span, body .sidebar .rule-symbol, body .sidebar .local-dot { display: none; }
body .sidebar .side-bottom { margin-top: 0; padding: 0; }
body .sidebar .side-bottom p { font-size: 10px; margin: 0; }
body .sidebar .side-bottom p:not(.lodge-motto) { display: none; }
body > main, body.participant-app > main, body.admin-page #admin-app { margin-left: 252px; padding: 0 18px; max-width: none; width: calc(100% - 252px); }
body .topbar, body.admin-page #admin-app .topbar { min-height: 42px; padding: 5px 0; gap: 6px; }
body .session-controls { gap: 6px; row-gap: 4px; }
body .topbar button, body .topbar a { font-size: 12px; padding: 5px 9px; }
body .heading, body.admin-page #admin-app .heading { min-height: 0; padding: 8px 0; gap: 8px; }
body .heading h1, body.participant-app .heading h1, body.admin-page #admin-app .heading h1 { font-size: 26px; margin: 3px 0; }
body .heading p { font-size: 12px; margin: 4px 0; }
body .heading::after { display: none; }
body .hero { min-height: 80px; height: 80px; padding: 10px 20px; }
body .hero h2 { font-size: 27px; margin: 5px 0; }
body .hero .eyebrow { display: none; }
body .hero .gold-link { font-size: 12px; }
body .hero-art img { width: 58px; height: 58px; }
body .hero-art span { font-size: 11px; }
body .stats, body .finance-stats { gap: 8px; }
body .stat, body .finance-stats .stat { padding: 8px 12px; }
body .stat-label { font-size: 12px; }
body .stat-value, body .finance-stats .stat-value { font-size: 27px; margin: 4px 0; }
body .stat-detail, body .finance-stats .stat-detail { font-size: 11px; line-height: 1.3; }
body > main > footer { padding: 6px 0; }
body #reference-notice { padding: 7px 12px; margin: 0 0 4px; font-size: 12px; line-height: 1.3; }

body.participant-app > main > #dashboard { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; align-content: start; overflow: auto; }
body #dashboard > .hero, body #dashboard > .stats { grid-column: 1 / -1; }
body #dashboard > .two-col, body #dashboard > #missing-note { display: contents; }
body #dashboard > .history-panel, body #dashboard > .two-col > .panel { min-height: 0; height: auto; flex: none; }
body #dashboard #missing-note .notice { padding: 0; margin: 0; }
body #dashboard #missing-note .compact-body > button { margin: 6px; }
body #dashboard #due-list, body #dashboard #upcoming-list, body #dashboard #recent-history { overflow: visible; max-height: none; }

body #settings { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; align-content: start; overflow: auto; }
body #settings .settings-picker { display: none; }
body #settings .settings-card.compact-card, body .compact-card { min-height: 0; padding: 0; margin: 0; overflow: visible; }
body #settings .settings-card.compact-card.settings-inactive { display: block; }
body .compact-card { border: 1px solid #e2dccf; border-radius: 16px; background: #fffdf8; }
body .compact-summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; }
body .compact-summary h2, body #settings .compact-summary h2 { flex: 1; font-size: 17px; margin: 0; min-width: 0; }
body .compact-launcher { display: block; width: 100%; min-height: 32px; padding: 2px 0; border: 0; background: transparent; color: var(--navy); font-size: 16px; line-height: 1.3; text-align: left; cursor: pointer; }
body .compact-launcher::after { content: ' ↗'; color: #866326; }
body .compact-launcher:hover { color: #866326; }
body .compact-count { min-width: 30px; padding: 4px 7px; border-radius: 10px; background: #eae0c9; text-align: center; font-size: 17px; }
body dialog.workspace-dialog { width: min(920px,calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); padding: 0; overflow: hidden; }
body dialog.workspace-dialog[open] { display: flex; flex-direction: column; }
body dialog.workspace-dialog > .dialog-heading { flex: 0 0 auto; padding: 12px 18px; }
body dialog.workspace-dialog > .dialog-heading h2 { font-size: 24px; margin: 0; }
body dialog.workspace-dialog > .compact-body { flex: 1 1 auto; min-height: 0; overflow: auto; max-height: none; padding: 14px 18px; }
body .compact-body > h2, body .compact-body > .panel-heading h2, body .compact-body > .panel-heading .eyebrow { display: none; }
body .compact-body > .panel-heading .counter { display: none; }
body .compact-body > .panel-heading { padding: 0 0 8px; }
body .compact-body > .panel-heading:has(h2:only-child) { display: none; }
body .compact-body :is(.finance-table,.table-wrap,.finance-table-slot) { max-height: none; overflow: visible; flex: none; min-height: 0; }
body .compact-body > form { display: grid; gap: 10px; }
body .compact-body .finance-form, body .finance-rules .compact-body .finance-form { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px 0; }
body .compact-body .finance-rules, body .compact-body .finance-note { margin: 8px 0; }
body .compact-body .finance-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
body #participant-invitations { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px; }
body #participant-invitations > h2 { display: none; }
body #participant-invitations > p { grid-column: 1 / -1; margin: 0 0 5px; font-size: 13px; }

body.participant-app > main > :is(#finance-obligations,#finance-cash) { overflow: hidden; gap: 9px; }
body :is(#finance-obligations,#finance-cash) > .finance-panel { flex: 1 1 0; min-height: 0; }
body :is(#finance-obligations,#finance-cash) > .finance-panel > .finance-table-slot { display: flex; flex: 1 1 0; min-height: 0; }
body :is(#finance-obligations,#finance-cash) > .finance-panel .finance-table { flex: 1 1 0; min-height: 0; max-height: none; overflow: auto; }
body .finance-panel .panel-heading { padding: 8px 12px; }
body .finance-panel .panel-heading h2 { font-size: 21px; }
body .finance-panel > .finance-note { font-size: 11px; margin: 7px 12px; }
body .finance-toolbar { gap: 8px; }
body .finance-toolbar > .finance-rules { display: block; flex: 0 1 auto; margin-left: auto; }
body .finance-toolbar > .compact-card .compact-summary { padding: 4px 10px; }
body .finance-toolbar .compact-launcher { font-size: 13px; }
body.participant-app > main > #finance-mlnr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; gap: 10px; overflow: auto; }
body #finance-mlnr > .finance-toolbar, body #finance-mlnr > .finance-stats { grid-column: 1 / -1; }
body #finance-mlnr > .finance-even-col { display: contents; }
body.admin-page #admin-app .heading { min-height: 0; }
body.admin-page #admin-app > .small-muted { font-size: 11px; margin: 3px 0 7px; }
@media (min-width: 751px) {
 body .finance-stats, body.participant-app .finance-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
 body .compact-body .finance-stats, body.participant-app .compact-body .finance-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-height: 640px) and (min-width: 751px) {
 body .sidebar .provider-brand, body .sidebar .side-bottom { display: none; }
 body .sidebar nav :is(button,a), body.admin-page #admin-sidebar nav a { min-height: 31px; padding: 5px 8px; }
 body .sidebar .brand { padding-bottom: 3px; }
 body .hero { min-height: 64px; height: 64px; }
 body .hero-art img { width: 46px; height: 46px; }
}
@media (max-width: 750px) {
 body:not(.signed-out) { display: flex; flex-direction: column; }
 body > .sidebar, body.admin-page #admin-sidebar { position: static; width: auto; height: auto; flex: 0 0 auto; margin: 6px 8px 0; padding: 7px 10px; gap: 5px; }
 body .sidebar .brand, body.admin-page #admin-sidebar .brand { padding: 0; flex-wrap: nowrap; }
 body .sidebar .brand img, body.admin-page #admin-sidebar .brand img { width: 30px; height: 30px; }
 body .sidebar .brand strong, body.admin-page #admin-sidebar .brand strong { font-size: 16px; }
 body .sidebar .brand span { display: inline; margin-left: 6px; }
 body.admin-page #admin-sidebar .brand > span { display: none; }
 body .sidebar .provider-brand, body .sidebar .side-bottom { display: none; }
 body .sidebar nav, body.admin-page #admin-sidebar nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; }
 body .sidebar nav :is(button,a), body.admin-page #admin-sidebar nav a { min-height: 30px; font-size: 12px; padding: 5px 7px; }
 body .sidebar nav button span { display: none; }
 body > main, body.participant-app > main, body.admin-page #admin-app { margin-left: 0; width: 100%; max-width: 100%; padding: 0 10px; min-width: 0; min-height: 0; flex: 1 1 0; }
 body .topbar { min-height: 34px; padding: 4px 0; }
 body .topbar button, body .topbar a { font-size: 11px; padding: 4px 6px; }
 body .heading { padding: 6px 0; }
 body .heading h1, body.participant-app .heading h1, body.admin-page #admin-app .heading h1 { font-size: 23px; }
 body .hero { min-height: 64px; height: 64px; padding: 8px 12px; }
 body .hero h2 { font-size: 24px; margin: 2px 0; }
 body .stats, body .finance-stats, body.participant-app .finance-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
 body .stat, body .finance-stats .stat { padding: 6px 9px; }
 body .stat-value, body .finance-stats .stat-value { font-size: 23px; }
 body .stat-detail { font-size: 10px; }
 body.participant-app > main > #dashboard, body #settings, body.participant-app > main > #finance-mlnr { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
 body .compact-summary { padding: 7px 10px; }
 body .compact-launcher { font-size: 14px; }
 body .compact-count { font-size: 14px; }
 body #participant-invitations { padding: 10px; gap: 8px; }
 body .compact-body .finance-form, body .finance-rules .compact-body .finance-form { grid-template-columns: 1fr; }
 body .finance-toolbar > .finance-rules { margin-left: 0; }
 body .finance-toolbar .field { max-width: 115px; }
 body .finance-toolbar button { font-size: 12px; min-height: 32px; padding: 6px 9px; }
 body .finance-panel .toolbar { flex-wrap: wrap; padding: 7px 9px; gap: 6px; }
 body .finance-panel .toolbar input[type=search] { min-width: 110px; }
 body .finance-panel .toolbar select { max-width: 160px; }
 body .finance-panel > .finance-note { display: none; }
 body dialog.workspace-dialog > .dialog-heading { padding: 10px 12px; }
 body dialog.workspace-dialog > .dialog-heading h2 { font-size: 21px; }
 body dialog.workspace-dialog > .compact-body { padding: 10px 12px; }
}
@media (max-width: 750px) {
 body .session-controls { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 3px 5px; }
 body #exit-app { justify-self: end; }
 body #settings .compact-summary, body #dashboard .compact-summary { min-height: 47px; }
 body #dashboard .stat-detail, body #dashboard > .hero { display: none; }
 body.participant-app > main > #dashboard { grid-auto-rows: max-content; }
 body .session-controls #connection-status { grid-column: 1 / -1; }
 body .session-controls #pwa-install-status { grid-column: 1 / -1; }
 body .session-controls #pwa-install-status:empty { display: none; }
 body .topbar { padding: 2px 0; }
 body .topbar button, body .topbar a { min-height: 28px; padding: 3px 5px; }
 body :is(#finance-obligations,#finance-cash,#finance-mlnr) > .finance-toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: 5px; }
 body .finance-toolbar > .field { display: flex; align-items: center; gap: 5px; max-width: none; font-size: 11px; }
 body .finance-toolbar > .field input { width: 70px; padding: 4px 6px; min-height: 30px; }
 body .finance-toolbar > button { padding: 5px; font-size: 11px; min-width: 0; }
 body .finance-toolbar > .compact-card .compact-summary { padding: 2px 5px; gap: 3px; }
 body .finance-toolbar .compact-launcher { font-size: 11px; }
 body .finance-stats .stat { padding: 5px 7px; }
 body .finance-stats .stat-label { font-size: 11px; }
 body .finance-stats .stat-value { font-size: 20px; margin: 2px 0; }
 body .finance-stats .stat-detail { display: none; }
 body .finance-panel .panel-heading { padding: 5px 9px; }
 body .finance-panel .panel-heading h2 { margin: 0; font-size: 19px; }
 body .finance-panel .toolbar { padding: 4px 7px; gap: 4px; }
 body .finance-panel .toolbar :is(input,select,button) { min-height: 30px; padding: 4px 6px; font-size: 11px; }
 body :is(#finance-obligations,#finance-cash) .finance-table-slot { min-width: 0; }
 body :is(#finance-obligations,#finance-cash) .finance-table { min-width: 0; }
}
@media (max-width: 750px) and (max-height: 700px) {
 body #dashboard > .hero { display: none; }
 body .stat-detail { display: none; }
}

@media (max-height: 680px) and (min-width: 751px) {
 body .heading .eyebrow, body .heading p, body .finance-stats .stat-detail { display: none; }
 body .finance-stats .stat { padding: 6px 10px; }
 body .finance-stats .stat-value { font-size: 23px; margin: 3px 0; }
}

/* One visual language for actions, including dynamically created dialogs. */
:root {
 --action-blue: #102b40;
 --action-gold: #ffe0a3;
 --action-edge: #b79556;
}
body :is(button, input[type=button], input[type=submit], input[type=reset],
 a.primary, a.secondary, a[role=button], .sidebar nav a, .admin-menu-grid a,
 .admin-dialog-nav a, summary) {
 background: linear-gradient(150deg, #203f56, var(--action-blue)) !important;
 color: var(--action-gold) !important;
 border-color: var(--action-edge) !important;
 border-radius: 12px;
 text-decoration: none;
}
body :is(button, a.primary, a.secondary, a[role=button], .sidebar nav a,
 .admin-menu-grid a, .admin-dialog-nav a, summary):hover {
 background: linear-gradient(150deg, #31566f, #17364e) !important;
 filter: none;
}
body :is(button, a.primary, a.secondary, .sidebar nav a, .admin-menu-grid a,
 .admin-dialog-nav a, summary):focus-visible {
 outline: 3px solid #b79556 !important;
 outline-offset: 3px;
}
body :is(button:disabled, input[type=submit]:disabled, [aria-disabled=true]) {
 opacity: .55;
 cursor: not-allowed;
}
body .sidebar nav :is(button.active, a.active),
body .member-tabs button[aria-selected=true], body .admin-menu-grid a.is-active {
 background: #31536b !important;
 box-shadow: inset 4px 0 #ffe0a3, inset 0 0 0 2px #b79556;
}
body button :is(.contact-help-sign, span), body .compact-launcher::after {
 color: inherit;
}
body .contact-help-sign { background: transparent; border-color: currentColor; }
body .password-toggle { padding: 5px 10px; }
body .icon-button { min-width: 34px; min-height: 34px; line-height: 1; }
body summary { padding: 8px 12px; border: 1px solid var(--action-edge); }
body .compact-summary {
 background: linear-gradient(150deg, #203f56, var(--action-blue));
 color: var(--action-gold);
 border-radius: inherit !important;
}
body .compact-launcher { padding: 6px 10px; }
body .compact-count { background: #ffe0a3; color: #102b40; }
body .compact-summary .section-help-button { margin-left: 0; }

/* Use spare height for identity; the emblem yields space to the navigation. */
@media (min-width: 751px) {
 body .sidebar .brand { order: 0; }
 body .sidebar nav { order: 1; }
 body .sidebar::after {
  content: ''; order: 2; display: block; flex: 1 1 150px; min-height: 0;
  max-height: 240px; width: min(100%, 190px); margin: auto; align-self: center;
  background: url('/emblem.svg') center / contain no-repeat; opacity: .72;
  pointer-events: none;
 }
 body .sidebar .provider-brand { order: 3; }
 body .sidebar .side-bottom { order: 4; }
}
@media (min-width: 751px) and (min-height: 760px) {
 body > .sidebar, body.admin-page #admin-sidebar { padding: 16px 12px; gap: 12px; }
 body .sidebar .brand img, body.admin-page #admin-sidebar .brand img { width: 54px; height: 54px; }
 body .sidebar nav, body.admin-page #admin-sidebar nav { gap: clamp(4px, .8vh, 10px); }
 body .sidebar nav :is(button,a), body.admin-page #admin-sidebar nav a { min-height: 40px; padding: 9px 8px; }
 body .sidebar .provider-brand { min-height: 82px; padding: 10px 8px 22px; margin: 0; }
 body .sidebar .provider-brand img { width: 42px; height: 42px; }
 body .sidebar .provider-brand b { font-size: 20px; }
 body .sidebar .provider-brand span { display: block; bottom: 7px; font-size: 8px; letter-spacing: .5px; }
 body.participant-app > main > #dashboard {
  grid-template-rows: minmax(150px, 1fr) auto;
  grid-auto-rows: minmax(86px, .5fr); align-content: stretch; gap: 14px;
 }
 body #dashboard:not(:has(#recent-history-panel:not([hidden]))) { grid-template-columns: repeat(2,minmax(0,1fr)); }
 body #dashboard > .hero { height: auto; min-height: 0; padding: 24px 30px; }
 body #dashboard .hero h2 { font-size: clamp(30px, 2.8vw, 46px); }
 body #dashboard .hero .eyebrow { display: block; }
 body #dashboard .hero .gold-link { padding: 8px 14px; font-size: 15px; border: 1px solid var(--action-edge); }
 body #dashboard .hero-art img { width: clamp(100px, 15vh, 170px); height: clamp(100px, 15vh, 170px); }
 body #dashboard .stat { padding: 16px; }
 body #dashboard .stat-value { font-size: 36px; }
 body #dashboard .compact-summary { height: 100%; min-height: 86px; }
 body #dashboard .compact-launcher { min-height: 52px; font-size: 19px; }
 body #invitations { display: flex; flex-direction: column; gap: 18px; overflow: auto; }
 body #participant-invitations { flex: 0 0 auto; padding: 24px; gap: 20px; }
 body #participant-invitations > p { font-size: 15px; line-height: 1.65; }
 body .invitation-role-panel > .compact-summary { min-height: clamp(90px, 14vh, 160px); padding: 20px; }
 body .invitation-role-panel .compact-launcher { font-size: clamp(19px, 1.6vw, 25px); min-height: 54px; }
 body #invitations::after {
  content: 'NIHIL SINE DEO'; flex: 1 1 180px; min-height: 110px;
  display: flex; align-items: center; padding: 24px 36px;
  background: url('/emblem.svg') right 36px center / auto 78% no-repeat,
   radial-gradient(ellipse at right, #294b61, #102b40 70%);
  color: var(--action-gold); border: 3px solid var(--action-edge); border-radius: 28px;
  font-size: clamp(24px, 2.8vw, 42px); letter-spacing: .12em;
 }
}
@media (max-width: 750px), (max-height: 640px) {
 body .sidebar::after { display: none; }
}


/* Authorized Figma ergonomics overlay, synthetic validation pending. */
/* Design proposal for four synthetic role panels. Exact candidate stylesheet; publication requires approval. */
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/ux-font-01.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/ux-font-02.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/ux-font-01.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/ux-font-02.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/ux-font-01.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/ux-font-02.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/ux-font-01.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/ux-font-02.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('/ux-font-03.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('/ux-font-04.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('/ux-font-03.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('/ux-font-04.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
 --ux-reading: Inter, 'Segoe UI', Arial, sans-serif;
 --ux-heading: 'Noto Serif', 'Palatino Linotype', Georgia, serif;
 --ux-navy: #102b40;
 --ux-gold: #b79556;
 --ux-on-navy: #ffe0a3;
 --ux-surface: #fffdf8;
 --ux-background: #f7f2e7;
 --ux-text: #15273b;
 --ux-muted: #526176;
 --ux-edge: #c3cbd2;
 --ux-focus: #326b94;
 --ux-nav-active: #27475f;
 --ux-space-sm: 8px;
 --ux-nav-gap: 3px;
 --ux-space-md: 16px;
 --ux-radius: 10px;
}
body { color:var(--ux-text); background:var(--ux-background); }
body :where(*) { font-family:var(--ux-reading) !important; font-weight:400 !important; }
body :where(h1,h2,h3,h4,.brand strong,.lodge-motto,.stat-value,.form-section-title) {
 font-family:var(--ux-heading) !important; font-weight:600 !important; line-height:1.3;
}
body :where(strong,b,th,button,.primary,.secondary,nav a,.eyebrow,.field,.office-label) { font-weight:600 !important; }
body :where(pre,code,pre *) { font-family:Consolas,'Courier New',monospace !important; }
body :where(input,select,textarea) { font-size:14px; line-height:1.5; border-color:var(--ux-edge); }
body .field { color:var(--ux-text); font-size:13px; gap:6px; }
body .small-muted, body .member-status, body .person-sub { color:var(--ux-muted); }
body :is(button.primary, a.primary, input[type=submit]) {
 background:var(--ux-navy) !important; color:var(--ux-on-navy) !important;
 border:1px solid var(--ux-gold) !important; border-radius:var(--ux-radius); min-height:44px;
}
body button.primary, body a.primary, body button.secondary, body a.secondary, body input[type=submit] {
 font-size:13px; line-height:20px; padding:11px 16px;
}
body :is(button.secondary, a.secondary, button.text-button,
button.icon-button, button.section-help-button) {
 background:var(--ux-surface) !important; color:var(--ux-navy) !important;
 border:1px solid var(--ux-edge) !important; border-radius:var(--ux-radius);
}
body :is(button.secondary, a.secondary):hover { background:#edf2f5 !important; }
/* The baseline action selector has specificity (0,2,2). Override it
   deliberately, including its gradient background and heritage corners. */
body :is(button,a,input).primary.primary {
 background:var(--ux-navy) !important; color:var(--ux-on-navy) !important;
 border:1px solid var(--ux-gold) !important; border-radius:var(--ux-radius) !important;
 min-height:44px;
}
body :is(button,a).secondary.secondary,
body button.text-button.text-button, body button.icon-button.icon-button,
body button.section-help-button.section-help-button {
 background:var(--ux-surface) !important; color:var(--ux-text) !important;
 border:1px solid var(--ux-edge) !important; border-radius:var(--ux-radius) !important;
 min-height:44px;
}
body :is(button,a).secondary.secondary:hover { background:#edf2f5 !important; }
body button.section-help-button.section-help-button { border-radius:50% !important; min-height:30px; }
body button.text-button { border-color:transparent !important; }
body button.section-help-button { min-width:30px; min-height:30px; border-radius:50%; }
body button.icon-button { min-width:36px; min-height:36px; font-size:24px; }
body:is(.participant-app,.admin-page) :is(button,input,select,textarea,a[role=button],summary):focus-visible {
 outline:3px solid var(--ux-focus) !important; outline-offset:3px;
}
body .sidebar nav :is(button,a) {
 background:transparent !important; color:#e8edf3 !important; border-color:transparent !important;
 min-height:38px; border-radius:8px; line-height:1.4; white-space:normal;
}
body .sidebar nav :is(button.active,a.active,a.is-active) {
 background:var(--ux-nav-active) !important; color:var(--ux-on-navy) !important;
 box-shadow:inset 3px 0 var(--ux-on-navy);
}
body .sidebar nav :is(button,a):hover { background:#223f56 !important; }
body .sidebar { overflow-y:auto; }
body .session-controls { flex-wrap:wrap; gap:8px; }
body .topbar { flex-wrap:wrap; }
body .topbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
body .topbar > .session-controls { grid-column:1 / -1; }
body .session-controls #connection-status { flex:1 1 100%; }
body .sidebar nav { gap:var(--ux-nav-gap); }
body #panel-context-notice {
 padding:6px 12px; margin:0 0 8px; font-size:12px; line-height:18px;
 border-width:1px !important; border-radius:var(--ux-radius) !important;
}
body .heading h1, body.participant-app .heading h1,
body.admin-page #admin-app .heading h1 { font-size:22px; line-height:29px; }
body .section-help-owner > .toolbar { padding-right:54px; }
body.admin-page #admin-app :is(button,a).secondary.secondary { min-height:44px; }
body .compact-launcher.compact-launcher {
 background:transparent !important; color:var(--ux-text) !important;
 border-color:transparent !important;
}
body .compact-summary { background:var(--ux-surface) !important; color:var(--ux-text) !important; }
body button.compact-launcher.compact-launcher:hover { background:#edf2f5 !important; color:var(--ux-text) !important; }
body.participant-app > main > :is(#finance-obligations,#finance-cash) { overflow:auto; }
body :is(#finance-obligations,#finance-cash) > .finance-panel:not(.compact-card) { min-height:254px; flex-shrink:0; }
body :is(#finance-obligations,#finance-cash) > .finance-panel > .finance-table-slot { min-height:124px; }
/* Reuse the application's role-aware navigation picker before the table
   becomes narrower than its working width. No privilege switch is added. */
@media (max-width:900px) {
 body.participant-app { height:auto; min-height:100dvh; overflow:auto; }
 body.participant-app > .sidebar {
  position:static; width:auto; height:auto; margin:8px; padding:12px;
  display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,1fr); gap:8px;
 }
 body.participant-app > .sidebar nav { display:none; }
 body.participant-app > .sidebar .navigation-picker {
  display:block; width:100%; min-height:44px; align-self:center;
  background:var(--ux-navy); color:var(--ux-on-navy); border-color:var(--ux-gold);
 }
 body.participant-app > .sidebar .provider-brand {
  min-height:0; padding:8px; margin:0; max-width:220px;
 }
 body.participant-app > .sidebar .side-bottom { align-self:center; margin:0; }
 body.participant-app > main { margin-left:0; width:100%; height:auto; min-height:0; padding:12px; overflow:visible; }
 body.participant-app > main > .page { flex:0 0 auto; height:auto; overflow:visible; }
 body.participant-app .finance-table-slot, body.participant-app .finance-table-slot > .panel {
  flex:0 0 auto; height:auto; min-height:0;
 }
 body.participant-app > main > :is(#finance-obligations,#finance-cash) { flex:0 0 auto; height:auto; overflow:visible; }
 body :is(#finance-obligations,#finance-cash) > .finance-panel,
 body :is(#finance-obligations,#finance-cash) > .finance-panel > .finance-table-slot,
 body :is(#finance-obligations,#finance-cash) > .finance-panel .finance-table {
  flex:0 0 auto; height:auto; min-height:0; overflow:visible;
 }
 body.participant-app .table-wrap td:last-child:has(button) {
  position:sticky; right:0; background:var(--ux-surface); z-index:1;
 }
}
body .panel-heading { align-items:center; }
body th { letter-spacing:.02em; color:var(--ux-muted); }
body td { font-size:14px; line-height:1.5; }
body .dialog-heading { align-items:flex-start; gap:12px; }
body dialog .dialog-scroll { padding-top:16px; }
body dialog .dialog-footer { position:sticky; bottom:0; z-index:1; background:var(--ux-surface); flex-wrap:wrap; }
body .error, body .finance-failure { color:#8b2e23; background:#fff4f0; border-color:#ca9c90; }
body .notice { color:var(--ux-text); }
@media (max-width:1000px) {
 body .topbar { gap:8px; }
 body .heading { flex-wrap:wrap; }
 body .heading .primary { margin-left:auto; }
 body .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body .field.wide { grid-column:span 2; }
}
@media (max-width:600px) {
 body .topbar { grid-template-columns:minmax(0,1fr); }
 body .form-grid { grid-template-columns:minmax(0,1fr); }
 body .field.wide { grid-column:auto; }
 body .heading .primary { margin-left:0; }
 body dialog { width:calc(100vw - 24px); }
 body .dialog-footer .primary { width:100%; }
}


/* Keep the member-sheet action visible before any horizontal scrolling. */
body.participant-app #members-body td:last-child {
 position:sticky; right:0; z-index:2; background:var(--ux-surface);
}
body.participant-app #members-body td:last-child button {
 min-width:80px; min-height:44px; white-space:nowrap;
}


/* Finite grouping of rare commands; primary work stays directly available. */
body details.panel-action-group { display:block; min-width:0; max-width:100%; margin:0; }
body details.panel-action-group > summary {
 list-style:none; cursor:pointer; display:flex; align-items:center; gap:8px;
 min-height:44px; padding:10px 13px; box-sizing:border-box;
 font-family:var(--ux-reading); font-size:13px; font-weight:600; line-height:20px;
 color:var(--ux-text); background:var(--ux-surface);
 border:1px solid var(--ux-edge); border-radius:var(--ux-radius);
}
body details.panel-action-group > summary::-webkit-details-marker { display:none; }
body details.panel-action-group > summary::after { content:'▾'; margin-left:auto; }
body details.panel-action-group[open] > summary::after { content:'▴'; }
body .panel-action-group-body { display:flex; flex-direction:column; gap:8px; padding:8px 0; max-width:100%; }
body .panel-action-group-body > :is(button,a) { max-width:100%; white-space:normal; text-align:left; }
body .admin-actions > .panel-action-group { flex:1 1 170px; }
body .heading > .panel-action-group { flex:0 1 auto; }
body .compact-summary h2:has(> .panel-action-group) { min-width:0; width:auto; }
body .panel-action-group:focus-within { position:relative; z-index:3; }
@media(max-width:900px){
 body .session-controls > .panel-action-group { flex:1 1 180px; }
 body .heading > .panel-action-group,body .admin-actions > .panel-action-group { max-width:100%; }
}

/* Keep the Lodge and its frequent action reachable while metadata scrolls. */
@media (max-width:900px) {
 body.admin-page #admin-lodges td:last-child,
 body.admin-page #admin-lodges th:last-child {
  position:sticky; right:0; z-index:2; background:var(--ux-surface);
  box-shadow:-1px 0 var(--ux-edge);
 }
 body.admin-page #admin-lodges th:last-child { z-index:3; }
 body.admin-page #admin-lodges td:last-child { vertical-align:top; }
}

/* Finite authorized batch: member sheet (three tabs), administrator installation,
   receipt and individual obligation. Values, validation and DOM order stay intact. */
body.participant-app #member-dialog { width:min(640px,calc(100vw - 24px)); }
body #member-form { display:flex; flex-direction:column; min-height:0; max-height:calc(100dvh - 28px); }
body #member-form .dialog-heading { padding:12px 16px; margin:0; flex-shrink:0; }
body #member-form .member-tabs { padding:6px 16px; margin:0; gap:4px; flex-shrink:0; }
body #member-form .member-tabs button { min-height:44px; }
body #member-form .dialog-scroll { padding:10px 16px 12px; flex:1 1 auto; min-height:0; max-height:calc(100dvh - 180px); overflow:auto; }
body #member-form .form-section-title { margin:0 0 10px; padding-block:0; }
body #member-form .dialog-footer { padding:10px 16px; gap:10px; flex-shrink:0; }
body #member-form :is(#identity-fields,#grade-fields,#extra-fields) { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:10px; }
body #member-form :is(#identity-fields,#grade-fields,#extra-fields) > .field { grid-column:span 6; min-width:0; margin:0; gap:4px; }
body #member-form #identity-fields > .field:has([name="number"]) { grid-column:span 3; }
body #member-form #identity-fields > .field:has([name="birth_date"]) { grid-column:span 3; }
body #member-form #identity-fields > .field:has([name="birth_place"]) { grid-column:span 6; }
body #member-form #identity-fields > .field:has([name="phone"]) { grid-column:span 4; }
body #member-form #identity-fields > .field:has([name="email"]) { grid-column:span 8; }
body #member-form #identity-fields > .field:has([name="address"]) { grid-column:1 / -1; }
body #member-form #grade-fields > .field:has(input) { grid-column:span 4; }
body #member-form #grade-fields > .field:has([name="confirmed_grade"]) { grid-column:1 / -1; }
body #member-form #extra-fields > .field:has([name="mlnr_role"]) { grid-column:span 6; }
body #member-form :is(input,select,textarea) { width:100%; min-width:0; max-width:100%; min-height:44px; }
body #member-form :is([name="birth_date"],[name="initiation"],[name="fellow"],[name="master"]) { max-width:18ch; }
body #member-form [name="number"] { max-width:14ch; }
body #member-form [name="cnp"] { max-width:20ch; }
body #member-form [name="confirmed_grade"] { max-width:34ch; }
body #member-form [name="status"] { max-width:22ch; }
body #member-form textarea { min-height:84px; resize:vertical; }
body #member-form :is(.error,.notice) { min-width:0; overflow-wrap:anywhere; }

body.admin-page #admin-app #admin-install-form { width:100%; max-width:640px; display:grid; grid-template-columns:repeat(12,minmax(0,1fr)) !important; gap:6px 10px !important; align-items:start; }
body.admin-page #admin-app #admin-install-form > .field { display:grid; grid-column:span 6; min-width:0; margin:0; padding:0; gap:4px; }
body.admin-page #admin-app #admin-install-form :is(input,select) { width:100%; min-width:0; max-width:100%; min-height:44px; }
body.admin-page #admin-app #admin-install-form > p { grid-column:1 / -1; margin:0; min-width:0; overflow-wrap:anywhere; }
body.admin-page #admin-app #admin-install-form > #admin-install-recipient-status { grid-column:span 6; align-self:end; }
body.admin-page #admin-app #admin-install-form > button { min-height:44px; max-width:100%; justify-self:start; margin:0; }
body.admin-page #admin-app #admin-install-form > button[type="submit"] { grid-column:span 7; }
body.admin-page #admin-app #admin-install-form > .admin-discard { grid-column:span 5; }

body :is(#finance-receipt-form,#finance-obligation-form) { grid-template-columns:repeat(12,minmax(0,1fr)); gap:8px 10px; padding:8px 10px 12px; }
body :is(#finance-receipt-form,#finance-obligation-form) > .field { grid-column:span 6; min-width:0; margin:0; gap:4px; }
body :is(#finance-receipt-form,#finance-obligation-form) :is(input,select) { width:100%; min-width:0; max-width:100%; min-height:44px; }
body #finance-receipt-form > .field:has(:is([name="date"],[name="amount_cents"],[name="account"])) { grid-column:span 4; }
body #finance-obligation-form > .field:has(:is([name="year"],[name="installment"])) { grid-column:span 2; }
body #finance-obligation-form > .field:has(:is([name="amount_cents"],[name="due_date"])) { grid-column:span 4; }
body #finance-obligation-form > .field:has([name="reference"]) { grid-column:1 / -1; }
body :is(#finance-receipt-form,#finance-obligation-form) :is([name="date"],[name="due_date"]) { max-width:18ch; }
body :is(#finance-receipt-form,#finance-obligation-form) :is([name="amount_cents"],[name="prior_collected_cents"],[name="prior_mlnr_cents"]) { max-width:23ch; }
body #finance-obligation-form :is([name="year"],[name="installment"]) { max-width:10ch; }
body #finance-receipt-form [name="account"] { max-width:22ch; }
body :is(#finance-receipt-form,#finance-obligation-form) :is(.error,.notice,.finance-note) { overflow-wrap:anywhere; min-width:0; }
@media(max-width:900px) {
 body.admin-page #admin-app #admin-install-form > :is(.field,#admin-install-recipient-status) { grid-column:1 / -1; }
}
@media(max-width:600px) {
 body #member-form #identity-fields > .field:has(:is([name="number"],[name="birth_date"],[name="birth_place"],[name="phone"])) { grid-column:span 6; }
 body #member-form #identity-fields > .field:has(:is([name="email"],[name="address"],[name="cnp"])) { grid-column:1 / -1; }
 body #member-form #grade-fields > .field:has(input) { grid-column:span 6; }
 body #finance-receipt-form > .field:has(:is([name="member_id"],[name="category"])) { grid-column:1 / -1; }
 body #finance-receipt-form > .field:has(:is([name="date"],[name="amount_cents"],[name="account"])) { grid-column:span 6; }
 body #finance-obligation-form > .field:has(:is([name="year"],[name="amount_cents"],[name="due_date"],[name="installment"])) { grid-column:span 6; }
}
@media(max-width:400px) {
 body #member-form :is(#identity-fields,#grade-fields,#extra-fields) > .field,
 body :is(#finance-receipt-form,#finance-obligation-form) > .field { grid-column:1 / -1 !important; }
}

/* Goal corectii: actions are distinct from white editable fields. */
body:is(.participant-app,.admin-page) :is(button,button.secondary.secondary,button.primary.primary,button.text-button.text-button,button.icon-button.icon-button,button.section-help-button.section-help-button,button.compact-launcher.compact-launcher,a.secondary.secondary,a.primary.primary,input.primary.primary) {
 background:var(--ux-navy,#102b40) !important; color:var(--ux-on-navy,#ffe0a3) !important; border-color:var(--ux-gold,#b79556) !important;
}
body:is(.participant-app,.admin-page) :is(button,a.secondary,a.primary):hover { background:#27475f !important; color:#ffe0a3 !important; }
body:is(.participant-app,.admin-page) :is(button,input.primary):disabled { opacity:1; background:#27475f !important; color:#d4dee6 !important; cursor:default; }
body:is(.participant-app,.admin-page) .sidebar nav :is(button.active,a.is-active) { background:#27475f !important; box-shadow:inset 3px 0 #ffe0a3; }
body:is(.participant-app,.admin-page) :is(.panel,.stat,.admin-card,.settings-card,.finance-preview,.admin-explanation) { background:var(--ux-background,#f7f2e7); }
body.admin-compact-layout { height:100dvh; min-height:0; overflow:hidden; }
body.admin-compact-layout #admin-sidebar { position:fixed; left:8px; top:8px; bottom:8px; width:220px; height:calc(100dvh - 16px); padding:12px; margin:0; overflow:hidden; }
body.admin-compact-layout #admin-sidebar .brand { gap:8px; padding-bottom:12px; }
body.admin-compact-layout #admin-sidebar .brand img { width:48px; height:48px; }
body.admin-compact-layout #admin-sidebar .brand strong { font-size:18px; }
body.admin-compact-layout #admin-sidebar nav { display:flex; flex-direction:column; gap:4px; padding:0; }
body.admin-compact-layout #admin-sidebar nav a { min-height:44px; padding:10px; font-size:14px; }
body.admin-compact-layout #admin-sidebar .side-bottom { margin-top:auto; padding:8px 0; }
body.admin-compact-layout #admin-sidebar .side-bottom::before { height:50px; min-height:50px; }
body.admin-compact-layout #admin-sidebar .side-bottom :is(.rule-symbol,p:not(.lodge-motto)) { display:none; }
body.admin-compact-layout #admin-app { display:flex; flex-direction:column; height:100dvh; min-height:0; margin-left:236px; padding:12px 20px; overflow:hidden; gap:8px; }
body.admin-compact-layout #admin-app[hidden] { display:none; }
body.admin-compact-layout #admin-app > .heading,body.admin-compact-layout #admin-app > .small-muted { display:none; }
body.admin-compact-layout #admin-app > .topbar { flex:0 0 auto; min-height:0; padding:0 0 8px; gap:8px; letter-spacing:normal; }
body.admin-compact-layout #admin-app .session-controls { display:flex; align-items:center; gap:8px; }
body.admin-compact-layout #admin-app #admin-account { flex:1 1 auto; min-width:120px; font-size:13px; }
body.admin-compact-layout #admin-workspace { flex:1 1 0; min-height:0; margin:0; display:flex; flex-direction:column; gap:12px; }
body.admin-compact-layout #admin-workspace[hidden] { display:none; }
body.admin-compact-layout .admin-workspace-heading { flex:0 0 auto; margin:0; }
body.admin-compact-layout #admin-section-content { flex:1 1 0; min-height:0; padding:0; overflow:hidden; }
body.admin-compact-layout .admin-menu-page { margin:0; border:0 !important; background:transparent; box-shadow:none; }
body.admin-compact-layout #admin-section-content > .admin-menu-page { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; align-content:start; }
body.admin-compact-layout .admin-menu-page > .panel-heading { display:none; }
body.admin-compact-layout .admin-menu-page > .admin-menu-page { display:contents; }
body.admin-compact-layout .admin-menu-grid { grid-column:1 / -1; display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px !important; padding:0 !important; }
body.admin-compact-layout :is(.admin-function-launcher,.admin-menu-grid a) { display:flex; align-items:center; justify-content:center; min-height:64px !important; padding:16px !important; margin:0; width:100%; color:#ffe0a3 !important; background:#102b40 !important; border:1px solid #b79556; border-radius:10px !important; text-align:center; text-decoration:none; font-size:14px; line-height:1.4; }
body.admin-compact-layout #admin-app > footer { flex:0 0 auto; padding:4px 0; font-size:11px; }
body.admin-compact-layout dialog.admin-function-dialog { width:min(1400px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); padding:0; overflow:hidden; background:#f7f2e7; }
body.admin-compact-layout dialog.admin-function-dialog[open] { display:flex; flex-direction:column; }
body.admin-compact-layout .admin-function-dialog > .admin-window-heading { flex:0 0 auto; padding:12px 16px; }
body.admin-compact-layout .admin-window-body { flex:1 1 auto; min-height:0; overflow:auto; padding:16px; letter-spacing:normal; }
body.admin-compact-layout .admin-window-body :is(.table-wrap,.admin-list) { max-height:none; overflow:visible; }
body.admin-compact-layout .admin-window-body > .panel-heading h2 { display:none; }
body.admin-compact-layout .admin-window-body > :is(p,.admin-actions,.admin-source) { margin:0 0 12px; padding:0; }
body.admin-compact-layout .admin-window-body .settings-card { padding:0; border:0; }
body.admin-compact-layout .admin-window-body .admin-menu-page > .panel-heading { display:block; }
body.admin-compact-layout .admin-account-tools { display:flex; flex-wrap:wrap; gap:12px; }
body.admin-compact-layout .admin-account-tools > :is(#pwa-install-help,#pwa-uninstall-panel) { flex:1 1 100%; letter-spacing:normal; }
body.admin-compact-layout #admin-alerts-button.needs-attention { border-color:#cf713f !important; box-shadow:inset 0 0 0 1px #cf713f; }
@media(max-width:1100px) {
 body.admin-compact-layout:not(.signed-out) { display:block; }
 body.admin-compact-layout #admin-app .session-controls { flex-wrap:wrap; }
 body.admin-compact-layout #admin-section-content > .admin-menu-page,body.admin-compact-layout .admin-menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:650px) {
 body.admin-compact-layout #admin-sidebar { position:static; width:auto; height:auto; margin:6px 8px; padding:8px; }
 body.admin-compact-layout #admin-sidebar .side-bottom { display:none; }
 body.admin-compact-layout #admin-sidebar .brand { padding:0; }
 body.admin-compact-layout #admin-sidebar nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.admin-compact-layout #admin-sidebar nav a { min-height:36px; padding:6px 8px; }
 body.admin-compact-layout #admin-app { margin-left:0; height:auto; flex:1; padding:8px 12px; }
 body.admin-compact-layout:not(.signed-out) { display:flex; flex-direction:column; }
 body.admin-compact-layout :is(.admin-function-launcher,.admin-menu-grid a) { padding:8px; font-size:13px; }
}

/* Agentoria: one persistent home and one reusable function window. */
body.admin-unified-layout #admin-section-content { display:flex; flex-direction:column; }
body.admin-unified-layout .admin-home-pane { display:flex; flex-direction:column; gap:16px; border:0 !important; background:transparent; box-shadow:none; margin:0; padding:0; min-height:0; }
body.admin-unified-layout .admin-home-pane > h2 { margin:0; font-size:24px; }
body.admin-unified-layout #admin-app #admin-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:0; }
body.admin-unified-layout #admin-summary .admin-card { min-width:0; padding:12px; }
body.admin-unified-layout .admin-home-pane .admin-cards { margin:0; }
body.admin-unified-layout .admin-home-pane .admin-card { margin:0; }
body.admin-unified-layout .admin-home-health { padding:16px; border:1px solid var(--ux-gold); border-radius:14px; background:var(--ux-surface); }
body.admin-unified-layout .admin-home-health h2 { font-size:20px; margin:0 0 12px; }
body.admin-unified-layout .admin-home-tools { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
body.admin-unified-layout #admin-app #admin-home-health-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:0; }
body.admin-unified-layout .admin-home-tools a { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
body.admin-unified-layout .admin-window-body[hidden] { display:none !important; }
body.admin-unified-layout .admin-window-heading { display:flex; align-items:center; gap:12px; }
body.admin-unified-layout .admin-window-heading h2 { flex:1; min-width:0; margin:0; font-size:24px; }
body.admin-unified-layout .admin-window-slot { display:flex; flex:1; flex-direction:column; min-height:0; overflow:hidden; }
body.admin-unified-layout .admin-window-slot > .admin-popup-pane { display:contents; }
body.admin-unified-layout .admin-window-slot > .admin-popup-pane > .admin-window-body { flex:1; min-height:0; overflow:auto; }
body.admin-unified-layout .admin-window-body > .panel-heading h2 { display:none; }
body.admin-unified-layout .admin-window-body .admin-menu-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
body.admin-unified-layout .admin-window-body .admin-menu-grid a { min-height:44px !important; padding:12px !important; font-size:14px; }
body.admin-unified-layout .admin-window-body :is(.admin-list,.table-wrap) { overflow:visible; max-height:none; }
body.admin-unified-layout .admin-technical-trigger { min-height:36px; padding:6px 10px; font-size:12px; }
body.admin-unified-layout .admin-technical-value { overflow-wrap:anywhere; margin:8px 0; }
@media(max-width:1000px) {
 body.admin-unified-layout #admin-app #admin-summary,body.admin-unified-layout #admin-app #admin-home-health-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
 body.admin-unified-layout #admin-summary .admin-card { padding:10px; }
 body.admin-unified-layout #admin-app .admin-card strong { font-size:20px; }
 body.admin-unified-layout #admin-app .admin-card p { font-size:12px; line-height:1.3; margin:4px 0; }
 body.admin-unified-layout .admin-home-pane { gap:10px; }
 body.admin-unified-layout .admin-home-health { padding:10px; }
 body.admin-unified-layout #admin-home-health-summary .admin-card { padding:8px; }
 body.admin-unified-layout #admin-app #admin-home-health-summary strong { font-size:16px; overflow-wrap:anywhere; }
 body.admin-unified-layout #admin-app .admin-home-tools :is(button,a) { min-height:36px !important; padding:6px 8px !important; font-size:12px; }
 body.admin-unified-layout #admin-app .admin-workspace-heading { display:none; }
 body.admin-unified-layout .admin-home-pane > h2 { font-size:20px; }
}

/* Native Figma AI specification 154:5340, R1/R4/R5/R6/R7. */
body.figma-ai-layout { --ai-sidebar:208px; --ux-navy:#122c3e; --ux-text:#15273b; --ux-surface:#fffefa; --ux-muted:#52657c; background:#f7f2e8; font-size:14px; line-height:20px; }
body.figma-ai-layout :is(button,input,select,textarea,a.secondary,summary) { font-size:14px; line-height:20px; border-radius:6px !important; }
body.figma-ai-layout :where(button,a.secondary,summary) { min-height:44px !important; padding:10px 14px; white-space:normal; }
body.figma-ai-layout :where(button,a.secondary):not(.icon-button):not(.section-help-button):not(.meeting-day):not(.meeting-time-button) { min-width:96px; }
body.figma-ai-layout :where(input:not([type=checkbox]):not([type=radio]),select,textarea) { box-sizing:border-box; height:44px; min-height:44px !important; font-size:16px !important; line-height:24px; padding:8px 12px; max-width:100%; }
body.figma-ai-layout textarea { min-height:112px !important; resize:vertical; }
body.figma-ai-layout .field { font-size:14px; line-height:20px; gap:6px; }
body.figma-ai-layout :where(button,input,select,textarea,summary,a):focus-visible { outline:2px solid #276e9b !important; outline-offset:2px; }
body.figma-ai-layout :where(.icon-button,.section-help-button) { width:44px !important; min-width:44px !important; height:44px !important; min-height:44px !important; padding:8px; }
body.figma-ai-layout :is(.panel,.finance-panel,.admin-card,.stat,.stat-card,.admin-home-health) { border-radius:8px !important; box-shadow:none; border-width:1px !important; }
body.figma-ai-layout .stat-label { padding-right:52px; min-height:44px; }
body.figma-ai-layout .stat > .section-help-floating { top:12px; right:12px; }
body.figma-ai-layout .panel > .section-help-floating { position:static; margin:12px; align-self:flex-end; float:none; }
body.figma-ai-layout .sidebar,body.figma-ai-layout.admin-page #admin-sidebar { position:fixed; inset:0 auto 0 0; width:var(--ai-sidebar); height:100dvh; padding:16px; margin:0; border:0; border-radius:0 !important; overflow-y:auto; overflow-x:hidden; display:flex; flex-direction:column; gap:12px; background:#122c3e !important; }
body.figma-ai-layout .sidebar .brand { display:flex; flex-direction:column; align-items:flex-start; gap:6px; padding:0 0 12px; text-align:left; border-bottom:1px solid #b79556; }
body.figma-ai-layout .sidebar .brand img { width:44px; height:44px; margin:0 0 6px; flex:none; }
body.figma-ai-layout .sidebar .brand strong { font-size:20px; line-height:28px; overflow-wrap:normal; word-break:normal; }
body.figma-ai-layout .sidebar .brand span { font-size:14px; line-height:20px; margin:4px 0 0; display:block; }
body.figma-ai-layout .sidebar nav,body.figma-ai-layout.admin-page #admin-sidebar nav { display:flex; flex-direction:column; gap:4px; width:100%; padding:0; overflow:visible; }
body.figma-ai-layout .sidebar nav :is(button,a,summary) { width:100%; min-height:44px !important; padding:10px 12px; border:0; border-radius:6px !important; font-size:14px; line-height:20px; text-align:left; letter-spacing:normal; color:#f8ead0; text-decoration:none; background:transparent !important; }
body.figma-ai-layout .sidebar nav :is(button,a).active,body.figma-ai-layout .sidebar nav a.is-active { background:#29495e !important; box-shadow:inset 3px 0 #ffe0a3; }
body.figma-ai-layout .ai-nav-group { width:100%; }
body.figma-ai-layout .ai-nav-group > summary { cursor:pointer; }
body.figma-ai-layout .ai-nav-group[open] > summary { color:#ffe0a3; }
body.figma-ai-layout .ai-nav-group > div { padding-left:8px; border-left:1px solid #52657c; margin-left:8px; }
body.figma-ai-layout .sidebar .navigation-picker { display:none !important; }
body.figma-ai-layout .sidebar .provider-brand { width:auto; height:auto; min-height:0; padding:8px 0; margin:0; display:flex; }
body.figma-ai-layout .sidebar .provider-brand img { width:32px; height:32px; }
body.figma-ai-layout .sidebar .provider-brand b { font-size:14px; }
body.figma-ai-layout .sidebar .provider-brand span,body.figma-ai-layout .sidebar .side-bottom::before,body.figma-ai-layout .sidebar::after { display:none; }
body.figma-ai-layout .sidebar .side-bottom { margin-top:auto; padding:4px 0; min-height:0; }
body.figma-ai-layout .sidebar .local-dot { white-space:normal; word-break:normal; font-size:12px; line-height:18px; }
body.figma-ai-layout > main,body.figma-ai-layout.admin-page #admin-app { position:relative; display:flex; flex-direction:column; margin:0 0 0 var(--ai-sidebar); padding:16px; width:calc(100% - var(--ai-sidebar)); height:100dvh; min-height:0; overflow-y:auto; overflow-x:hidden; gap:12px; }
body.figma-ai-layout > main > .topbar,body.figma-ai-layout.admin-page #admin-app > .topbar { display:flex; align-items:center; flex-wrap:wrap; flex:0 0 auto; min-height:44px; padding:0; margin:0; gap:8px 12px; font-size:14px; line-height:20px; letter-spacing:normal; border:0; }
body.figma-ai-layout .topbar .top-date { display:none; }
body.figma-ai-layout .session-controls { display:flex; align-items:center; justify-content:flex-end; flex:1; flex-wrap:wrap; gap:8px; }
body.figma-ai-layout :is(#connection-status,#admin-account) { flex:1 1 160px; font-size:13px; line-height:18px; min-width:0; overflow-wrap:anywhere; }
body.figma-ai-layout > main > .heading { min-height:56px; padding:0; margin:0; display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; flex:0 0 auto; }
body.figma-ai-layout .heading h1,body.figma-ai-layout.admin-page #admin-app .heading h1 { font-size:24px; line-height:32px; margin:0; }
body.figma-ai-layout .heading > div { flex:1 1 240px; }
body.figma-ai-layout .heading .eyebrow,body.figma-ai-layout .heading p { display:none; }
body.figma-ai-layout #next-meeting-card { order:4; margin:0; padding:10px 16px; min-height:0; flex:none; }
body.figma-ai-layout > main > .page { order:3; flex:0 0 auto; min-height:0; height:auto; overflow:visible; }
/* Main workspaces grow with their controls; legacy ID rules must not create nested scroll areas. */
body.figma-ai-layout.participant-app > main > :is(#finance-obligations,#finance-cash,#finance-mlnr,#settings,#invitations) { overflow:visible; }
body.figma-ai-layout :is(#finance-obligations,#finance-cash) > .finance-panel { flex:0 0 auto; }
body.figma-ai-layout > main > :is(.notice,.error) { order:2; flex:none; }
body.figma-ai-layout > main > footer { order:5; padding:8px 0; margin-top:auto; flex:none; }
body.figma-ai-layout.participant-app > main > #dashboard { display:flex; flex-direction:column; gap:16px; overflow:visible; }
body.figma-ai-layout.participant-app > main > #dashboard.hidden { display:none; }
body.figma-ai-layout #dashboard .hero { display:none; }
body.figma-ai-layout #dashboard .stats { margin:0; flex:none; min-height:0; }
body.figma-ai-layout #dashboard .stat { min-height:96px; padding:16px; }
body.figma-ai-layout #dashboard > .two-col { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; height:auto; flex:none; }
body.figma-ai-layout #dashboard .two-col > .panel,body.figma-ai-layout #recent-history-panel { display:block; height:auto; min-height:0; overflow:visible; }
body.figma-ai-layout :is(#due-list,#upcoming-list,#recent-history) { max-height:none; height:auto; overflow:visible; }
body.figma-ai-layout .panel-heading { padding:16px 20px; gap:12px; }
body.figma-ai-layout .panel-heading h2,body.figma-ai-layout .finance-panel .panel-heading h2 { font-size:20px; line-height:28px; margin:0; }
body.figma-ai-layout .toolbar { gap:12px; padding:16px 20px; flex-wrap:wrap; }
body.figma-ai-layout .table-wrap { max-height:none; height:auto; overflow-x:auto; overflow-y:visible; }
body.figma-ai-layout table { width:100%; border-collapse:collapse; }
body.figma-ai-layout th,body.figma-ai-layout td { font-size:14px; line-height:20px; padding:12px; }
body.figma-ai-layout tbody tr { height:70px; }
body.figma-ai-layout td .ai-date-line { display:block; white-space:nowrap; }
body.figma-ai-layout #members table { min-width:756px; table-layout:fixed; }
body.figma-ai-layout #members th:nth-child(1) { width:176px; }
body.figma-ai-layout #members th:nth-child(2) { width:120px; }
body.figma-ai-layout #members th:nth-child(3) { width:180px; }
body.figma-ai-layout #members th:nth-child(4) { width:156px; }
body.figma-ai-layout #members th:nth-child(5) { width:124px; }
body.figma-ai-layout #members .search { flex:1 1 240px; }
body.figma-ai-layout .ai-mobile-filters { display:contents; }
body.figma-ai-layout .ai-mobile-filters > summary { display:none; }
body.figma-ai-layout .ai-mobile-filters > div { display:flex; gap:12px; }
body.figma-ai-layout .finance-obligations-layout { display:flex; flex-direction:column; gap:16px; }
body.figma-ai-layout .finance-obligations-layout > .finance-obligation-commands { order:0; }
body.figma-ai-layout .finance-obligations-layout > .finance-obligation-overview { order:1; }
body.figma-ai-layout .ai-money { white-space:nowrap !important; overflow-wrap:normal !important; word-break:normal !important; font-variant-numeric:tabular-nums; text-align:right; }
body.figma-ai-layout .finance-obligation-commands > .panel-heading { display:none; }
body.figma-ai-layout .finance-members { display:block; width:100%; min-height:0; }
body.figma-ai-layout #finance-obligations :is(.finance-table-slot,.finance-table,.finance-members) { height:auto; max-height:none; overflow:visible; min-height:0; flex:none; }
body.figma-ai-layout #finance-obligations .finance-table { overflow-x:auto; }
body.figma-ai-layout .finance-table table { min-width:756px; }
body.figma-ai-layout .finance-table td:has(.money),body.figma-ai-layout .finance-table .money,body.figma-ai-layout .finance-stat strong,body.figma-ai-layout .finance-stat-value { white-space:nowrap; overflow-wrap:normal; word-break:normal; font-variant-numeric:tabular-nums; text-align:right; }
body.figma-ai-layout .finance-stats { grid-template-columns:repeat(auto-fit,minmax(176px,1fr)); gap:12px; }
body.figma-ai-layout .finance-table th:last-child,body.figma-ai-layout .finance-table td:last-child { min-width:124px; }
body.figma-ai-layout .finance-table td:last-child:has(button) { position:sticky; right:0; background:var(--ux-surface); }
body.figma-ai-layout :is(#annexes,.officers-panel,#officers-form,.officer-grid) { height:auto !important; min-height:0 !important; overflow:visible !important; flex:none !important; }
body.figma-ai-layout .officer-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:none; gap:16px 24px; padding:20px; }
body.figma-ai-layout .officer-toolbar { flex-wrap:wrap; padding:16px 20px; gap:12px; }
body.figma-ai-layout .officer-toolbar > .section-help-button { position:static; margin:0; flex:none; }
body.figma-ai-layout .officer-field { display:flex; flex-direction:column; align-items:stretch; gap:6px; min-width:0; }
body.figma-ai-layout .office-label { font-size:14px; line-height:20px; }
body.figma-ai-layout .officer-field input { width:100%; min-width:0; }
body.figma-ai-layout dialog { width:680px; max-width:calc(100vw - 48px); max-height:calc(100dvh - 48px); border-radius:12px !important; padding:0; border:1px solid #bac6cf; }
body.figma-ai-layout dialog.ai-suspended-dialog { visibility:hidden !important; }
body.figma-ai-layout dialog.ai-suspended-dialog::backdrop { background:transparent !important; backdrop-filter:none !important; }
body.figma-ai-layout dialog.ai-active-dialog { visibility:visible !important; }
body.figma-ai-layout dialog.finance-dialog { width:680px; max-width:calc(100vw - 48px); }
body.figma-ai-layout dialog .dialog-heading { min-height:56px; padding:12px 24px; }
body.figma-ai-layout dialog .dialog-heading h2 { font-size:22px; line-height:30px; }
body.figma-ai-layout dialog :is(.dialog-scroll,.finance-dialog-body) { padding:24px; min-height:0; overflow:auto; }
body.figma-ai-layout dialog :is(.dialog-footer,.finance-form-actions) { min-height:64px; padding:12px 24px; gap:8px; position:sticky; bottom:0; background:var(--ux-surface); }
body.figma-ai-layout dialog .form-grid,body.figma-ai-layout dialog .finance-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 24px; }
body.figma-ai-layout dialog #finance-rules-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 24px; padding:0; }
body.figma-ai-layout dialog #finance-rules-form .field { width:100%; max-width:none; min-width:0; }
body.figma-ai-layout dialog #finance-rules-form :is(input:not([type=checkbox]),select) { width:100%; max-width:none; }
body.figma-ai-layout dialog :is(.finance-rule-semesters,.finance-rule-taxes,.finance-rule-dates) { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 24px; }
body.figma-ai-layout dialog :is(.finance-rule-wide,.finance-rule-actions) { grid-column:1/-1; }
body.figma-ai-layout dialog .finance-rule-actions { display:flex; flex-wrap:wrap; gap:8px; padding-top:8px; }
body.figma-ai-layout dialog #finance-rules-form .field:has(input[type=checkbox]) { grid-column:1/-1; display:flex; flex-direction:row; align-items:center; min-height:44px; }
body.figma-ai-layout #member-dialog,body.figma-ai-layout #import-dialog { inset:0 0 0 auto; margin:0; width:680px; max-width:calc(100vw - 32px); height:100dvh; max-height:100dvh; border-radius:0 !important; }
body.figma-ai-layout #member-form { height:100%; max-height:100%; }
body.figma-ai-layout #member-form > .dialog-scroll { min-height:0; overflow-y:auto; flex:1; }
body.figma-ai-layout .member-tabs { gap:8px; padding:8px 24px; }
body.figma-ai-layout dialog:has(#finance-mlnr-confirm-form) { width:480px; }
body.figma-ai-layout .admin-workspace,body.figma-ai-layout #admin-workspace,body.figma-ai-layout #admin-section-content { min-height:0; height:auto; flex:none; overflow:visible; }
body.figma-ai-layout .admin-menu-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
body.figma-ai-layout .admin-home-tools { flex-wrap:wrap; gap:8px; }
body.figma-ai-layout.admin-page #admin-workspace > .admin-workspace-heading { display:flex; align-items:center; gap:12px; margin:0 0 16px; }
body.figma-ai-layout.admin-page #admin-section-content > .admin-popup-pane { display:block; padding:20px; }
body.figma-ai-layout.admin-page #admin-section-content .admin-window-body { overflow:visible; }
body.figma-ai-layout.admin-page #admin-sidebar .brand { display:flex; flex-direction:column; align-items:flex-start; flex-wrap:nowrap; padding-bottom:12px; }
body.figma-ai-layout.admin-page #admin-sidebar .brand > span { flex-basis:auto; width:100%; white-space:normal; }
body.figma-ai-layout.admin-page #admin-app :is(button,a.primary,a.secondary,.admin-menu-grid a,summary) { border-radius:6px !important; min-height:44px !important; padding:10px 14px !important; }
body.figma-ai-layout.admin-page #admin-app :is(.panel,.admin-card,.notice,.error,.admin-explanation) { border-radius:8px !important; }
body.figma-ai-layout.admin-page #admin-section-content .admin-window-body { padding:0; }
body.figma-ai-layout.admin-page #admin-section-content > .admin-popup-pane { padding:20px; }
body.figma-ai-layout #content-admin-account-window { display:flex; flex-direction:column; gap:12px; }
body.figma-ai-layout #meetings { height:auto; overflow:visible; }
body.figma-ai-layout #meetings > .meeting-calendar-panel { height:auto; overflow:visible; padding:16px !important; }
body.figma-ai-layout .meeting-context { flex-wrap:wrap; align-items:flex-end; }
body.figma-ai-layout .meeting-context label { font-size:14px; }
body.figma-ai-layout .meeting-context :is(input,select) { max-width:180px; }
body.figma-ai-layout .meeting-month-nav { margin:12px 0; gap:8px; }
body.figma-ai-layout .meeting-month-nav button { min-width:44px; max-width:30%; height:auto; }
body.figma-ai-layout .meeting-month-grid { grid-auto-rows:auto; flex:none; gap:4px; }
body.figma-ai-layout #meeting-month-grid .meeting-day { width:100%; min-width:0; min-height:44px !important; height:44px; padding:4px !important; font-size:14px; line-height:20px; }
body.figma-ai-layout #meeting-month-grid .meeting-time-button { width:100%; min-width:0; min-height:32px !important; height:auto; padding:4px 0 !important; font-size:12px !important; }
body.figma-ai-layout .meeting-actions { flex-wrap:wrap; }
body.figma-ai-layout .meeting-small-dialog { padding:24px; }
body.figma-ai-layout .meeting-small-dialog .meeting-interval-editor { gap:16px; }
body.figma-ai-layout .ai-menu-button { display:none; }
body.figma-ai-layout .ai-navigation-dialog { width:320px; max-width:calc(100vw - 32px); height:100dvh; max-height:100dvh; inset:0 auto 0 0; margin:0; border-radius:0 !important; background:#122c3e; color:#fff0ce; padding:16px; overflow-y:auto; }
body.figma-ai-layout .ai-navigation-dialog > button { margin:0 0 12px; width:100%; }
body.figma-ai-layout .ai-navigation-dialog::backdrop { background:#122c3e80; }
@media(min-width:1280px) { body.figma-ai-layout { --ai-sidebar:224px; } body.figma-ai-layout > main,body.figma-ai-layout.admin-page #admin-app { padding:24px; } }
@media(max-width:1023px) {
 body.figma-ai-layout { height:auto; min-height:100dvh; overflow:auto; }
 body.figma-ai-layout .sidebar,body.figma-ai-layout.admin-page #admin-sidebar { position:relative; inset:auto; width:100%; height:auto; min-height:112px; padding:12px 16px; overflow:visible; display:block; margin:0; }
 body.figma-ai-layout .sidebar .brand { padding:0 110px 0 0; border:0; min-height:44px; display:block; }
 body.figma-ai-layout .sidebar .brand img { display:none; }
 body.figma-ai-layout .sidebar .brand strong { font-size:22px; line-height:30px; }
 body.figma-ai-layout .sidebar .brand span { margin-top:6px; }
 body.figma-ai-layout .sidebar .provider-brand,body.figma-ai-layout .sidebar .side-bottom { display:none; }
 body.figma-ai-layout .ai-menu-button { display:block; position:absolute; top:12px; right:16px; background:#122c3e; color:#ffe0a3; border:1px solid #b79556; }
 body.figma-ai-layout > main,body.figma-ai-layout.admin-page #admin-app { margin:0; padding:16px; width:100%; height:auto; min-height:calc(100dvh - 112px); overflow:visible; }
 body.figma-ai-layout .topbar > div:first-child { display:none; }
 body.figma-ai-layout .sidebar nav { display:flex; }
}
@media(max-width:767px) {
 body.figma-ai-layout .heading h1 { font-size:22px; line-height:30px; }
 body.figma-ai-layout #dashboard .two-col { grid-template-columns:minmax(0,1fr); }
 body.figma-ai-layout .officer-grid { grid-template-columns:minmax(0,1fr); padding:16px; }
 body.figma-ai-layout .toolbar { padding:16px; }
 body.figma-ai-layout .ai-mobile-filters { display:block; width:100%; }
 body.figma-ai-layout .ai-mobile-filters > summary { display:block; border:1px solid #bac6cf; padding:10px 12px; }
 body.figma-ai-layout .ai-mobile-filters > div { display:grid; grid-template-columns:1fr; gap:12px; padding-top:12px; }
 body.figma-ai-layout .ai-mobile-filters:not([open]) > div { display:none; }
 body.figma-ai-layout #members .search { flex-basis:100%; }
 body.figma-ai-layout .ai-card-table { min-width:0 !important; display:block; width:100%; }
 body.figma-ai-layout .ai-card-table thead { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
 body.figma-ai-layout .ai-card-table tbody { display:grid; gap:16px; }
 body.figma-ai-layout .ai-card-table tbody tr { display:block; height:auto; padding:16px; border:1px solid #ccd5dd; border-radius:8px; background:var(--ux-surface); }
 body.figma-ai-layout .ai-card-table tbody td { position:static !important; display:block; padding:5px 0; width:auto !important; border:0; background:transparent; overflow-wrap:anywhere; }
 body.figma-ai-layout .ai-card-table td::before { content:attr(data-column); display:block; font-size:13px; font-weight:600; color:var(--ux-muted); }
 body.figma-ai-layout .ai-card-table td:last-child:has(button) { padding-top:12px; }
 body.figma-ai-layout .ai-card-table td:last-child button { width:100%; }
 body.figma-ai-layout dialog { width:100%; max-width:100%; height:100dvh; max-height:100dvh; margin:0; border-radius:0 !important; }
 body.figma-ai-layout dialog.finance-dialog { width:100%; max-width:100%; }
 body.figma-ai-layout #member-dialog,body.figma-ai-layout #import-dialog { width:100%; max-width:100%; }
 body.figma-ai-layout dialog .form-grid,body.figma-ai-layout dialog .finance-form-grid { grid-template-columns:minmax(0,1fr); }
 body.figma-ai-layout dialog #finance-rules-form,body.figma-ai-layout dialog :is(.finance-rule-semesters,.finance-rule-taxes,.finance-rule-dates) { grid-template-columns:minmax(0,1fr); }
 body.figma-ai-layout dialog .field.wide { grid-column:auto; }
 body.figma-ai-layout dialog :is(.dialog-scroll,.finance-dialog-body) { padding:16px; }
 body.figma-ai-layout dialog :is(.dialog-heading,.dialog-footer,.finance-form-actions) { padding:12px 16px; }
 body.figma-ai-layout dialog .dialog-footer { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
 body.figma-ai-layout dialog:has(#finance-mlnr-confirm-form) { width:calc(100vw - 32px); max-width:calc(100vw - 32px); height:auto; max-height:calc(100dvh - 32px); margin:auto; border-radius:12px !important; }
 body.figma-ai-layout .admin-menu-grid { grid-template-columns:minmax(0,1fr); }
}

/* Figma 164:5083: title, next meeting, actions remain above the dashboard. */
body.figma-ai-layout main > .heading.has-next-meeting {display:grid;grid-template-columns:minmax(220px,1fr) minmax(290px,380px) auto;align-items:center;gap:16px;}
body.figma-ai-layout .heading.has-next-meeting .heading-summary {min-width:0;}
body.figma-ai-layout .heading.has-next-meeting .heading-actions {display:flex;flex-wrap:wrap;gap:12px;align-items:center;}
body.figma-ai-layout .heading.has-next-meeting #next-meeting-card {order:initial;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;padding:12px 16px;min-width:0;margin:0;}
body.figma-ai-layout .heading.has-next-meeting #next-meeting-card[hidden] {display:none;}
body.figma-ai-layout .heading.has-next-meeting #next-meeting-card strong {font-size:14px;line-height:1.5;overflow-wrap:anywhere;}
body.figma-ai-layout .heading.has-next-meeting #next-meeting-card small {font-size:12px;line-height:1.5;}
@media(max-width:1600px){body.figma-ai-layout main > .heading.has-next-meeting{grid-template-columns:1fr;}body.figma-ai-layout .heading.has-next-meeting .heading-actions{justify-content:flex-start;}}
@media(max-width:600px){body.figma-ai-layout .heading.has-next-meeting .heading-actions{flex-direction:column;align-items:stretch;}body.figma-ai-layout .heading.has-next-meeting .heading-actions button{width:100%;}}

body.figma-ai-layout .heading.has-next-meeting #next-meeting-card small {align-self:flex-start;text-align:left;}

/* Reserve the help button's row before financial values at every screen size. */
body.figma-ai-layout .finance-page .stat:has(> .section-help-floating) .stat-label { display:block; min-height:52px; padding-right:56px; }

/* Desktop workspaces use the available height before falling back to page scroll. */
@media (min-width:1024px) {
 body.figma-ai-layout > main,body.figma-ai-layout.admin-page #admin-app { padding:16px 20px; gap:8px; }
 body.figma-ai-layout .sidebar,body.figma-ai-layout.admin-page #admin-sidebar { padding:12px; gap:8px; }
 body.figma-ai-layout .sidebar .brand,body.figma-ai-layout.admin-page #admin-sidebar .brand { flex-direction:row; align-items:center; gap:8px; padding-bottom:8px; }
 body.figma-ai-layout .sidebar .brand img { width:32px; height:32px; margin:0; }
 body.figma-ai-layout .sidebar .brand strong { font-size:17px; line-height:22px; }
 body.figma-ai-layout .sidebar .brand span { font-size:13px; line-height:18px; margin-top:2px; }
 body.figma-ai-layout.admin-page #admin-sidebar .brand { display:grid; grid-template-columns:40px minmax(0,1fr); }
 body.figma-ai-layout.admin-page #admin-sidebar .brand img { grid-column:1; grid-row:1/3; }
 body.figma-ai-layout.admin-page #admin-sidebar .brand > :is(strong,span) { grid-column:2; min-width:0; width:auto; }
 body.figma-ai-layout .sidebar nav,body.figma-ai-layout.admin-page #admin-sidebar nav { gap:2px; }
 body.figma-ai-layout .sidebar nav :is(button,a,summary) { min-height:34px !important; padding:6px 8px; font-size:14px; line-height:20px; }
 body.figma-ai-layout .sidebar .provider-brand { padding:4px 0; }
 body.figma-ai-layout .sidebar .side-bottom { padding:0; }
 body.figma-ai-layout .sidebar .lodge-motto { margin:4px 0; }
 body.figma-ai-layout main > .heading.has-next-meeting { grid-template-columns:minmax(230px,1fr) minmax(260px,340px) auto; gap:12px; }
 body.figma-ai-layout .heading.has-next-meeting #next-meeting-card { padding:8px 12px; gap:2px; }
 body.figma-ai-layout > main > .heading { min-height:48px; }
 body.figma-ai-layout > main > #panel-context-notice { padding:6px 12px; line-height:20px; }
 body.figma-ai-layout > main > footer { padding:6px 0; gap:6px 12px; font-size:12px; line-height:16px; }
 body.figma-ai-layout > main :is(button,a.primary,a.secondary,summary),body.figma-ai-layout.admin-page #admin-app :is(button,a.primary,a.secondary,.admin-menu-grid a,summary) { min-height:36px !important; padding:6px 12px !important; }
 body.figma-ai-layout > main :is(input:not([type=checkbox]):not([type=radio]),select) { min-height:36px !important; padding:6px 10px; }
 body.figma-ai-layout .panel:has(> .section-help-floating) { position:relative; }
 body.figma-ai-layout .panel > .section-help-floating { position:absolute; top:8px; right:8px; margin:0; }
 body.figma-ai-layout .panel:has(> .section-help-floating) > :is(.panel-heading,.meeting-context,.toolbar) { padding-right:60px; }
 body.figma-ai-layout #participant-invitations:has(> .section-help-floating) > :is(h2,p) { padding-right:60px; }
 body.figma-ai-layout .panel-heading,body.figma-ai-layout .toolbar { padding:12px 16px; gap:10px; }
 body.figma-ai-layout th,body.figma-ai-layout td { padding:8px 10px; }
 body.figma-ai-layout #finance-obligations > .finance-panel,body.figma-ai-layout .finance-obligations-layout > .finance-panel { min-height:0; }
 body.figma-ai-layout .finance-obligations-layout { gap:10px; }
 body.figma-ai-layout #finance-obligations .finance-table :is(th,td) { padding:6px 10px; }
 body.figma-ai-layout #finance-obligations .finance-members > .panel-heading { padding:8px 16px; }
 body.figma-ai-layout #finance-obligations .finance-members > .toolbar { padding:8px 16px; }
 body.figma-ai-layout #finance-obligations .finance-stats .stat { padding:8px 12px; min-height:0; }
 body.figma-ai-layout #finance-obligations .finance-stats .stat-label { min-height:0; }
 body.figma-ai-layout #finance-obligations .finance-obligation-overview .stat-label { min-height:32px; padding-right:42px; }
 body.figma-ai-layout #finance-obligations .finance-obligation-overview .stat-value { font-size:22px; line-height:28px; margin:3px 0; white-space:nowrap; }
 body.figma-ai-layout #finance-obligations .finance-obligation-overview .stat-detail { font-size:12px; line-height:16px; }
 body.figma-ai-layout #finance-obligations .finance-obligation-overview .stat > .section-help-floating { top:8px; right:8px; width:32px !important; min-width:32px !important; height:32px !important; min-height:32px !important; padding:4px !important; }
 body.figma-ai-layout #finance-cash .stat-label { min-height:52px; }
 body.figma-ai-layout .finance-page > .finance-toolbar > .field { display:flex; flex-direction:row; align-items:center; gap:8px; max-width:none; margin:0; }
 body.figma-ai-layout .finance-page > .finance-toolbar .field input { width:128px; height:36px; min-height:36px !important; }
 body.figma-ai-layout .session-controls > .panel-action-group { position:relative; }
 body.figma-ai-layout .session-controls > .panel-action-group[open] { z-index:30; }
 body.figma-ai-layout .session-controls > .panel-action-group > .panel-action-group-body { position:absolute; top:calc(100% + 4px); right:0; width:280px; max-width:calc(100vw - 48px); max-height:min(440px,calc(100dvh - 100px)); overflow:auto; padding:12px; border:1px solid #b79556; border-radius:8px; background:var(--ux-surface); box-shadow:0 8px 24px #122c3e26; }
 body.figma-ai-layout tbody tr { height:auto; min-height:48px; }
 body.figma-ai-layout #dashboard { gap:12px !important; }
 body.figma-ai-layout #dashboard .stat { min-height:84px; padding:12px; }
 body.figma-ai-layout #dashboard .stat-label { min-height:36px; }
 body.figma-ai-layout #dashboard > .two-col { gap:12px; }
 body.figma-ai-layout #invitations { gap:12px; }
 body.figma-ai-layout #participant-invitations { padding:16px; gap:12px; }
 body.figma-ai-layout #participant-invitations > p { margin:6px 0; font-size:14px; line-height:22px; }
 body.figma-ai-layout .invitation-role-panel > .compact-summary { min-height:72px; padding:12px; }
 body.figma-ai-layout .invitation-role-panel .compact-launcher { font-size:18px; }
 body.figma-ai-layout #invitations::after { flex:0 0 auto; min-height:56px; padding:12px 20px; font-size:24px; border-radius:8px; border-width:1px; }
 body.figma-ai-layout #meetings > .meeting-calendar-panel { padding:12px !important; }
 body.figma-ai-layout #meetings .meeting-context { gap:8px; }
 body.figma-ai-layout #meetings .meeting-context label { display:flex; flex-direction:row; align-items:center; gap:8px; }
 body.figma-ai-layout .officer-grid { padding:12px 16px; gap:12px 16px; }
 body.figma-ai-layout .meeting-month-nav { margin:8px 0; }
 body.figma-ai-layout #meeting-month-grid { gap:4px; }
 body.figma-ai-layout #meeting-month-grid .meeting-cell { display:flex; flex-direction:row; align-items:stretch; gap:2px; min-height:44px; }
 body.figma-ai-layout #meeting-month-grid .meeting-day { width:auto; flex:1 1 0; min-height:44px !important; }
 body.figma-ai-layout #meeting-month-grid .meeting-time-button { width:auto; flex:1 1 0; min-height:44px !important; font-size:13px !important; }
 body.figma-ai-layout #meeting-month-grid .meeting-time-label { align-self:center; font-size:13px; }
 body.figma-ai-layout #meetings .meeting-actions { margin-top:8px; gap:8px; }
 body.figma-ai-layout #meetings .meeting-actions p:empty { display:none; }
 body.figma-ai-layout.admin-page #admin-workspace > .admin-workspace-heading { margin-bottom:10px; }
 body.figma-ai-layout.admin-page #admin-section-content > .admin-popup-pane { padding:12px 16px; }
 body.figma-ai-layout.admin-page #admin-devices .admin-role-installation { gap:4px; }
 body.figma-ai-layout.admin-page #admin-devices .admin-role-installation p { margin:4px 0 0; font-size:13px; line-height:18px; }
 body.figma-ai-layout.admin-page #admin-devices .admin-device-indicator { width:100%; min-height:36px !important; padding:6px 10px !important; }
 body.figma-ai-layout.admin-page #admin-devices :is(.admin-note,.admin-explanation,.panel-foot) { margin-top:8px; padding:8px 10px; line-height:20px; }
 body.figma-ai-layout.admin-page #admin-lodges-table td p { margin:3px 0; line-height:20px; }
 body.figma-ai-layout.admin-page #admin-lodges-table td:nth-child(3) { min-width:150px; }
 body.figma-ai-layout.admin-page #admin-lodges-table td:nth-child(4) { min-width:200px; }
 body.figma-ai-layout.admin-page #admin-lodges-table td:last-child { width:36%; min-width:360px; }
 body.figma-ai-layout.admin-page #admin-lodges-table .admin-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
 body.figma-ai-layout.admin-page #admin-lodges .admin-window-body > .admin-actions { align-items:flex-start; margin:8px 0; }
 body.figma-ai-layout.admin-page #admin-lodges [data-source] { margin:6px 0; }
 body.figma-ai-layout.admin-page #admin-lodges .toolbar { padding:6px 12px; }
 body.figma-ai-layout.admin-page #admin-lodges .toolbar > .field { display:flex; flex-direction:row; align-items:center; gap:8px; margin:0; }
 body.figma-ai-layout.admin-page #admin-lodges .admin-window-body > .panel-heading { display:none; }
 body.figma-ai-layout.admin-page #admin-section-content > #admin-lodges { padding:10px 12px; }
 body.figma-ai-layout.admin-page #admin-lodges .panel-foot { margin:6px 0 0; padding:4px 10px; font-size:12px; line-height:18px; }
}
@media (min-width:1280px) {
 body.figma-ai-layout .officer-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
 body.figma-ai-layout .finance-obligations-layout { display:grid; grid-template-columns:minmax(0,1fr) 400px; align-items:start; }
 body.figma-ai-layout .finance-obligation-overview .finance-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:1024px) and (max-width:1279px) {
 body.figma-ai-layout main > .heading.has-next-meeting { grid-template-columns:minmax(230px,1fr) minmax(250px,320px); }
 body.figma-ai-layout .heading.has-next-meeting .heading-actions { grid-column:1/-1; }
}

/* Short desktop windows keep the device search on one line without shrinking controls. */
@media (min-width:1024px) and (max-height:780px) {
 body.figma-ai-layout.admin-page #admin-devices .toolbar { padding:6px 12px; }
 body.figma-ai-layout.admin-page #admin-devices .toolbar > .field { display:flex; flex-direction:row; align-items:center; gap:8px; margin:0; }
 body.figma-ai-layout.admin-page #admin-devices .admin-source { padding-bottom:4px; }
 body.figma-ai-layout.admin-page #admin-devices .panel-foot { margin-bottom:8px; }
}

/* The ordinary More details must not inherit the page-wide 20px top margin. */
@media (min-width:1024px) and (max-height:780px) {
 body.figma-ai-layout.admin-page #admin-lodges .admin-window-body > .admin-actions > details { margin:0; }
 body.figma-ai-layout.admin-page #admin-lodges-table :is(th,td) { padding:5px 10px; }
}

/* The finite lodge shortcuts open above the table instead of growing the work area. */
@media (min-width:1024px) {
 body.figma-ai-layout.admin-page #admin-lodges .admin-window-body > .admin-actions > details { position:relative; margin:0; }
 body.figma-ai-layout.admin-page #admin-lodges .admin-window-body > .admin-actions > details[open] { z-index:30; }
 body.figma-ai-layout.admin-page #admin-lodges .admin-window-body > .admin-actions > details > .admin-menu-grid { position:absolute; top:calc(100% + 4px); left:0; width:520px; max-width:calc(100vw - 280px); max-height:min(400px,calc(100dvh - 160px)); overflow:auto; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px !important; padding:12px !important; border:1px solid #b79556; border-radius:8px; background:var(--ux-surface); box-shadow:0 8px 24px #122c3e26; }
}

/* Explicitly wide finance dialogs and MLNR table workspaces keep their intended width. */
@media (min-width:1024px) {
 body.figma-ai-layout dialog.finance-dialog.finance-dialog-wide,body.figma-ai-layout #finance-mlnr dialog.workspace-dialog:has(.finance-table) { width:min(1100px,calc(100vw - 48px)); }
}

/* Short backup views reserve space for the finite retention explanation without hiding data. */
@media (min-width:1024px) and (max-height:780px) {
 body.figma-ai-layout.admin-page #admin-backups .admin-window-body > .panel-heading:has(> h2:only-child) { display:none; }
 body.figma-ai-layout.admin-page #admin-backups .admin-source { margin-bottom:6px; padding-bottom:4px; }
 body.figma-ai-layout.admin-page #admin-backups .admin-cards { padding-bottom:4px; }
 body.figma-ai-layout.admin-page #admin-backups .admin-explanation { margin:6px 0 0; padding:6px 12px; }
 body.figma-ai-layout.admin-page #admin-backups .panel-foot { margin-bottom:6px; padding:6px 12px; }
}

/* The individual-obligation form has two readable columns inside its narrow dialog. */
@media (min-width:1024px) {
 body.figma-ai-layout dialog.finance-dialog:not(.finance-dialog-wide) #finance-obligation-form > .field:has(:is([name="year"],[name="amount_cents"],[name="due_date"],[name="installment"])) { grid-column:span 6; }
 body.figma-ai-layout dialog.finance-dialog:not(.finance-dialog-wide) #finance-obligation-form :is([name="year"],[name="due_date"]) { max-width:24ch; }
}

/* Finite lodge-row actions do not stretch their table row or neighbouring control. */
@media (min-width:1024px) {
 body.figma-ai-layout.admin-page #admin-lodges-table details.panel-action-group { position:relative; min-width:0; }
 body.figma-ai-layout.admin-page #admin-lodges-table details.panel-action-group[open] { z-index:40; }
 body.figma-ai-layout.admin-page #admin-lodges-table details.panel-action-group > .panel-action-group-body { position:absolute; top:calc(100% + 4px); right:0; width:280px; max-width:calc(100vw - 48px); max-height:min(400px,calc(100dvh - 120px)); overflow:auto; padding:12px; border:1px solid #b79556; border-radius:8px; background:var(--ux-surface); box-shadow:0 8px 24px #122c3e26; }
 body.figma-ai-layout.admin-page #admin-lodges-table tbody > tr:nth-last-child(-n+2) details.panel-action-group > .panel-action-group-body { top:auto; bottom:calc(100% + 4px); }
}

/* Short desktop chrome keeps the full meeting date readable on the available row. */
@media (min-width:1280px) and (max-height:780px) {
 body.figma-ai-layout main > .heading.has-next-meeting { grid-template-columns:minmax(230px,1fr) minmax(260px,420px) auto; }
}

/* At the compact desktop boundary, Home keeps its title/help and two actions together. */
@media (min-width:1280px) and (max-width:1439px) and (max-height:780px) {
 body.figma-ai-layout main:has(> #dashboard:not(.hidden)) > .heading.has-next-meeting { grid-template-columns:minmax(320px,1fr) minmax(260px,380px) auto; column-gap:8px; }
 body.figma-ai-layout main:has(> #dashboard:not(.hidden)) > .heading.has-next-meeting .heading-summary { white-space:nowrap; }
 body.figma-ai-layout main:has(> #dashboard:not(.hidden)) > .heading.has-next-meeting .heading-actions { flex-wrap:nowrap; gap:8px; white-space:nowrap; }
 body.figma-ai-layout #dashboard > .two-col:has(#due-list > .empty):has(#upcoming-list > .empty) .panel-heading { padding-top:6px; padding-bottom:6px; }
 body.figma-ai-layout #dashboard > .two-col:has(#due-list > .empty):has(#upcoming-list > .empty) .empty { padding-top:4px; padding-bottom:4px; }
 body.figma-ai-layout #dashboard > .two-col:has(#due-list > .empty):has(#upcoming-list > .empty) .panel-foot { padding-top:6px; padding-bottom:6px; }
}

/* Allocation tables need their intended readable width even in short forms. */
@media (min-width:1024px) {
 body.figma-ai-layout dialog.finance-dialog:has(.finance-table) { width:min(1100px,calc(100vw - 48px)); }
}

/* Short history summaries keep their text and use less surrounding whitespace. */
@media (min-width:1024px) and (max-height:780px) {
 body.figma-ai-layout #dashboard > #recent-history-panel > .panel-heading { padding-top:6px; padding-bottom:6px; }
 body.figma-ai-layout #dashboard #recent-history > .change-row { padding-top:4px; padding-bottom:4px; }
 body.figma-ai-layout.admin-page #admin-events-table td { padding:7px 10px; }
 body.figma-ai-layout.admin-page #admin-usage .admin-window-body > .panel-heading:has(> h2:only-child) { display:none; }
 body.figma-ai-layout.admin-page #admin-usage .admin-source { margin-bottom:6px; padding-bottom:4px; }
 body.figma-ai-layout.admin-page #admin-usage .admin-inset { margin-bottom:6px; }
 body.figma-ai-layout.admin-page #admin-usage .admin-cards { padding-bottom:4px; }
 body.figma-ai-layout.admin-page #admin-usage .admin-card { padding:8px; }
 body.figma-ai-layout.admin-page #admin-usage .admin-card strong { margin:2px 0; }
 body.figma-ai-layout.admin-page #admin-usage-table :is(th,td) { padding:4px 10px; }
 body.figma-ai-layout.admin-page #admin-backups #admin-retention-source { margin:4px 0; }
 body.figma-ai-layout.admin-page #admin-backups :is(#admin-backup-jobs,#admin-retention-table) > .admin-empty { margin:4px 0; padding:4px 0; }
 body.figma-ai-layout.admin-page #admin-backup-health :is(th,td) { padding:4px 8px; }
 body.figma-ai-layout.admin-page #admin-backups .admin-window-body:has(#admin-backup-jobs > .admin-empty):has(#admin-retention-table > .admin-empty) > details.admin-explanation { display:inline-block; vertical-align:top; width:calc(50% - 8px); margin-right:8px; }
}
