:root{
  --bg:#f6f7f9;
  --panel-bg:#ffffff;
  --muted:#6b7280;
  --divider:#e6e7eb;
  --blue:#3b82f6;
  --green:#10b981;
  --orange:#f97316;
  --purple:#8e24aa;
  --blue-tint:#F3F8FF;
  --green-tint:#F1FBF8;
  --orange-tint:#FFF7F1;
  --purple-tint:#F8F2FA;
  --blue-glow:rgba(59,130,246,0.22);
  --green-glow:rgba(16,185,129,0.22);
  --orange-glow:rgba(249,115,22,0.22);
  --purple-glow:rgba(142, 36, 170, 0.22);
  --radius:10px;
  --gap:20px;
  --ui-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-family: var(--ui-font);
}

/* App shell fills viewport and prevents document scroll */
html,body{height:100%;}
body{margin:0;background:var(--bg);font-family:inherit;color:#111;}
.app-shell{
  height:100vh;
  display:flex;
  gap:0;
  overflow:hidden; /* prevent page scrolling */
}

.panel{
  box-sizing:border-box;
  background:var(--panel-bg);
  padding:24px;
  overflow-y:auto;
}

/* Two-column split with thin divider */
.bible{flex:1 1 50%; border-right:1px solid var(--divider); display:flex; flex-direction:column; overflow:hidden}

/* Bible panel typography (Cambria like BSB Word doc) */
.bible .panel-header,
.bible .bible-content{
  font-family: Cambria, Georgia, "Times New Roman", Times, serif;
}
.bible .hover-bar{
  font-family: var(--ui-font);
}
/* Untranslated marker (rendered from BSB '-') */
.word.untranslated-marker{
  font-size:0.85em;
  color: var(--muted);
  opacity:0.75;
}

.notes{flex:1 1 50%;}

.panel-header{
  margin:0 0 12px 0;
  position:relative;
}
.panel-header h1{font-size:1.1rem;margin:0}
.panel-header h2{font-size:1rem;margin:0}
.panel-header .subtitle{font-size:0.85rem;color:var(--muted);margin:4px 0 0}

/* Modern centered navigation row */
.bible-nav-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin: 10px 0 8px 0;
  gap: 12px;
}

.bible-nav-left {
  justify-self: start;
}

.bible-nav-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  position: relative;
}

.bible-nav-right {
  width: 28px; /* Match approximate width of back button for centering */
}

/* Reference picker button (pill style) */
.reference-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--panel-bg);
  color: #111;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.reference-picker-btn:hover {
  border-color: var(--muted);
  background: rgba(0, 0, 0, 0.02);
}

.reference-picker-btn:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.reference-picker-btn[aria-expanded="true"] {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.05);
}

.picker-caret {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.reference-picker-btn[aria-expanded="true"] .picker-caret {
  transform: rotate(180deg);
}

/* Picker menus (book and chapter dropdowns) */
.picker-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--divider);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 4px;
}

.picker-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.95rem;
  font-family: inherit;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #111;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.picker-menu button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.picker-menu button:focus {
  outline: none;
  background: rgba(59, 130, 246, 0.1);
}

/* Visually hidden utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Legacy styles - kept for backwards compatibility but hidden */
.panel-header .toolbar{
  display:none;
}

.reference-nav{
  display:none;
}

.panel-header .reference-label {
  display:none;
}

.nav-arrow{
  padding:4px 4px;
  font-size:0.7rem;
  border:1px solid var(--divider);
  border-radius:6px;
  background:var(--panel-bg);
  color:#111;
  cursor:pointer;
  transition:border-color 0.2s ease, background-color 0.2s ease;
  font-family:inherit;
  line-height:1;
}

.nav-arrow:hover:not(:disabled){
  border-color:var(--muted);
  background:rgba(0,0,0,0.02);
}

.nav-arrow:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 2px rgba(59,130,246,0.1);
}

.nav-arrow:disabled{
  opacity:0.5;
  cursor:not-allowed;
}

