:root {
  --ink: #1f2a28;
  --muted: #65706b;
  --paper: #fffaf0;
  --surface: #ffffff;
  --line: #dfd8c8;
  --green: #315f51;
  --green-dark: #173d35;
  --clay: #9d5038;
  --gold: #c2944e;
  --shadow: 0 18px 50px rgba(35, 31, 26, 0.15);
  --hero-text: #fffdf6;
  --hero-date: rgba(255, 253, 246, 0.88);
  --control-bg: rgba(255, 255, 255, 0.94);
  --reading-bg: rgba(255, 255, 255, 0.97);
  --point-bg: #fffdf8;
  --point-number-bg: #eef4ef;
  --date-pill-bg: #f3ead9;
  --notice-bg: #fff6df;
  --notice-text: #70512d;
  --progress-bg: #ece3d4;
  --control-font-size: 1rem;
  --field-label-size: 0.86rem;
  --field-input-size: 1rem;
  --meta-font-size: 0.92rem;
  --title-font-size: clamp(1.75rem, 4vw, 3.25rem);
  --passage-font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  --point-font-size: 1rem;
  --progress-font-size: 0.95rem;
  --footer-font-size: 0.9rem;
}

html[data-theme="dark"] {
  --ink: #edf4ef;
  --muted: #aebbb5;
  --paper: #101816;
  --surface: #17231f;
  --line: #34443f;
  --green: #6cb49b;
  --green-dark: #e3f2ec;
  --clay: #e4aa91;
  --gold: #d7b46a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --control-bg: rgba(23, 35, 31, 0.96);
  --reading-bg: rgba(22, 32, 29, 0.98);
  --point-bg: #121d1a;
  --point-number-bg: #20352f;
  --date-pill-bg: #3a2f25;
  --notice-bg: #2b251a;
  --notice-text: #ead6ac;
  --progress-bg: #28342f;
}

html[data-text-size="1"] {
  --control-font-size: 0.94rem;
  --field-label-size: 0.82rem;
  --field-input-size: 0.94rem;
  --meta-font-size: 0.86rem;
  --title-font-size: clamp(1.55rem, 5vw, 2.65rem);
  --passage-font-size: 1rem;
  --point-font-size: 0.96rem;
  --progress-font-size: 0.9rem;
  --footer-font-size: 0.84rem;
}

html[data-text-size="2"] {
  --control-font-size: 0.98rem;
  --field-label-size: 0.84rem;
  --field-input-size: 0.98rem;
  --meta-font-size: 0.9rem;
  --title-font-size: clamp(1.65rem, 5.5vw, 2.95rem);
  --passage-font-size: 1.08rem;
  --point-font-size: 1rem;
  --progress-font-size: 0.94rem;
  --footer-font-size: 0.88rem;
}

html[data-text-size="4"] {
  --control-font-size: 1.08rem;
  --field-label-size: 0.9rem;
  --field-input-size: 1.1rem;
  --meta-font-size: 1rem;
  --title-font-size: clamp(1.95rem, 6.5vw, 3.55rem);
  --passage-font-size: 1.24rem;
  --point-font-size: 1.12rem;
  --progress-font-size: 1.04rem;
  --footer-font-size: 0.98rem;
}

html[data-text-size="5"] {
  --control-font-size: 1.14rem;
  --field-label-size: 0.94rem;
  --field-input-size: 1.16rem;
  --meta-font-size: 1.06rem;
  --title-font-size: clamp(2.1rem, 7.2vw, 3.9rem);
  --passage-font-size: 1.34rem;
  --point-font-size: 1.22rem;
  --progress-font-size: 1.1rem;
  --footer-font-size: 1.02rem;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Pretendard",
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: clamp(280px, 42vh, 430px);
  display: flex;
  align-items: end;
  background:
    linear-gradient(180deg, rgba(21, 32, 29, 0.18), rgba(21, 32, 29, 0.72)),
    url("assets/daily-bible-hero.png") center 58% / cover no-repeat;
  color: var(--hero-text);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(19, 36, 32, 0.72), rgba(19, 36, 32, 0.16));
}

