/* Stage one: lower Home only. Assignment/header/navigation retain their styles. */
#app-view #home-lower-section {
  grid-column: 1 / -1; grid-row: auto; order: 2; width: 100%; min-width: 0;
  display: grid; gap: 12px; margin: 0; padding: 0;
  --lower-text: var(--theme-text, #18362f);
  --lower-muted: var(--theme-muted, #607169);
  --lower-surface: var(--theme-surface, #fff);
  --lower-border: var(--theme-border, #dce5df);
  --lower-green: #245d3e;
  --lower-red: #b3233c;
  --lower-focus: #176bad;
  color: var(--lower-text);
}
#app-view #home-lower-section [hidden] { display: none !important; }
#app-view #home-lower-section :is(button, a) { box-sizing: border-box; font-family: var(--ds-font-family, system-ui, sans-serif); letter-spacing: normal; text-transform: none; box-shadow: none; }
#app-view #home-lower-section :is(button, a):focus-visible { outline: 3px solid var(--lower-focus); outline-offset: 3px; }
#app-view #home-lower-section #presence-toggle {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-rows: auto;
  grid-row: auto; grid-column: auto; align-items: center; gap: 12px;
  min-height: 78px; width: 100%; margin: 0; padding: 15px;
  border: 1px solid var(--lower-border); border-radius: 17px;
  background: var(--lower-surface); color: var(--lower-text); text-align: left;
}
#app-view #home-lower-section #presence-toggle.active { background: color-mix(in srgb, var(--lower-green) 5%, var(--lower-surface)); }
#app-view #home-lower-section #presence-toggle .today-action-icon { display: grid; place-items: center; width: 28px; height: 34px; margin: 0; padding: 0; background: none; color: var(--lower-muted); border: 0; border-radius: 0; }
#app-view #home-lower-section #presence-toggle .today-action-icon svg { width: 28px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; }
#app-view #home-lower-section #presence-toggle .presence-action-copy { position: static; display: grid; gap: 4px; min-width: 0; grid-column: 2; grid-row: 1; text-align: left; }
#app-view #home-lower-section #presence-toggle .presence-line { display: block; overflow-wrap: anywhere; color: var(--lower-text); font-size: .95rem; font-weight: 500; line-height: 1.4; }
#app-view #home-lower-section #presence-status-dot { display: none; }
#app-view #home-lower-section #presence-toggle #presence-title { position: static; display: block; grid-column: 3; grid-row: 1; max-width: 130px; padding: 11px 14px; border-radius: 11px; background: var(--lower-green); color: #fff; font-size: .88rem; line-height: 1.35; font-weight: 650; text-align: center; white-space: normal; text-transform: none; }
#app-view #home-lower-section #presence-expiration { grid-column: 1 / -1; grid-row: 2; color: var(--lower-muted); font-size: .75rem; line-height: 1.4; }
#app-view #home-lower-section #home-issue-panel { overflow: hidden; border: 1px solid var(--lower-border); border-radius: 17px; background: color-mix(in srgb, #bc861c 4%, var(--lower-surface)); }
#app-view #home-lower-section #open-issues { display: block; width: 100%; min-height: 64px; grid-column: auto; grid-row: auto; margin: 0; padding: 17px; border: 0; border-radius: 0; background: transparent; color: var(--lower-text); text-align: left; }
#app-view #home-lower-section #open-issues:focus-visible { outline-offset: -4px; }
#app-view #home-lower-section #open-issues .summary-card-copy { display: flex !important; position: static; width: 100%; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 0; }
#app-view #home-lower-section #issue-card-label { color: var(--lower-text); font-size: 1.1rem; font-weight: 750; white-space: normal; letter-spacing: normal; text-transform: none; }
#app-view #home-lower-section #issue-count-summary { font: 500 .82rem/1.4 var(--ds-font-family, system-ui, sans-serif); color: var(--lower-muted); margin: 0; white-space: normal; text-align: start; }
#app-view #home-lower-section #home-active-issues { grid-column: auto; grid-row: auto; margin: 0 17px; border: 0; border-top: 1px solid var(--lower-border); border-radius: 0; background: transparent; box-shadow: none; }
#app-view #home-lower-section .home-active-issue { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 64px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--lower-border); border-radius: 0; background: transparent; text-align: left; color: var(--lower-text); }
#app-view #home-lower-section .home-active-issue:last-child { border-bottom: 0; }
#app-view #home-lower-section .home-active-issue-level { width: 10px; height: 10px; flex: 0 0 10px; align-self: center; border-radius: 50%; background: var(--issue-dot, #ad811d); }
#app-view #home-lower-section .issue-level-red { --issue-dot: var(--lower-red); }
#app-view #home-lower-section .issue-level-green { --issue-dot: #3e7a3a; }
#app-view #home-lower-section .home-active-issue-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
#app-view #home-lower-section .home-active-issue-copy strong { font-size: .94rem; line-height: 1.4; font-weight: 600; letter-spacing: normal; text-transform: none; overflow-wrap: anywhere; white-space: normal; overflow: visible; }
#app-view #home-lower-section .home-active-issue-copy small { font-size: .76rem; line-height: 1.4; color: var(--lower-muted); }
#app-view #home-lower-section .home-active-issue-cue { font-size: 1.4rem; color: var(--lower-muted); }
#app-view #home-lower-section #home-view-all-reports { width: 100%; min-height: 44px; margin: 0; padding: 10px; border: 0; border-top: 1px solid var(--lower-border); background: transparent; color: var(--lower-text); font-size: .85rem; }
#app-view #home-lower-section #home-issue-panel:has(.has-critical) { border-color: var(--lower-red); background: color-mix(in srgb, var(--lower-red) 6%, var(--lower-surface)); }
#app-view #home-lower-section .home-lower-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#app-view #home-lower-section .home-lower-actions :is(.report-action, #open-live) { display: flex; align-items: center; justify-content: center; gap: 9px; grid-column: auto; grid-row: auto; width: 100%; min-width: 0; min-height: 70px; margin: 0; padding: 14px 10px; border: 1px solid var(--lower-border); border-radius: 15px; background: color-mix(in srgb, var(--lower-green) 5%, var(--lower-surface)); color: var(--lower-text); text-align: center; }
#app-view #home-lower-section .home-lower-actions :is(.report-action, #open-live).report-action { background: var(--lower-green); border-color: var(--lower-green); color: white; }
#app-view #home-lower-section .home-lower-actions :is(.today-action-copy, .summary-card-copy) { display: flex !important; position: static; width: auto; min-width: 0; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 0; font-size: .95rem; font-weight: 550; line-height: 1.35; letter-spacing: normal; text-transform: none; }
#app-view #home-lower-section #coverage-home-label { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; white-space: normal; }
#app-view #home-lower-section #coverage-home-summary { display: inline; min-height: 0; margin: 0; padding: 0; border-radius: 0; background: none; color: inherit; font-size: .95rem; line-height: 1.35; font-weight: 550; letter-spacing: normal; }
#app-view #home-lower-section #coverage-home-summary::before { content: '· '; }
#app-view #home-lower-section .lower-action-icon { width: 25px; height: 25px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; font-size: 28px; line-height: 25px; }
#app-view #home-lower-section .home-lower-actions:has([hidden]) { grid-template-columns: minmax(0, 1fr); }
#app-view #home-lower-section :is(#home-open-service-order, #home-prayer-row) { display: grid; grid-template-columns: 28px minmax(0, 1fr) 16px; align-items: center; gap: 14px; grid-column: auto; grid-row: auto; width: 100%; min-height: 76px; margin: 0; padding: 16px; border: 1px solid var(--lower-border); border-radius: 16px; background: var(--lower-surface); color: var(--lower-text); font-size: 1rem; font-weight: 500; line-height: 1.4; text-align: left; text-decoration: none; }
#app-view #home-lower-section .lower-row-icon { width: 28px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; color: var(--lower-muted); }
#app-view #home-lower-section #home-open-service-order strong { font-size: 1rem; line-height: 1.4; letter-spacing: normal; text-transform: none; color: var(--lower-text); font-weight: 550; }
#app-view #home-lower-section #home-open-service-order small { display: block; overflow-wrap: anywhere; margin-top: 3px; font-size: .82rem; line-height: 1.4; color: var(--lower-muted); font-weight: 450; }
#app-view #home-lower-section :is(#home-open-service-order, #home-prayer-row) > span:last-child { color: var(--lower-muted); font-size: 1.4rem; }
@media (max-width: 370px) {
  #app-view #home-lower-section #presence-toggle { padding: 12px; gap: 9px; grid-template-columns: 24px minmax(0, 1fr) auto; }
  #app-view #home-lower-section #presence-toggle #presence-title { max-width: 108px; padding: 10px; }
  #app-view #home-lower-section .home-lower-actions :is(.report-action, #open-live) { flex-wrap: wrap; }
}

#app-view #home-lower-section #home-prayer-row .lower-row-icon { fill: currentColor; stroke: none; }

#app-view #home-lower-section .home-lower-actions:not(:has(button:not([hidden]))) { display: none; }

#app-view #home-lower-section .report-action .lower-action-icon circle { fill: currentColor; stroke: none; }
#app-view #home-lower-section .report-action .lower-action-icon path { stroke: var(--lower-green); stroke-width: 2.5; }

html[data-theme="dark"] #app-view #home-lower-section { --lower-red: #f0808c; --lower-focus: #8cc6ff; }

/* One shared signup invitation, regardless of the number of open events. */
#app-view #home-lower-section #home-special-event-signups {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 10px 14px;
  border: 1px solid var(--lower-border); border-radius: 13px;
  background: color-mix(in srgb, var(--lower-green) 4%, var(--lower-surface));
  color: var(--lower-text); text-decoration: none; text-align: left;
  font-size: .875rem; font-weight: 550; line-height: 1.4; white-space: nowrap;
}
#app-view #home-lower-section .home-special-event-signups-action {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  color: var(--lower-text); font-weight: 650;
}
#app-view #home-lower-section .home-special-event-signups-action > span { font-size: 1.2rem; line-height: 1; }

#app-view #home-lower-section #home-special-event-signups > span:first-child {
  min-width: 0; white-space: normal; overflow-wrap: anywhere;
}

#app-view #home-lower-section #home-prayer-count { display: block; margin-top: 3px; color: var(--lower-muted); font-size: .82rem; font-weight: 400; }
#app-view #home-lower-section #home-prayer-count[hidden] { display: none; }