.sticky {
  position: sticky;
  top: 0;
  background: transparent;
  z-index: 100;
  padding-bottom: 12px;
  border-bottom: none;
  pointer-events: auto;
  isolation: isolate;
}

/* Paragraph layout */
.verses{line-height:1.6;color:#111}
.paragraph{margin:0 0 8px 0}
.paragraph.paragraph-start{
  margin-top:14px;
  text-indent:0;
}
.verse-num{font-size:0.75rem;vertical-align:super;margin-right:0;color:var(--muted)}

/* Poetry styles (optional, for future use) */
.paragraph.poetry{
  text-indent:0;
  margin-left:1.5em;
}
.poetry-line{
  display:block;
  margin-left:1.5em;
}

/* Verse headings (section titles) */
.verse-heading{
  font-size:0.95rem;
  font-weight:700;
  margin:16px 0 4px 0;
  color:#111;
}

/* Psalm heading prose tokens (italic only) */
.psalm-heading-token{
  font-style: italic;
}

/* Psalm 119 acrostic markers */
.psalm-acrostic{
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 12px 0;
}

.psalm-acrostic .hebrew-letter{
  font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif;
  font-size: 1.3rem;
}

.psalm-acrostic .latin-name{
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}

.word{display:inline-block;font-size:1rem;cursor:default;position:relative;padding-bottom:6px;vertical-align:baseline}
.word.untranslated{opacity:0.6;color:var(--muted);font-style:normal}

/* Words with attached public notes: subtle underline indicator (toggle controlled) */
.bible.public-notes-underline-on .word.has-public-notes{
  text-decoration: underline;
  text-decoration-color: rgba(120,120,120,.85);
  text-decoration-thickness: 1.3px;
  text-underline-offset: 1.5px;
}

/* Glowing words use hand pointer */
.word.tag-blue,
.word.tag-green,
.word.tag-orange,
.word.tag-purple{cursor:pointer}

/* Punctuation spans */
.punct{color:inherit;cursor:default;display:inline}

/* Micro dots for secondary tags */
.tag-dots{position:absolute;left:50%;transform:translateX(-50%);bottom:0;display:flex;gap:2px;pointer-events:none}
.tag-dot{width:4px;height:4px;border-radius:50%;opacity:0.9;display:inline-block}
.tag-dot.blue{background:var(--blue)}
.tag-dot.green{background:var(--green)}
.tag-dot.orange{background:var(--orange)}
.tag-dot.purple{background:var(--purple)}

/* Subtle hover affordance for tagged words (tasteful) */
.word.tag-blue:hover,
.word.tag-green:hover,
.word.tag-orange:hover,
.word.tag-purple:hover{
  text-decoration:underline;
  text-decoration-thickness:1px;
  background-color:rgba(0,0,0,0.02);
  border-radius:6px;
}

/* Tag colors */
.tag-blue{font-weight:700;color:var(--blue)}
.tag-green{font-weight:700;color:var(--green)}
.tag-orange{font-weight:700;color:var(--orange)}
.tag-purple{font-weight:700;color:var(--purple)}

/* phrase bubble wrapper */
.active-phrase{
  display:inline;
  padding:0;
  border:0;
  border-radius:999px;
  color:#fff;
}

.active-phrase.tag-blue{
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.85), 0 6px 12px var(--blue-glow);
}

.active-phrase.tag-green{
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,.85), 0 6px 12px var(--green-glow);
}

.active-phrase.tag-orange{
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,.85), 0 6px 12px var(--orange-glow);
}

.active-phrase.tag-purple{
  background: var(--purple);
  box-shadow: 0 0 0 3px rgba(142, 36, 170, .85), 0 6px 12px var(--purple-glow);
}

.active-phrase.tag-yellow{
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250,204,21,.85), 0 6px 12px rgba(250,204,21,.35);
}

/* words inside phrase bubble should not add their own bubble */
.word.is-active{ color:inherit; border-radius:0; background:none; box-shadow:none; }

