@import "tailwindcss";

.reader-toolbar {
  display: grid;
  grid-template-columns: 110px 180px minmax(280px, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  background: var(--card);
  box-shadow: var(--shadow);
}
.reader-toolbar > label:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 10px;
}
.reader-toolbar label span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.reader-toolbar select,
.reading-options select,
.book-toolbar select {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px;
}
.reader-toolbar > select,
.reader-search-button,
.reader-reset-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 9px;
}
.reader-search-button {
  background: var(--wine);
  color: #fff;
  border-color: var(--wine);
  cursor: pointer;
  font-weight: 700;
}
.reader-reset-button { cursor: pointer; font-weight: 700; }
.top-search {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 9px;
  padding: 0 13px;
}
.top-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 12px 0;
}
.result-total {
  display: grid;
  place-items: center;
  min-width: 78px;
  color: var(--sage);
  font-size: 12px;
}
.reading-options {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--paper-2);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.reading-options > span {
  flex: 1;
}
.reading-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.reading-options button,
.book-toolbar button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
.book-toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
}
.book-toolbar button:disabled {
  opacity: 0.35;
}
.search-view {
  min-height: 600px;
}
.verse-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 9px;
  padding: 8px 0;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 17px;
  line-height: 1.85;
}
.verse-row > b {
  font-family: Georgia, serif;
  color: var(--wine);
  font-size: 12px;
  padding-top: 6px;
}
.verse-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: flex-start;
  gap: 10px;
}
.verse-main > span { min-width: 0; }
.verse-main > span,
.verse-row > div,
.chapter-text {
  min-width: 0;
  overflow: visible;
}
.verse-main > span {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.dictionary-word {
  display: inline;
  border: 0;
  border-bottom: 2px dotted #2670a8;
  background: color-mix(in srgb, #2670a8 9%, transparent);
  color: #155e93;
  padding: 0 1px;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}
[data-theme="dark"] .dictionary-word { color: #80c8ff; }
.commentary-button,
.chapter-resources button {
  flex: none;
  border: 1px solid color-mix(in srgb, var(--wine) 45%, var(--line));
  background: color-mix(in srgb, var(--wine) 7%, var(--card));
  color: var(--wine);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.commentary-button { justify-self: end; align-self: start; }
.old-text {
  display: block;
  margin-top: 5px;
  padding: 7px 10px;
  border-left: 2px solid #9a6b38;
  background: color-mix(in srgb, #b78952 9%, var(--card));
  color: var(--ink);
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 13px;
  line-height: 1.7;
}
.old-text strong { color: #895a28; margin-right: 6px; }
.books-modal { max-width: 1080px; }
.books-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px 24px 28px; }
.books-grid section { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; align-content: start; }
.books-grid h3 { grid-column: 1 / -1; margin: 0 0 7px; color: var(--wine); font-family: Georgia, "Noto Serif KR", serif; }
.books-grid button { display: flex; justify-content: space-between; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); padding: 7px 8px; cursor: pointer; white-space: nowrap; min-width: 0; font-size: 13px; }
.books-grid button:hover { border-color: var(--wine); color: var(--wine); }
.books-grid .book-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.books-grid small { color: var(--muted); flex: 0 0 auto; white-space: nowrap; }
.chapter-resources { display: flex; align-items: center; gap: 7px; }
.chapter-summary-line,
.chapter-theology-line {
  width: 100%;
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--sage-light);
  color: var(--ink);
  padding: 9px 18px;
  text-align: left;
  cursor: pointer;
}
.chapter-theology-line { background: color-mix(in srgb, var(--wine) 6%, var(--card)); }
.chapter-summary-line b { color: var(--sage); }
.chapter-theology-line b { color: var(--wine); }
.chapter-summary-line span,
.chapter-theology-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-summary-line i,
.chapter-theology-line i { font-style: normal; font-size: 11px; color: var(--muted); }
.resource-modal { max-width: 760px; }
.wide-resource { max-width: 920px; }
.compact-modal { max-width: 640px; }
.resource-body { padding: 22px 26px; white-space: pre-wrap; line-height: 1.85; }
.resource-body > p { margin: 0; }
.source-link,
.resource-list a {
  display: inline-block;
  color: var(--sage);
  font-weight: 800;
  text-decoration: none;
}
.compact-modal > .source-link { margin: 0 26px 24px; }
.resource-list { padding: 10px 24px 28px; }
.resource-list article { padding: 16px 0; border-bottom: 1px solid var(--line); }
.resource-list h3 { margin: 0 0 7px; font-family: Georgia, "Noto Serif KR", serif; }
.resource-list p { margin: 0 0 9px; white-space: pre-wrap; line-height: 1.75; }
.summary-list { padding: 10px 20px 24px; display: grid; gap: 4px; max-height: 62vh; overflow: auto; }
.summary-list button { display: grid; grid-template-columns: 60px 1fr; gap: 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); padding: 9px 11px; text-align: left; cursor: pointer; font: inherit; }
.summary-list button:hover,
.summary-list button.active { border-color: var(--sage); background: var(--sage-light); }
.summary-list b { color: var(--wine); }
.summary-list span { line-height: 1.55; }
.theology-body {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
}
.theology-body strong { color: var(--wine); }
.resource-modal.wide-resource { max-width: 920px; width: min(920px, calc(100vw - 24px)); }
.resource-modal.compact-modal { max-width: 640px; width: min(640px, calc(100vw - 24px)); }
.resource-modal .summary-grid { border-top: 0; }
.annotated {
  position: relative;
  border-bottom: 2px dotted var(--wine);
  background: color-mix(in srgb, var(--wine) 8%, transparent);
  cursor: help;
}
.note-pop {
  display: none;
  position: absolute;
  z-index: 12;
  left: 0;
  top: calc(100% + 10px);
  width: min(390px, 75vw);
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--wine);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 13px;
  line-height: 1.65;
}
.annotated:hover .note-pop,
.annotated:focus .note-pop {
  display: block;
}
.note-pop b {
  color: var(--wine);
}
.note-pop p {
  margin: 7px 0;
}
.note-pop a {
  color: var(--sage);
  font-weight: 700;
  text-decoration: none;
}
.cross-ref,
.english {
  display: block;
  margin-top: 2px;
  padding: 2px 8px;
  border-left: 2px solid var(--sage);
  background: var(--sage-light);
  color: var(--muted);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 11px;
}
.cross-ref strong {
  color: var(--sage);
  margin-right: 7px;
}
.cross-text { color: var(--ink); }
.cross-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.cross-marker-wrap {
  position: relative;
  display: inline-block;
  vertical-align: super;
  line-height: 1;
  margin: 0 1px;
}
.cross-marker {
  border: 0;
  background: transparent;
  color: #c3263f;
  padding: 0 2px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}
.cross-marker-pop {
  display: none;
  position: absolute;
  z-index: 18;
  left: 0;
  top: calc(100% + 6px);
  width: min(300px, 72vw);
  padding: 9px;
  border: 1px solid var(--wine);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  line-height: 1.5;
}
.cross-marker-wrap:hover .cross-marker-pop,
.cross-marker-wrap.is-open .cross-marker-pop { display: flex; flex-wrap: wrap; gap: 5px; }
.cross-marker-pop b { width: auto; color: var(--wine); }
.marker-pop-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
  margin-bottom:2px;
}
.marker-pop-close{
  flex:0 0 auto;
  width:22px;
  height:22px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--paper);
  color:var(--muted);
  padding:0;
  font:inherit;
  font-size:16px;
  line-height:1;
  cursor:pointer;
}
.marker-pop-close:hover{color:var(--wine);border-color:var(--wine)}
.cross-marker-pop button:not(.marker-pop-close) {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--sage);
  padding: 3px 6px;
  cursor: pointer;
}
.cross-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.cross-links button {
  border: 1px solid color-mix(in srgb, var(--sage) 35%, var(--line));
  border-radius: 5px;
  background: var(--card);
  color: var(--sage);
  padding: 2px 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cross-links button:hover { border-color: var(--sage); text-decoration: underline; }
.cross-ref em { display: block; margin-top: 3px; font-style: normal; }
.old-bible-original {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, #c79a58 7%, var(--card));
  padding: 10px 18px 13px;
}
.old-bible-original > header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 11px;
}
.old-bible-original > header strong { color: var(--wine); }
.old-bible-original > header span,
.old-bible-original > p { color: var(--muted); margin: 0; font-size: 11px; }
.old-bible-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 12px; }
.old-bible-pages a { display: block; width: 100%; min-width: 0; color: var(--muted); text-decoration: none; font-size: 10px; }
.old-bible-pages img { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; object-position: top left; border: 1px solid var(--line); background: #eee8d8; }
.old-bible-pages span { display: block; padding-top: 3px; }
.bible-scan-original { border-color: #b4a98e; background: #f6f1e5; }
.direct-answer { margin: 5px 0 12px !important; color: var(--wine); font-size: 20px !important; line-height: 1.45; }
.english {
  border-color: var(--wine);
}
@media (max-width: 720px) {
  .reader-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: none;
  }
  .reader-toolbar > label:first-child {
    padding-left: 0;
    flex: 0 0 auto;
  }
  .result-total {
    display: none;
  }
  .reading-options {
    gap: 10px;
    overflow: visible;
    flex-wrap: wrap;
  }
  .reading-options > span {
    flex: 0 0 auto;
  }
  .reading-options label,
  .reading-options button {
    white-space: nowrap;
  }
  .book-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }
  .verse-main { gap: 5px; }
  .commentary-button { padding: 2px 5px; }
  .chapter-summary-line,
  .chapter-theology-line { grid-template-columns: 62px 1fr; padding: 8px 12px; }
  .chapter-summary-line i,
  .chapter-theology-line i { display: none; }
}

