.mc {
  --mc-navy: #102634;
  --mc-paper: #f8f2e5;
  --mc-white: #fffdf7;
  --mc-ink: #172d3a;
  --mc-muted: #4f5960;
  --mc-line: #d6c9b2;
  --mc-gold: #ecc27e;
  --mc-wine: #682a40;
  background: var(--mc-paper);
  color: var(--mc-ink);
  font-size: 1rem;
  line-height: 1.6;
}

.mc h1, .mc h2, .mc h3 {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.12;
  text-wrap: balance;
}

.mc h2 { font-size: clamp(2rem, 4vw, 3.5rem); margin: 0 0 .8rem; font-weight: 500; }
.mc h3 { font-size: clamp(1.25rem, 2.3vw, 1.65rem); margin: 0 0 .65rem; }
.mc p { margin-block: 0 1rem; }
.mc :focus-visible, .mc-dialog :focus-visible { outline: 3px solid #97512b; outline-offset: 4px; }
.mc-hero :focus-visible, .mc-dialog .mc-tools :focus-visible { outline-color: var(--mc-gold); }
.mc a:not(.mc-button):not([data-mc-enlarge]) { text-decoration: underline; text-underline-offset: .2em; }
.mc-path { display: flex; gap: .5rem; flex-wrap: wrap; padding-block: .9rem; color: var(--mc-muted); font-size: .875rem; }

.mc-hero {
  color: var(--mc-paper);
  background:
    repeating-linear-gradient(90deg, transparent 0 71px, #f3d49a09 71px 72px),
    radial-gradient(ellipse at 78% 44%, #264455 0%, var(--mc-navy) 64%);
  border-block: 1px solid #3c4d50;
}

.mc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1.4rem; }
.mc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: .4rem;
  padding: .55rem 1rem;
  background: var(--mc-navy);
  color: var(--mc-paper);
  font: inherit;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
}
.mc-button:hover { background: #2a4555; }
.mc-button[disabled] { cursor: default; opacity: .5; }
.mc-button[hidden] { display: none; }
.mc-button.mc-outline { background: transparent; color: var(--mc-ink); border-color: #78848b; }
.mc-button.mc-outline:hover { background: #efe5d2; }

.mc-section { padding-block: clamp(2.75rem, 6vw, 5rem); }
#muestra.mc-section { scroll-margin-top: 5.5rem; }
.mc-section + .mc-section { border-top: 1px solid var(--mc-line); }
.mc-section p { max-width: 65ch; }
.mc-levels { margin: 1.2rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.mc-levels li { border: 1px solid var(--mc-line); background: var(--mc-white); border-radius: .25rem; font-size: .875rem; padding: .22rem .55rem; }
.mc-case-list { display: grid; gap: 1.1rem; }
.mc-sample { margin: 0; min-width: 0; background: var(--mc-white); border: 1px solid var(--mc-line); border-radius: .55rem; padding: clamp(.8rem, 2vw, 1.25rem); }
.mc-sample p { color: var(--mc-muted); font-size: .875rem; margin-bottom: .65rem; }
.mc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.mc-sheet { display: block; color: var(--mc-ink); text-align: center; font-weight: 700; font-size: .875rem; }
.mc-sheet img { display: block; width: 100%; height: auto; border: 1px solid var(--mc-line); border-radius: .25rem; margin-bottom: .45rem; }
.mc-sheet:hover { text-decoration: underline; text-underline-offset: .2em; }
.mc-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); }
.mc-bottom article { padding: clamp(1.2rem, 3vw, 2.2rem); border: 1px solid var(--mc-line); border-radius: .5rem; background: var(--mc-white); }
.mc-bottom h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }

.mc-hero .mc-reader-wrap { padding-block: clamp(.95rem, 3.2vw, 2.5rem); }
.mc-back-book { display: inline-flex; align-items: center; min-height: 44px; color: #f3d593; font-weight: 700; margin-bottom: .25rem; }
.mc-reader-intro h1 { font-size: clamp(2.7rem, 5.3vw, 4.6rem); font-weight: 500; margin: 0 0 .75rem; letter-spacing: -.045em; }
.mc-reader-intro p { max-width: 55ch; color: #eceadf; }
.mc-reader-intro .mc-spoiler { color: var(--mc-gold); font-size: .875rem; margin-bottom: 0; }
.mc-layout { display: grid; grid-template-columns: minmax(13rem, .34fr) minmax(0, 1fr); align-items: start; gap: clamp(1rem, 4vw, 2.7rem); padding-block: clamp(1.2rem, 4vw, 2.7rem) 3rem; }
.mc-layout[hidden], .mc-stage img[hidden] { display: none; }
.mc-controls, .mc-stage { border: 1px solid var(--mc-line); border-radius: .55rem; background: var(--mc-white); padding: clamp(.95rem, 2.7vw, 1.65rem); }
.mc-controls { position: sticky; top: 1rem; }
.mc-controls label { font-weight: 750; display: block; margin-bottom: .45rem; }
.mc-controls select { appearance: none; width: 100%; min-height: 46px; padding: .45rem 2.5rem .45rem .7rem; color: var(--mc-ink); background: var(--mc-paper); border: 1px solid #78848b; border-radius: .4rem; font: inherit; cursor: pointer; }
.mc-select { position: relative; }
.mc-select::after { content: ''; position: absolute; width: .55rem; height: .55rem; border-right: 2px solid var(--mc-ink); border-bottom: 2px solid var(--mc-ink); right: 1rem; top: 16px; transform: rotate(45deg); pointer-events: none; }
.mc-paging { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-block: .7rem 1rem; }
.mc-download { display: flex; flex-direction: column; gap: .45rem; }
.mc-download p { color: var(--mc-muted); font-size: .875rem; margin: 0; }
.mc-stage { min-width: 0; }
.mc-stage-header { display: flex; flex-wrap: wrap; gap: .5rem .8rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.mc-stage h2 { font-size: clamp(1.55rem, 3vw, 2.5rem); margin: 0; }
.mc-stage img { display: block; width: 100%; height: auto; border: 1px solid var(--mc-line); }
.mc-stage .mc-page-link { display: inline-block; line-height: 1.5; margin-top: .85rem; }
.mc-status:empty, [data-mc-deduction-status]:empty, [data-mc-deduction-steps]:empty { display: none; }
.mc-retry { margin-bottom: .7rem; }
.mc-deduction { background: #f7eddb; border: 1px solid #d6c29f; border-radius: .4rem; margin-bottom: 1rem; }
.mc-deduction summary { cursor: pointer; padding: .7rem .9rem; color: #662b3e; font-weight: 800; min-height: 44px; }
.mc-deduction[open] summary { border-bottom: 1px solid #d6c29f; }
.mc-deduction > div { padding: .85rem clamp(.8rem, 2.3vw, 1.4rem); }
.mc-deduction > div > p { margin: 0; }
.mc-deduction ol { margin: 0; padding-inline-start: 1.35rem; max-width: 65ch; }
.mc-deduction li { padding-inline-start: .25rem; line-height: 1.7; }
.mc-deduction li + li { margin-top: .55rem; }
.mc-deduction li::marker { font-weight: 800; color: #662b3e; }
.mc-no-js { padding-block: 1.6rem 3rem; }

.mc-dialog {
  --mc-navy: #102634;
  --mc-paper: #f8f2e5;
  --mc-gold: #ecc27e;
  width: min(95vw, 70rem);
  max-width: none;
  max-height: 94dvh;
  margin: auto;
  background: var(--mc-paper);
  color: var(--mc-navy);
  padding: 0;
  border: 1px solid #beb399;
  border-radius: .55rem;
  overflow: hidden;
}
.mc-dialog::backdrop { background: #08151dd9; }
.mc-dialog .mc-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; background: var(--mc-navy); color: var(--mc-paper); padding: .55rem .75rem; }
.mc-tools h2 { font: 700 1rem/1.25 Georgia, serif; margin: 0; flex: 1 1 10rem; }
.mc-tools form { margin: 0; }
.mc-zoom { display: flex; align-items: center; gap: .32rem; }
.mc-zoom output { min-width: 3.2rem; text-align: center; font-size: .875rem; }
.mc-tools button { background: transparent; color: var(--mc-paper); font: inherit; font-size: .92rem; padding-inline: .5rem; border: 1px solid #f8f2e580; border-radius: .3rem; min-width: 44px; min-height: 44px; cursor: pointer; }
.mc-tools button:hover { background: #f8f2e522; }
.mc-tools button:disabled { opacity: .5; cursor: default; }
.mc-viewport { max-height: 76dvh; overflow: auto; padding: .55rem; overscroll-behavior: contain; }
.mc-viewport img { display: block; width: var(--mc-zoom, 100%); height: auto; max-width: none; margin-inline: auto; }

.mc-shelf { background: #f4efdf; }
.mc-shelf .featured-image { background: #e3d7bf; }
.mc-shelf-links { scroll-margin-top: 6.5rem; margin-top: 1.25rem; padding: 1rem 0 0; border-top: 1px solid var(--line); }
.mc-shelf-links h3 { margin: 0 0 .45rem; font-size: 1rem; }
.mc-shelf-links > div { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.mc-shelf-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: .2em; }
.mc-other-books { margin-bottom: 2rem; }
.mc-other-books h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.mc-other-books a { font-size: inherit; text-decoration: underline; text-underline-offset: .2em; }

@media (max-width: 740px) {
  .mc-bottom, .mc-layout { grid-template-columns: minmax(0, 1fr); }
  .mc-controls { position: static; }
  .mc-pair { gap: .5rem; }
  .mc-stage-header { align-items: flex-start; }
}

@media (max-width: 660px) {
  .mc-dialog:modal { display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .mc-tools h2 { flex-basis: 100%; }
  .mc-viewport { max-height: none; padding: .25rem; }
}
