:root {
  --bg-overlay: rgba(44, 24, 16, 0.6);
  --bg-modal: #FDFBF7;
  --bg-panel: #FFFFFF;
  --text-primary: #2C1810;
  --text-secondary: #6D5E57;
  --brand-primary: #8D6E63;
  --brand-dark: #5D4037;
  --brand-accent: #A1887F;
  --border-color: #D7CCC8;
  --danger: #D32F2F;
  --success: #388E3C;
  --link: #0645AD;
  --input-bg: #FFFFFF;
  --paper: #f7f3e9;
  --ink: #222;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Lato", Arial, sans-serif;
}

.reading-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
}


.popup-text {
  padding: 20px;
}

.category-item {
    padding: 13px;

}

.popup-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  width: 600px;
  max-height: 80vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}


.popup-content::-webkit-scrollbar {
  width: 6px;
}

.popup-content::-webkit-scrollbar-track {
  background-color: transparent;
  margin-top: 20px;
  margin-bottom: 20px;
}

.popup-content::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 6px;
}

.popup-content::-webkit-scrollbar-button {
  display: none !important;
}

#titles-section {
  display: none;
  margin-top: 20px;
}


#reading-popup-text {
  margin-top: 20px;
  line-height: 1.6;
}

#reading-popup-text p {
  margin-bottom: 18px;
}

.clickable-word {
  cursor: pointer;
  position: relative;
  padding: 0 2px;
}



.readings-list {
  position: relative;
  padding-top: 44px;
}


.vb-masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto 0;
}

.vb-paper-name {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 54px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  display: flex;
  flex-direction: column;
}

.vb-paper-name img {
  height: 84px;
  width: auto;
  margin-top: 0;
}

.vb-paper-date,
.vb-paper-city,
.vb-paper-tag,
.vb-paper-issue {
  font-variant: small-caps;
  letter-spacing: .08em;
  opacity: .85;
}

.vb-masthead-left,
.vb-masthead-right {
  width: 180px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.page-header {
  max-width: 1100px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-header {
  max-width: 1100px;
  margin: 24px auto 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}


.reading-popup .popup-content {
  background: #fffefc;
  border: 1px solid #c8c2b3;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
  max-width: min(900px, 92vw);
  padding: 24px;
}


#reading-popup-text {
  max-width: 72ch;
  margin: 0 auto;
}

.vb-article {
  column-width: 28rem;
  column-gap: 2.2rem;
  column-rule: 1px solid #e0d9c8;
}

.vb-article h1,
.vb-article h2,
.vb-article h3 {
  column-span: all;
  font-family: var(--font-serif);
  margin: 0 0 .4em;
}

.vb-article p {
  text-align: justify;
  hyphens: auto;
}

.vb-article p:first-of-type::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 4.2rem;
  line-height: .8;
  padding: .10rem .45rem 0 0;
  margin: .1rem .4rem 0 0;
  background: linear-gradient(180deg, #111, #333);
  color: #fff;
  border-radius: 4px;
}

.clickable-word {
  position: relative;
  transition: background .15s ease;
}

.clickable-word:hover {
  background: #fff1b8;
}

.vb-mode-sentence .clickable-sentence:hover {
  background: #fff1b8;
  border-radius: 3px;
  transition: background-color 0.1s ease;
}

.vb-mode-sentence .clickable-sentence {
  position: relative;
}


.meaning-box {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--brand-dark);
  color: #fff;
  padding: 10px 14px;
  font-size: 0.95rem;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  white-space: normal;
  width: max-content;
  max-width: min(500px, 80vw);
  text-align: center;
  line-height: 1.4;
}

.vb-mode-toggle {
  display: inline-flex;
  border-radius: 20px;
  padding: 3px;
  margin-left: 15px;
  vertical-align: middle;
  border: 1px solid var(--brand-dark);
}

.vb-toggle-btn {
  border: none;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
  transition: all 0.2s ease;
}

.vb-toggle-btn.active {
  background: var(--brand-dark);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: bold;
}

.vb-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}


@media (max-width: 600px) {

  .vb-masthead {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .vb-masthead-left,
  .vb-masthead-right {
    width: 100%;
    text-align: center;
  }

  .vb-article {
    column-count: 1;
  }

}

.vb-empty {
  border: 1px dashed #c8c2b3;
  background: #fffefc;
  padding: 12px;
  border-radius: 6px;
  font-style: italic;
}

.vb-action-link {
  background: none;
  border: 0;
  padding: 0;
  margin-left: 12px;
  font-size: 1rem;
  cursor: pointer;
  font-family: var(--font-serif);
  font-variant: small-caps;
  letter-spacing: .06em;
  color: #222;
}

.vb-action-link::before {
  content: "✚";
  margin-right: .4rem;
}

.vb-action-link:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.vb-empty {
  border: 1px dashed #c8c2b3;
  background: #fffefc;
  padding: 12px;
  border-radius: 6px;
  font-style: italic;
}

.reading-popup .popup-content {
  background: #fffef7;
  border: 1px solid #c8c2b3;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .25);
  max-width: min(1020px, 100vw);
  border-radius: 12px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.reading-popup .popup-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}


.reading-popup .popup-content::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 26px;
  border-radius: 12px 0 0 12px;
  pointer-events: none;
  background: radial-gradient(120px 80px at -20px 50%, rgba(0, 0, 0, .12), rgba(0, 0, 0, 0));
  opacity: .55;
}

