/* Home and its shared navigation. Loaded after the legacy card styles. */
.app-shell {
  --sidebar-width: 224px;
  --home-bg: #fbf8f1;
  --home-surface: #fffdf8;
  --home-ink: #23342b;
  --home-muted: #687368;
  --home-line: #e0e3d8;
  --home-accent: #26704e;
  --home-selected: #e9f0e4;
  --home-warm: #89662f;
  --home-soft: #edf2e8;
  --home-soft-line: #d2dfce;
  --home-primary-ink: #ffffff;
  --home-chart-1: #398260;
  --home-chart-2: #a7813e;
  --home-chart-3: #4d8796;
  --home-chart-4: #8c74aa;
  --home-chart-5: #7c8d4d;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-body);
}

html[data-theme="dark"] .app-shell {
  --home-bg: #101814;
  --home-surface: #16221b;
  --home-ink: #f2f3e9;
  --home-muted: #abb9ab;
  --home-line: #2c3c31;
  --home-accent: #77c99c;
  --home-selected: #213c2b;
  --home-warm: #e2c48c;
  --home-soft: #182b20;
  --home-soft-line: #2b4935;
  --home-primary-ink: #10261a;
  --home-chart-1: #77c99c;
  --home-chart-2: #dbb66f;
  --home-chart-3: #85b8c6;
  --home-chart-4: #b69dd1;
  --home-chart-5: #acbd79;
}

html[data-theme] .app-shell :is(.app-sidebar, .app-header, .app-nav-bar) {
  background: var(--home-surface);
  border-color: var(--home-line);
  color: var(--home-ink);
  box-shadow: none;
}

html[data-theme] .app-shell :is(.app-sidebar-header, .app-sidebar-utility) {
  border-color: var(--home-line);
}

html[data-theme] .app-shell .nav-link {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--home-muted);
  transition: background-color 150ms ease, color 150ms ease;
}

html[data-theme] .app-shell .nav-link:hover {
  color: var(--home-ink);
  background: var(--home-selected);
}

html[data-theme] .app-shell .nav-link.active {
  color: var(--home-accent);
  background: var(--home-selected);
  font-weight: 600;
}

html[data-theme] .app-shell .nav-link-icon { width: 18px; height: 18px; stroke-width: 1.6; }
html[data-theme] .app-shell :is(.app-sidebar-wordmark, .app-header-wordmark) {
  font-family: var(--font-body);
  color: var(--home-ink);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.8px;
}

html[data-theme] .app-shell :is(.app-sidebar-logo, .app-header-logo) { width: 27px; height: 27px; }
html[data-theme] .app-shell :is(.sidebar-toggle-btn, .header-btn) {
  background: transparent;
  color: var(--home-muted);
  border: 0;
  box-shadow: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
}
html[data-theme] .app-shell :is(.sidebar-toggle-btn, .header-btn):hover { background: var(--home-selected); color: var(--home-ink); }
html[data-theme] .app-shell .sidebar-toggle-btn svg { width: 20px; height: 20px; stroke-width: 1.6; }
html[data-theme] .app-shell .header-actions { gap: 8px; }
html[data-theme] .app-shell .mobile-nav-item { color: var(--home-muted); }
html[data-theme] .app-shell .mobile-nav-item.active { color: var(--home-accent); }
html[data-theme] .app-shell .mobile-nav-item .mobile-nav-icon-wrapper { background: transparent; }
html[data-theme] .app-shell .header-tab { font: 500 14px var(--font-body); color: var(--home-muted); }
html[data-theme] .app-shell .header-tab.active { color: var(--home-ink); }
html[data-theme] .app-shell .header-tab.active::after { background: var(--home-accent); height: 2px; border-radius: 0; }
html[data-theme] .app-shell .streak-badge {
  background: transparent;
  color: var(--home-muted);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  font-weight: 400;
}
html[data-theme] .app-shell[data-active-view="home"] .app-main-content { background: var(--home-bg); }