/* Subtle group-hover state for related words */
.word.is-hovered{outline:0;border-radius:6px}
.word.is-hovered.tag-blue{background:rgba(59,130,246,0.08)}
.word.is-hovered.tag-green{background:rgba(16,185,129,0.06)}
.word.is-hovered.tag-orange{background:rgba(249,115,22,0.06)}
.word.is-hovered.tag-purple{background:rgba(142, 36, 170, 0.06)}

/* Note scripture preview heading */
.note-preview-heading{
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 0.95rem;        /* slightly bigger than before, not dramatic */
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #111;
  text-transform: none;      /* stop forced uppercase */
  margin: 0 0 8px 0;
}

.note-preview-verse{
  margin: 0 0 6px 0;
  font-family: Cambria, Georgia, "Times New Roman", Times, serif;
  font-size: 0.95rem;     /* keep same scale */
  line-height: 1.6;       /* match Bible panel */
  color: #111;
}

/* Editor Mode text overlay - hidden, replaced with stripe background */
.editor-mode-text{
  display:none;
}

/* Editor Mode diagonal stripe background */
.notes.editor-mode {
  position: relative;
}

.notes.editor-mode::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.04) 0px,
    rgba(0, 0, 0, 0.04) 10px,
    rgba(0, 0, 0, 0.00) 10px,
    rgba(0, 0, 0, 0.00) 20px
  );
  opacity: 1;
  z-index: 0;
  pointer-events: none;
}

.notes.editor-mode > * {
  position: relative;
  z-index: 1;
}

/* Notes list */
.notes-list{display:flex;flex-direction:column;gap:16px;flex:1;min-height:0}

/* Simple color indicator (shown when notes panel is empty) */
.simple-color-indicator {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  align-items: flex-start;
  margin: auto;
  width: fit-content;
}

.color-indicator-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-indicator-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.color-indicator-icon-blue {
  background-color: var(--blue);
}

.color-indicator-icon-green {
  background-color: var(--green);
}

.color-indicator-icon-orange {
  background-color: var(--orange);
}

.color-indicator-icon-purple {
  background-color: var(--purple);
}

.color-indicator-text {
  font-size: 1rem;
  font-weight: 600;
}

.color-indicator-text-blue {
  color: var(--blue);
}

.color-indicator-text-green {
  color: var(--green);
}

.color-indicator-text-orange {
  color: var(--orange);
}

.color-indicator-text-purple {
  color: var(--purple);
}
.note{position:relative;padding:16px;border-radius:var(--radius);box-shadow:0 1px 0 rgba(16,24,40,0.02);border:1px solid rgba(16,24,40,0.04)}
.note-title{margin:0 0 6px 0;font-size:1rem}

/* Color-specific tweaks so preview reads well per note color */
.note-blue .note-preview{  margin:0 0 10px 0;
  color:rgba(0,0,0,0.85);
  font-size:0.95rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height:1.4;
  white-space:pre-wrap;
  padding:10px 12px;
  border-left:4px solid rgba(0,0,0,0.06);
  background:rgba(0,0,0,0.02);
  border-radius:6px;
  box-sizing:border-box;
  border-left-color:rgba(59,130,246,0.9);background:rgba(59,130,246,0.03)
}
.note-green .note-preview{margin:0 0 10px 0;color:var(--muted);font-size:0.9rem}
.note-orange .note-preview{margin:0 0 10px 0;color:var(--muted);font-size:0.9rem}
.note-purple .note-preview{margin:0 0 10px 0;color:var(--muted);font-size:0.9rem}

.note-body{margin:0 0 12px 0;line-height:1.5}
.note-link{display:inline-block;color:var(--blue);text-decoration:underline}

/* Very light tints for note cards */
.note-blue{background:var(--blue-tint);border-color:rgba(59,130,246,0.12)}
.note-green{background:var(--green-tint);border-color:rgba(16,185,129,0.12)}
.note-orange{background:var(--orange-tint);border-color:rgba(249,115,22,0.12)}
.note-purple{background:var(--purple-tint);border-color:rgba(142, 36, 170, 0.12)}

