:root {
  --ink: #18262d;
  --ink-soft: #45545a;
  --paper: #f7f4ec;
  --paper-deep: #ece6d7;
  --white: #fffdf8;
  --gold: #d6a54d;
  --gold-dark: #8e682b;
  --plum: #69445f;
  --teal: #2c6a70;
  --line: rgba(24, 38, 45, 0.18);
  --shadow: 0 24px 70px rgba(24, 38, 45, 0.14);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(214,165,77,.18), transparent 26rem),
    linear-gradient(135deg, #f9f6ef 0%, #efeadd 100%);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
button, select, textarea { font: inherit; }
button, select { min-height: 44px; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed; top: .5rem; left: .5rem; z-index: 100;
  transform: translateY(-160%); background: var(--ink); color: white;
  padding: .65rem 1rem; border-radius: .4rem;
}
.skip-link:focus { transform: none; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem clamp(1rem, 4vw, 3.5rem);
  background: rgba(247,244,236,.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.home-link { display: inline-flex; align-items: center; text-decoration: none; }
.brand-wordmark { display: block; width: clamp(9rem, 16vw, 11rem); height: auto; }
.top-actions { display: flex; align-items: center; gap: .55rem; }
.week-select-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
select, .quiet-button {
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); padding: .55rem .9rem;
}
.quiet-button:hover, select:hover { border-color: var(--gold-dark); }

.welcome {
  width: min(1180px, calc(100% - 2rem)); min-height: calc(100vh - 76px); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(3rem, 8vw, 7rem) 0;
}
.eyebrow { margin: 0 0 1rem; color: var(--gold-dark); font-size: .76rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.welcome h1 { margin: 0; font: 400 clamp(5rem, 15vw, 10rem)/.8 var(--serif); letter-spacing: -.075em; }
.period { color: var(--gold-dark); }
.welcome-subtitle { margin: 2rem 0 1.25rem; font: 400 clamp(1.5rem, 4vw, 2.8rem)/1.1 var(--serif); }
.pastor-note { margin: 1.1rem 0 1.2rem; max-width: 36rem; padding: 1rem 1.15rem; border-left: 3px solid var(--gold); border-radius: 0 .85rem .85rem 0; background: rgba(214,165,77,.09); }
.pastor-note p { margin: 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
.pastor-note footer { margin-top: .55rem; color: var(--gold-dark); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.welcome-intro { max-width: 36rem; font-size: 1.08rem; color: var(--ink-soft); }
.start-here { max-width: 40rem; margin-top: 1.6rem; padding: 1.25rem; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 1rem 1rem 0; background: rgba(255,253,248,.72); }
.start-here .eyebrow { margin-bottom: .35rem; }
.start-here h2 { margin: 0 0 .45rem; font: 400 1.55rem/1.15 var(--serif); }
.start-here p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.start-links { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-top: .85rem; }
.start-links a { color: var(--teal); font-size: .88rem; font-weight: 800; text-underline-offset: .2em; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.primary-button, .secondary-button, .scripture-link {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: .7rem 1.1rem; font-weight: 800; text-decoration: none;
}
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; }
.primary-button:hover { background: #28404a; }
.secondary-button { border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.storage-note { margin-top: 1.3rem; max-width: 34rem; color: #6a6f70; font-size: .88rem; }
.welcome-art { position: relative; overflow: hidden; width: min(100%, 420px); aspect-ratio: 4 / 5; justify-self: center; border-radius: 48% 48% 8% 8%; background: var(--white); box-shadow: var(--shadow); }
.welcome-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(214,165,77,.18), rgba(44,106,112,.2)); mix-blend-mode: color; pointer-events: none; }
.welcome-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: contrast(1.05); }

.week-dialog { width: min(760px, calc(100% - 2rem)); max-height: min(86vh, 760px); padding: 0; border: 0; border-radius: 1.25rem; color: var(--ink); background: var(--white); box-shadow: 0 28px 90px rgba(24,38,45,.32); }
.week-dialog::backdrop { background: rgba(24,38,45,.58); backdrop-filter: blur(5px); }
.week-dialog-card { position: relative; padding: clamp(1.4rem, 5vw, 2.5rem); }
.week-dialog-card h2 { margin: 0 2.5rem .5rem 0; font: 400 clamp(2rem, 6vw, 3.2rem)/1 var(--serif); }
.week-dialog-card > p:not(.eyebrow) { margin: 0 0 1.4rem; color: var(--ink-soft); }
.dialog-close { position: absolute; top: 1rem; right: 1rem; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.6rem; }
.week-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.week-dialog-grid button { display: grid; gap: .2rem; padding: 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--paper); color: var(--ink); text-align: left; }
.week-dialog-grid button:hover { border-color: var(--gold-dark); background: var(--paper-deep); }
.week-dialog-grid span { color: var(--gold-dark); font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.week-dialog-grid strong { font: 400 1.3rem/1.15 var(--serif); }
.week-dialog-grid small { color: var(--ink-soft); font-size: .78rem; }

.backup-dialog { width: min(680px, calc(100% - 2rem)); max-height: min(90vh, 760px); padding: 0; border: 0; border-radius: 1.25rem; color: var(--ink); background: var(--white); box-shadow: 0 28px 90px rgba(24,38,45,.32); }
.backup-dialog::backdrop { background: rgba(24,38,45,.64); backdrop-filter: blur(5px); }
.backup-dialog-card { position: relative; padding: clamp(1.4rem, 5vw, 2.6rem); }
.backup-dialog h2 { margin: 0 2.5rem .7rem 0; font: 400 clamp(2rem, 6vw, 3.2rem)/1 var(--serif); }
.backup-dialog section > p:not(.eyebrow, .form-message) { color: var(--ink-soft); }
.privacy-note { display: grid; gap: .2rem; margin: 1.3rem 0; padding: 1rem 1.1rem; border-left: 4px solid var(--teal); border-radius: 0 .8rem .8rem 0; background: #edf4f2; }
.privacy-note span { color: var(--ink-soft); font-size: .92rem; }
.backup-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.backup-choice { display: grid; gap: .3rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); color: var(--ink); text-align: left; }
.backup-choice:hover { border-color: var(--gold-dark); background: var(--paper-deep); }
.backup-choice strong { font: 400 1.35rem/1.1 var(--serif); }
.backup-choice span { color: var(--ink-soft); font-size: .9rem; }
.backup-dialog form { display: grid; gap: .65rem; margin-top: 1.25rem; }
.backup-dialog form > label:not(.show-password) { margin-top: .35rem; font-size: .82rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.file-field-label { margin-top: .35rem; font-size: .82rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.backup-dialog input[type="password"], .backup-dialog input[type="text"], .backup-dialog input[type="file"] { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: .75rem; background: var(--white); color: var(--ink); padding: .75rem; font: inherit; }
.backup-dialog input:focus-visible { outline: 3px solid rgba(214,165,77,.55); outline-offset: 2px; }
.file-picker-row { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.file-picker-button { flex: 0 0 auto; min-height: 48px; padding: .7rem 1rem; border: 1px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 800; }
.file-picker-button:hover { background: var(--paper); }
#backup-file-name { min-width: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: .88rem; }
.visually-hidden-file { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.show-password { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }
.show-password input { width: 1.15rem; height: 1.15rem; }
.form-message { min-height: 1.5rem; margin: .15rem 0; color: #8b2e27; font-weight: 700; }
.text-button { width: auto; min-height: 36px; margin: 0 0 1rem; padding: 0; border: 0; background: transparent; color: var(--teal); font-weight: 800; text-decoration: underline; text-underline-offset: .2em; }

.guide-shell {
  width: min(1240px, calc(100% - 2rem)); margin: 2rem auto 5rem;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start;
}
.week-panel, .content-panel { border: 1px solid var(--line); background: rgba(255,253,248,.92); box-shadow: var(--shadow); }
.week-panel { position: sticky; top: 5.5rem; border-radius: 1.2rem; overflow: hidden; }
.week-heading { padding: 1.5rem; background: var(--ink); color: white; }
.week-brand-row { display: flex; align-items: center; gap: .75rem; }
.week-brand-mark { display: block; width: 1.65rem; height: 2.45rem; object-fit: contain; filter: invert(1); opacity: .72; }
.week-heading .eyebrow { margin: 0; color: #efd49c; }
.week-heading h2 { margin: 0 0 .75rem; font: 400 2.2rem/1 var(--serif); }
.week-brand-row + h2 { margin-top: .9rem; }
.week-heading p:last-child { margin: 0; color: #d8e0e2; }
.progress-wrap { padding: 1.25rem 1.5rem .7rem; }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.progress-track { height: 5px; margin-top: .65rem; overflow: hidden; border-radius: 5px; background: var(--paper-deep); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--gold); transition: width .25s ease; }
.day-nav { display: grid; padding: .6rem .8rem; }
.day-nav button, .week-overview-button {
  display: flex; align-items: center; gap: .85rem; width: 100%; border: 0; border-radius: .8rem; background: transparent; color: var(--ink); text-align: left; padding: .75rem;
}
.day-nav button:hover, .day-nav button[aria-current="page"], .week-overview-button:hover, .week-overview-button[aria-current="true"] { background: var(--paper-deep); }
.day-number { display: grid; place-items: center; flex: 0 0 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 50%; font-size: .8rem; font-weight: 800; }
.day-nav button.complete .day-number { background: var(--teal); color: white; border-color: var(--teal); }
.day-label { display: grid; line-height: 1.2; }
.day-label small { color: #777; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.week-overview-button { margin: 1rem .8rem 0; width: calc(100% - 1.6rem); border: 1px solid var(--line); justify-content: center; font-weight: 750; }

.content-panel { min-height: 70vh; border-radius: 1.2rem; padding: clamp(1.4rem, 5vw, 4rem); }
.content-header { padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.content-header h1 { margin: .3rem 0 1rem; max-width: 14ch; font: 400 clamp(2.8rem, 7vw, 5.6rem)/.92 var(--serif); letter-spacing: -.045em; }
.reading-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.reading-ref { font-weight: 850; letter-spacing: .04em; }
.scripture-link { border: 1px solid var(--ink); color: var(--ink); padding: .55rem .85rem; }
.scripture-link:hover { background: var(--ink); color: white; }
.message-link { display: inline-flex; align-items: center; margin-top: 1rem; padding: .65rem 1rem; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 850; letter-spacing: .02em; }
.message-link:hover { background: var(--gold-dark); color: white; }
.body-copy { margin: 2.2rem 0; }
.body-copy p { max-width: 48rem; font: 400 1.1rem/1.78 var(--serif); }
.body-copy p + p { margin-top: 1.25rem; }
.callout-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin: 2rem 0; }
.callout { border-left: 4px solid var(--gold); background: var(--paper); padding: 1.25rem; border-radius: 0 .8rem .8rem 0; }
.callout.connect-it { grid-column: 1 / -1; }
.callout h3, .response-card h3 { margin: 0 0 .6rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.callout p { margin: 0; }
.connect-scripture { margin: 1rem 0 .7rem; padding: 1rem; border: 1px solid rgba(214,165,77,.5); border-radius: .75rem; background: rgba(255,253,248,.82); }
.connect-scripture .connect-scripture-ref { margin-bottom: .65rem; color: var(--gold-dark); font-family: var(--sans); font-size: .72rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.connect-scripture p:not(.connect-scripture-ref) { font: 400 1rem/1.58 var(--serif); }
.connect-scripture p + p { margin-top: .45rem; }
.connect-scripture sup { margin-right: .32rem; color: var(--gold-dark); font: 800 .68rem/1 var(--sans); }
.connect-scripture-link { color: var(--teal); font-size: .82rem; font-weight: 800; text-underline-offset: .2em; }
.response-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.response-section > h2 { margin: 0 0 1.5rem; font: 400 2rem/1.1 var(--serif); }
.response-grid { display: grid; gap: 1rem; }
.response-card { padding: 1.25rem; border-radius: 1rem; background: var(--paper); }
.response-card p { margin: 0 0 .8rem; }
textarea {
  width: 100%; min-height: 132px; resize: vertical; border: 1px solid var(--line); border-radius: .75rem;
  background: var(--white); color: var(--ink); padding: .9rem; line-height: 1.55;
}
textarea:focus, button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(214,165,77,.55); outline-offset: 2px; }
.live-sent-label { display: block; margin: 1rem 0 .45rem; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.overview-art { overflow: hidden; margin: 1.5rem 0 2rem; border-radius: 1rem; background: var(--ink); }
.overview-art img { display: block; width: 100%; max-height: 310px; object-fit: cover; filter: contrast(1.05); }
.week-notes-grid { display: grid; gap: 1rem; }
.week-close { margin-top: 3rem; padding-top: 2.5rem; border-top: 2px solid var(--gold); }
.week-close > h2 { margin: 0 0 .5rem; font: 400 clamp(2.1rem, 5vw, 3.4rem)/1 var(--serif); }
.week-close > p:not(.eyebrow) { margin: 0 0 1.4rem; color: var(--ink-soft); }
.week-close-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.daily-backup-card { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-top: 2rem; padding: 1.25rem; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 0 1rem 1rem 0; background: #edf4f2; }
.daily-backup-card .eyebrow { margin-bottom: .3rem; color: var(--teal); }
.daily-backup-card h3 { margin: 0; font: 400 1.45rem/1.15 var(--serif); }
.daily-backup-card p:not(.eyebrow) { margin: .35rem 0 0; color: var(--ink-soft); font-size: .9rem; }
.daily-backup-card .backup-status { color: var(--teal); font-weight: 800; }
.daily-backup-card .secondary-button { flex: 0 0 auto; }
.print-week-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.2rem; margin-top: 1.5rem; padding: 1.35rem; border-radius: 1rem; background: var(--ink); color: white; }
.print-week-card .eyebrow { margin-bottom: .3rem; color: #efd49c; }
.print-week-card h3 { margin: 0; font: 400 1.45rem/1.15 var(--serif); }
.print-week-card p:not(.eyebrow) { margin: .35rem 0 0; color: #d8e0e2; font-size: .9rem; }
.print-week-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.print-week-card .secondary-button { border-color: white; color: white; }
.print-week-card .secondary-button:hover { background: white; color: var(--ink); }
.save-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; transform: translateY(150%); opacity: 0; transition: .25s ease; background: var(--ink); color: white; border-radius: 999px; padding: .65rem 1rem; font-size: .85rem; }
.save-toast.show { transform: none; opacity: 1; }
.site-footer { width: min(1180px, calc(100% - 2rem)); margin: 1rem auto 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: #6a6f70; }
.site-footer p { margin: 0; font-size: .72rem; line-height: 1.5; }

@media (max-width: 820px) {
  .topbar { align-items: flex-start; }
  .home-link span:last-child { display: none; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .welcome { grid-template-columns: 1fr; min-height: auto; padding-top: 3.5rem; }
  .welcome-art { max-height: 440px; }
  .guide-shell { grid-template-columns: 1fr; width: min(100% - 1rem, 760px); margin-top: .5rem; }
  .week-panel { position: static; }
  .day-nav { grid-template-columns: repeat(5, minmax(96px,1fr)); overflow-x: auto; }
  .day-nav button { display: grid; justify-items: center; text-align: center; }
  .week-overview-button { margin-top: 1rem; }
  .content-panel { padding: 1.25rem; }
  .callout-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; }
  .top-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-wordmark { width: 9.5rem; }
  .quiet-button { font-size: .84rem; }
  #week-select { grid-column: 1 / -1; width: 100%; max-width: none; }
  .welcome h1 { font-size: 6rem; }
  .welcome-art { border-radius: 35% 35% 6% 6%; }
  .content-header h1 { font-size: 3.2rem; }
  .week-dialog-grid { grid-template-columns: 1fr; }
  .backup-choice-grid { grid-template-columns: 1fr; }
  .daily-backup-card { align-items: stretch; flex-direction: column; }
  .daily-backup-card .secondary-button { width: 100%; }
  .print-week-card { grid-template-columns: 1fr; }
  .print-week-actions { display: grid; justify-content: stretch; }
  .print-week-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
