:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --paper: #fffdf8;
  --ink: #24211c;
  --muted: #756d61;
  --line: #ded7ca;
  --accent: #1f6f61;
  --accent-strong: #155248;
  --focus: #b9852c;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(100%, 720px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 8vw, 2.4rem);
  line-height: 1.05;
}

.icon-button,
button,
select,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.icon-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
}

.lookup,
.picker {
  display: grid;
  gap: 10px;
}

.lookup {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.picker {
  grid-template-columns: minmax(0, 1.4fr) minmax(78px, 0.6fr) minmax(78px, 0.6fr) minmax(78px, 0.6fr);
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
}

input,
select {
  width: 100%;
  min-height: 44px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
}

button {
  min-height: 44px;
  padding: 0 14px;
  background: var(--paper);
  color: var(--ink);
}

.primary {
  align-self: end;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 700;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 35%);
  outline-offset: 2px;
}

.message {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #d8bd82;
  border-radius: 8px;
  background: #fff7e5;
  color: #65470d;
}

.passage {
  margin: 22px 0 14px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.current-ref {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-weight: 800;
}

.verse-text {
  margin: 0;
  font-size: clamp(1.45rem, 7vw, 2.35rem);
  line-height: 1.72;
  word-break: break-word;
}

.verse-line {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.verse-line:last-child {
  margin-bottom: 0;
}

.verse-number {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 2.2;
  text-align: right;
}

.verse-copy {
  white-space: pre-wrap;
}

.verse-nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 10px;
  background: linear-gradient(180deg, transparent, var(--bg) 22%);
}

.verse-nav button {
  font-weight: 700;
}

.site-credit {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

.site-credit a {
  color: var(--accent-strong);
  font-weight: 700;
}

@media (max-width: 430px) {
  .shell {
    padding-inline: 12px;
  }

  .picker {
    grid-template-columns: 1fr 1fr;
  }

  .picker .field:first-child {
    grid-column: 1 / -1;
  }
}