/* Note word label inside cards */
.note-word{margin:0 0 8px 0;font-weight:700;font-size:1.15rem}
.note-word.tag-blue{color:var(--blue)}
.note-word.tag-green{color:var(--green)}
.note-word.tag-orange{color:var(--orange)}
.note-word.tag-purple{color:var(--purple)}

/* Close button */
.close{position:absolute;top:8px;right:8px;border:0;background:transparent;color:rgba(0,0,0,0.6);font-size:18px;line-height:1;padding:6px;border-radius:6px;cursor:pointer}
.close:focus, .close:focus-visible{outline:3px solid rgba(59,130,246,0.25);outline-offset:3px;border-radius:6px}

/* Public note header row layout */
.note-header-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.note-header-left{min-width:0}
.note-header-actions{display:flex;gap:10px;align-items:center;flex-shrink:0}
.note-header-row .close{position:static;top:auto;right:auto;padding:0}
.note-header-actions .note-footer-btn{white-space:nowrap}

/* Accessibility for links */
.note a:focus, .note a:focus-visible, a:focus, a:focus-visible{outline:3px solid rgba(59,130,246,0.25);outline-offset:3px;border-radius:4px}

/* Responsive stacking */
@media (max-width:900px){
  .app-shell{flex-direction:column}
  .bible{border-right:0;border-bottom:1px solid var(--divider)}
  .bible,.notes{height:50vh;flex-basis:auto}
  .panel{padding:18px}
}

.bible .bible-content{flex:1;overflow-y:auto;padding-bottom:16px}

/* Reclaim space when hover bar is disabled */
.bible.hoverbar-off .bible-content { padding-bottom: 0; }
.bible.hoverbar-off .hover-bar { display: none !important; }

/* Hover bar at bottom of left panel: fixed footer inside panel */
.bible .hover-bar{
  position:static;
  display:flex;
  gap:8px;
  align-items:center;
  padding-top:10px;
  border-top:1px solid var(--divider);
  background:linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.98));
  font-size:0.95rem;
  color:var(--muted);
}
.hover-value{color:#111;font-weight:600;
  /* clamp to two lines with ellipsis */
  display:block; /* fallback for non-webkit */
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  white-space:normal;
  text-overflow:ellipsis;
  /* ensure consistent line-height and exact two-line max height */
  line-height:1.25;
  max-height: calc(1.25em * 2);
  height: calc(1.25em * 2);
  margin:0; padding:0;
  /* keep hover text top-aligned inside the hover bar to remove extra bottom gap */
  align-self:flex-start;
  /* allow long words to wrap so they can be clamped */
  overflow-wrap: anywhere;
}

/* Hover bar parts */
.hb-muted{ color:var(--muted); opacity:0.95; margin-right:6px; }
.hb-def{ font-weight:400; margin-left:6px; color:inherit }
.hb-main{ margin-right:6px }

/* Small polish */
.paragraph .word{word-break:keep-all}

/* Context menu for right-click word details */
.context-menu{
  position:fixed;
  background:#fff;
  border:1px solid var(--divider);
  border-radius:6px;
  box-shadow:0 2px 8px rgba(16,24,40,0.1);
  z-index:9999;
  min-width:200px;
}
.context-menu-item{
  display:block;
  width:100%;
  padding:8px 12px;
  border:none;
  background:transparent;
  color:#111;
  font-size:0.9rem;
  text-align:left;
  cursor:pointer;
  transition:background-color 0.15s ease;
  font-family:inherit;
}
.context-menu-item:hover{
  background-color:rgba(59,130,246,0.08);
}
.context-menu-item:first-child{
  border-top-left-radius:5px;
  border-top-right-radius:5px;
}
.context-menu-item:last-child{
  border-bottom-left-radius:5px;
  border-bottom-right-radius:5px;
}