/* A shared type scale and spacing rhythm for the complete home screen. */
html[data-theme] #view-home { container: home / inline-size; display: block; max-width: 1080px; color: var(--home-ink); white-space: normal; animation: none; }
html[data-theme] #view-home .welcome-section { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 0 0 28px; padding: 0; }
html[data-theme] #view-home .welcome-section::after { display: none; }
html[data-theme] #view-home #welcome-message { margin: 0; color: var(--home-ink); font: 500 24px/1.3 var(--font-body); letter-spacing: -0.6px; }
html[data-theme] #view-home .welcome-name { font-weight: inherit; }
html[data-theme] #view-home .home-date { order: 2; margin: 0; color: var(--home-muted); font: 400 13px/1.5 var(--font-body); }
html[data-theme] #view-home :is(#blog-posts-area, #sunday-nudge-widget-area):empty { display: none; }
html[data-theme] #view-home :is(#blog-posts-area, #sunday-nudge-widget-area):not(:empty) { margin-bottom: 24px; }
html[data-theme] #view-home .home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  grid-template-areas: "reading practice" "related activity";
  gap: 28px 40px;
  align-items: start;
}
html[data-theme] #view-home .home-reading-column { grid-area: reading; min-width: 0; }
html[data-theme] #view-home .home-side-column { grid-area: practice; min-width: 0; padding: 0; border: 0; background: transparent; border-radius: 0; }
html[data-theme] #view-home .home-secondary-readings { grid-area: related; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; min-width: 0; }
html[data-theme] #view-home .home-activity { grid-area: activity; padding: 16px 0 0; border-top: 2px solid var(--home-soft-line); }

html[data-theme] #view-home .scripture-flyer-surface,
html[data-theme] #view-home .scripture-flyer-surface:hover { display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--home-ink); box-shadow: none; transform: none; transition: none; overflow: visible; cursor: default; }
html[data-theme] #view-home .home-reading-art { display: block; width: 100%; height: 144px; margin: 0 0 20px; border-radius: 8px; object-fit: cover; object-position: 50% 48%; }
html[data-theme] #view-home .scripture-flyer-surface::before,
html[data-theme] #view-home .scripture-flyer-surface::after { display: none; }
html[data-theme] #view-home .scripture-flyer-surface .glass-overlay { display: flex; flex-direction: column; gap: 0; padding: 0; min-height: 0; background: transparent; }
html[data-theme] #view-home :is(.home-section-label, #daily-victory-badge, #home-hymn-badge, #home-reflection-badge, #home-fasting-badge) {
  display: block;
  align-self: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--home-ink);
  font: 600 14px/1.5 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  text-shadow: none;
}
html[data-theme] #view-home .scripture-flyer-surface :is(.scripture-ref, .daily-promise-ref) { display: block; margin: 4px 0 16px; color: var(--home-muted); font: 400 12px/1.5 var(--font-body); text-transform: none; letter-spacing: 0; }
html[data-theme] #view-home .scripture-flyer-surface :is(.scripture-text, .daily-promise-quote) { max-width: 100%; margin: 0; padding: 0; color: var(--home-ink); font: 400 24px/1.5 Georgia, "Times New Roman", serif; letter-spacing: -0.3px; text-shadow: none; }
html[data-theme] #view-home .home-reading-footer { display: block; margin-top: 16px; padding: 0; border: 0; }
html[data-theme] #view-home .home-reading-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px 16px; margin: 0; }
html[data-theme] #view-home .victory-actions { display: flex; flex: 0 0 auto; width: auto; margin: 0; }
html[data-theme] #view-home :is(.home-text-link, .scripture-expand-hint, .fasting-widget-text-btn) { display: inline-flex; align-items: center; align-self: flex-start; justify-content: flex-start; gap: 6px; min-height: 40px; margin: 0; padding: 8px 0; border: 0; border-radius: 0; background: transparent; color: var(--home-accent); font: 500 13px/1.5 var(--font-body); text-align: left; text-decoration: none; box-shadow: none; transform: none; cursor: pointer; }
html[data-theme] #view-home :is(.home-text-link, .scripture-expand-hint, .fasting-widget-text-btn):hover { text-decoration: underline; text-underline-offset: 4px; }
html[data-theme] #view-home :is(.home-text-link, .victory-btn, .fasting-widget-text-btn) svg { width: 14px; height: 14px; stroke-width: 1.6; }
html[data-theme] #view-home .home-reading-actions:has(.scripture-expand-hint:not(.hidden)) .home-reader-link { display: none; }
html[data-theme] #view-home .scripture-flyer-surface .victory-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; margin: 0; padding: 8px 12px; border: 1px solid var(--home-line); border-radius: 5px; background: transparent; color: var(--home-ink); font: 500 13px/1.5 var(--font-body); box-shadow: none; transform: none; white-space: nowrap; }
html[data-theme] #view-home .daily-victory-card :is(.home-reader-link, .scripture-expand-hint) { padding: 8px 14px; border-radius: 5px; background: var(--home-accent); color: var(--home-primary-ink); }
html[data-theme] #view-home .daily-victory-card :is(.home-reader-link, .scripture-expand-hint):hover { opacity: 0.9; text-decoration: none; }
html[data-theme] #view-home .scripture-flyer-surface .victory-btn:hover { background: var(--home-selected); }
html[data-theme] #view-home .scripture-flyer-surface .victory-btn.logged { border-color: transparent; color: var(--home-muted); background: transparent; opacity: 1; }

