.level-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.level-tabs button b {
  font-size: 11px;
  font-weight: 600;
}

.reader-header,
.reader-layout {
  width: min(1380px, calc(100% - 48px));
}

.reader-layout {
  grid-template-columns: minmax(340px, 1fr) minmax(330px, 390px) minmax(210px, 245px);
  gap: clamp(24px, 3vw, 48px);
  overflow: hidden;
}

.phone {
  height: min(610px, calc(100dvh - 154px));
  min-height: 430px;
}

.reader-books {
  align-self: stretch;
  height: min(650px, calc(100dvh - 120px));
  min-width: 0;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid #bad7c8;
  border-radius: 20px;
  background: #d6eee1;
  color: #153f37;
}

@media (max-height: 820px) and (min-width: 851px) {
  .reader-layout {
    padding-block: 14px 24px;
  }

  .intro h1 {
    font-size: 52px;
  }

  .intro > p:last-child {
    margin-top: 11px;
  }

  .control-group {
    margin-top: 18px;
  }

  .choice-row,
  .primary-actions {
    margin-top: 10px;
  }

  .primary-actions button {
    height: 41px;
  }

  .phone {
    height: min(560px, calc(100dvh - 150px));
  }

  .reader-books {
    height: min(610px, calc(100dvh - 118px));
    padding: 18px;
  }

  .reader-books-intro h2 {
    margin-block: 8px;
    font-size: 28px;
  }

  .reader-books-intro p {
    font-size: 10px;
  }

  .reader-book-list {
    gap: 7px;
    margin: 14px 0 11px;
  }

  .reader-book {
    padding: 9px 11px;
  }

  .reader-book em {
    margin-top: 6px;
  }

}

.reader-books-intro > span {
  color: #f05d47;
  font: 500 9px 'DM Mono', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reader-books-intro h2 {
  margin: 12px 0 10px;
  font: 500 clamp(27px, 2.3vw, 35px)/.98 'DM Mono', monospace;
  letter-spacing: -.07em;
}

.reader-books-intro h2 em {
  color: #f05d47;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  letter-spacing: -.03em;
}

.reader-books-intro p {
  margin: 0;
  color: #58716b;
  font-size: 11px;
  line-height: 1.55;
}

.reader-book-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 16px;
}

.reader-book {
  display: block;
  padding: 12px 13px;
  border: 1px solid rgba(21, 63, 55, .18);
  border-radius: 9px;
  background: rgba(255, 255, 255, .5);
  color: #153f37;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.reader-book:hover,
.reader-book:focus-visible {
  transform: translateX(-3px);
  border-color: rgba(21, 63, 55, .28);
  background: rgba(255, 255, 255, .74);
}

.reader-book.active {
  border-color: #eca94c;
  background: rgba(255, 253, 248, .82);
  box-shadow: 3px 3px 0 rgba(236, 169, 76, .72);
}

.reader-book small,
.reader-book strong,
.reader-book em {
  display: block;
}

.reader-book small {
  color: #66807a;
  font: 500 8px 'DM Mono', monospace;
  text-transform: uppercase;
}

.reader-book strong {
  margin-top: 4px;
  font: 600 12px 'DM Mono', monospace;
}

.reader-book em {
  margin-top: 9px;
  color: #f05d47;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.reader-book.unavailable {
  cursor: default;
  opacity: .56;
}

.reader-book.unavailable:hover,
.reader-book.unavailable:focus-visible,
.reader-book.unavailable.active {
  transform: none;
  border-color: rgba(21, 63, 55, .18);
  background: rgba(255, 255, 255, .5);
  box-shadow: none;
}

@media (max-width: 1050px) and (min-width: 851px) {
  .reader-header,
  .reader-layout {
    width: min(100% - 28px, 1080px);
  }

  .reader-layout {
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 350px) 190px;
    gap: 18px;
  }

  .reader-books {
    padding: 14px;
  }

  .reader-books-intro h2 {
    font-size: 22px;
  }
}

@media (max-width: 850px) {
  .reader-header,
  .reader-layout {
    width: calc(100% - 24px);
  }

  .reader-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .reader-books {
    grid-row: 2;
    height: auto;
    min-height: 0;
    align-self: auto;
    display: grid;
    grid-template-columns: minmax(118px, .75fr) 2fr;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .reader-books-intro > span,
  .reader-books-intro p {
    display: none;
  }

  .reader-books-intro h2 {
    margin: 0;
    font-size: 17px;
  }

  .reader-book-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 0;
  }

  .reader-book {
    padding: 7px 6px;
    border-radius: 7px;
  }

  .reader-book:hover,
  .reader-book:focus-visible {
    transform: none;
  }

  .reader-book.active {
    box-shadow: 2px 2px 0 #eca94c;
  }

  .reader-book small {
    font-size: 6px;
  }

  .reader-book strong {
    margin-top: 2px;
    font-size: 8px;
  }

  .reader-book em {
    margin-top: 3px;
    font-size: 7px;
  }

  .device-stage {
    grid-row: 3;
    padding-bottom: 12px;
  }

  .phone {
    width: min(310px, calc(100% - 12px));
    height: calc(100% - 12px);
    min-height: 285px;
  }
}