/* Original language word details note */
.note-word-details{
  background:var(--orange-tint);
  border-color:rgba(249,115,22,0.12);
}
.note-word-details .note-word{
  color:var(--orange);
}
.note-scripture-word{
  margin:0 0 12px 0;
  font-weight:700;
  font-size:1rem;
  color:#111;
  font-family:Cambria, Georgia, serif;
}
.note-details-rows{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.note-detail-row{
  display:flex;
  gap:8px;
  font-size:0.9rem;
  line-height:1.4;
}
.note-detail-label{
  font-weight:600;
  color:#111;
  min-width:120px;
  flex-shrink:0;
}
.note-detail-value{
  color:var(--muted);
  word-break:break-word;
}

/* Word study hit highlighting */
.ws-hit{
  font-weight:700;
  color:var(--orange);
  background:rgba(249,115,22,0.12);
  border-radius:6px;
  box-shadow:0 0 0 2px rgba(249,115,22,.45), 0 6px 12px rgba(249,115,22,.18);
  padding:0 2px;
  cursor:default;
}
/* Word study note styling */
.note-word-study{
  background:var(--orange-tint);
  border-color:rgba(249,115,22,0.12);
}
.note-word-study .note-word{
  color:var(--orange);
}
.note-word-study-header{
  margin:0 0 12px 0;
  font-weight:700;
  font-size:0.95rem;
  color:#111;
}
.note-word-study-verses{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:12px;
}
.word-study-verse{
  font-size:0.9rem;
  line-height:1.6;
}
.word-study-verse-ref{
  margin:0 0 4px 0;
  font-weight:600;
  color:var(--muted);
  font-size:0.85rem;
}
.word-study-verse-text{
  margin:0;
  color:#111;
  word-break:break-word;
}

/* Note footer row (flex layout for link/source + buttons) */
.note-footer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
}

/* Left side: link/source can truncate if too long */
.note-footer-row > .note-link,
.note-footer-row > .note-footer-source{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Note author attribution (scoped to footer row only) */
.note-footer-row .note-author{
  color:var(--muted);
  font-style:italic;
  margin-left:8px;
  max-width:240px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  display:inline-block;
  min-width:0;
  vertical-align:baseline;
}


/* Right side: action buttons container */
.note-footer-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  flex-shrink:0;
}

/* Action buttons styling */
.note-footer-btn{
  padding:4px 10px;
  font-size:0.85rem;
  font-family:inherit;
  border:1px solid var(--divider);
  border-radius:6px;
  background:transparent;
  color:#111;
  cursor:pointer;
  transition:background-color 0.15s ease, border-color 0.15s ease;
  white-space:nowrap;
}

.note-footer-btn:hover:not(:disabled){
  background-color:rgba(0,0,0,0.04);
  border-color:var(--muted);
}

.note-footer-btn:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 2px rgba(59,130,246,0.1);
}

.note-footer-btn:disabled{
  opacity:0.5;
  cursor:not-allowed;
}

/* Icon-only buttons for Edit and Delete */
.note-edit-btn,
.note-delete-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  padding:0;
  font-size:0;
  color:var(--muted);
}

.note-edit-btn svg,
.note-delete-btn svg{
  width:18px;
  height:18px;
  stroke:currentColor;
}

.note-edit-btn:hover:not(:disabled),
.note-delete-btn:hover:not(:disabled){
  color:#111;
  background-color:rgba(0,0,0,0.06);
}

.note-edit-btn:focus-visible,
.note-delete-btn:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:2px;
}

/* Icon-only Glow button */
.note-glow-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  padding:0;
  font-size:0;
  color:var(--muted);
}

.note-glow-btn svg{
  width:18px;
  height:18px;
  stroke:currentColor;
}

.note-glow-btn:hover:not(:disabled){
  color:#111;
  background-color:rgba(0,0,0,0.06);
}

.note-glow-btn:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:2px;
}

.note-glow-btn.is-loading svg{
  opacity:0.6;
  animation:pulse 0.6s ease-in-out infinite;
}

@keyframes pulse{
  0%, 100%{opacity:0.6;}
  50%{opacity:1;}
}

/* Icon-only Feedback button */
.note-feedback-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  padding:0;
  font-size:0;
  color:var(--muted);
}

.note-feedback-btn svg{
  width:18px;
  height:18px;
  stroke:currentColor;
}