html[data-theme] #view-home .home-secondary-readings .scripture-flyer-surface { padding-top: 0; border: 0; }
html[data-theme] #view-home .daily-promise-heading { display: flex; justify-content: flex-start; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
html[data-theme] #view-home .scripture-flyer-surface .daily-promise-category { flex-shrink: 1; color: var(--home-warm); font: 400 12px/1.5 var(--font-body); text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; }
html[data-theme] #view-home .scripture-flyer-surface .daily-promise-quote { font-size: 18px; line-height: 1.55; letter-spacing: -0.1px; }
html[data-theme] #view-home .home-secondary-readings .daily-promise-card { border-left: 2px solid var(--home-warm); padding-left: 16px; }
html[data-theme] #view-home .home-secondary-readings .hymn-today-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 16px; }
html[data-theme] #view-home .home-hymn-art { display: block; width: 88px; height: 112px; object-fit: cover; object-position: 72% 50%; border-radius: 5px; }
html[data-theme] #view-home .home-secondary-readings .home-reading-actions { margin-top: 8px; }
html[data-theme] #view-home .scripture-flyer-surface .hymn-today-title { margin: 12px 0 4px; color: var(--home-ink); font: 500 18px/1.4 var(--font-body); letter-spacing: -0.2px; text-shadow: none; }
html[data-theme] #view-home .scripture-flyer-surface .hymn-today-meta { margin: 0 0 8px; color: var(--home-muted); font: 400 12px/1.5 var(--font-body); }
html[data-theme] #view-home .home-reflection-question { color: var(--home-ink); font: 500 16px/1.5 var(--font-body); margin: 4px 0 12px; }
html[data-theme] #view-home .home-mood-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
html[data-theme] #view-home .home-mood-choices button { min-height: 38px; padding: 6px; border: 1px solid var(--home-soft-line); border-radius: 5px; background: var(--home-bg); color: var(--home-ink); font: 500 12px/1.5 var(--font-body); cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
html[data-theme] #view-home .home-mood-choices button:hover { border-color: var(--home-accent); background: var(--home-selected); }
html[data-theme] #view-home .home-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
html[data-theme] #view-home .home-section-heading .home-text-link { align-self: center; }
html[data-theme] #view-home .home-side-section { margin: 0; padding: 0; border: 0; }
html[data-theme] #view-home .home-reflection-card { padding: 12px 16px 16px; margin-bottom: 24px; border: 0; border-radius: 8px; background: var(--home-soft); }
html[data-theme] #view-home .home-mood-summary { display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--home-muted); font: 400 13px/1.5 var(--font-body); }
html[data-theme] #view-home #fasting-quick-widget { color: var(--home-muted); font: 400 13px/1.5 var(--font-body); }
html[data-theme] #view-home .home-fast-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
html[data-theme] #view-home .home-fast-empty p { margin: 0; }

