/* Nesive Bible — radar theme (dark default, light variant) */
:root {
  --accent: #CDF463;
  --accent-ink: #0c1206;
  --radius: 16px;
}
html[data-theme="dark"] {
  --page: #050807;
  --panel: #0E1512;
  --panel2: #121a15;
  --field: rgba(0, 0, 0, 0.4);
  --text: #E7F5C8;
  --text2: #9bb0a4;
  --text3: #6f8577;
  --line: rgba(205, 244, 99, 0.18);
  --line-strong: rgba(205, 244, 99, 0.45);
  --glow: rgba(205, 244, 99, 0.05);
  --accent-soft: rgba(205, 244, 99, 0.12);
  --verse-num: #CDF463;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
html[data-theme="light"] {
  --page: #F5F5EF;
  --panel: #FFFFFF;
  --panel2: #F0F0E8;
  --field: #FFFFFF;
  --text: #141414;
  --text2: #5f6b5a;
  --text3: #8a8a80;
  --line: rgba(77, 107, 0, 0.22);
  --line-strong: rgba(77, 107, 0, 0.5);
  --glow: rgba(77, 107, 0, 0.05);
  --accent: #4d6b00;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(77, 107, 0, 0.1);
  --verse-num: #4d6b00;
  --shadow: 0 8px 32px rgba(60, 70, 40, 0.14);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
.hidden { display: none !important; }
a { color: var(--accent); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand-mark { color: var(--accent); font-size: 20px; line-height: 1; display: inline-flex; }
.brand-mark svg { display: block; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 2px; }
.brand-sub { font-size: 10px; letter-spacing: 2px; color: var(--text2); }
.top-actions { display: flex; gap: 4px; }
.icon-btn {
  background: transparent; border: 1px solid transparent; color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--line); }

/* App shell */
.app { max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; }
.view h1 { font-size: 24px; margin: 8px 0 12px; }
.view h2 { font-size: 17px; margin: 24px 0 10px; }
.count { color: var(--text2); font-size: 13px; font-weight: 400; }

/* Buttons */
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 999px; padding: 10px 20px;
  font-size: 15px; font-weight: 700;
}
.btn-primary:active { opacity: 0.85; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 18px;
  font-size: 15px;
}
.btn-ghost:active { background: var(--accent-soft); }

/* Home */
.home-hero {
  background: linear-gradient(135deg, var(--panel) 0%, var(--glow) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.home-hero-label { font-size: 12px; letter-spacing: 2px; color: var(--text2); margin-bottom: 10px; }
.daily-verse {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  font-size: 20px; line-height: 1.7; margin: 0 0 8px;
}
.daily-verse-ref { color: var(--accent); font-size: 14px; margin: 0 0 16px; }
.home-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.book-grid button {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px 6px; font-size: 15px; text-align: center;
}
.book-grid button small { display: block; color: var(--text2); font-size: 11px; margin-top: 3px; }
.book-grid button:active { border-color: var(--line-strong); background: var(--accent-soft); }
.copyright { color: var(--text3); font-size: 12px; text-align: center; margin: 28px 0 8px; line-height: 1.6; }

/* Reader */
.reader-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  position: sticky; top: 59px; z-index: 30;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(12px);
  padding: 8px 0; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.reader-nav {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.reader-nav .caret { color: var(--accent); font-size: 12px; }
.reader-version {
  background: transparent; border: 1px solid var(--line-strong); color: var(--accent);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700;
}
.reader { padding: 8px 4px 0; }
.reader-title { text-align: center; font-size: 26px; letter-spacing: 4px; margin: 18px 0 4px; }
.reader-meta { text-align: center; color: var(--text2); font-size: 13px; margin-bottom: 18px; }
.verses {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  font-size: 18px; line-height: 2.05; letter-spacing: 0.5px;
}
.verses.font-small { font-size: 16px; }
.verses.font-large { font-size: 20px; }
.verses.font-xlarge { font-size: 23px; }
.verses.line-tight { line-height: 1.75; }
.verses.line-loose { line-height: 2.4; }
.verse { cursor: pointer; border-radius: 6px; padding: 1px 2px; }
.verse:hover { background: var(--accent-soft); }
.verse .vn {
  font-family: -apple-system, sans-serif;
  font-size: 0.62em; color: var(--verse-num); vertical-align: super;
  margin-right: 4px; font-weight: 700; line-height: 0;
}
.verse .vn.hidden-num { display: none; }
.verse-head {
  font-family: -apple-system, sans-serif;
  font-size: 16px; font-weight: 700; color: var(--accent);
  margin: 22px 0 6px; letter-spacing: 1px;
}
.verse-head .xref { color: var(--text2); font-weight: 400; font-size: 13px; margin-left: 6px; }
.poetry { display: block; padding-left: 1.2em; text-indent: -1.2em; }
.verse.hl-yellow { background: rgba(250, 204, 21, 0.28); }
.verse.hl-green { background: rgba(205, 244, 99, 0.3); }
.verse.hl-blue { background: rgba(96, 165, 250, 0.28); }
.verse.hl-pink { background: rgba(244, 114, 182, 0.28); }
.verse.bookmarked { box-shadow: inset 3px 0 0 var(--accent); }
.verse .note-dot { color: var(--accent); font-size: 0.7em; vertical-align: super; }
/* Selected verses (wd.bible style): accent underline + soft tint */
.verse.selected { background: rgba(205, 244, 99, 0.14); box-shadow: inset 0 -2px 0 var(--accent); }
.verse-en {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92em; line-height: 1.8; color: var(--text2);
  display: block; margin: 2px 0 10px; padding-left: 22px;
}
.reader-pager { display: flex; justify-content: space-between; gap: 10px; margin: 28px 0 8px; }
.reader-pager .btn-ghost { flex: 1; }
.reader-pager .btn-ghost:disabled { opacity: 0.35; }

/* Verse detail */
.verse-block {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin: 12px 0;
}
.verse-block h3 { margin: 0 0 8px; font-size: 14px; color: var(--accent); letter-spacing: 1px; }
.verse-block p {
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 19px; line-height: 1.9; margin: 0;
}
.verse-block.en p { font-family: Georgia, serif; font-size: 17px; color: var(--text); }
.verse-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.verse-highlight-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--text2); font-size: 14px; }
.hl-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; padding: 0;
}
.hl-yellow { background: #FACC15; }
.hl-green { background: #CDF463; }
.hl-blue { background: #60A5FA; }
.hl-pink { background: #F472B6; }
.hl-clear { background: transparent; border-color: var(--line-strong); color: var(--text2); font-size: 14px; }
.hl-dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--accent); }
.verse-note-box { margin: 12px 0; }
.verse-note-box textarea {
  width: 100%; background: var(--field); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); padding: 12px; font-size: 15px; resize: vertical;
}
.verse-note-view {
  background: var(--accent-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; line-height: 1.7;
}
.verse-note-view small { display: block; color: var(--text2); margin-bottom: 4px; }

/* Search */
.search-box { display: flex; gap: 8px; margin: 8px 0; }
.search-box input {
  flex: 1; background: var(--field); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); padding: 12px 18px; font-size: 16px; outline: none;
  min-width: 0;
}
.search-box input:focus { border-color: var(--line-strong); }
.search-hint { color: var(--text2); font-size: 13px; margin: 4px 2px 16px; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.search-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; text-align: left; color: var(--text); width: 100%;
}
.search-item .ref { color: var(--accent); font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.search-item .txt {
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 16px; line-height: 1.8;
}
.search-item mark { background: var(--accent); color: var(--accent-ink); border-radius: 3px; padding: 0 2px; }
.search-empty { color: var(--text2); text-align: center; padding: 32px 0; }

/* Bookmarks / tabs */
.tabs { display: flex; gap: 6px; margin: 8px 0 16px; overflow-x: auto; }
.tabs button {
  background: transparent; border: 1px solid var(--line); color: var(--text2);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; white-space: nowrap;
}
.tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.bm-list { display: flex; flex-direction: column; gap: 10px; }
.bm-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; width: 100%; text-align: left; color: var(--text);
}
.bm-item .ref { color: var(--accent); font-size: 13px; font-weight: 700; }
.bm-item .txt { font-family: "Songti SC", "STSong", Georgia, serif; font-size: 16px; line-height: 1.8; margin-top: 4px; }
.bm-item .meta { color: var(--text2); font-size: 12px; margin-top: 6px; }
.bm-empty { color: var(--text2); text-align: center; padding: 40px 0; line-height: 1.8; }

/* Plan */
.plan-head p { color: var(--text2); line-height: 1.7; }
.plan-progress { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.plan-progress-bar { flex: 1; height: 8px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.plan-progress-bar div { height: 100%; background: var(--accent); border-radius: 999px; }
.plan-progress span { font-size: 13px; color: var(--text2); white-space: nowrap; }
.plan-today {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-day {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.plan-day.done { opacity: 0.55; }
.plan-day .day-num { font-size: 13px; color: var(--text2); min-width: 52px; }
.plan-day .day-readings { flex: 1; font-size: 14px; line-height: 1.6; }
.plan-day .day-readings button {
  background: none; border: none; color: var(--accent); font-size: 14px; padding: 0 2px; text-align: left;
}
.plan-day input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }

/* Bottom nav */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--page) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text2); text-decoration: none; font-size: 11px; padding: 4px 10px; border-radius: 10px;
}
.bottomnav a.active { color: var(--accent); }
.bottomnav .nav-ico { font-size: 20px; line-height: 1; display: inline-flex; }
.bottomnav .nav-ico svg { display: block; }

/* Drawer */
.drawer-backdrop, .sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 50;
}
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-width: 760px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-bottom: none;
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  max-height: 82vh; overflow-y: auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-note { color: var(--text2); font-size: 12px; line-height: 1.7; margin: 14px 2px 0; }
.picker-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.picker-books button {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px 6px; font-size: 15px;
}
.picker-books button.current { border-color: var(--accent); color: var(--accent); }
.chapter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.chapter-grid button {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px 0; font-size: 15px;
}
.chapter-grid button.current { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.version-item {
  display: block; width: 100%; text-align: left;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 8px;
}
.version-item strong { display: block; font-size: 16px; }
.version-item span { color: var(--text2); font-size: 13px; }
.version-item.current { border-color: var(--accent); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.setting-row label { font-size: 15px; }
.seg { display: flex; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { background: transparent; border: none; color: var(--text2); border-radius: 999px; padding: 7px 13px; font-size: 14px; }
.seg button.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.setting-check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 14px 0; cursor: pointer; }
.setting-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.setting-esv { align-items: center; }
.setting-esv input {
  flex: 1; min-width: 0;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.setting-esv input:focus { outline: none; border-color: var(--accent); }
.setting-backup { align-items: center; }
.backup-btns { display: flex; gap: 8px; }
.backup-btns .btn-ghost { padding: 8px 14px; }

/* Verse action sheet */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-width: 760px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-bottom: none;
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
}
.sheet-ref { color: var(--accent); font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.sheet-text { font-family: "Songti SC", "STSong", Georgia, serif; font-size: 17px; line-height: 1.8; margin: 0 0 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-grid button {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 0; font-size: 14px;
}
.sheet-hl { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--text2); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--page); border-radius: 999px;
  padding: 10px 20px; font-size: 14px; font-weight: 700; white-space: nowrap;
  box-shadow: var(--shadow);
}

/* Multi-select floating action bar */
.selbar {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 55;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 20px;
  padding: 10px 12px; box-shadow: var(--shadow);
  max-width: calc(100vw - 24px); width: max-content;
}
.selbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.selbar-count { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.selbar .btn-primary { padding: 8px 16px; }
.selbar .btn-ghost { padding: 8px 12px; }
.selbar-colors { font-size: 13px; color: var(--text2); }
.selbar-note input {
  flex: 1; min-width: 180px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 8px 10px; font-size: 14px;
}
.selbar-note input:focus { outline: none; border-color: var(--accent); }

@media (min-width: 768px) {
  .app { padding-top: 24px; }
  .verses { font-size: 19px; }
  .drawer { left: 50%; right: auto; transform: translateX(-50%); width: 640px; border-bottom: 1px solid var(--line); border-radius: 20px; bottom: 24px; }
  .sheet { left: 50%; right: auto; transform: translateX(-50%); width: 560px; border-bottom: 1px solid var(--line); border-radius: 20px; bottom: 24px; }
}