.note-feedback-btn:hover:not(:disabled){
  color:#111;
  background-color:rgba(0,0,0,0.06);
}

.note-feedback-btn:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:2px;
}

/* Feedback sent (disabled) state with visual lock icon indicates completion */
.note-feedback-sent{
  cursor:not-allowed;
}

.note-feedback-sent:hover{
  background-color:transparent;
}

/* Optical alignment correction for feedback-sent (lock) icon */
.note-feedback-btn.note-feedback-sent svg{
  display:block;
  transform:translateX(1px);
}

/* Buttons in notes */
.note-word-study-btn-container,
.note-load-more-container{
  margin-top:12px;
  display:flex;
}
.note-word-study-btn,
.note-load-more-btn{
  padding:8px 16px;
  border:1px solid rgba(249,115,22,0.3);
  background:rgba(249,115,22,0.08);
  color:var(--orange);
  border-radius:6px;
  font-size:0.85rem;
  font-weight:600;
  cursor:pointer;
  transition:all 0.2s ease;
  font-family:inherit;
}
.note-word-study-btn:hover,
.note-load-more-btn:hover{
  background:rgba(249,115,22,0.15);
  border-color:rgba(249,115,22,0.5);
}
.note-word-study-btn:focus,
.note-load-more-btn:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(249,115,22,0.2);
}
/* Editor Mode button */
.editor-mode-btn{
  display: none;
}

/* Add note button and menu */
.add-note-wrap {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.add-note-btn {
  position: relative;
  z-index: 102;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--panel-bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  font-family: inherit;
  color: #111;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.05s ease;
}

.add-note-btn[hidden] {
  display: none !important;
}

.add-note-btn:hover {
  border-color: var(--muted);
  background: rgba(59, 130, 246, 0.04);
}

.add-note-btn:active {
  transform: translateY(1px);
}

.add-note-btn:focus,
.add-note-btn:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.public-note-cap-helper {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--panel-bg);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--divider);
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
}

.add-note-menu {
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  background: var(--panel-bg);
  border: 1px solid var(--divider);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  min-width: 220px;
  z-index: 200;
}

.add-note-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: #111;
  border-radius: 8px;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.add-note-item:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

.add-note-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: transparent;
}

/* Notes toolbar (left + right controls) */
.notes-toolbar {
  position: relative;
  z-index: 101;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  background: transparent;
}

/* Close all notes button */
.close-all-notes-btn {
  position: relative;
  z-index: 102;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--panel-bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  font-family: inherit;
  color: #c1121f;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.05s ease;
}

.close-all-notes-btn:hover {
  border-color: var(--muted);
  background: rgba(193, 18, 31, 0.06);
}

.close-all-notes-btn:active {
  transform: translateY(1px);
}

.close-all-notes-btn:focus,
.close-all-notes-btn:focus-visible {
  outline: none;
  border-color: #c1121f;
  box-shadow: 0 0 0 2px rgba(193, 18, 31, 0.15);
}