.hero__content {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 54px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(2.55rem, 5.4vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero__date {
  margin: 18px 0 0;
  color: var(--hero-date);
  font-size: 1.05rem;
  font-weight: 700;
}

.utility-tools {
  position: absolute;
  top: 16px;
  right: max(16px, calc((100% - 1120px) / 2));
  z-index: 3;
  display: inline-grid;
  grid-template-columns: 38px 28px 38px 38px;
  gap: 6px;
  align-items: center;
}

.utility-button,
.utility-status {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(18, 30, 27, 0.42);
  color: #fffdf6;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.utility-button {
  padding: 0;
  font-size: 0.92rem;
  font-weight: 900;
}

.utility-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.utility-status {
  display: inline-grid;
  place-items: center;
  color: #ead5a5;
  font-size: 0.86rem;
  font-weight: 900;
}

.reader {
  width: min(1120px, calc(100% - 32px));
  margin: -34px auto 0;
  position: relative;
  z-index: 2;
  padding-bottom: 48px;
}

.toolbar {
  display: grid;
  grid-template-columns: 58px minmax(140px, 220px) 58px minmax(100px, 150px) minmax(170px, 1fr) minmax(100px, 150px);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}

.current-day-button,
.today-reset-button,
.action-button,
.nav-button,
.field {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: var(--control-bg);
  box-shadow: 0 10px 24px rgba(25, 37, 33, 0.1);
}

.current-day-button,
.today-reset-button,
.action-button,
.nav-button {
  min-height: 48px;
  padding: 0 18px;
  color: var(--green-dark);
  font-size: var(--control-font-size);
  font-weight: 800;
}

.current-day-button,
.today-reset-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.current-day-button span {
  color: var(--clay);
}

.today-reset-button {
  padding: 0 18px;
  background: var(--green);
  color: #fff;
  border-color: rgba(49, 95, 81, 0.5);
}

.action-button {
  background: var(--control-bg);
  color: var(--green-dark);
  border-color: rgba(255, 255, 255, 0.55);
}

.field {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
}

.field span {
  color: var(--muted);
  font-size: var(--field-label-size);
  font-weight: 800;
}

.field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--field-input-size);
  font-weight: 800;
}

.reading {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--reading-bg);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
}

.reading__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.day-pill,
.date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: var(--meta-font-size);
  font-weight: 900;
}

.day-pill {
  background: var(--green);
  color: #fff;
}

.date-pill {
  background: var(--date-pill-bg);
  color: var(--clay);
}

.reading h2 {
  margin: 0;
  font-size: var(--title-font-size);
  line-height: 1.18;
  letter-spacing: 0;
}

.passage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 18px 0 0;
  border-bottom: 3px solid rgba(194, 148, 78, 0.45);
  color: var(--green-dark);
  font-size: var(--passage-font-size);
  font-weight: 900;
  line-height: 1.5;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.passage::after {
  content: "⌄";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.45em;
  height: 1.45em;
  border-radius: 999px;
  background: rgba(49, 95, 81, 0.12);
  color: var(--green);
  font-size: 0.72em;
}

.passage:hover,
.passage:focus-visible {
  border-color: var(--gold);
  color: var(--green);
}

.passage:hover {
  transform: translateY(-1px);
}

.passage:focus-visible {
  outline: 3px solid rgba(194, 148, 78, 0.38);
  outline-offset: 5px;
}

.bible-reader {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bible-reader[hidden] {
  display: none;
}

.bible-reader__tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: var(--point-bg);
}

.bible-version-tab,
.bible-reader__close {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--control-bg);
  color: var(--green-dark);
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
}

.bible-version-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bible-version-tab.is-active {
  border-color: rgba(49, 95, 81, 0.55);
  background: var(--green);
  color: #fff;
}

.bible-version-tab--link::after {
  content: "↗";
  margin-left: 6px;
  font-size: 0.82em;
}

.bible-reader__close {
  margin-left: auto;
  color: var(--muted);
}

.bible-reader__body {
  padding: clamp(18px, 3vw, 28px);
}

.bible-reader h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.35;
}

.bible-reader__status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
}

.scripture-content {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.scripture-section {
  display: grid;
  gap: 16px;
}

.scripture-section h4 {
  margin: 0;
  color: var(--clay);
  font-size: 1.08rem;
  line-height: 1.4;
}

.scripture-chapter {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.scripture-chapter h5 {
  margin: 0 0 12px;
  color: var(--green-dark);
  font-size: 1rem;
  line-height: 1.4;
}

.scripture-verses {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 2.05rem;
}

.scripture-verses li {
  padding-left: 0.25rem;
  color: var(--ink);
  font-size: var(--point-font-size);
  line-height: 1.72;
}

.scripture-verses li::marker {
  color: var(--green);
  font-weight: 900;
}

.notice {
  margin: 18px 0 0;
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: var(--notice-bg);
  color: var(--notice-text);
  font-weight: 700;
  line-height: 1.55;
}

.points {
  display: grid;
  gap: 12px;
  margin: 30px 0;
  padding: 0;
  list-style: none;
  counter-reset: point;
}

.points li {
  counter-increment: point;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  align-items: start;
  min-height: 64px;
  border: 1px solid #ece4d6;
  border-radius: 8px;
  background: var(--point-bg);
  padding: 16px;
  font-size: var(--point-font-size);
  line-height: 1.58;
}

.points li::before {
  content: counter(point);
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--point-number-bg);
  color: var(--green-dark);
  font-weight: 900;
}

.progress-wrap {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: var(--progress-font-size);
  font-weight: 800;
}

.progress-text strong {
  color: var(--clay);
}

.progress-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-bg);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 180ms ease;
}

