/* Precursores Maranga. Local presentation layer; no external fonts or assets. */
:root {
  --bg: #f4f3ee;
  --bg-deep: #e8efed;
  --surface: #ffffff;
  --surface-soft: #f2f6f5;
  --border: #d2dfdc;
  --text: #173d46;
  --muted: #526b70;
  --accent: #176b79;
  --accent-strong: #073344;
  --accent-soft: #176b79;
  --success: #226448;
  --warning: #8a571c;
  --gold: #e8c37b;
  --shadow: 0 8px 26px rgba(24, 56, 59, .055);
  --radius-lg: 22px;
  --radius-md: 14px;
}

html { color-scheme: light; background: var(--bg); }
html { scroll-padding-bottom: calc(16px + var(--session-dock-space, 0px)); }
body {
  background: var(--bg);
  font-family: "Segoe UI", "Aptos", system-ui, sans-serif;
  line-height: 1.5;
}
.ambient, .glass::before { display: none; }
.app-shell { overflow: clip; }
.app { width: min(100%, 1120px); gap: 20px; padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(36px + env(safe-area-inset-bottom, 0px)); }
.app > *, .brand, .brand > div, .hero-top > *, .section-header > div, .modal-header > div { min-width: 0; }
.card { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); backdrop-filter: none; }
h1, h2, .stamp-value { text-wrap: pretty; }
h1, h2, h3, button { overflow-wrap: anywhere; }
h2 { font-weight: 650; letter-spacing: -.025em; }
.eyebrow { font-size: .72rem; letter-spacing: .13em; font-weight: 700; }
.history-time, .modal-note, .schedule-summary-text { line-height: 1.6; }
button, summary { touch-action: manipulation; }
button:not(:disabled), summary { cursor: pointer; }
button { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
button:disabled { opacity: 1; color: #526567; background: #e6ebe9; border-color: #d0d9d6; filter: none; }
:is(button, input, textarea, select, summary, a):focus-visible { outline: 3px solid #176b79; outline-offset: 3px; }

/* The official mark leads the page; the timer stays close to the main action. */
.hero {
  container-type: inline-size;
  container-name: brand-header;
  position: relative;
  padding: 28px 30px 20px;
  background: #073344;
  color: #ffffff;
  border-color: #073344;
  border-radius: 26px;
  box-shadow: 0 12px 30px rgba(7, 51, 68, .13);
}
.hero::after {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  right: -160px;
  top: -190px;
  border: 44px solid rgba(232, 195, 123, .1);
  border-radius: 50%;
  pointer-events: none;
}
.hero-top { align-items: flex-start; }
.brand { gap: 20px; align-items: center; }
.brand-logo { width: 80px; height: 80px; flex: 0 0 auto; border-radius: 22px; object-fit: contain; border: 1px solid #779799; box-shadow: none; }
.brand .eyebrow { display: block; color: #c4d9db; font-size: .65rem; margin-bottom: 7px; }
.brand h1 { font-size: clamp(1.65rem, 3.5vw, 2.35rem); font-weight: 650; line-height: 1.12; letter-spacing: -.045em; }
.brand h1 span { color: #ebcf98; }
.brand-tagline { margin-top: 7px; color: #edf5f3; font-size: .98rem; }
.hero-copy { color: #c4d9db; font-size: .78rem; max-width: 60ch; margin-top: 5px; line-height: 1.5; }
.hero-actions { position: relative; z-index: 1; flex-shrink: 0; }
.icon-button { width: 44px; height: 44px; border-radius: 14px; background: #164657; border-color: #64828c; color: white; box-shadow: none; }
.icon-button:hover { background: #22586a; border-color: #a5bec5; }
.hero :focus-visible { outline-color: #ebcf98; }
.hero-grid { margin-top: 22px; border-top: 1px solid #39616c; padding-top: 14px; }
.clock-panel { gap: 10px; flex-direction: row; align-items: center; }
.live-date { color: #d2e4e4; font-size: .81rem; }
.live-time { font-size: .92rem; font-variant-numeric: tabular-nums; font-weight: 600; color: #ffffff; }
.clock-panel.is-tracking { padding: 10px 14px; border-radius: 12px; background: #164d58; }
.live-time.is-tracking { color: #ffdda0; }

.tracker-card { padding: 22px 26px; border-left: 4px solid #b58b43; }
.tracker-card .section-header { margin-bottom: 16px; }
.tracker-card .eyebrow { display: block; margin-bottom: 3px; }
.section-header h2 { font-size: 1.2rem; }
.state-badge { color: #365b63; background: #eff4f3; border-color: #c6d8d4; font-weight: 600; }
.tracker-card .state-badge { white-space: normal; text-align: center; line-height: 1.3; }
.primary-actions { margin: 0; }
.primary-actions .action-button { min-height: 58px; font-size: 1.05rem; border-radius: 14px; }
.action-button, .modal-submit { background: #12596a; color: #fff; border: 1px solid transparent; border-radius: 12px; box-shadow: none; }
.action-button:not(:disabled):hover, .modal-submit:not(:disabled):hover { background: #073e50; box-shadow: 0 4px 12px rgba(7, 51, 68, .12); }
.action-start { background: #12596a; }
.action-start::before { content: ""; display: inline-block; margin-right: 12px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; vertical-align: -1px; }
.action-stop, .modal-submit.action-stop { background: #993d47; color: white; }
.action-stop:not(:disabled):hover { background: #7a2e37; }
.primary-actions .action-stop::before { content: ""; display: inline-block; width: 10px; height: 10px; background: currentColor; border-radius: 2px; margin-right: 12px; }
.secondary-action, .ghost-button, .history-action, .modal-close, .consult-tab {
  background: #ffffff;
  color: #174e5b;
  border: 1px solid #9bb6b3;
  border-radius: 12px;
  min-height: 44px;
  font-weight: 600;
}
:is(.secondary-action, .ghost-button, .history-action, .modal-close, .consult-tab):not(:disabled):hover { background: #eaf2ef; border-color: #4f7d80; box-shadow: none; }
.compact-ghost { font-weight: 500; }
.install-strip-button { min-width: 48px; font-size: 1rem; padding: 10px 16px; min-height: 48px; }
.install-strip { margin: 16px 0 0; justify-content: flex-start; }
.share-action { background: #12596a; border-color: #12596a; color: #ffffff; }
.share-action:not(:disabled):hover { background: #073e50; border-color: #073e50; }
.danger-action, .history-action.danger { color: #923845; background: #fff7f6; border-color: #cda5a5; }
.danger-action:not(:disabled):hover, .history-action.danger:not(:disabled):hover { background: #fbe9e7; border-color: #ac626a; }

/* Monthly reading is calm and bright, with one strong total and one report action. */
.primary-metric { position: relative; padding: 26px; background: #ffffff; gap: 18px; }
.primary-metric > .eyebrow { color: #526b70; }
.primary-metric .metric-value { color: #073344; font-size: clamp(2.6rem, 7vw, 3.75rem); letter-spacing: -.055em; line-height: 1.07; font-weight: 650; }
.primary-metric .metric-label { margin-top: -12px; color: #526b70; font-size: .9rem; }
.primary-metric .goal-grid { padding-top: 18px; border-top: 1px solid var(--border); }
.primary-metric .goal-metric { border-color: var(--border); padding: 14px 0 0; }
.goal-value { font-weight: 650; color: #173d46; }
.primary-metric .share-card { padding-top: 18px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.share-quick-links { gap: 12px; }
.share-quick-links .history-time { font-size: .8rem; }
.share-quick-actions button { font-size: .78rem; line-height: 1.4; }
.progress-track { height: 9px; background: #dce8e3; }
.progress-fill { background: #217987; }
.progress-meta { color: #526b70; font-size: .85rem; }
.progress-meta span:last-child { font-weight: 700; color: #174e5b; }
.status-bar { margin-top: 0; font-size: .86rem; padding: 14px 16px; border-radius: 12px; }
.status-neutral { background: #eef5f5; border-color: #cbdfe0; color: #244e5a; }
.status-good { background: #ecf5ee; border-color: #bcd8c5; color: #225b3d; }
.status-warning { background: #fff4df; border-color: #e6cf9c; color: #78501e; }
.pioneer-card { border-top: 3px solid #c8aa70; gap: 14px; }

.start-card, .goal-metric, .history-item, .schedule-chip, .agenda-item,
.study-item, .study-editor-card, .toggle-card, .settings-block, .pioneer-backfill-row,
.settings-summary-card, .collapse-card, .consult-panel, .schedule-row, .person-card {
  background: #f5f8f6;
  border-color: var(--border);
}
.agenda-card { padding: 24px; background: #ffffff; gap: 12px; }
.agenda-heading { font-size: 1.1rem; font-weight: 650; color: #173d46; letter-spacing: -.02em; }
.agenda-card .stamp-value { font-size: .9rem; color: #526b70; line-height: 1.65; font-weight: 400; }
.agenda-collapse { border: 0; padding: 0; background: transparent; }
.agenda-open { background: #f2f7f5; border-color: var(--border); }
.agenda-open:not(:disabled):hover { background: #eaf2ef; border-color: #699897; }
.agenda-meta { flex-shrink: 0; }
.day-summary, .service-year-month { border-color: var(--border); background: transparent; }
.history-badge { background: #e8f1ef; }
.person-lesson { color: #526b70; }
.shortcut-card { padding: 22px; gap: 12px; }
.tools-heading { grid-column: 1 / -1; font-size: 1.1rem; margin: 0 0 2px; }
.shortcut-card .secondary-action { text-align: left; min-height: 64px; padding: 14px; font-size: .86rem; background: #f5f8f6; }
.shortcut-card .secondary-action:hover { background: #e9f1ec; }
.shortcut-card #manualEntryButton { grid-column: auto; }
.shortcut-card #serviceConductorButton { grid-column: 1 / -1; min-height: 44px; }
.consult-card { padding: 24px; gap: 12px; }
.consult-card .section-header { margin-bottom: 4px; }
.collapse-card { border-radius: 12px; }
.collapse-summary { padding: 8px 0; font-size: .93rem; }
.collapse-summary::after { color: #176b79; }
.collapse-card[open] .collapse-summary::after { transform: none; }
.segmented { background: #e6eeeb; }
.segmented button[aria-pressed=true], .consult-tab.is-active { background: #174e5b; color: white; box-shadow: none; }
.study-status.is-complete, .service-conductor-status.is-used { color: #225b3d; background: #e9f3ec; border-color: #bdd6c5; }
.study-status.is-pending { color: #805123; background: #fff4e1; border-color: #dcc79f; }
.revisit-status, .service-conductor-status.is-unused { color: #174e5b; background: #e9f2f3; border-color: #bdd3d6; }
.service-conductor-topic-card { background: #f5f8f6; }
.service-conductor-topic-card[open] { border-color: #95b8b4; box-shadow: none; }
.service-conductor-readonly-text { color: #173d46; }

/* Form fields and dialogs use the same light surfaces and explicit focus states. */
.field input, .field select, .field textarea, .schedule-hours input, .pioneer-backfill-row input {
  background: #ffffff;
  color: #173d46;
  border: 1px solid #66847f;
  border-radius: 10px;
  padding: 12px;
  min-height: 48px;
  font-size: 1rem;
}
.field input:focus, .field select:focus, .field textarea:focus, .schedule-hours input:focus { background: #ffffff; border-color: #176b79; transform: none; }
input::placeholder, textarea::placeholder { color: #657975; opacity: 1; }
.field span { font-size: .85rem; font-weight: 600; color: #425f63; }
.field select { appearance: auto; padding-right: 12px; }
.select-field::after { content: none; }
.schedule-hours input { padding: 10px 4px; }
.schedule-toggle input { accent-color: #176b79; }
.toggle-slider { pointer-events: none; background: #cad7d2; border-color: #829e98; }
.toggle-slider::after { background: white; box-shadow: 0 2px 5px #173d4626; }
.toggle-switch input { cursor: pointer; }
.toggle-switch input:checked + .toggle-slider { background: #176b79; border-color: #176b79; }
.toggle-switch input:focus-visible + .toggle-slider { outline: 3px solid #176b79; outline-offset: 4px; }
.modal-backdrop { background: rgba(7, 33, 42, .64); backdrop-filter: blur(5px); }
.modal-panel { background: #ffffff; border: 1px solid #cbdad5; box-shadow: 0 24px 70px #0733443d; color: #173d46; padding: 0 22px 20px; border-radius: 22px; }
.modal-header, .modal-actions { background: #ffffff; border-color: #d2dfdc; }
.modal-header { padding-top: 20px; padding-bottom: 16px; }
.modal-header h2 { font-size: 1.18rem; line-height: 1.3; }
.modal-actions { bottom: -20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.modal-actions button { font-size: .9rem; }
.modal-note { font-size: .88rem; }
.settings-help .modal-note, .danger-zone p { margin: 10px 0; }
.settings-summary-card-error { color: #923845; background: #fff0ee; border-color: #d3a2a6; }
.danger-zone { border-color: #dfc9c8; }
.danger-zone summary, .danger-text-action { color: #923845; }
.notice-banner { background: #f0f5f1; border-color: #cadacf; box-shadow: none; }
#featureNoticeDismissButton, #featureNoticeDismissButton:hover, #featureNoticeDismissButton:focus-visible { color: #174e5b; border-color: #9bb6b3; }
.backup-reminder { background: #fff8e9; border-color: #ddcbaa; color: #674e2c; line-height: 1.6; }
.safety-banner { background: #fff0ee; color: #792b37; border-color: #b87980; }
.save-feedback { background: #073344; color: #ffffff; border-color: #6b9298; box-shadow: 0 6px 24px #07334426; }
.app-footer { padding: 14px 0 0; border-top: 1px solid #d5ddd7; gap: 4px; }
.footer-brand { color: #365b63; font-size: .78rem; font-weight: 600; text-align: center; }
.footer-brand span { color: #526b70; font-weight: 400; }
.version-chip-subtle { color: #526b70; font-size: .7rem; }

@media (min-width: 900px) {
  .app { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
  .tracker-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .65fr); gap: 22px; align-items: center; }
  .tracker-card .section-header { margin: 0; }
  .primary-actions .action-button { min-height: 60px; }
}
@media (max-width: 640px) {
  .app { padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(24px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
  .hero { padding: 16px; border-radius: 22px; }
  .brand { gap: 12px; align-items: flex-start; }
  .brand-logo { width: 54px; height: 54px; border-radius: 15px; }
  .brand .eyebrow { display: none; }
  .brand h1 { font-size: 1.45rem; line-height: 1.15; letter-spacing: -.025em; }
  .brand h1 span { display: block; }
  .brand-tagline { display: none; }
  .hero-copy { font-size: .875rem; margin-top: 8px; max-width: 30ch; }
  .hero-top { gap: 6px; }
  .icon-button { width: 48px; height: 48px; border-radius: 12px; }
  .hero-grid { margin-top: 12px; padding-top: 10px; }
  .live-date { font-size: .875rem; max-width: none; }
  .live-time { font-size: .875rem; }
  .tracker-card { padding: 18px; }
  .tracker-card .section-header { gap: 12px; }
  .tracker-card .eyebrow { display: none; }
  .tracker-card .section-header h2 { font-size: 1.03rem; }
  .tracker-card .state-badge { max-width: 125px; font-size: .875rem; padding: 7px 8px; flex-shrink: 1; }
  .primary-metric, .agenda-card, .consult-card { padding: 22px; }
  .primary-metric .metric-value { font-size: 3rem; }
  .shortcut-card { padding: 20px; }
  .modal-shell { padding: 10px; }
  .modal-panel { padding: 0 16px 16px; max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); }
  .modal-header { padding-top: 16px; }
  .modal-actions { bottom: -16px; flex-wrap: wrap; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .modal-actions-split > * { flex-basis: 100%; }
  .modal-header h2 { font-size: 1.08rem; }
  .footer-brand span { display: block; margin-top: 2px; }
}
@media (max-width: 360px) {
  .app { padding-left: 10px; padding-right: 10px; }
  .hero { padding-left: 14px; padding-right: 14px; }
  .brand-logo { width: 44px; height: 44px; border-radius: 12px; }
  .brand { gap: 9px; }
  .brand h1 { font-size: 1.45rem; }
  .hero-copy { font-size: .875rem; }
  .primary-metric, .agenda-card, .consult-card, .shortcut-card { padding: 18px; }
  .shortcut-card .secondary-action { padding: 11px; }
  .primary-metric .goal-metrics, .share-quick-actions { grid-template-columns: 1fr; }
  .modal-inline-actions { flex-wrap: wrap; }
  .modal-inline-actions > * { flex-basis: 100%; }
}

/* Daily actions precede the monthly summary in both visual and DOM order. */
.app > .draft-recovery-card { order: 1; grid-column: 1 / -1; }
.app > .shortcut-card { order: 3; }
.app > .overview-grid { order: 5; }
.app { padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px) + var(--session-dock-space, 0px)); }
.shortcut-card { padding: 18px; gap: 10px; }
.shortcut-card .secondary-action { min-height: 52px; padding: 12px; font-size: 1rem; }
.shortcut-card #serviceConductorButton { grid-column: auto; min-height: 52px; }
.shortcut-card .tools-heading { font-size: 1rem; }
.shortcut-card.without-conductor #reportsShortcutButton { grid-column: 1 / -1; }
.eyebrow, .mini-label, .history-time, .history-item .history-time,
.primary-metric .metric-label, .primary-metric > .eyebrow,
.share-quick-links .history-time, .share-quick-actions button, .progress-meta,
.field span, .modal-note, .modal-header .eyebrow, .toggle-copy .modal-note,
.footer-brand, .version-chip-subtle, .service-conductor-counter { font-size: .875rem; }
.modal-actions button, .agenda-card .stamp-value, .modal-form input,
.modal-form select, .modal-form textarea, .schedule-toggle { font-size: 1rem; }
.modal-actions, .modal-inline-actions { flex-wrap: wrap; min-width: 0; }
.modal-actions > *, .modal-inline-actions > * { min-width: 0; }
.modal-actions > button, .modal-inline-actions > button { flex: 1 1 8rem; }
.field input, .field textarea, .field select { min-width: 0; max-width: 100%; }
.tracker-card .state-badge { max-width: 100%; border-radius: 10px; }
.modal-close { min-width: 48px; width: 48px; height: 48px; padding: 0; font-size: 24px; line-height: 1; }
.modal-header { align-items: flex-start; }
.compact-dialog-viewport .modal-header, .compact-dialog-viewport .modal-actions { position: static; }
.modal-panel { scroll-padding-top: 120px; scroll-padding-bottom: 120px; }
.modal-layer { top: var(--dialog-viewport-top, 0px); bottom: auto; height: var(--dialog-viewport-height, 100dvh); }
.modal-shell { height: 100%; min-height: 0; }
.modal-panel { max-height: calc(var(--dialog-viewport-height, 100dvh) - 24px - env(safe-area-inset-top, 0px)); }
.schedule-row { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
.schedule-toggle { min-height: 48px; gap: 12px; white-space: normal; }
.schedule-toggle input { flex-shrink: 0; }
.schedule-time-grid { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schedule-hours { display: grid; grid-template-columns: 1fr; gap: 4px; min-width: 0; text-align: left; }
.schedule-hours input { width: 100%; font-size: 1rem; padding: 10px; }
.schedule-unit { font-size: .875rem; color: #425f63; }
.report-step { display: grid; gap: 14px; }
.report-step[hidden], .active-session-dock[hidden], .draft-recovery-card[hidden] { display: none; }
.report-option-grid { grid-template-columns: 1fr; }
.report-option-button { text-align: left; font-size: 1rem; min-height: 64px; }
.report-option-button span { font-size: .875rem; line-height: 1.55; font-weight: 400; }
.report-confirmed-summary { background: #edf5ee; color: #225b3d; padding: 14px; border-radius: 10px; }
.draft-recovery-card { padding: 18px; background: #fff8e9; }
.draft-recovery-card h2 { font-size: 1.05rem; }
.draft-recovery-card p { margin: 8px 0 14px; font-size: .875rem; }
.draft-item { padding: 16px; border: 1px solid #9bb6b3; border-radius: 12px; background: #f5f8f6; min-width: 0; }
.draft-item h3 { font-size: 1.05rem; }
.draft-item p { margin: 10px 0; }
.draft-item summary { min-height: 48px; padding: 12px 0; }
.draft-item dl { margin: 12px 0; }
.draft-item dt { font-weight: 650; margin-top: 12px; }
.draft-item dd { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.draft-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.draft-actions button { flex: 1 1 180px; }
.active-session-dock { position: fixed; z-index: 15; bottom: 0; left: 0; right: 0; padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: #073344; color: white; display: flex; justify-content: center; align-items: center; gap: 24px; border-top: 1px solid #779799; box-shadow: 0 -4px 20px #07334426; }
.active-session-dock div { min-width: 0; display: grid; }
.active-session-dock span { font-size: .875rem; }
.active-session-dock strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.active-session-dock button { min-height: 48px; font-size: 1rem; }
.save-feedback { bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--session-dock-space, 0px)); }
@media (min-width: 900px) {
  .app > .shortcut-card { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app > .agenda-card { grid-column: 1 / -1; }
  .app > .overview-grid { grid-row: auto; }
  .shortcut-card.without-conductor #reportsShortcutButton { grid-column: span 2; }
}
@media (max-width: 640px) {
  .brand { min-width: 0; }
  .brand-logo { width: 44px; height: 44px; }
  .hero-top { gap: 8px; }
  .clock-panel { flex-wrap: wrap; flex-direction: row; }
  .tracker-card .section-header { flex-wrap: wrap; }
  .primary-metric .goal-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
  .modal-field-grid, .study-editor-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
  .active-session-dock { gap: 12px; }
}
@media (max-height: 500px) {
  .modal-header, .modal-actions { position: static; }
  .modal-panel { scroll-padding: 16px; }
}
@container brand-header (max-width: 15em) {
  .hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .brand { display: contents; }
  .brand-logo { grid-column: 1; grid-row: 1; }
  .brand > div { grid-column: 1 / -1; grid-row: 2; }
  .hero-actions { grid-column: 2; grid-row: 1; }
}