/* Anchor overlays to the notes panel (so absolute centering works inside it) */
#notes-panel{
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Add Word / Phrase Note occupies full notes panel */
.awp-overlay{
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Make sure hidden actually hides the overlay (our display:flex would otherwise override it) */
.awp-overlay[hidden]{
  display: none !important;
}

/* Full-height, note-like container */
.awp-card{
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1; /* fill available vertical space */

  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(107,114,128,0.14);
  background: var(--panel-bg);
  box-shadow: 0 1px 0 rgba(16,24,40,0.02);
  box-sizing: border-box;
}

.awp-card.awp-blue   { background: var(--blue-tint); }
.awp-card.awp-green  { background: var(--green-tint); }
.awp-card.awp-orange { background: var(--orange-tint); }
.awp-card.awp-purple { background: var(--purple-tint); }

.awp-card.awp-blue   .awp-title { color: var(--blue); }
.awp-card.awp-green  .awp-title { color: var(--green); }
.awp-card.awp-orange .awp-title { color: var(--orange); }
.awp-card.awp-purple .awp-title { color: var(--purple); }

.awp-title{
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: rgba(17,24,39,0.85);
  text-align: left;
}

/* Close (X) button — same positioning vibe as .close, but separate class */
.awp-close{
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  color: rgba(0,0,0,0.6);
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}

.awp-close:focus,
.awp-close:focus-visible{
  outline: 3px solid rgba(59,130,246,0.25);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Delete Confirm Dialog */
.mini-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.mini-confirm-dialog {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 260px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.mini-confirm-text {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.mini-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.mini-confirm-delete {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: none;
  border-radius: 6px;
  background: #dc2626;
  color: white;
  cursor: pointer;
  font-weight: 500;
}

.mini-confirm-delete:hover {
  background: #b91c1c;
}

.mini-confirm-delete:focus,
.mini-confirm-delete:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.mini-confirm-cancel {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--divider);
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  font-weight: 500;
}

.mini-confirm-cancel:hover {
  background: #e5e7eb;
}

.mini-confirm-cancel:focus,
.mini-confirm-cancel:focus-visible {
  outline: 2px solid var(--divider);
  outline-offset: 2px;
}

/* AWP Form Styling */
.awp-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.awp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.awp-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.awp-field input,
.awp-field select,
.awp-field textarea {
  width: 100%;
  max-width: 100%;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #111;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: var(--panel-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.awp-field input,
.awp-field select {
  height: 40px;
  line-height: 1.2;
}

.awp-field input {
  padding-top: 4px;
  padding-bottom: 4px;
}

.awp-field textarea {
  min-height: 130px;
  resize: vertical;
}

.awp-field input:focus,
.awp-field select:focus,
.awp-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.awp-field input::placeholder,
.awp-field textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.awp-optional {
  font-weight: 400;
  opacity: 0.7;
}

.awp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

#awp-create-btn {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

#awp-create-btn:hover:not(:disabled) {
  background: #2563eb;
}

#awp-create-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.awp-error {
  font-size: 0.85rem;
  color: #dc2626;
  min-height: 20px;
}

/* Settings Menu */
.bible-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}

.logo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}

.logo-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  border-radius: 6px;
}

.logo-img {
  display: block;
  height: 36px;
  width: auto;
}

.settings-wrap {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.settings-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--divider);
  background: var(--panel-bg);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  font-family: inherit;
  color: #111;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.05s ease;
}

.settings-btn:hover {
  border-color: var(--muted);
  background: rgba(59, 130, 246, 0.04);
}

.settings-btn:active {
  transform: translateY(1px);
}

.settings-btn:focus,
.settings-btn:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.settings-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--panel-bg);
  border: 1px solid var(--divider);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  min-width: 280px;
  z-index: 200;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-align: left;
}

.settings-item:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

.settings-item[hidden] {
  display: none !important;
}

.settings-toggle-item {
  border: none;
  padding: 8px 12px;
}

.settings-action-item {
  font-size: 0.9rem;
  color: #111;
  width: 100%;
  padding: 10px 12px;
}

.settings-label {
  font-size: 0.9rem;
  color: #111;
  font-weight: 500;
  flex: 1;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid var(--divider);
  background: #e5e7eb;
  transition: 0.2s;
  border-radius: 999px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  transition: 0.2s;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .slider {
  background: rgba(16, 185, 129, 0.35);
  border-color: rgba(16, 185, 129, 0.65);
}

.switch input:checked + .slider:before {
  transform: translate(18px, -50%);
}

.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

/* ========================================
   Auth Indicator (near settings)
   ======================================== */
.auth-indicator {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
}

/* ========================================
   Login Modal (similar to AWP overlay)
   ======================================== */
/* About Overlay */
#about-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  box-sizing: border-box;
}

#about-overlay[hidden] {
  display: none !important;
}

.about-card {
  position: relative;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.about-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  color: rgba(0,0,0,0.6);
  font-size: 28px;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.about-close:focus,
.about-close:focus-visible {
  outline: 3px solid rgba(59,130,246,0.25);
  outline-offset: 3px;
  border-radius: 6px;
}

.about-content {
  max-width: 600px;
  margin: 0 auto;
}

.about-title {
  margin: 0 0 24px 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111;
  text-align: center;
}

.about-content > p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  text-align: justify;
  color: #111;
}