/* Preserve the circular timer, with its focus and duration beside it. */
html[data-theme] #view-home .home-fast-widget .home-section-heading { margin-bottom: 12px; }
html[data-theme] #view-home .home-fast-complete { min-height: 36px; padding: 6px 10px; border: 1px solid var(--home-line); border-radius: 5px; background: transparent; color: var(--home-ink); font: 500 12px/1.5 var(--font-body); cursor: pointer; }
html[data-theme] #view-home .home-fast-complete:hover { background: var(--home-selected); }
html[data-theme] #view-home .home-fast-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 16px; width: 100%; padding: 0; border: 0; background: transparent; color: var(--home-ink); font-family: var(--font-body); text-align: left; cursor: pointer; }
html[data-theme] #view-home .home-fast-widget .timer-ring-container { display: block; position: relative; width: 150px; height: 150px; margin: 0; }
html[data-theme] #view-home .home-fast-widget .timer-circle-svg { display: block; width: 150px; height: 150px; transform: rotate(-90deg); }
html[data-theme] #view-home .home-fast-widget :is(.timer-circle-bg, .timer-circle-indicator) { fill: none; stroke-width: 8; }
html[data-theme] #view-home .home-fast-widget .timer-circle-bg { stroke: var(--home-soft-line); }
html[data-theme] #view-home .home-fast-widget .timer-circle-indicator { stroke: var(--home-accent); stroke-linecap: round; stroke-dasharray: 408.4; stroke-dashoffset: 408.4; transition: stroke-dashoffset 0.5s linear; }
html[data-theme] #view-home .home-fast-widget .timer-text-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
html[data-theme] #view-home .home-fast-widget .timer-countdown { color: var(--home-ink); font: 600 19px/1.2 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: -0.4px; white-space: nowrap; }
html[data-theme] #view-home .home-fast-widget .timer-label { color: var(--home-muted); font: 400 11px/1.5 var(--font-body); text-transform: none; letter-spacing: 0; }
html[data-theme] #view-home .home-fast-summary { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
html[data-theme] #view-home .home-fast-field { display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; color: var(--home-ink); font: 500 13px/1.5 var(--font-body); }
html[data-theme] #view-home .home-fast-field-label { color: var(--home-muted); font-size: 12px; font-weight: 400; }
html[data-theme] #view-home .home-fast-apps { color: var(--home-muted); font: 400 11px/1.5 var(--font-body); overflow-wrap: anywhere; }
html[data-theme] #view-home .upcoming-fast-header { flex-wrap: wrap; gap: 12px; }
html[data-theme] #view-home .upcoming-fast-title { color: var(--home-ink); font: 500 14px/1.5 var(--font-body); }
html[data-theme] #view-home .upcoming-fast-countdown { gap: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; }
html[data-theme] #view-home :is(.countdown-label, .countdown-value, .upcoming-fast-tag .tag-label, .upcoming-fast-meta) { color: var(--home-muted); font: 400 12px/1.5 var(--font-body); text-transform: none; letter-spacing: 0; }

html[data-theme] #view-home .home-activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
html[data-theme] #view-home .home-activity-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--home-ink); font-family: var(--font-body); text-align: left; cursor: pointer; }
html[data-theme] #view-home .home-activity-value { color: var(--home-accent); font-size: 22px; line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.4px; }
html[data-theme] #view-home .home-activity-label { color: var(--home-muted); font: 400 12px/1.5 var(--font-body); }
html[data-theme] #view-home .home-activity-detail { color: var(--home-muted); font: 400 11px/1.5 var(--font-body); }
html[data-theme] #view-home .home-activity-item:hover .home-activity-label { text-decoration: underline; text-underline-offset: 3px; }
html[data-theme] #view-home button:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 4px; }
html[data-theme] #view-home .daily-promise-card[aria-busy="true"] .home-reading-actions { visibility: hidden; }

html[data-theme] #view-home .daily-victory-card.scripture-flyer-surface .scripture-expand-hint { padding: 8px 14px; border-radius: 5px; background: var(--home-accent); color: var(--home-primary-ink); }