.nav-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-color: var(--line);
  background: var(--surface);
}

.nav-button span {
  font-size: 1.5rem;
  line-height: 1;
}

.nav-button--compact {
  padding: 0;
}

.nav-button--compact span {
  font-size: 1.9rem;
}

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 36px;
  color: var(--muted);
  font-size: var(--footer-font-size);
  line-height: 1.55;
}

.app-version {
  display: inline-block;
  margin-left: 8px;
  color: #8a8174;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  html {
    font-size: 17px;
  }

  .hero {
    min-height: 240px;
    background-position: center 62%;
  }

  .hero__overlay {
    background: linear-gradient(180deg, rgba(19, 36, 32, 0.36), rgba(19, 36, 32, 0.8));
  }

  .toolbar {
    grid-template-columns: 48px minmax(0, 1fr) 48px minmax(78px, 0.72fr);
    gap: 9px;
    margin-bottom: 16px;
  }

  .reader {
    margin: 0 auto;
    padding-top: 14px;
    padding-bottom: 38px;
  }

  .current-day-button {
    min-height: 56px;
  }

  .nav-button--compact {
    min-height: 56px;
  }

  .field {
    min-height: 46px;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 0 12px;
  }

  .field--date {
    grid-column: 1 / 4;
  }

  .today-reset-button {
    grid-column: 4;
    min-height: 56px;
    padding: 0 12px;
    font-size: 1.05rem;
  }

  .action-button {
    grid-column: 4;
    min-height: 46px;
    padding: 0 12px;
    font-size: 1.05rem;
  }

  .reading {
    padding: 28px 22px;
  }

  .reading__meta {
    margin-bottom: 22px;
  }

  .day-pill,
  .date-pill {
    min-height: 38px;
    padding: 0 14px;
  }

  .points {
    gap: 16px;
    margin: 34px 0;
  }

  .points li {
    grid-template-columns: 38px 1fr;
    gap: 14px;
    padding: 16px 16px;
    line-height: 1.62;
  }

  .points li::before {
    width: 38px;
    height: 38px;
  }

  .bible-reader__tabs {
    gap: 6px;
    padding: 8px;
  }

  .bible-version-tab,
  .bible-reader__close {
    min-height: 42px;
    padding: 0 11px;
    font-size: 0.9rem;
  }

  .bible-reader__body {
    padding: 20px 16px;
  }

  .scripture-content {
    gap: 20px;
  }

  .scripture-verses {
    gap: 7px;
    padding-left: 1.9rem;
  }

  .scripture-verses li {
    line-height: 1.68;
  }

  .footer {
    padding-bottom: 34px;
  }
}

@media (max-width: 430px) {
  .reader,
  .footer,
  .hero__content {
    width: min(100% - 22px, 1120px);
  }

  .hero__content {
    padding: 74px 0 30px;
  }

  h1 {
    font-size: clamp(2.35rem, 11vw, 3.4rem);
  }

  .hero__date {
    margin-top: 14px;
    font-size: 1rem;
  }

  .utility-tools {
    top: 12px;
    right: 12px;
    grid-template-columns: 34px 24px 34px 34px;
    gap: 5px;
  }

  .utility-button,
  .utility-status {
    min-height: 34px;
  }

  .utility-button {
    font-size: 0.82rem;
  }

  .toolbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px minmax(70px, 0.68fr);
  }

  .nav-button--compact,
  .current-day-button {
    min-height: 54px;
  }

  .current-day-button {
    font-size: 1.08rem;
  }

  .field--date {
    grid-column: 1 / 4;
  }

  .today-reset-button {
    grid-column: 4;
    min-height: 54px;
  }

  .action-button {
    grid-column: 4;
    min-height: 46px;
  }
}