.about-category {
  margin: 16px 0;
  padding: 0;
}

.about-category-title {
  font-weight: 700;
  margin: 0 0 4px 0;
  font-size: 1rem;
  color: #111;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-category-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.about-icon-blue {
  background-color: var(--blue);
}

.about-icon-green {
  background-color: var(--green);
}

.about-icon-orange {
  background-color: var(--orange);
}

.about-icon-purple {
  background-color: var(--purple);
}

.about-text-blue {
  color: var(--blue);
}

.about-text-green {
  color: var(--green);
}

.about-text-orange {
  color: var(--orange);
}

.about-text-purple {
  color: var(--purple);
}

.about-category p:last-child {
  margin: 0;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.8);
}

#login-overlay {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#login-overlay[hidden] {
  display: none !important;
}

.login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(107,114,128,0.14);
  background: var(--panel-bg);
  box-shadow: 0 1px 0 rgba(16,24,40,0.02);
  max-width: 400px;
  margin: auto;
}

.login-title {
  margin: 0 0 20px 0;
  font-weight: 700;
  font-size: 1.1rem;
  color: rgba(17,24,39,0.85);
  text-align: left;
}

.login-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  color: rgba(0,0,0,0.6);
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}

.login-close:focus,
.login-close:focus-visible {
  outline: 3px solid rgba(59,130,246,0.25);
  outline-offset: 3px;
  border-radius: 6px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(17,24,39,0.85);
}

.login-field input {
  padding: 8px 12px;
  font-size: 0.95rem;
  border: 1px solid rgba(107,114,128,0.3);
  border-radius: 6px;
  background: var(--panel-bg);
  color: #111;
  font-family: inherit;
}

.login-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.login-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.login-actions button {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.login-actions button[type="submit"] {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.login-actions button[type="submit"]:hover {
  background: #2563eb;
}

.login-actions button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-actions button[type="button"] {
  background: transparent;
  color: #111;
  border-color: var(--divider);
}

.login-actions button[type="button"]:hover {
  background: rgba(0,0,0,0.04);
}

.login-error {
  font-size: 0.85rem;
  color: #dc2626;
  margin-top: 8px;
  text-align: center;
}

.signin-view,
.register-view {
  display: flex;
  flex-direction: column;
}

.signin-view[hidden],
.register-view[hidden] {
  display: none !important;
}

.signin-footer,
.register-footer {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.link-button {
  background: none;
  border: none;
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
  font-size: inherit;
  font-weight: 600;
  padding: 0;
  font-family: inherit;
  transition: color 0.2s ease;
}

.link-button:hover {
  color: #2563eb;
  text-decoration: underline;
}

.link-button:focus {
  outline: 3px solid rgba(59,130,246,0.25);
  outline-offset: 2px;
  border-radius: 4px;
  padding: 2px 4px;
}

/* Feedback UI Styles */
/* Legacy text label styling - scoped to old span implementation to avoid conflicts */
.note-footer-actions span.note-feedback-sent {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--divider);
  border-radius: 6px;
  background: transparent;
  color: #111;
  font-style: italic;
  white-space: nowrap;
  display: inline-block;
}

.note-feedback-composer {
  padding: 12px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 6px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.feedback-label {
  margin: 0 0 8px 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #111;
}

.feedback-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.feedback-send-btn {
  margin-top: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1px solid var(--blue);
  background-color: var(--blue);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.feedback-send-btn:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

.feedback-send-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.feedback-error {
  margin: 8px 0 0 0;
  padding: 0;
  color: #dc2626;
  font-size: 0.85rem;
}

.note-active-feedback {
  padding: 12px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--divider);
  border-radius: 6px;
  margin: 12px 0 0 0;
}

.feedback-header {
  margin: 0 0 6px 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #111;
}

.feedback-text {
  margin: 0;
  font-size: 0.9rem;
  color: #111;
  line-height: 1.5;
  word-break: break-word;
}