html[data-theme] #view-home .home-reflection-history { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--home-line); }
html[data-theme] #view-home .home-reflection-history figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
html[data-theme] #view-home .home-reflection-history h4 { margin: 0; color: var(--home-ink); font: 600 13px/1.5 var(--font-body); }
html[data-theme] #view-home #home-reflection-history-scope { color: var(--home-muted); font: 400 11px/1.5 var(--font-body); }
html[data-theme] #view-home .home-reflection-bars { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
html[data-theme] #view-home .home-reflection-bar-row { display: grid; grid-template-columns: minmax(72px, 1fr) minmax(60px, 1.4fr) 20px; align-items: center; gap: 8px; font: 400 12px/1.5 var(--font-body); }
html[data-theme] #view-home .home-reflection-bar-label { color: var(--home-ink); overflow-wrap: anywhere; }
html[data-theme] #view-home .home-reflection-bar-track { display: block; height: 7px; overflow: hidden; border-radius: 4px; background: var(--home-soft-line); }
html[data-theme] #view-home .home-reflection-bar-track > span { display: block; height: 100%; border-radius: inherit; background: var(--reflection-color, var(--home-accent)); }
html[data-theme] #view-home .home-reflection-bar-description { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
html[data-theme] #view-home .home-reflection-bar-count { color: var(--home-muted); text-align: right; font-variant-numeric: tabular-nums; }
html[data-theme] #view-home :is(.home-reflection-history-latest, .home-reflection-history-empty) { color: var(--home-muted); font: 400 11px/1.6 var(--font-body); }
html[data-theme] #view-home .home-reflection-history-latest { margin: 12px 0 0; }
html[data-theme] #view-home .home-reflection-history-latest:empty { display: none; }
html[data-theme] #view-home .home-reflection-history-empty { margin: 0; }

@media (min-width: 1024px) {
  .app-shell .app-header { padding-inline: 32px; }
  .app-shell[data-active-view="home"] .app-main-content { padding: 36px 40px 48px; }
}
@container home (max-width: 1000px) {
  html[data-theme] #view-home .home-secondary-readings { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@container home (max-width: 760px) {
  html[data-theme] #view-home .home-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "reading" "practice" "related" "activity"; gap: 24px; }
  html[data-theme] #view-home .home-side-column { padding: 0; border: 0; }
  html[data-theme] #view-home .home-fasting-card { max-width: 440px; }
  html[data-theme] #view-home .home-activity-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container home (max-width: 480px) {
  html[data-theme] #view-home .home-secondary-readings { gap: 24px; }
  html[data-theme] #view-home .scripture-flyer-surface .scripture-text { font-size: 21px; line-height: 1.5; }
  html[data-theme] #view-home .home-reading-actions { gap: 8px 12px; }
  html[data-theme] #view-home .home-activity-grid { gap: 12px; }
  html[data-theme] #view-home .home-activity-label { font-size: 11px; }
  html[data-theme] #view-home .home-reading-art { height: 104px; margin-bottom: 16px; }
  html[data-theme] #view-home .home-hymn-art { width: 88px; height: 104px; }
}
@media (max-width: 599px) {
  html[data-theme] .app-shell[data-active-view="home"] { --header-height: calc(56px + var(--app-safe-area-top)); }
  html[data-theme] .app-shell[data-active-view="home"] .app-main-content { padding: 24px 20px calc(var(--nav-bar-height) + 28px); }
  html[data-theme] #view-home .welcome-section { margin-bottom: 24px; }
  html[data-theme] #view-home #welcome-message { font-size: 22px; }
  html[data-theme] .app-shell[data-active-view="home"] .header-actions #notifications-toggle-btn { border: 0; border-radius: 6px; }
  html[data-theme] .app-shell[data-active-view="home"] .header-actions .profile-avatar-btn { width: 30px; height: 30px; border: 1px solid var(--home-line); background: var(--home-surface); }
}
@container home (max-width: 320px) {
  html[data-theme] #view-home .home-fast-body { grid-template-columns: 150px minmax(0, 1fr); gap: 8px; }
  html[data-theme] #view-home .home-activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
