@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Myanmar:wght@400;500;600;700&display=swap");

:root {
  --ink: #17231d;
  --muted: #68766f;
  --green: #176b4a;
  --green-dark: #0e4d35;
  --mint: #e8f3ed;
  --gold: #d9a441;
  --paper: #f6f6f1;
  --card: #fff;
  --line: #dce4df;
  --danger: #a63c3c;
  --header-bg: #0e4d35;
  --hero-start: #103f30;
  --hero-end: #176b4a;
  --footer-bg: #102c21;
  --input-bg: #fbfcfb;
  --shadow: rgba(17,68,49,.1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html[data-theme="light"] {
  --ink: #18221e;
  --muted: #64726b;
  --green: #176b4a;
  --green-dark: #164f3c;
  --mint: #eaf5ef;
  --gold: #c8912e;
  --paper: #f8fbf9;
  --card: #fff;
  --line: #dce7e1;
  --header-bg: #fff;
  --hero-start: #e8f5ee;
  --hero-end: #f8fbf9;
  --footer-bg: #e4eee8;
  --input-bg: #f8fbf9;
  --shadow: rgba(25,70,52,.09);
  color-scheme: light;
}
html[data-theme="dark"] {
  --ink: #ecf4ef;
  --muted: #a9b9b0;
  --green: #5fc694;
  --green-dark: #193f30;
  --mint: #203d31;
  --gold: #e2b45b;
  --paper: #111b16;
  --card: #18251f;
  --line: #31443a;
  --danger: #f08c8c;
  --header-bg: #0b1510;
  --hero-start: #0d271c;
  --hero-end: #183e2e;
  --footer-bg: #09130e;
  --input-bg: #111d17;
  --shadow: rgba(0,0,0,.3);
  color-scheme: dark;
}
html[data-theme="sepia"] {
  --ink: #352c20;
  --muted: #766956;
  --green: #527052;
  --green-dark: #394f3c;
  --mint: #e3e5d2;
  --gold: #b67a2e;
  --paper: #eee3cd;
  --card: #f9f0dd;
  --line: #d7c7aa;
  --header-bg: #3d4f3d;
  --hero-start: #465a43;
  --hero-end: #6d7654;
  --footer-bg: #354136;
  --input-bg: #f5ead5;
  --shadow: rgba(73,53,27,.14);
  color-scheme: light;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.sr-only {
  height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
  width: 1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }

.site-header {
  align-items: center;
  background: var(--header-bg);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px clamp(20px, 5vw, 72px);
}
.brand { align-items: center; display: flex; gap: 12px; text-decoration: none; }
.brand-mark {
  align-items: center;
  background: var(--gold);
  border-radius: 12px 3px 12px 3px;
  color: var(--green-dark);
  display: flex;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  width: 44px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: #c3d9cf; font-size: 10px; margin-top: 3px; }
.connection-status {
  align-items: center;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  color: #d3e5dc;
  display: flex;
  font-size: 10px;
  gap: 7px;
  padding: 8px 11px;
}
.connection-status b { font-weight: 400; }
.header-actions { align-items: center; display: flex; gap: 10px; }
.install-link {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: #fff;
  font-size: 10px;
  padding: 8px 10px;
  text-decoration: none;
}
.install-link:hover { background: rgba(255,255,255,.1); }
.header-feedback {
  background: rgba(217,164,65,.16);
  border: 1px solid rgba(244,207,131,.35);
  border-radius: 8px;
  color: #f8dda7;
  cursor: pointer;
  font-size: 10px;
  padding: 8px 10px;
}
.header-feedback:hover { background: rgba(217,164,65,.25); }
.preference-button {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  font-size: 10px;
  padding: 8px 10px;
}
.preference-button:hover { background: rgba(255,255,255,.15); }
.connection-status span {
  background: var(--gold);
  border-radius: 50%;
  height: 7px;
  width: 7px;
}
.connection-status.online span { background: #58d798; box-shadow: 0 0 0 4px rgba(88,215,152,.12); }
.connection-status.error { color: #ffd1d1; }
.connection-status.error span { background: #ff7777; }

main { min-height: calc(100vh - 170px); }
.hero {
  align-items: center;
  background:
    radial-gradient(circle at 82% 35%, rgba(217,164,65,.19), transparent 20%),
    linear-gradient(125deg, var(--hero-start), var(--hero-end));
  color: #fff;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, .5fr);
  min-height: 380px;
  overflow: hidden;
  padding: 55px clamp(24px, 8vw, 120px);
  position: relative;
}
.hero::after {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  content: "";
  height: 480px;
  position: absolute;
  right: -150px;
  top: -190px;
  width: 480px;
}
.hero-copy { max-width: 720px; position: relative; z-index: 1; }
.eyebrow, .section-kicker {
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  margin: 0 0 10px;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 69px);
  letter-spacing: -.04em;
  line-height: 1.28;
  margin: 0;
}
.hero h1 em { color: #f4cf83; font-style: normal; }
.hero-copy > p:last-child {
  color: #cfe0d8;
  font-size: 14px;
  line-height: 1.9;
  margin: 18px 0 0;
  max-width: 610px;
}
.hero-symbol {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  max-width: 210px;
  position: relative;
  width: 100%;
  z-index: 1;
}
.hero-symbol::before {
  border: 1px dashed rgba(217,164,65,.55);
  border-radius: 50%;
  content: "";
  inset: 12px;
  position: absolute;
}
.hero-symbol span { color: var(--gold); font-family: Georgia, serif; font-size: 75px; line-height: 1; }
.hero-symbol small { color: #d0e2d9; font-size: 11px; }

.search-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 35px var(--shadow);
  margin: 0 0 32px;
  max-width: none;
  padding: 25px;
  position: relative;
  width: 100%;
  z-index: 2;
}
.search-heading, .library-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-kicker { color: var(--green); letter-spacing: .1em; margin-bottom: 5px; }
.search-heading h2, .library-heading h2 { font-size: 22px; margin: 0; }
.result-count { color: var(--muted); font-size: 11px; margin: 0; }
.search-form { display: grid; gap: 10px; grid-template-columns: 1fr 220px auto; }
.search-box {
  align-items: center;
  background: var(--input-bg);
  border: 1px solid #cdd8d2;
  border-radius: 9px;
  display: flex;
  padding: 0 14px;
}
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,74,.1); }
.search-box > span:first-child { color: var(--green); font-size: 26px; margin-right: 8px; transform: rotate(-20deg); }
.search-box input {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-width: 0;
  outline: none;
  padding: 12px 0;
  width: 100%;
}
.category-box select {
  background: var(--input-bg);
  border: 1px solid #cdd8d2;
  border-radius: 9px;
  color: var(--ink);
  height: 100%;
  padding: 0 12px;
  width: 100%;
}
.search-form button {
  background: var(--green);
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  padding: 0 22px;
}
.search-form button:hover { background: var(--green-dark); }

.reader-shell {
  display: grid;
  gap: 28px;
  grid-template-columns: 245px minmax(0, 1fr);
  margin: -42px auto 70px;
  max-width: 1280px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.reader-main { min-width: 0; }
.browse-sidebar {
  align-self: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(17,68,49,.08);
  padding: 21px;
  position: sticky;
  top: 18px;
}
.sidebar-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 17px;
}
.sidebar-heading h2 { font-size: 17px; margin: 0; }
.browse-close { display: none; }
.category-nav { display: grid; gap: 5px; }
.category-nav-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #405149;
  cursor: pointer;
  display: flex;
  font-size: 11px;
  gap: 8px;
  justify-content: space-between;
  padding: 10px 11px;
  text-align: left;
  width: 100%;
}
.category-nav-item:hover { background: #f2f7f4; }
.category-nav-item.active { background: var(--mint); color: var(--green-dark); font-weight: 700; }
.category-nav-item strong {
  align-items: center;
  background: rgba(23,107,74,.08);
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  justify-content: center;
  min-width: 26px;
  padding: 3px 6px;
}
.sidebar-action {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
  margin-top: 12px;
  padding: 15px 10px 8px;
  text-align: left;
  width: 100%;
}
.sidebar-action.active { color: #a05c1b; font-weight: 700; }
.feedback-prompt {
  background: linear-gradient(145deg, #124c37, #176b4a);
  border-radius: 12px;
  color: #fff;
  margin-top: 15px;
  padding: 17px;
}
.feedback-prompt > span {
  align-items: center;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  color: #f5d28b;
  display: flex;
  font-size: 18px;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.feedback-prompt h3 { font-size: 13px; margin: 11px 0 6px; }
.feedback-prompt p { color: #d0e1d8; font-size: 9px; line-height: 1.7; margin: 0 0 12px; }
.feedback-prompt button {
  background: var(--gold);
  border: 0;
  border-radius: 7px;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  padding: 8px 10px;
  width: 100%;
}
.browse-toggle {
  background: var(--green-dark);
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  display: none;
  padding: 11px 14px;
}
.sidebar-scrim { display: none; }

.library { margin: 0; max-width: none; padding: 0 0 70px; }
.text-button {
  background: transparent;
  border: 0;
  color: var(--green);
  cursor: pointer;
  font-size: 12px;
  padding: 7px 0;
}
.text-button[aria-pressed="true"] { color: #a05c1b; font-weight: 700; }
.results { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.library-summary {
  align-items: center;
  background:
    radial-gradient(circle at 90% 20%, rgba(217,164,65,.16), transparent 28%),
    #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 22px;
  grid-column: 1 / -1;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  min-height: 180px;
  padding: 28px;
}
.summary-icon {
  align-items: center;
  background: var(--mint);
  border-radius: 50%;
  color: var(--green);
  display: flex;
  font-family: Georgia, serif;
  font-size: 36px;
  height: 78px;
  justify-content: center;
  width: 78px;
}
.summary-copy p { color: var(--muted); font-size: 10px; margin: 0 0 2px; }
.summary-copy strong {
  color: var(--green-dark);
  display: block;
  font-family: Georgia, "Myanmar Text", serif;
  font-size: 38px;
  line-height: 1.25;
}
.summary-copy strong small { font-family: inherit; font-size: 13px; }
.summary-copy span { color: var(--muted); display: block; font-size: 10px; line-height: 1.8; max-width: 510px; }
.summary-actions { display: grid; gap: 8px; min-width: 190px; }
.primary-action, .secondary-action {
  border-radius: 8px;
  cursor: pointer;
  font-size: 10px;
  padding: 11px 14px;
}
.primary-action { background: var(--green); border: 1px solid var(--green); color: #fff; }
.secondary-action { background: #fff; border: 1px solid #b9c9c1; color: var(--green); }
.hymn-card {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: 58px 1fr auto;
  min-height: 112px;
  padding: 18px;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  width: 100%;
}
.hymn-card:hover, .hymn-card:focus-visible {
  border-color: #9abdad;
  box-shadow: 0 10px 24px rgba(17,68,49,.08);
  outline: none;
  transform: translateY(-2px);
}
.hymn-number {
  align-items: center;
  background: var(--mint);
  border-radius: 10px;
  color: var(--green);
  display: flex;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  height: 58px;
  justify-content: center;
}
.hymn-card h3 { font-size: 15px; line-height: 1.55; margin: 0 0 5px; }
.hymn-card p { color: var(--muted); font-size: 10px; margin: 0; }
.favorite-icon { color: #a1aaa5; font-size: 22px; }
.favorite-icon.active { color: var(--gold); }
.empty-state, .error-state, .loading-card {
  align-items: center;
  background: #fff;
  border: 1px dashed #c8d4ce;
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 190px;
  padding: 30px;
  text-align: center;
}
.loading-card span {
  animation: pulse 1s infinite alternate;
  background: var(--mint);
  border-radius: 50%;
  height: 34px;
  width: 34px;
}
@keyframes pulse { to { opacity: .35; transform: scale(.82); } }
.error-state { border-color: #e6b8b8; color: var(--danger); }

.detail {
  background: #fff;
  border-top: 5px solid var(--gold);
  box-shadow: 0 -15px 45px rgba(11,47,34,.15);
  margin: 0 0 70px;
  max-width: none;
  padding: clamp(25px, 5vw, 60px);
  position: relative;
  width: 100%;
}
.detail-close {
  background: var(--mint);
  border: 0;
  border-radius: 50%;
  color: var(--green);
  cursor: pointer;
  font-size: 20px;
  height: 38px;
  position: absolute;
  right: 22px;
  top: 22px;
  width: 38px;
}
.detail-number { color: var(--green); font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.detail h2 { font-size: clamp(25px, 4vw, 40px); margin: 8px 55px 8px 0; }
.detail-meta { color: var(--muted); font-size: 11px; margin-bottom: 30px; }
.detail-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 5px;
  margin: 0 0 28px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.detail-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 11px;
  margin-bottom: -1px;
  padding: 11px 15px;
}
.detail-tab:hover { color: var(--green); }
.detail-tab[aria-selected="true"] {
  border-bottom-color: var(--gold);
  color: var(--green);
  font-weight: 700;
}
.detail-tab:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.detail-tab-panel { min-height: 120px; }
.verse {
  border-left: 2px solid var(--line);
  display: grid;
  gap: 15px;
  grid-template-columns: 34px 1fr;
  line-height: 2;
  margin: 0 0 18px;
  padding: 4px 0 4px 20px;
  white-space: pre-wrap;
}
.verse strong { color: var(--green); font-family: Georgia, serif; }
.verse.chorus { background: #fbf5e9; border-left-color: var(--gold); padding-bottom: 14px; padding-top: 14px; }
.detail-actions { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; padding-top: 18px; }
.detail-actions button {
  background: var(--green);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  padding: 10px 16px;
}
.detail-actions .correction-button {
  background: #fff;
  border: 1px solid #b8c9c0;
  color: var(--green);
}
.music-toolbar {
  align-items: center;
  background: var(--mint);
  border-radius: 10px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 16px;
}
.music-toolbar strong { color: var(--green-dark); display: block; font-size: 13px; }
.music-toolbar p { color: var(--muted); font-size: 9px; line-height: 1.7; margin: 3px 0 0; }
.music-toolbar select {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  max-width: 280px;
  padding: 8px 10px;
}
.transpose-controls {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.transpose-controls > strong {
  color: var(--ink);
  font-size: 10px;
}
.transpose-buttons { align-items: center; display: flex; gap: 7px; }
.transpose-buttons button {
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
}
.transpose-step {
  background: var(--green);
  border-radius: 50%;
  color: #fff;
  font-size: 18px !important;
  height: 34px;
  line-height: 1;
  padding: 0;
  width: 34px;
}
.transpose-reset {
  background: var(--input-bg);
  border-radius: 7px;
  color: var(--green-dark);
  font-size: 9px !important;
  padding: 8px 11px;
}
.transpose-buttons button:disabled { cursor: not-allowed; opacity: .45; }
.transpose-value {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 700;
  min-width: 92px;
  text-align: center;
}
.music-status {
  color: var(--muted);
  font-size: 10px;
  min-height: 18px;
  text-align: center;
}
.music-status.error {
  background: #fff0f0;
  border-radius: 8px;
  color: var(--danger);
  margin-bottom: 15px;
  padding: 12px;
}
.music-score {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 160px;
  overflow-x: auto;
  padding: 12px;
}
.music-score svg { display: block; height: auto; max-width: none; }
.music-download {
  color: var(--green);
  display: inline-block;
  font-size: 10px;
  margin-top: 12px;
}

footer {
  align-items: center;
  background: var(--footer-bg);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 110px;
  padding: 24px clamp(20px, 5vw, 72px);
}
footer > a { color: #b9cec4; font-size: 11px; text-decoration: none; }
.footer-links { align-items: flex-end; display: flex; flex-direction: column; gap: 9px; }
.footer-links a { color: #b9cec4; font-size: 11px; text-decoration: none; }
.footer-links button {
  background: transparent;
  border: 0;
  color: #f0ca7d;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}

.feedback-dialog {
  background: transparent;
  border: 0;
  max-height: calc(100vh - 30px);
  max-width: 680px;
  padding: 0;
  width: calc(100% - 28px);
}
.feedback-dialog::backdrop { background: rgba(7,30,22,.72); backdrop-filter: blur(3px); }
.feedback-form {
  background: #fff;
  border-top: 5px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0,0,0,.25);
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  padding: 28px;
}
.feedback-header { align-items: flex-start; display: flex; justify-content: space-between; }
.feedback-header h2 { font-size: 23px; margin: 0; }
.dialog-close, .browse-close {
  background: var(--mint);
  border: 0;
  border-radius: 50%;
  color: var(--green);
  cursor: pointer;
  font-size: 20px;
  height: 34px;
  line-height: 1;
  width: 34px;
}
.feedback-message { color: var(--muted); font-size: 11px; line-height: 1.9; margin: 13px 0 18px; }
.feedback-hymn {
  background: var(--mint);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  color: var(--green-dark);
  font-size: 11px;
  margin-bottom: 16px;
  padding: 10px 12px;
}
.feedback-form label { color: #46564e; display: grid; font-size: 10px; gap: 6px; margin-bottom: 13px; }
.feedback-form label small { color: var(--muted); font-weight: 400; }
.feedback-form input, .feedback-form select, .feedback-form textarea {
  background: #fbfcfb;
  border: 1px solid #cdd8d2;
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  padding: 10px 11px;
  resize: vertical;
  width: 100%;
}
.feedback-form input:focus, .feedback-form select:focus, .feedback-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23,107,74,.1);
}
.feedback-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.feedback-submit {
  background: var(--green);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  padding: 11px 18px;
}
.feedback-submit:disabled { cursor: wait; opacity: .65; }
.feedback-status { font-size: 10px; line-height: 1.7; margin: 4px 0 12px; min-height: 0; }
.feedback-status.success { background: #e9f6ee; border-radius: 7px; color: #176b4a; padding: 10px; }
.feedback-status.error { background: #fff0f0; border-radius: 7px; color: var(--danger); padding: 10px; }

.settings-dialog {
  background: transparent;
  border: 0;
  max-height: calc(100vh - 30px);
  max-width: 720px;
  padding: 0;
  width: calc(100% - 28px);
}
.settings-dialog::backdrop { background: rgba(7,30,22,.72); backdrop-filter: blur(3px); }
.settings-panel {
  background: var(--card);
  border-top: 5px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0,0,0,.25);
  color: var(--ink);
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  padding: 28px;
}
.settings-group { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.settings-group h3, .settings-group > label {
  color: var(--ink);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 12px;
}
.settings-group > p { color: var(--muted); font-size: 10px; line-height: 1.7; margin: 8px 0 0; }
.settings-group > select {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 10px 11px;
  width: 100%;
}
.theme-choices { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theme-choice {
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 34px 1fr;
  margin: 0;
  padding: 12px;
}
.theme-choice.selected { border-color: var(--green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 15%, transparent); }
.theme-choice input { accent-color: var(--green); margin: 0; }
.theme-swatch {
  background: var(--swatch);
  border: 2px solid rgba(127,127,127,.25);
  border-radius: 50%;
  height: 30px;
  width: 30px;
}
.theme-choice strong, .theme-choice small { display: block; }
.theme-choice strong { color: var(--ink); font-size: 11px; }
.theme-choice small { color: var(--muted); font-size: 8px; line-height: 1.5; margin-top: 2px; }
.settings-panel > .feedback-submit { margin-top: 22px; min-width: 100px; }

.settings-sidebar-action { margin-top: 0; }

.account-button {
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  max-width: 180px;
  overflow: hidden;
  padding: 8px 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-button.signed-in { background: transparent; color: #f5d28b; }
.account-dialog {
  background: transparent;
  border: 0;
  max-height: calc(100vh - 30px);
  max-width: 690px;
  padding: 0;
  width: calc(100% - 28px);
}
.account-dialog::backdrop { background: rgba(7,30,22,.72); backdrop-filter: blur(3px); }
.account-panel {
  background: var(--card);
  border-top: 5px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0,0,0,.25);
  color: var(--ink);
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  padding: 28px;
}
.account-tabs {
  background: var(--input-bg);
  border-radius: 9px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
  padding: 4px;
}
.account-tabs button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  padding: 10px;
}
.account-tabs button.active {
  background: var(--card);
  box-shadow: 0 2px 8px var(--shadow);
  color: var(--green);
  font-weight: 700;
}
.account-form { display: grid; gap: 13px; }
.account-form label {
  color: var(--ink);
  display: grid;
  font-size: 10px;
  gap: 6px;
}
.account-form input {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  padding: 11px;
  width: 100%;
}
.account-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}
.account-primary, .account-secondary {
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  padding: 11px 16px;
}
.account-primary { background: var(--green); border: 1px solid var(--green); color: #fff; }
.account-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-top: 14px;
}
.social-login {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  margin-top: 22px;
  padding-top: 18px;
  text-align: center;
}
.social-providers { display: grid; gap: 8px; margin-top: 11px; }
.social-provider {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 11px;
  text-decoration: none;
}
.social-provider.google::before { color: #4285f4; content: "G"; margin-right: 9px; }
.social-provider.facebook::before { color: #1877f2; content: "f"; font-size: 15px; margin-right: 9px; }
.account-welcome {
  color: var(--green);
  font-family: Georgia, "Myanmar Text", serif;
  font-size: 22px;
  font-weight: 700;
  margin: 18px 0 6px;
}
.account-sync-note {
  background: var(--mint);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  margin: 0 0 20px;
  padding: 11px;
}

html[data-theme="light"] .site-header { border-bottom: 1px solid var(--line); color: var(--ink); }
html[data-theme="light"] body,
html[data-theme="dark"] body,
html[data-theme="sepia"] body {
  background-color: var(--paper);
  color: var(--ink);
}
html[data-theme="light"] .brand small { color: var(--muted); }
html[data-theme="light"] .install-link,
html[data-theme="light"] .preference-button {
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="light"] .connection-status {
  background: var(--mint);
  border-color: var(--line);
  color: var(--muted);
}
html[data-theme="light"] .hero { color: var(--ink); }
html[data-theme="light"] .hero-copy > p:last-child,
html[data-theme="light"] .hero-symbol small { color: var(--muted); }
html[data-theme="light"] .hero-symbol { border-color: var(--line); }
html[data-theme="light"] footer { color: var(--ink); }
html[data-theme="light"] footer .brand small,
html[data-theme="light"] .footer-links a { color: var(--muted); }

html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .browse-sidebar,
html[data-theme="dark"] .library-summary,
html[data-theme="dark"] .hymn-card,
html[data-theme="dark"] .detail,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .error-state,
html[data-theme="dark"] .loading-card,
html[data-theme="dark"] .feedback-form {
  background-color: var(--card);
  color: var(--ink);
}
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .category-box select,
html[data-theme="dark"] .feedback-form input,
html[data-theme="dark"] .feedback-form select,
html[data-theme="dark"] .feedback-form textarea {
  background: var(--input-bg);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] .feedback-form label { color: var(--muted); }
html[data-theme="dark"] .verse.chorus { background: #332d1f; }
html[data-theme="dark"] .secondary-action,
html[data-theme="dark"] .detail-actions .correction-button {
  background: var(--input-bg);
  border-color: var(--line);
  color: var(--green);
}
html[data-theme="dark"] .feedback-status.success { background: #183a2b; }
html[data-theme="dark"] .feedback-status.error { background: #3c2020; }

html[data-theme="sepia"] .search-panel,
html[data-theme="sepia"] .browse-sidebar,
html[data-theme="sepia"] .library-summary,
html[data-theme="sepia"] .hymn-card,
html[data-theme="sepia"] .detail,
html[data-theme="sepia"] .empty-state,
html[data-theme="sepia"] .loading-card,
html[data-theme="sepia"] .feedback-form {
  background-color: var(--card);
}
html[data-theme="sepia"] .search-box,
html[data-theme="sepia"] .category-box select,
html[data-theme="sepia"] .feedback-form input,
html[data-theme="sepia"] .feedback-form select,
html[data-theme="sepia"] .feedback-form textarea {
  background: var(--input-bg);
  border-color: var(--line);
}

@media (max-width: 980px) {
  .reader-shell { grid-template-columns: 1fr; margin-top: -36px; }
  .browse-toggle { display: block; justify-self: start; }
  .browse-sidebar {
    border-radius: 0 16px 16px 0;
    bottom: 0;
    left: 0;
    max-width: 310px;
    overflow-y: auto;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
    width: 86vw;
    z-index: 20;
  }
  .browse-sidebar.open { transform: translateX(0); }
  .browse-close { display: block; }
  .sidebar-scrim {
    background: rgba(7,30,22,.55);
    bottom: 0;
    display: block;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 19;
  }
}

@media (max-width: 760px) {
  .site-header { padding: 12px 18px; }
  .brand strong { font-size: 13px; }
  .connection-status { font-size: 0; padding: 9px; }
  .header-actions { gap: 6px; }
  .header-feedback { display: none; }
  .account-button { max-width: 110px; }
  .preference-button span { display: none; }
  .install-link { font-size: 9px; padding: 7px; }
  .hero { grid-template-columns: 1fr; min-height: 380px; padding: 48px 24px 75px; }
  .hero-symbol { display: none; }
  .reader-shell { gap: 13px; margin-top: -34px; padding: 0 12px; }
  .search-panel { padding: 19px; width: 100%; }
  .search-heading, .library-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .search-form { grid-template-columns: 1fr; }
  .category-box select, .search-form button { height: 48px; }
  .results { grid-template-columns: 1fr; }
  .library { padding-bottom: 45px; }
  .library-summary { grid-template-columns: 62px 1fr; padding: 20px; }
  .summary-icon { font-size: 28px; height: 58px; width: 58px; }
  .summary-copy strong { font-size: 31px; }
  .summary-actions { grid-column: 1 / -1; min-width: 0; }
  .hymn-card { grid-template-columns: 52px 1fr auto; padding: 14px; }
  .hymn-number { height: 52px; }
  .feedback-row { grid-template-columns: 1fr; gap: 0; }
  .feedback-form { padding: 22px 18px; }
  .settings-panel { padding: 22px 18px; }
  .account-panel { padding: 22px 18px; }
  .theme-choices { grid-template-columns: 1fr; }
  .detail-tabs { margin-left: -12px; margin-right: -12px; padding: 0 12px; }
  .music-toolbar { align-items: stretch; flex-direction: column; }
  .music-toolbar select { max-width: none; width: 100%; }
  .transpose-controls { align-items: stretch; flex-direction: column; gap: 9px; }
  .transpose-buttons { flex-wrap: wrap; }
  .transpose-value { flex: 1; }
  .music-score { margin-left: -10px; margin-right: -10px; padding: 5px; }
  footer { align-items: flex-start; flex-direction: column; gap: 20px; }
  .footer-links { align-items: flex-start; }
}