.tab-nav button {
  position: relative;
  padding: 0 4px;
}
.tab-nav button.active {
  color: var(--wine);
  font-weight: 700;
}
.tab-nav button.active:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--wine);
}
.bible-workspace {
  max-width: 1320px;
  margin: auto;
  padding: 56px clamp(20px, 5vw, 72px) 80px;
}
.bible-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 30px;
}
.bible-heading h1 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  margin: 16px 0 8px;
}
.bible-heading p {
  color: var(--muted);
  margin: 0;
}
.go-research {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--wine);
  background: var(--wine);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
}
.bible-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.bible-controls,
.bible-reader {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.bible-controls {
  padding: 20px;
  position: sticky;
  top: 100px;
}
.bible-controls h2 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 18px;
  margin: 0 0 14px;
}
.bible-controls > label:not(.plain-search) {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0;
}
.bible-controls select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 10px;
  border-radius: 8px;
}
.chapter-nav {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.chapter-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  min-width: 36px;
  min-height: 34px;
  cursor: pointer;
}
.chapter-nav-btn:hover {
  background: color-mix(in srgb, var(--wine) 8%, var(--card));
  color: var(--wine);
}
.chapter-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.chapter-nav-ico {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  color: var(--wine);
  font-family: inherit;
}
.chapter-nav-now-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--wine) 8%, var(--card));
}
.chapter-nav-now {
  width: auto;
  min-width: 64px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--wine);
  font-size: 12px;
  font-weight: 800;
  padding: 0 2px;
  text-align: center;
}
.bible-controls hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.plain-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px;
  border-radius: 8px;
}
.plain-search svg {
  width: 17px;
  color: var(--muted);
}
.plain-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
.search-count {
  font-size: 12px;
  color: var(--sage);
  margin: 12px 2px 0;
}
.bible-reader {
  overflow: hidden;
  min-height: 650px;
}
.bible-reader > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.bible-reader header span {
  color: var(--wine);
  font-size: 11px;
}
.bible-reader header h2 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.bible-reader header small {
  color: var(--muted);
}
.chapter-text {
  padding: 25px 34px 45px;
  max-width: 850px;
}
.chapter-text p {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 9px;
  margin: 0;
  padding: 8px 0;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 17px;
  line-height: 1.85;
}
.chapter-text b {
  font-family: Georgia, serif;
  color: var(--wine);
  font-size: 12px;
  padding-top: 6px;
}
.plain-results {
  padding: 10px 30px 35px;
  max-height: 680px;
  overflow: auto;
}
.plain-results button {
  width: 100%;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 15px 4px;
  cursor: pointer;
}
.plain-results button:hover {
  background: var(--sage-light);
}
.plain-results b {
  color: var(--sage);
}
.plain-results span {
  font-family: Georgia, "Noto Serif KR", serif;
  line-height: 1.7;
}
.plain-results mark {
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--wine) 45%, transparent);
  text-decoration-thickness: 3px;
}
.result-filters {
  display: flex;
  align-items: center;
  gap: 9px;
}
.result-filters select {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 7px;
  padding: 7px 9px;
}
.target-verse {
  margin: 2px -9px;
  padding: 7px 9px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--wine) 10%, var(--card));
  font-weight: 800;
  box-shadow: inset 3px 0 var(--wine);
}
.verse-row.target-verse {
  align-items: start;
}
.verse-row.target-verse > b {
  font-weight: 900;
}
.plain-results .empty {
  padding: 24px 4px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .tab-nav {
    display: flex !important;
    position: static !important;
    height: 100% !important;
    flex-direction: row !important;
    background: none !important;
    border: 0 !important;
    padding: 0 8px !important;
    margin-left: auto;
  }
  .tab-nav button {
    height: 100% !important;
    padding: 0 7px;
  }
  .tab-nav button[data-tab="admin"] {
    display: none;
  }
  .bible-workspace {
    padding: 30px 14px 55px;
  }
  .bible-heading {
    display: block;
  }
  .go-research {
    margin-top: 18px;
  }
  .bible-grid {
    grid-template-columns: 1fr;
  }
  .bible-controls {
    position: static;
  }
  .bible-reader > header {
    padding: 8px 16px;
  }
  .chapter-text {
    padding: 18px;
  }
  .chapter-text p {
    font-size: 16px;
  }
  .plain-results {
    padding: 8px 16px;
  }
  .plain-results button {
    grid-template-columns: 85px 1fr;
    gap: 8px;
  }
  .brand span:last-child {
    display: none;
  }
}