.vb-article-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid #c8c2b3;
  padding: 6px 0 10px;
  margin: -4px 0 14px;
  font-variant: small-caps;
}

.vb-article-header .vb-paper-name {
  font-family: var(--font-serif);
  font-weight: 900;
  letter-spacing: .04em;
}

.vb-article-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  margin: 4px 0 12px;
}

.vb-article {
  column-width: 28rem;
  column-gap: 2.2rem;
  column-rule: 1px solid #e0d9c8;
}

.vb-article p {
  text-align: justify;
  hyphens: auto;
}

.vb-article p:first-of-type::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 4.2rem;
  line-height: .8;
  padding: .10rem .45rem 0 0;
  margin: .1rem .4rem 0 0;
  background: linear-gradient(180deg, #111, #333);
  color: #fff;
  border-radius: 4px;
}

.analysis-status {
  text-align: center;
  padding: 15px;
  border-radius: 12px;
  margin: 15px auto;
  max-width: 300px;
  transition: opacity 0.3s ease;

}

.analysis-status.hidden {
  display: none;
}

.status-text {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  display: block;
  margin-bottom: 10px;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}


.loader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 16px;
}

.loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-dark);
  opacity: .25;
  animation: dotPulse 1.2s ease-in-out infinite;
}

.loader span:nth-child(2) {
  animation-delay: .2s;
}

.loader span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes dotPulse {

  0%,
  60%,
  100% {
    transform: scale(1);
    opacity: .25;
  }

  30% {
    transform: scale(1.6);
    opacity: 1;
  }
}

.dots.loader {
  display: inline-flex;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .loader span {
    animation: none;
    opacity: .6;
  }
}


.mcq-section {
  margin-top: 2rem;
  padding-top: 1rem;
}

.mcq-section h3 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  color: #333;
}

.mcq-question-block {
  margin-bottom: 2rem;
}

.mcq-question {
  font-weight: bold;
  margin-bottom: 1rem;
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mcq-option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.mcq-option-label:hover {
  background-color: #f7f7f7;
}

.mcq-option-label input[type="radio"] {
  flex-shrink: 0;
}

.mcq-option-label.correct {
  background-color: #e6f4ea;
  border-color: #34c759;
  font-weight: bold;
  color: #2d6b3d;
}

.mcq-option-label.incorrect {
  background-color: #fce8e6;
  border-color: #ea4335;
  color: #a5281b;
}



.custom-reading-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(40, 38, 34, 0.6);
  backdrop-filter: blur(20px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.custom-reading-modal.is-visible {
  display: flex;
}

.custom-modal-card {
  background: #fffef7;
  border: 1px solid #c8c2b3;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .25);
  border-radius: 12px;
  padding: 24px 32px;
  width: min(800px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.custom-modal-card * {
  font-family: var(--font-serif);

}

.custom-modal-header {
  border-bottom: 1px solid #c8c2b3;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.custom-modal-header h3 {
  margin: 0;
  font-weight: 900;
  font-variant: small-caps;
  letter-spacing: .06em;
  color: #222;
}

.custom-modal-label {
  display: block;
  margin-top: 8px;
  margin-bottom: 6px;
  font-variant: small-caps;
  letter-spacing: .06em;
  font-weight: 700;
  color: #222;
}

.custom-modal-input:focus,
.custom-modal-textarea:focus {
  outline: none;
}

.custom-modal-textarea {
  min-height: 260px;
  resize: vertical;
}

.custom-modal-error {
  color: #b00020;
  margin: 6px 0 0;
  min-height: 20px;
  font-style: italic;
}

.custom-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.custom-modal-btn {
  background: none;
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-variant: small-caps;
  letter-spacing: .06em;
  color: #222;
  transition: background-color 0.2s;
}

.custom-modal-btn:hover {
  background: #f0eadc;
}

.custom-modal-actions .custom-modal-btn:last-of-type {
  background: var(--brand-dark);
  color: #fffef7;
}


.custom-modal-input,
.custom-modal-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  background: #f9f6ee;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
  font-size: 16px;
  color: #222;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.custom-modal-textarea {
  min-height: 260px;
  resize: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.custom-modal-textarea::-webkit-scrollbar {
  display: none;
}