@media (max-width: 520px) {
  .intro:after {
    content: '90 passages';
  }

  .level-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .reader-books {
    grid-template-columns: 90px 1fr;
  }

  .reader-books-intro h2 {
    font-size: 14px;
  }

  .device-stage {
    padding-bottom: 16px;
  }

  .phone {
    width: min(288px, calc(100% - 18px));
    height: calc(100% - 16px);
    min-height: 270px;
    border-radius: 25px;
  }
}

.practice-pack-card {
  margin-top: auto;
  padding: 12px 13px;
  border: 1px solid rgba(21, 63, 55, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .58);
}

.practice-pack-card > span,
.practice-pack-card > strong,
.practice-pack-card > small {
  display: block;
}

.practice-pack-card > span {
  color: #f05d47;
  font: 500 7px 'DM Mono', monospace;
  letter-spacing: .08em;
}

.practice-pack-card > strong {
  margin-top: 5px;
  font: 600 11px/1.3 'DM Mono', monospace;
}

.practice-pack-card > small {
  margin-top: 4px;
  color: #668079;
  font-size: 8px;
  line-height: 1.4;
}

.practice-pack-card button {
  width: 100%;
  margin-top: 9px;
  padding: 9px 8px;
  border: 0;
  border-radius: 6px;
  background: #153f37;
  color: white;
  font: 700 9px 'DM Sans', sans-serif;
  cursor: pointer;
}

.practice-pack-card button:hover {
  background: #20564b;
}

.pack-dialog {
  width: min(850px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fffdf8;
  color: #153f37;
  box-shadow: 4px 4px 0 #eca94c;
  overflow: auto;
}

.pack-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(245px, .85fr);
}

.pack-dialog::backdrop {
  background: rgba(21, 63, 55, .7);
  backdrop-filter: blur(3px);
}

.pack-dialog-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(21, 63, 55, .2);
  border-radius: 50%;
  background: #fffdf8;
  color: #153f37;
  font-size: 21px;
  cursor: pointer;
}

.pack-dialog-copy {
  padding: 34px 34px 28px;
}

.pack-dialog-copy > span,
.pack-payment > span {
  color: #f05d47;
  font: 500 8px 'DM Mono', monospace;
  letter-spacing: .09em;
}

.pack-dialog-copy h2 {
  margin: 12px 0 13px;
  font: 500 37px/.98 'DM Mono', monospace;
  letter-spacing: -.07em;
}

.pack-dialog-copy h2 em {
  color: #f05d47;
  font: 600 italic 1em 'Playfair Display', serif;
  letter-spacing: -.03em;
}

.pack-dialog-copy > p {
  color: #58716b;
  font-size: 12px;
  line-height: 1.55;
}

.pack-dialog-copy ul {
  margin: 18px 0;
  padding-left: 18px;
  color: #4f6963;
  font-size: 11px;
  line-height: 1.75;
}

.pack-price {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e6d8ce;
}

.pack-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 16px;
}

.pack-choice button {
  position: relative;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #ddd6ca;
  border-radius: 7px;
  background: #fff;
  color: #58716b;
  text-align: left;
  cursor: pointer;
}

.pack-choice button strong,
.pack-choice button small {
  display: block;
}

.pack-choice button strong {
  color: #153f37;
  font-size: 10px;
}

.pack-choice button small {
  margin-top: 2px;
  font-size: 8px;
}

