/* Navigation and app frame. The score reader keeps its own offline layout. */
body { background: #f6f5f1; }
.app-frame { --shadow: 0 2px 6px rgb(37 33 30 / 3%); min-height: 100dvh; }
.app-workspace { min-width: 0; padding: 0 24px calc(100px + env(safe-area-inset-bottom)); }
.app-sidebar { display: none; }
.login-panel .logo-wrap { width: 108px; height: 93px; border: 0; background: transparent; box-shadow: none; }
.login-panel .logo-img { max-width: 100%; max-height: 100%; }
.nav-brand { display: flex; align-items: center; gap: 16px; }
.nav-brand .logo-wrap { flex: none; width: 84px; height: 76px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.nav-brand .logo-img { max-width: 100%; max-height: 100%; }
.nav-brand-text { display: grid; gap: 5px; }
.nav-brand-text strong { font-family: Georgia, "Times New Roman", serif; font-size: 23px; line-height: 1.15; font-weight: 600; }
.nav-brand-text span { font-size: 14px; color: var(--muted); }
.mobile-masthead { padding: 22px 0; border-bottom: 1px solid var(--line); }
.page-heading { padding: 28px 0 22px; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 32px; line-height: 1.18; font-weight: 500; letter-spacing: -.02em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.page-footer { padding-top: 28px; font-size: 12px; color: var(--muted); }
.nav-groups { display: grid; gap: 20px; }
.nav-caption { margin: 0 12px 7px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.nav-icon { display: block; width: 21px; height: 21px; flex: none; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; margin: 2px 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #494440; font-size: 14px; font-weight: 500; line-height: 22px; text-align: left; text-decoration: none; }
.nav-item.active { color: var(--accent); background: #f3e8e9; border-color: #ecdbdd; font-weight: 650; }
.nav-account { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.nav-person { display: grid; gap: 4px; padding: 12px; min-width: 0; }
.nav-person strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.nav-person span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.nav-session { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding-right: 12px; }
.nav-signout { display: flex; align-items: center; gap: 10px; background: transparent; color: var(--muted); font-size: 13px; min-height: 44px; padding: 10px 12px; border-radius: 6px; }
.nav-session .build-mark { font-size: 10px; font-weight: 400; opacity: 1; }
.bottom-nav { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fffefa; border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
.bottom-nav .nav-item { flex-direction: column; justify-content: center; gap: 4px; min-height: 58px; margin: 0; padding: 6px 2px; font-size: 11px; line-height: 16px; border: 0; text-align: center; }
.bottom-nav .nav-item.active { background: #f7eff0; }
.nav-dialog { position: fixed; inset: 0 0 0 auto; width: min(380px, calc(100vw - 32px)); max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); border: 0; border-left: 1px solid var(--line); color: var(--ink); background: #fffefa; overflow-y: auto; overscroll-behavior: contain; }
.nav-dialog::backdrop { background: rgb(27 25 23 / 38%); }
.nav-dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.nav-dialog-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 27px; }
.nav-close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); }
.menu-is-open { overflow: hidden; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: 12px; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; color: white; background: var(--accent); border-radius: 4px; }
.skip-link:focus { width: auto; height: auto; margin: 0; padding: 12px 18px; overflow: visible; clip-path: none; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid #215a83; outline-offset: 3px; }
.app-frame .button, .app-frame select, .app-frame input:not([type=checkbox]):not([type=radio]) { min-height: 44px; }
.app-frame .panel-head h2 { font-size: 20px; }
.app-frame .panel { box-shadow: 0 2px 8px rgb(37 33 30 / 3%); }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
.home-main { min-height: 420px; }
.home-main > .panel-head { align-items: center; }
.home-main .panel-head h2, .home-side h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(24px, 2.5vw, 34px); font-weight: 500; line-height: 1.15; }
.home-date { display: grid; min-width: 68px; padding: 10px; border-left: 1px solid var(--line); color: var(--muted); text-align: center; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.home-date strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; line-height: 1; }
.home-event-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; }
.home-meta { margin: 0 0 5px; font-size: 18px; font-weight: 700; }
.home-location { margin: 0 0 20px; color: var(--muted); }
.home-program { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.home-program > span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.home-program > strong { display: block; margin-top: 5px; font-size: 19px; }
.home-program ol { margin: 14px 0 0; padding-left: 22px; line-height: 1.65; }
.home-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 195px; }
.quick-attendance { grid-column: 1 / -1; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.quick-attendance > p { margin: 0 0 10px; font-weight: 700; }
.quick-attendance .segmented { max-width: 620px; }
.home-side { display: grid; gap: 20px; }
.home-side .panel-body { padding: 22px; }
.home-side h2 { font-size: 24px; }
.home-concert .concert-countdown { color: var(--accent); font-weight: 750; }
.section-title { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.count-badge { display: grid; min-width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--accent); color: white; font-size: 13px; font-weight: 800; }
.home-notices ul { list-style: none; margin: 16px 0; padding: 0; border-top: 1px solid var(--line); }
.home-notices li { border-bottom: 1px solid var(--line); }
.home-notices li button { display: grid; gap: 3px; width: 100%; padding: 13px 0; background: transparent; color: var(--ink); text-align: left; }
.home-notices li span { color: var(--muted); font-size: 12px; }
.text-link { min-height: 44px; padding: 0; background: transparent; color: var(--accent); font-weight: 700; }
.home-shortcuts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.shortcut-card { display: grid; gap: 6px; min-height: 94px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; color: var(--ink); text-align: left; }
.shortcut-card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.shortcut-card strong { font-size: 15px; }
.agenda-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.agenda-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: #fffefa; color: var(--ink); font-weight: 650; }
.filter-chip.active { border-color: var(--accent); background: #f3e8e9; color: var(--accent); }
.agenda-list { display: grid; gap: 30px; }
.agenda-month > h2 { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; }
.agenda-month > div { display: grid; gap: 10px; }
.agenda-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; }
.agenda-date { display: grid; align-content: center; align-self: start; min-height: 68px; border-right: 1px solid var(--line); text-align: center; color: var(--muted); text-transform: uppercase; font-size: 11px; font-weight: 700; }
.agenda-date strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 500; line-height: 1; }
.agenda-info h3 { margin: 6px 0; font-size: 20px; }
.agenda-info p { margin: 5px 0; color: var(--muted); }
.agenda-info .agenda-program { color: var(--ink); }
.agenda-response strong { color: var(--accent); }
.agenda-actions { display: flex; align-items: start; flex-wrap: wrap; gap: 8px; }
.agenda-item .quick-attendance { grid-column: 2 / -1; margin-top: 2px; }
.member-filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)); gap: 12px; margin-bottom: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.member-filters .field { margin: 0; }
.member-filter-count { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
[data-member-row] { display: grid; gap: 5px; }
.publication-preview { max-height: min(55vh, 560px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.preview-label { margin: 12px 0 4px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.calendar-panel > .panel-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.calendar-panel .month-actions .button { width: 44px; }
.app-frame .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
body:has(.app-frame) > .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
@media (hover: hover) {
  .nav-item:hover:not(.active), .nav-signout:hover, .nav-close:hover, .shortcut-card:hover, .home-notices li button:hover { background: var(--soft); color: var(--ink); }
}
@media (min-width: 1180px) {
  .app-frame { display: grid; grid-template-columns: 256px minmax(0, 1fr); max-width: 1760px; margin: 0 auto; }
  .app-sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: 28px 18px 16px; background: #fffefa; border-right: 1px solid var(--line); }
  .app-sidebar .nav-brand { flex-direction: column; align-items: flex-start; gap: 18px; padding: 0 12px 30px; }
  .app-sidebar .logo-wrap { width: 108px; height: 93px; }
  .app-sidebar .nav-brand-text strong { font-size: 25px; }
  .app-sidebar .nav-account { margin-top: auto; }
  .app-sidebar .nav-groups { padding-bottom: 24px; }
  .app-workspace { padding: 0 clamp(24px, 3vw, 52px) 32px; }
  .page-heading { padding: 36px 0 28px; }
  .page-heading h1 { font-size: 36px; }
  .mobile-masthead, .bottom-nav { display: none; }
  body:has(.app-frame) > .toast { bottom: 24px; }
}
@media (min-width: 821px) and (max-width: 1370px) {
  .app-frame .grid { grid-template-columns: minmax(0, 1fr); }
  .home-layout { grid-template-columns: minmax(0, 1fr); }
  .home-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .home-layout, .home-event-content { grid-template-columns: minmax(0, 1fr); }
  .home-main { min-height: 0; }
  .home-actions { min-width: 0; }
  .home-shortcuts { grid-template-columns: minmax(0, 1fr); }
  .agenda-item { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; }
  .agenda-actions, .agenda-item .quick-attendance { grid-column: 2; }
  .agenda-toolbar { align-items: stretch; flex-direction: column; }
  .member-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-search { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .app-workspace { padding-left: 14px; padding-right: 14px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .mobile-masthead { padding: 14px 0; }
  .nav-brand { gap: 12px; }
  .nav-brand .logo-wrap { width: 64px; height: 55px; }
  .nav-brand-text strong { font-size: 20px; }
  .nav-brand-text span { font-size: 13px; }
  .page-heading { padding: 20px 2px 16px; }
  .page-heading h1 { font-size: 28px; }
  .app-frame .panel-head, .app-frame .panel-body { padding: 15px; }
  .home-main > .panel-head { flex-direction: row; }
  .home-date { min-width: 58px; padding-left: 9px; }
  .home-side { grid-template-columns: minmax(0, 1fr); }
  .quick-attendance .segmented { grid-template-columns: minmax(0, 1fr); }
  .agenda-toolbar { gap: 12px; margin-bottom: 24px; }
  .agenda-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-filters .filter-chip { width: 100%; min-height: 44px; }
  .agenda-toolbar > .button { width: 100%; min-height: 46px; }
  .agenda-list { gap: 26px; }
  .agenda-month > h2 { font-size: 22px; }
  .agenda-item { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 14px 12px; border-radius: 10px; }
  .agenda-date { min-height: 58px; }
  .agenda-date strong { font-size: 28px; }
  .agenda-info h3 { margin-top: 5px; font-size: 19px; line-height: 1.2; }
  .agenda-info p { line-height: 1.4; overflow-wrap: anywhere; }
  .agenda-actions, .agenda-item .quick-attendance { grid-column: 1 / -1; }
  .agenda-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 2px; }
  .agenda-actions > :only-child { grid-column: 1 / -1; }
  .agenda-item .quick-attendance { margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
  .agenda-item .quick-attendance p { margin-top: 0; }
  .agenda-actions .button { width: 100%; min-height: 44px; }
  .member-filters { grid-template-columns: minmax(0, 1fr); }
  .member-search, .member-filter-count { grid-column: auto; }
}

@media (max-width: 360px) {
  .app-workspace { padding-left: 10px; padding-right: 10px; }
  .nav-brand .logo-wrap { width: 58px; height: 50px; }
  .nav-brand-text strong { font-size: 18px; }
  .page-heading h1 { font-size: 26px; }
  .agenda-item { grid-template-columns: 44px minmax(0, 1fr); padding-inline: 10px; }
  .bottom-nav { padding-left: 4px; padding-right: 4px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