:root {
  --paper: #f7f4ec;
  --paper-2: #efecdf;
  --ink: #1f211d;
  --muted: #6f7168;
  --line: #d7d2c2;
  --sage: #627654;
  --sage-light: #e9ecdf;
  --wine: #8f1830;
  --card: #fbfaf5;
  --shadow: 0 18px 60px rgba(55, 52, 42, 0.11);
}
:root[data-theme="dark"] {
  --paper: #171914;
  --paper-2: #20231c;
  --ink: #f0eee4;
  --muted: #aaa99f;
  --line: #3a3e32;
  --sage: #a9bd91;
  --sage-light: #293024;
  --wine: #e16b80;
  --card: #1e211a;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  transition:
    background 0.25s,
    color 0.25s;
}
.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 68% 10%,
      rgba(112, 130, 86, 0.08),
      transparent 28%
    ),
    var(--paper);
}
button,
textarea {
  font: inherit;
}
.topbar {
  height: 78px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 clamp(24px, 5vw, 78px);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: blur(14px);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 20px;
  white-space: nowrap;
}
.brand b {
  color: var(--wine);
}
.brand-mark {
  color: var(--wine);
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  padding-right: 12px;
}
.nav {
  margin: auto;
  display: flex;
  align-items: center;
  gap: 38px;
  height: 100%;
}
.nav a {
  height: 100%;
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  position: relative;
}
.nav a:hover,
.nav a.active {
  color: var(--wine);
}
.nav a.active:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--wine);
}
.header-actions {
  display: flex;
  gap: 8px;
}
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.icon-button:hover {
  border-color: var(--line);
  background: var(--card);
}
.mobile-menu {
  display: none;
}
.hero {
  max-width: 1420px;
  margin: auto;
  padding: 70px clamp(24px, 5vw, 76px) 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(480px, 0.93fr);
  gap: 70px;
  align-items: start;
}
.hero-copy {
  padding-top: 18px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #9aa68a;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--sage);
  font-size: 13px;
  background: var(--sage-light);
}
.eyebrow span {
  font-weight: 800;
}
.hero h1 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-weight: 500;
  font-size: clamp(42px, 4.25vw, 68px);
  line-height: 1.24;
  letter-spacing: -0.055em;
  margin: 22px 0;
}
.hero h1 em {
  font-style: normal;
  color: var(--wine);
}
.lead {
  font-size: 17px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 650px;
  margin-bottom: 26px;
}
.query-box {
  border: 1px solid #8da079;
  border-radius: 14px;
  background: var(--card);
  box-shadow:
    0 0 0 4px rgba(112, 134, 91, 0.1),
    var(--shadow);
  padding: 16px;
}
.query-box textarea {
  width: 100%;
  min-height: 104px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  padding: 4px;
}
.query-box textarea::placeholder {
  color: var(--muted);
}
.query-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.source-pill {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.submit {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--wine);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--wine) 30%, transparent);
}
.submit:hover {
  transform: translateY(-2px);
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 5px;
}
.evidence-card {
  border: 1px solid #aab49a;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 570px;
}
.card-head {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tiny-label {
  color: var(--sage);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.card-head h2 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 29px;
  font-weight: 500;
  margin: 5px 0 0;
}
.verified {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--sage);
  background: var(--sage-light);
  padding: 7px 9px;
  border-radius: 999px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.summary-grid div {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.summary-grid div:last-child {
  border: 0;
}
.summary-grid span {
  color: var(--muted);
  font-size: 11px;
}
.summary-grid strong {
  font-size: 14px;
}
.summary-grid .sage {
  color: var(--sage);
}
.finding {
  margin: 18px 22px 10px;
  padding: 16px 18px;
  background: var(--sage-light);
  border-radius: 9px;
  border-left: 3px solid var(--sage);
}
.finding-label {
  font-size: 11px;
  color: var(--sage);
  font-weight: 700;
}
.finding p {
  font-family: Georgia, "Noto Serif KR", serif;
  line-height: 1.65;
  margin: 8px 0 0;
  font-size: 15px;
}
.finding b {
  color: var(--wine);
}
.verse-list {
  padding: 4px 22px 14px;
  display: flex;
  flex-direction: column;
}
.verse {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 11px;
  align-items: start;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 13px 4px;
  cursor: pointer;
}
.verse:hover {
  background: var(--sage-light);
}
.verse-no {
  font-family: Georgia, serif;
  color: var(--wine);
  font-size: 12px;
}
.verse b {
  font-size: 13px;
  color: var(--sage);
}
.verse small {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 3px;
}
.verse em {
  font-style: normal;
  color: var(--wine);
  font-size: 10px;
  border: 1px solid color-mix(in srgb, var(--wine) 35%, transparent);
  border-radius: 999px;
  padding: 4px 7px;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 26px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.card-foot span,
.card-foot button {
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-foot button {
  border: 0;
  background: none;
  color: var(--wine);
  cursor: pointer;
}
.loading {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.loading span {
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-top-color: var(--wine);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.explore {
  border-top: 1px solid var(--line);
  padding: 64px clamp(24px, 7vw, 104px) 78px;
  background: var(--paper-2);
}
.section-title {
  max-width: 1250px;
  margin: 0 auto 34px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.section-title span {
  font-size: 12px;
  color: var(--wine);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.section-title h2 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 34px;
  font-weight: 500;
  margin: 8px 0;
}
.section-title p {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.example-grid {
  max-width: 1250px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.example-grid button {
  min-height: 138px;
  text-align: left;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: start;
}
.example-grid button:hover {
  border-color: var(--sage);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.example-grid span {
  font-family: Georgia, serif;
  color: var(--wine);
  font-size: 13px;
}
.example-grid p {
  margin: 0;
  line-height: 1.7;
  font-size: 14px;
}
.example-grid svg {
  color: var(--wine);
  align-self: end;
}
.principles {
  max-width: 1250px;
  margin: auto;
  padding: 70px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.principles > div {
  border-right: 1px solid var(--line);
  padding-right: 35px;
}
.principles > div:last-child {
  border: 0;
}
.principle-icon {
  font-family: serif;
  color: var(--wine);
  font-size: 26px;
}
.principles h3 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 20px;
  margin: 12px 0 8px;
}
.principles p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}
footer {
  border-top: 1px solid var(--line);
  padding: 28px clamp(24px, 5vw, 78px);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
footer span {
  color: var(--ink);
  font-family: Georgia, "Noto Serif KR", serif;
}
footer p {
  margin: 0;
}
footer b {
  color: var(--wine);
}
@media (max-width: 1000px) {
  .nav {
    gap: 20px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-copy {
    max-width: 760px;
  }
  .evidence-card {
    max-width: 760px;
  }
  .example-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .topbar {
    height: 66px;
    padding: 0 18px;
  }
  .brand {
    font-size: 16px;
  }
  .brand-mark {
    padding-right: 8px;
  }
  .mobile-menu {
    display: grid;
  }
  .nav {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    height: auto;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    height: 44px;
  }
  .nav a.active:after {
    display: none;
  }
  .hero {
    padding: 36px 18px;
  }
  .hero h1 {
    font-size: 39px;
  }
  .lead {
    font-size: 15px;
  }
  .evidence-card {
    min-height: 0;
  }
  .card-head {
    padding: 20px;
  }
  .summary-grid div {
    padding: 14px 10px;
  }
  .summary-grid strong {
    font-size: 12px;
  }
  .verse {
    grid-template-columns: 28px 1fr;
  }
  .verse em {
    display: none;
  }
  .card-foot {
    padding: 14px 18px;
  }
  .card-foot > span {
    display: none;
  }
  .explore {
    padding: 48px 18px;
  }
  .section-title {
    display: block;
  }
  .section-title p {
    text-align: left;
  }
  .example-grid {
    grid-template-columns: 1fr;
  }
  .principles {
    grid-template-columns: 1fr;
    padding: 45px 20px;
  }
  .principles > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 25px;
  }
  .principles > div:last-child {
    border: 0;
  }
  footer {
    display: block;
    text-align: center;
  }
  footer p {
    margin-top: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}

/* functional research workspace */
.nav button {
  height: 100%;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.nav button:hover {
  color: var(--wine);
}
.nav i {
  font-style: normal;
  background: var(--wine);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 10px;
}
.scope-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.scope-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.scope-button span {
  margin-left: 6px;
}
.context-on {
  font-size: 12px;
  color: var(--sage);
  background: var(--sage-light);
  border-radius: 999px;
  padding: 7px 10px;
}
.scope-panel {
  position: absolute;
  z-index: 12;
  width: min(680px, calc(100vw - 36px));
  max-height: 440px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.scope-top {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.scope-top button {
  border: 0;
  background: none;
  color: var(--wine);
  cursor: pointer;
}
.book-group {
  padding-top: 14px;
}
.book-group > label {
  display: flex;
  gap: 7px;
  margin-bottom: 9px;
}
.book-group > div {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.book-group > div label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
input[type="checkbox"] {
  accent-color: var(--wine);
}
.query-tools > span {
  font-size: 12px;
  color: var(--muted);
}
.submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.save-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--wine);
  border-radius: 999px;
  padding: 8px 11px;
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}
.card-head h2 {
  max-width: 330px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verse-list {
  max-height: 250px;
  overflow: auto;
}
.verse {
  grid-template-columns: 34px 1fr;
}
.verse small {
  -webkit-line-clamp: 2;
}
.welcome-result {
  min-height: 490px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: var(--muted);
}
.welcome-result svg {
  color: var(--wine);
  width: 42px;
  height: 42px;
}
.welcome-result h2 {
  font-family: Georgia, "Noto Serif KR", serif;
  color: var(--ink);
  font-weight: 500;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 18px;
  line-height: 1.8;
}
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(12, 13, 10, 0.62);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal {
  width: min(840px, 100%);
  height: min(760px, 92vh);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  min-width: 0;
}
.modal-head > div { min-width: 0; }
.modal-head p { white-space: normal; overflow-wrap: anywhere; }
.modal-scroll-body,
.resource-list,
.resource-body,
.summary-list {
  min-height: 0;
}
.modal-scroll-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.resource-list.modal-scroll-body { max-height: none; }
.resource-body.modal-scroll-body { overflow-y: auto; }
.modal-scroll-body > .source-link { margin: 0 26px 24px; }
.modal-head span {
  font-size: 11px;
  color: var(--wine);
  font-weight: 700;
}
.modal-head h2 {
  font-family: Georgia, "Noto Serif KR", serif;
  margin: 5px 0;
  font-size: 24px;
}
.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.modal-head > button {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.all-verses,
.saved-list {
  overflow: auto;
  padding: 10px 26px 26px;
}
.all-verses article {
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}
.all-verses b {
  color: var(--sage);
  font-size: 13px;
}
.all-verses p {
  font-family: Georgia, "Noto Serif KR", serif;
  line-height: 1.75;
  margin: 7px 0 0;
}
.more {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--wine);
  border-radius: 9px;
  padding: 12px;
  margin-top: 14px;
  cursor: pointer;
}
.saved-list article {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.saved-list article > button:first-child {
  flex: 1;
  border: 0;
  background: none;
  text-align: left;
  padding: 18px 5px;
  color: var(--ink);
  cursor: pointer;
}
.saved-list b,
.saved-list span {
  display: block;
}
.saved-list span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.delete {
  border: 0;
  background: none;
  color: var(--wine);
  cursor: pointer;
  padding: 10px;
}
.hero-copy {
  position: relative;
}
@media (max-width: 720px) {
  .nav button {
    height: 44px;
    text-align: left;
  }
  .book-group > div {
    grid-template-columns: repeat(3, 1fr);
  }
  .scope-panel {
    left: 0;
  }
  .modal-bg {
    padding: 8px;
  }
  .modal {
    height: 96vh;
  }
  .modal-head {
    padding: 18px;
  }
  .all-verses,
  .saved-list {
    padding: 8px 18px 18px;
  }
  .context-on {
    display: none;
  }
}
.reasoning-box h3 {
  font-family: Georgia, "Noto Serif KR", serif;
  margin: 7px 0;
  font-size: 17px;
}
.reasoning-box p {
  font-family: inherit;
  font-size: 13px;
  margin: 5px 0 8px;
}
.reasoning-box small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 3px;
}
.evidence-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 110px auto;
  gap: 8px;
  padding: 13px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.evidence-filters label {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}
.evidence-filters label svg {
  width: 16px;
  color: var(--muted);
}
.evidence-filters input,
.evidence-filters select,
.evidence-filters button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px;
  min-width: 0;
}
.evidence-filters input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  padding: 0;
}
.evidence-filters button {
  color: var(--wine);
  cursor: pointer;
}
@media (max-width: 720px) {
  .evidence-filters {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
  }
  .evidence-filters label {
    grid-column: 1/-1;
  }
}

/* Compact research workspace */
.topbar {
  height: 58px;
  padding: 0 clamp(14px, 3vw, 38px);
}
.brand {
  font-size: 17px;
}
.brand-mark {
  padding-right: 9px;
}
.nav {
  gap: 20px;
}
.icon-button {
  width: 36px;
  height: 36px;
}
.bible-workspace {
  max-width: 1380px;
  padding: 20px clamp(12px, 3vw, 38px) 38px;
}
.bible-heading {
  align-items: center;
  margin-bottom: 12px;
}
.bible-heading h1 {
  font-size: 30px;
  margin: 7px 0 2px;
}
.bible-heading p {
  font-size: 12px;
}
.eyebrow {
  padding: 5px 8px;
  font-size: 11px;
}
.go-research {
  padding: 8px 11px;
  font-size: 12px;
}
.reader-toolbar {
  grid-template-columns: 105px 165px minmax(260px, 1fr) auto;
  gap: 7px;
  padding: 8px;
  border-radius: 9px 9px 0 0;
}
.reader-toolbar select,
.reading-options select,
.book-toolbar select {
  padding: 7px 8px;
}
.top-search {
  padding: 7px 10px;
}
.reading-options {
  gap: 13px;
  padding: 6px 10px;
  margin-bottom: 9px;
}
.reading-options button,
.book-toolbar button {
  padding: 7px 9px;
}
.book-toolbar {
  gap: 6px;
  margin-bottom: 7px;
}
.bible-reader {
  border-radius: 9px;
  min-height: 500px;
}
.bible-reader > header {
  padding: 8px 16px;
}
.bible-reader header h2 {
  font-size: 20px;
  margin: 0;
}
.chapter-text {
  padding: 12px 20px 26px;
  max-width: 1000px;
}
.verse-row {
  grid-template-columns: 28px 1fr;
  gap: 7px;
  padding: 4px 0;
  font-size: 16px;
  line-height: 1.72;
}
.cross-ref,
.english {
  display: block;
  margin-top: 2px;
  padding: 2px 8px;
  border-left: 2px solid var(--sage);
  background: var(--sage-light);
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
.english {
  border-left-color: var(--wine);
}
.english strong {
  color: var(--wine);
  margin-right: 5px;
}
.note-count {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 9px;
  text-decoration: none;
  vertical-align: middle;
}
.note-pop {
  width: min(480px, 85vw);
  max-height: 420px;
  overflow: auto;
  padding: 11px;
}
.note-item {
  display: block;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.note-item strong {
  display: block;
  font-size: 12px;
}
.note-item p {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
}
.note-item a {
  font-size: 11px;
}
.scan-strip {
  margin: 0 0 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  padding: 9px;
}
.scan-strip header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.scan-strip header b {
  color: var(--ink);
}
.scan-strip > div {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-top: 8px;
}
.scan-strip a {
  width: 130px;
  flex: none;
  color: var(--ink);
  text-decoration: none;
  font-size: 10px;
}
.scan-strip img {
  width: 130px;
  height: 90px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.scan-strip a span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.hero {
  max-width: 1380px;
  padding: 30px clamp(14px, 3vw, 38px);
  gap: 30px;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.92fr);
}
.hero-copy {
  padding-top: 3px;
}
.hero h1 {
  font-size: 45px;
  margin: 13px 0;
}
.lead {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 15px;
}
.query-box {
  padding: 10px;
  border-radius: 10px;
}
.query-box textarea {
  min-height: 78px;
  font-size: 14px;
}
.evidence-card {
  min-height: 500px;
  border-radius: 10px;
}
.explore {
  padding: 30px clamp(14px, 3vw, 38px);
}
.section-title {
  margin-bottom: 15px;
}
.section-title h2 {
  font-size: 26px;
}
.example-grid {
  gap: 8px;
}
.example-grid button {
  min-height: 90px;
  padding: 13px;
}
.admin-modal {
  width: min(900px, 96vw);
  height: min(690px, 94vh);
}
.admin-layout {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 0;
  flex: 1;
}
.admin-layout > nav {
  padding: 10px;
  border-right: 1px solid var(--line);
  background: var(--paper-2);
}
.admin-layout > nav button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
}
.admin-layout > nav button.active {
  background: var(--card);
  color: var(--wine);
  font-weight: 700;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
}
.admin-content {
  padding: 18px 20px;
  overflow: auto;
  position: relative;
}
.admin-content h3 {
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: 20px;
  margin: 0 0 14px;
}
.admin-content h4 {
  font-size: 12px;
  margin: 19px 0 8px;
}
.data-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.data-status article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.data-status b {
  font-size: 12px;
}
.data-status strong {
  font-size: 11px;
  color: var(--muted);
}
.data-status em {
  grid-column: 1/-1;
  font-style: normal;
  color: var(--sage);
  font-size: 10px;
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.upload-grid label {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 9px;
  font-size: 11px;
  color: var(--muted);
}
.upload-grid input {
  display: block;
  width: 100%;
  margin-top: 7px;
  font-size: 10px;
}
.admin-help {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--paper-2);
  padding: 9px;
  border-radius: 7px;
}
.field {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 12px;
}
.field input,
.field select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 9px;
}
.check-field {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}
.admin-actions {
  position: sticky;
  bottom: -18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 22px -20px -18px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.admin-actions span {
  font-size: 11px;
  color: var(--sage);
}
.admin-actions button {
  border: 0;
  border-radius: 7px;
  background: var(--wine);
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
}
@media (max-width: 720px) {
  .topbar {
    height: 54px;
    padding: 0 10px;
  }
  .tab-nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab-nav button {
    font-size: 11px !important;
    padding: 0 5px !important;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .tab-nav button[data-tab="admin"] {
    display: none;
  }
  .bible-workspace {
    padding: 12px 8px 25px;
  }
  .bible-heading h1 {
    font-size: 24px;
  }
  .bible-heading p {
    display: none;
  }
  .go-research {
    margin-top: 8px;
  }
  .reading-options {
    gap: 8px;
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
  .reader-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: none;
  }
  .reader-toolbar > * { grid-column: auto; flex: 0 0 auto; min-width: 0; }
  .reader-toolbar > label:first-child { min-width: 0; padding-left: 0; }
  .reader-toolbar > label:first-child span { display: none; }
  .reader-toolbar > label:first-child select,
  .reader-toolbar > select {
    width: auto;
    max-width: 86px;
    min-height: 32px;
    padding: 4px 6px;
    font-size: 12px;
  }
  .top-search {
    grid-column: auto;
    flex: 1 1 120px;
    min-width: 96px;
    padding: 4px 8px;
  }
  .top-search input { min-width: 0; width: 100%; font-size: 16px; }
  .reader-search-button,
  .reader-reset-button {
    grid-column: auto;
    min-height: 32px;
    padding: 4px 9px;
    font-size: 12px;
    white-space: nowrap;
  }
  .bible-heading { align-items: flex-start; gap: 8px; }
  .bible-heading > div { min-width: 0; }
  .go-research { flex: none; white-space: nowrap; }
  .verse-row { grid-template-columns: 23px minmax(0, 1fr); }
  .verse-row > div, .verse-main, .verse-main > span { min-width: 0; }
  .verse-main { grid-template-columns: minmax(0, 1fr) 52px; }
  .cross-ref, .english { overflow-wrap: anywhere; }
  .old-bible-original { padding: 9px 11px 11px; }
  .bible-reader > header {
    padding: 10px 12px;
  }
  .chapter-text {
    padding: 9px 11px;
  }
  .verse-row {
    font-size: 15px;
  }
  .hero {
    padding: 18px 10px;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-layout > nav {
    display: flex;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 6px;
  }
  .admin-layout > nav button {
    white-space: nowrap;
    width: auto;
  }
  .admin-content {
    padding: 14px;
  }
  .data-status,
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .field {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .admin-actions {
    margin: 18px -14px -14px;
  }

  /* Research tab: override the later compact desktop grid on phones. */
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 14px;
    padding: 16px 10px 24px;
    overflow: hidden;
  }
  .hero-copy,
  .evidence-card,
  .query-box,
  .scope-row,
  .scope-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .hero h1 {
    font-size: clamp(31px, 10vw, 42px);
    line-height: 1.18;
    letter-spacing: -0.045em;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
    margin: 13px 0;
  }
  .lead {
    width: 100%;
    max-width: none;
    font-size: 14px;
    line-height: 1.65;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  .eyebrow {
    max-width: 100%;
    white-space: normal;
    word-break: keep-all;
  }
  .query-box textarea { min-width: 0; }
  .modal-head h2 { font-size: 19px; }
  .resource-body { padding: 16px; }
  .modal-scroll-body > .source-link { margin: 0 16px 18px; }
  .books-grid { grid-template-columns: 1fr; padding: 14px; }
  .books-grid section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