.pack-choice button em {
  position: absolute;
  right: 7px;
  top: 7px;
  color: #f05d47;
  font: 500 7px 'DM Mono', monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pack-choice button.active {
  border-color: #eca94c;
  background: #fff8e7;
  box-shadow: 2px 2px 0 rgba(236, 169, 76, .48);
}

.pack-price > strong {
  font: 500 29px 'DM Mono', monospace;
}

.pack-price > span {
  color: #71857f;
  font-size: 8px;
  line-height: 1.5;
}

.pack-price b {
  color: #153f37;
}

.pack-whatsapp {
  display: block;
  width: max-content;
  margin-left: auto;
  margin-top: 16px;
  color: #153f37;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  text-decoration: none;
}

.pack-payment {
  padding: 34px 28px 25px;
  background: #d6eee1;
  text-align: center;
}

.pack-payment img {
  display: block;
  width: min(230px, 100%);
  max-height: 320px;
  margin: 14px auto 10px;
  object-fit: contain;
  background: white;
}

.pack-payment > strong {
  display: block;
  font: 600 12px 'DM Mono', monospace;
}

.pack-payment .selected-pack {
  margin-top: 8px;
  color: #f05d47;
  font-size: 9px;
}

.pack-payment > p {
  margin: 8px auto 0;
  max-width: 260px;
  color: #58716b;
  font-size: 9px;
  line-height: 1.5;
}

.payment-whatsapp {
  display: inline-block;
  margin-top: 9px;
  padding: 7px 10px;
  border-radius: 4px;
  background: #153f37;
  color: white;
  font: 600 8px 'DM Sans', sans-serif;
  text-decoration: none;
}

@media (max-height: 760px) and (min-width: 851px) {
  .practice-pack-card {
    padding: 8px 10px;
  }

  .practice-pack-card > small {
    display: none;
  }

  .practice-pack-card button {
    margin-top: 6px;
    padding-block: 7px;
  }
}

@media (max-width: 850px) {
  .reader-books {
    grid-template-columns: minmax(100px, .65fr) minmax(0, 1.45fr) minmax(130px, .9fr);
    align-items: center;
  }

  .practice-pack-card {
    margin: 0;
    padding: 7px;
  }

  .practice-pack-card > span,
  .practice-pack-card > small {
    display: none;
  }

  .practice-pack-card > strong {
    margin: 0;
    font-size: 8px;
  }

  .practice-pack-card button {
    margin-top: 5px;
    padding: 6px 5px;
    font-size: 7px;
  }
}

@media (max-width: 620px) {
  .reader-books {
    grid-template-columns: 78px minmax(0, 1fr) 105px;
  }

  .pack-dialog[open] {
    display: block;
  }

  .pack-dialog-copy,
  .pack-payment {
    padding: 26px 20px 22px;
  }

  .pack-dialog-copy h2 {
    font-size: 29px;
  }

  .pack-payment img {
    width: min(260px, 85%);
  }
}

@media (min-width: 621px) {
  .pack-dialog {
    width: min(820px, calc(100% - 32px));
    max-height: calc(100dvh - 24px);
    overflow: hidden;
  }

  .pack-dialog[open] {
    grid-template-columns: minmax(0, 1fr) 215px;
  }

  .pack-dialog-copy {
    padding: 22px 24px 18px;
  }

  .pack-dialog-copy h2 {
    margin: 8px 0 12px;
    font-size: 30px;
  }

  .pack-feature-grid {
    gap: 6px;
  }

  .pack-feature-grid article {
    gap: 7px;
    padding: 7px;
  }

  .pack-feature-grid i {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .pack-choice {
    gap: 6px;
    margin-top: 10px;
  }

  .pack-choice button {
    min-height: 40px;
    padding: 6px 8px;
  }

  .pack-price {
    margin: 10px 0 7px;
  }

  .pack-price > strong {
    font-size: 24px;
  }

  .pack-payment {
    padding: 22px 16px 18px;
    overflow: hidden;
  }

  .pack-payment img {
    width: min(190px, 100%);
    max-height: 245px;
    margin: 10px auto 8px;
  }

  .pack-payment > p {
    font-size: 8px;
    line-height: 1.4;
  }
}

@media (min-width: 851px) {
  .reader-books {
    padding: 18px;
    overflow: hidden;
  }

  .reader-books-intro h2 {
    margin: 8px 0;
    font-size: clamp(25px, 2vw, 30px);
  }

  .reader-books-intro p {
    font-size: 10px;
    line-height: 1.45;
  }

  .reader-book-list {
    gap: 6px;
    margin: 13px 0 9px;
  }

  .reader-book {
    padding: 8px 10px;
  }

  .reader-book strong {
    margin-top: 2px;
    font-size: 11px;
  }

  .reader-book em {
    margin-top: 5px;
    font-size: 8px;
  }

  .practice-pack-card {
    flex: 0 0 auto;
    max-width: 100%;
    padding: 8px 10px;
  }

  .practice-pack-card > strong {
    margin-top: 3px;
    font-size: 10px;
  }

  .practice-pack-card > small {
    margin-top: 2px;
    line-height: 1.25;
  }

  .practice-pack-card button {
    margin-top: 6px;
    padding: 7px 6px;
  }
}

@media (max-height: 860px) and (min-width: 851px) {
  .practice-pack-card > small {
    display: none;
  }
}

.reader-path-label {
  display: block;
  margin-top: 17px;
  color: #668079;
  font: 500 7px 'DM Mono', monospace;
  letter-spacing: .09em;
}

.sheet-preview {
  position: relative;
  width: 50px;
  height: 58px;
}

.sheet-preview i {
  position: absolute;
  width: 39px;
  height: 49px;
  border: 1px solid #cbbfae;
  background: #fffdf8;
  box-shadow: 1px 2px 0 rgba(21, 63, 55, .08);
}

.sheet-preview i:nth-child(1) {
  left: 0;
  top: 8px;
  transform: rotate(-6deg);
}

.sheet-preview i:nth-child(2) {
  left: 6px;
  top: 4px;
  transform: rotate(2deg);
}

.sheet-preview i:nth-child(3) {
  left: 10px;
  top: 0;
  border-top: 4px solid #f05d47;
  background: repeating-linear-gradient(to bottom,#fffdf8 0,#fffdf8 8px,#dfe8e2 9px,#fffdf8 10px);
}

.practice-pack-copy > span,
.practice-pack-copy > strong,
.practice-pack-copy > small {
  display: block;
}

.practice-pack-copy > span {
  color: #f05d47;
  font: 500 7px 'DM Mono', monospace;
  letter-spacing: .08em;
}

.practice-pack-copy > strong {
  margin-top: 4px;
  font: 600 10px/1.3 'DM Mono', monospace;
}

.practice-pack-copy > small {
  margin-top: 3px;
  color: #668079;
  font-size: 7px;
  line-height: 1.35;
}

@media (min-width: 851px) {
  .reader-book-list {
    position: relative;
    gap: 5px;
    margin: 6px 0 11px;
    padding-left: 12px;
  }

  .reader-book-list::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: rgba(21, 63, 55, .22);
  }

  .reader-book {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 43px;
    padding: 7px 9px;
  }

  .reader-book::before {
    content: '';
    position: absolute;
    left: -15px;
    width: 6px;
    height: 6px;
    border: 2px solid #d6eee1;
    border-radius: 50%;
    background: #668079;
  }

  .reader-book.active::before {
    background: #f05d47;
  }

  .reader-book strong,
  .reader-book em {
    margin: 0;
  }

  .reader-book em {
    max-width: 68px;
    text-align: right;
    line-height: 1.25;
  }

  .practice-pack-card {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    column-gap: 9px;
    padding: 10px;
    border-style: dashed;
    background: rgba(255, 253, 248, .78);
    box-shadow: 3px 3px 0 rgba(236, 169, 76, .55);
  }

  .practice-pack-card button {
    grid-column: 1 / -1;
    margin-top: 7px;
  }
}

@media (max-height: 860px) and (min-width: 851px) {
  .reader-path-label {
    margin-top: 10px;
  }

  .practice-pack-copy > small {
    display: none;
  }
}

@media (max-width: 850px) {
  .reader-path-label,
  .sheet-preview,
  .practice-pack-copy > span,
  .practice-pack-copy > small {
    display: none;
  }

  .practice-pack-copy > strong {
    margin: 0;
    font-size: 8px;
  }
}

.pack-dialog-copy .pack-summary {
  max-width: 430px;
  margin-bottom: 15px;
}

.pack-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 17px;
}

.pack-feature-grid article {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e4ddd1;
  border-radius: 8px;
  background: #fffaf0;
}

.pack-feature-grid i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d6eee1;
  color: #153f37;
  font: 600 9px 'DM Mono', monospace;
  font-style: normal;
}

.pack-feature-grid article:nth-child(2n) i {
  background: #f8e8c9;
}

.pack-feature-grid strong,
.pack-feature-grid small {
  display: block;
}

.pack-feature-grid strong {
  font: 600 9px/1.25 'DM Mono', monospace;
}

.pack-feature-grid small {
  margin-top: 2px;
  color: #71857f;
  font-size: 7px;
  line-height: 1.3;
}

@media (max-width: 460px) {
  .pack-feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Keep the practice device compact and leave the product rail room to breathe. */
@media (min-width: 1051px) {
  .reader-layout {
    grid-template-columns: minmax(340px, 1fr) minmax(300px, 350px) minmax(210px, 240px);
    gap: clamp(26px, 2.5vw, 42px);
    padding-bottom: 32px;
  }

  .phone {
    width: min(350px, 100%);
    height: min(590px, calc(100dvh - 170px));
    min-height: 410px;
    margin-bottom: 24px;
    box-shadow: 6px 8px 0 rgba(232, 180, 164, .72);
  }

  .reader-books {
    height: min(620px, calc(100dvh - 150px));
    min-height: 410px;
    margin-left: 14px;
    margin-bottom: 24px;
  }
}
