/*
 * Online Seder 3.0 — local professional-design study.
 *
 * This layer intentionally leaves the application's behavioral DOM intact.
 * It turns the existing roots into an action-first beit midrash: the active
 * corpus is visible in the first viewport, modes live in a permanent rail,
 * and advanced tools continue to appear only when their workflow needs them.
 */

.design-vnext {
  --vnext-brand: #174d47;
  --vnext-gold: #c28a36;
  --vnext-gold-bright: #e1b452;
  --vnext-paper: #fffdf8;
  --vnext-cream: #f6f1e8;
  --vnext-ink: #182d2b;
  --vnext-muted: #586b67;
  --vnext-line: #d8cfbf;
  --vnext-accent: #275f6b;
  --vnext-canvas: #eaf2f2;
  --vnext-canvas-deep: #dbe9e9;
  --vnext-surface: #f7fbf9;
  --vnext-surface-deep: #e7f1ed;
  --vnext-focus: #c28a36;
  --vnext-control-radius: 12px;
  --vnext-panel-radius: 22px;
  --vnext-major-radius: 28px;
  --vnext-shadow: 0 12px 34px rgba(34, 45, 39, .08);
  --vnext-float-shadow: 0 24px 58px rgba(25, 38, 34, .17);
  min-height: 100svh;
  background:
    radial-gradient(circle at 84% 4%, rgba(255, 255, 255, .82), transparent 29rem),
    radial-gradient(circle at 9% 96%, rgba(39, 95, 107, .09), transparent 31rem),
    linear-gradient(135deg, var(--vnext-canvas), var(--vnext-canvas-deep));
  transition: background-color 220ms ease, color 220ms ease;
}

.design-vnext:not(.progress-mode-active).learn-mode-active:not(.chavruta-mode-active) {
  --vnext-accent: #2f6f66;
  --vnext-canvas: #edf5f2;
  --vnext-canvas-deep: #dceae5;
  --vnext-surface: #f4faf7;
  --vnext-surface-deep: #e6f1ec;
  --vnext-focus: #b98632;
}

.design-vnext:not(.progress-mode-active).deck-mode-active {
  --vnext-accent: #466b8d;
  --vnext-canvas: #eef3f8;
  --vnext-canvas-deep: #dfe8f1;
  --vnext-surface: #f4f8fc;
  --vnext-surface-deep: #e5edf5;
  --vnext-focus: #567b9d;
}

.design-vnext:not(.progress-mode-active):has(#modeHero[data-mode="quiz"]) {
  --vnext-accent: #8b5059;
  --vnext-canvas: #f8f0f1;
  --vnext-canvas-deep: #ecdee1;
  --vnext-surface: #fcf6f6;
  --vnext-surface-deep: #f1e5e7;
  --vnext-focus: #a05f67;
}

.design-vnext:not(.progress-mode-active).chavruta-mode-active {
  --vnext-accent: #745371;
  --vnext-canvas: #f6f0f6;
  --vnext-canvas-deep: #e9deeb;
  --vnext-surface: #fbf7fb;
  --vnext-surface-deep: #eee4ef;
  --vnext-focus: #8c6888;
}

.design-vnext:not(.progress-mode-active):has(#modeHero[data-mode="print"]) {
  --vnext-accent: #276454;
  --vnext-canvas: #eef5f0;
  --vnext-canvas-deep: #dce9e0;
  --vnext-surface: #f5faf6;
  --vnext-surface-deep: #e4efe7;
  --vnext-focus: #337766;
}

.design-vnext:not(.progress-mode-active) {
  color: var(--vnext-ink);
}

.design-vnext :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--vnext-focus);
  outline-offset: 3px;
}

.design-vnext [tabindex="-1"]:focus {
  outline: 0;
}

.design-vnext :is(h1, h2, h3, h4, p, strong, small, span, button, a, label) {
  min-width: 0;
}

.design-vnext :is(h1, h2, h3, h4, p, button, a, label) {
  overflow-wrap: break-word;
  word-break: normal;
}

.design-vnext .eyebrow {
  color: #875817;
}

.design-vnext .library-wall {
  opacity: .12;
  filter: saturate(.5);
}

.design-vnext .library-wall::before,
.design-vnext .library-wall::after {
  opacity: .62;
}

.design-vnext .app-shell {
  position: relative;
  display: grid;
  width: min(1540px, calc(100% - 24px));
  grid-template-columns: 92px minmax(0, 1fr);
  grid-auto-flow: row;
  column-gap: 18px;
  row-gap: 14px;
  margin: 12px auto 42px;
}

.design-vnext .topbar {
  position: sticky;
  top: 0;
  z-index: 110;
  grid-column: 1 / -1;
  min-height: 64px;
  padding: 5px 14px;
  border-color: rgba(216, 207, 191, .72);
  border-radius: 20px;
  background: rgba(255, 253, 248, .9);
  box-shadow: 0 8px 26px rgba(34, 45, 39, .07);
  backdrop-filter: blur(22px) saturate(1.18);
}

.design-vnext .brand-motion {
  width: 160px;
  height: 54px;
}

.design-vnext .brand-orbit {
  bottom: 21px;
}

.design-vnext .brand-letter {
  width: 32px;
  height: 32px;
}

.design-vnext .brand-wordmark strong {
  font-size: 15px;
}

.design-vnext .brand-wordmark small {
  font-size: 8px;
}

.design-vnext .topbar-actions {
  gap: 8px;
}

.design-vnext .local-badge {
  display: none;
}

.design-vnext .personal-library-shortcuts {
  min-height: 42px;
  padding: 3px;
  border: 1px solid rgba(23, 77, 71, .15);
  border-radius: 999px;
  background: rgba(230, 240, 236, .64);
}

.design-vnext .personal-library-shortcuts button {
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 999px;
}

.design-vnext .theme-picker,
.design-vnext .account-button,
.design-vnext .icon-button,
.design-vnext .owner-review-link {
  min-height: 42px;
}

.design-vnext .mode-switcher {
  position: sticky;
  top: 78px;
  z-index: 90;
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1fr;
  align-self: start;
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(216, 207, 191, .7);
  border-radius: 22px;
  background: rgba(255, 253, 248, .82);
  box-shadow: 0 10px 30px rgba(34, 45, 39, .06);
  backdrop-filter: blur(18px);
}

.design-vnext .mode-button,
.design-vnext .mode-button[data-mode="learn"],
.design-vnext .mode-button[data-mode="learn"].active {
  position: relative;
  display: grid;
  min-height: 72px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 8px 4px;
  color: var(--vnext-muted);
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: none;
}

.design-vnext .mode-button:hover,
.design-vnext .mode-button[data-mode="learn"]:hover {
  color: var(--vnext-ink);
  border-color: rgba(23, 77, 71, .12);
  background: rgba(255, 253, 248, .9);
  box-shadow: 0 8px 18px rgba(34, 45, 39, .08);
  transform: translateY(-1px);
}

.design-vnext .mode-button.active,
.design-vnext .mode-button[data-mode="learn"].active {
  color: #fffdf8;
  border-color: #d5ad58;
  background: var(--vnext-accent);
  box-shadow: 0 9px 21px color-mix(in srgb, var(--vnext-accent) 25%, transparent),
    inset 0 0 0 1px rgba(255, 246, 218, .22);
  transform: none;
}

.design-vnext .mode-button .mode-icon,
.design-vnext .mode-switcher .mode-icon {
  width: 36px;
  height: 36px;
  border-width: 1.5px;
  border-radius: 11px;
}

.design-vnext .mode-button.active .mode-icon {
  color: #ffe4a0;
  border-color: currentColor;
  background: rgba(255, 255, 255, .06);
}

.design-vnext .mode-button strong {
  font-size: 10px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: .015em;
}

.design-vnext .mode-button small {
  display: none;
}

.design-vnext .mode-new-badge {
  top: 6px;
  right: 5px;
  bottom: auto;
  left: auto;
  min-width: 0;
  padding: 2px 5px;
  border-width: 1px;
  font-size: 7px;
  transform: none;
}

.design-vnext > .learn-launch-overlay,
.design-vnext > .chavruta-media-stage {
  grid-column: auto;
}

.design-vnext .app-shell > :is(
  .trial-banner,
  .hero,
  .mode-daf-library,
  .learn-library,
  .workspace,
  .quiz-panel,
  .site-footer
) {
  grid-column: 2;
}

.design-vnext .app-shell > .trial-banner {
  grid-column: 1 / -1;
  position: absolute;
  top: 80px;
  right: 0;
  left: 110px;
  z-index: 88;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 13px;
  box-shadow: 0 6px 18px rgba(44, 42, 36, .07);
  font-size: 12px;
  line-height: 1.25;
}

.design-vnext:has(#trialBanner:not(.hidden)) :is(.learn-library, .mode-daf-library, .quiz-panel) {
  margin-top: 55px;
}

.design-vnext .trial-banner strong,
.design-vnext .trial-banner button {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow-wrap: normal;
}

.design-vnext .trial-banner > span {
  flex: 1 1 auto;
}

/* The product itself replaces the promotional Learn banner. */
.design-vnext.learn-mode-active:not(.chavruta-mode-active):not(.learn-workspace-open) #modeHero[data-mode="learn"] {
  display: none;
}

/* The live product is the opening composition in every mode. Marketing-style
   banners only delayed the objects people came here to use. */
.design-vnext .hero {
  display: none !important;
}

.design-vnext .hero::before {
  opacity: .15;
}

.design-vnext .hero-copy {
  max-width: none;
}

.design-vnext .hero .eyebrow,
.design-vnext .hero[data-mode] .eyebrow {
  color: var(--vnext-accent);
  font-size: 11px;
}

.design-vnext .hero h1 {
  max-width: 24ch;
  margin: 0;
  color: var(--vnext-ink);
  font-size: clamp(34px, 3.4vw, 48px);
  line-height: 1.02;
}

.design-vnext .hero-pills,
.design-vnext .hero-copy > p:not(.eyebrow) {
  display: none;
}

.design-vnext .hero :is(.hero-books, .learn-hero-mark, .quiz-hero-mark, .chavruta-hero-mark) {
  position: relative;
  right: auto;
  bottom: auto;
  display: none;
  width: 150px;
  height: 94px;
  justify-self: end;
  margin: 0;
  opacity: .72;
  transform: scale(.65);
  transform-origin: center;
}

.design-vnext .hero[data-mode="deck"] .hero-books,
.design-vnext .hero[data-mode="quiz"] .quiz-hero-mark,
.design-vnext .hero[data-mode="chavruta"] .chavruta-hero-mark {
  display: block;
}

/* Learn launchpad */
.design-vnext .learn-library {
  display: grid;
  min-height: calc(100svh - 92px);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "masthead"
    "navigation"
    "books"
    "recent"
    "status";
  align-content: start;
  gap: 18px 26px;
  margin: 0;
  padding: clamp(24px, 2.8vw, 40px);
  overflow: clip;
  border: 1px solid rgba(216, 207, 191, .74);
  border-radius: var(--vnext-major-radius);
  background:
    radial-gradient(circle at 95% 0, rgba(194, 138, 54, .1), transparent 23rem),
    linear-gradient(145deg, color-mix(in srgb, var(--vnext-surface) 96%, white), var(--vnext-surface-deep));
  box-shadow: var(--vnext-shadow);
}

.design-vnext .learn-library::before {
  top: -330px;
  right: -250px;
  opacity: .55;
}

.design-vnext .learn-library::after {
  display: none;
}

.design-vnext .learn-library-masthead {
  grid-area: masthead;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin: 0;
  padding-bottom: 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--vnext-line) 74%, transparent);
}

.design-vnext .learn-library-title h2 {
  max-width: 20ch;
  padding: 0;
  color: var(--vnext-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(39px, 4.2vw, 58px);
  font-weight: 500;
  line-height: 1.02;
  text-wrap: balance;
}

.design-vnext .learn-library-title > p:last-child {
  max-width: 64ch;
  margin-top: 8px;
  color: var(--vnext-muted);
  font-size: 16px;
  line-height: 1.45;
}

.design-vnext .learn-library-masthead > .hero-daf-yomi {
  display: flex;
  min-width: 230px;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 11px 13px 11px 18px;
  color: #fffdf8;
  border: 1px solid color-mix(in srgb, var(--vnext-accent) 80%, #fff);
  border-radius: 18px;
  background: var(--vnext-accent);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--vnext-accent) 24%, transparent);
  text-align: left;
}

.design-vnext .learn-library-masthead > .hero-daf-yomi:hover {
  box-shadow: 0 16px 30px color-mix(in srgb, var(--vnext-accent) 31%, transparent);
  transform: translateY(-2px);
}

.design-vnext .hero-daf-yomi small {
  color: #f1cf84;
  font-size: 9px;
  letter-spacing: .13em;
}

.design-vnext .hero-daf-yomi strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 600;
}

.design-vnext .hero-daf-yomi-arrow {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #173833;
  border-radius: 50%;
  background: #f0c660;
  font-size: 21px;
}

.design-vnext .learn-library:has(#learnCollectionChooser:not(.hidden)) .learn-library-score {
  display: none !important;
}

.design-vnext .learn-library:has(#learnCollectionChooser.hidden) .hero-daf-yomi {
  display: none !important;
}

.design-vnext .learn-library-score {
  min-width: 230px;
  flex-basis: auto;
  padding: 13px 16px;
  border-radius: 17px;
  box-shadow: none;
}

.design-vnext .learn-library-navigation {
  grid-area: navigation;
  margin: 0;
}

.design-vnext .learn-library-stage {
  grid-area: books;
  min-width: 0;
  min-height: 0;
  padding: 0;
}

.design-vnext .learn-collection-chooser {
  display: grid;
  min-height: 0;
  align-content: start;
}

.design-vnext .learning-source-grid-root,
.design-vnext .learning-source-grid-divisions {
  display: grid;
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}

.design-vnext .learning-source-card {
  min-width: 0;
}

.design-vnext .learning-source-grid-root .learning-source-card,
.design-vnext .learning-source-grid-divisions .learning-source-card {
  min-height: clamp(246px, 32vh, 304px);
  align-content: end;
  padding: 24px clamp(16px, 1.8vw, 26px);
  border-width: 1px 1px 1px 10px;
  border-radius: 8px 28px 28px 8px;
  box-shadow:
    inset 5px 0 0 rgba(255, 255, 255, .1),
    9px 12px 0 color-mix(in srgb, currentColor 13%, var(--vnext-line)),
    0 22px 35px rgba(44, 42, 36, .15);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.design-vnext .learning-source-grid-root .learning-source-card:hover,
.design-vnext .learning-source-grid-root .learning-source-card:focus-visible,
.design-vnext .learning-source-grid-divisions .learning-source-card:hover,
.design-vnext .learning-source-grid-divisions .learning-source-card:focus-visible {
  filter: saturate(1.08) brightness(1.03);
  box-shadow:
    inset 5px 0 0 rgba(255, 255, 255, .14),
    10px 14px 0 color-mix(in srgb, currentColor 15%, var(--vnext-line)),
    0 28px 42px rgba(44, 42, 36, .2);
  transform: translateY(-6px) rotate(-.35deg);
}

.design-vnext .learning-source-book-symbol {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 248, 224, .32);
  border-radius: 50%;
  background: rgba(11, 34, 31, .18);
  font-size: 24px;
}

.design-vnext .learning-source-hebrew {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.design-vnext .learning-source-card > strong {
  font-size: clamp(22px, 2.1vw, 30px);
}

.design-vnext .learning-source-subtitle {
  min-height: 0;
  font-size: 13px;
  line-height: 1.35;
}

.design-vnext .learning-source-action {
  width: fit-content;
  min-height: 38px;
  padding: 8px 12px;
  background: rgba(7, 30, 27, .24);
}

.design-vnext .learning-source-card::after {
  right: auto;
  bottom: 0;
  left: 0;
  width: var(--source-progress, 0%);
  height: 5px;
  background: #e3b548;
}

.design-vnext .my-pages-library {
  grid-area: recent;
  align-self: stretch;
  min-width: 0;
  margin: 8px 0 0;
  padding: clamp(20px, 2.4vw, 30px);
  border: 1px solid rgba(23, 77, 71, .16);
  border-radius: 22px;
  background: color-mix(in srgb, var(--vnext-surface-deep) 74%, transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, .78);
}

.design-vnext .my-pages-library > header {
  align-items: center;
  margin-bottom: 14px;
}

.design-vnext .my-pages-library h3 {
  color: var(--vnext-ink);
  font-size: clamp(28px, 2.7vw, 38px);
}

.design-vnext .my-flashcards-link {
  min-height: 42px;
  padding: 8px 11px;
  color: var(--vnext-brand);
  border: 1px solid rgba(23, 77, 71, .22);
  border-radius: 12px;
  background: var(--vnext-paper);
  font-size: 11px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.design-vnext .learn-saved-pages {
  display: grid;
  max-height: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  overflow: visible;
  padding: 2px;
}

.design-vnext .learn-saved-page {
  gap: 6px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 207, 191, .82);
  border-radius: 16px;
  background: var(--vnext-paper);
  box-shadow: none;
}

.design-vnext .learn-saved-page-open {
  min-height: 76px;
  padding: 13px 14px;
}

.design-vnext .learn-saved-page-heading strong {
  font-size: 20px;
}

.design-vnext .learn-saved-page-heading small {
  font-size: 11px;
}

.design-vnext .learn-saved-page-views,
.design-vnext .learn-saved-page-rename,
.design-vnext .learn-saved-page-delete {
  min-height: 38px;
}

.design-vnext .learn-saved-pages-empty {
  display: grid;
  min-height: 170px;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--vnext-muted);
  border: 1px dashed rgba(23, 77, 71, .25);
  border-radius: 18px;
  background: rgba(255, 253, 248, .65);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.design-vnext .learn-library-status {
  grid-area: status;
}

.design-vnext .learn-library-stage .seder-book-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 1vw, 14px);
  padding-inline: 0;
}

/* Home screens and work surfaces use the same paper grammar. */
.design-vnext :is(.mode-daf-library, .quiz-panel) {
  margin: 0;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid rgba(216, 207, 191, .78);
  border-radius: var(--vnext-major-radius);
  background:
    radial-gradient(circle at 96% 2%, color-mix(in srgb, var(--vnext-accent) 9%, transparent), transparent 24rem),
    linear-gradient(145deg, color-mix(in srgb, var(--vnext-surface) 97%, white), var(--vnext-surface-deep));
  box-shadow: var(--vnext-shadow);
}

.design-vnext .mode-library-masthead {
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(216, 207, 191, .72);
}

.design-vnext .mode-library-masthead h2,
.design-vnext .quiz-heading h2 {
  padding: 0;
  font-size: clamp(34px, 3.5vw, 48px);
  line-height: 1.04;
}

.design-vnext .mode-my-decks,
.design-vnext .mode-premade-decks,
.design-vnext .mode-chavruta-shelf,
.design-vnext .quiz-deck-library {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.design-vnext .mode-my-decks > header,
.design-vnext .mode-premade-decks > header {
  align-items: center;
  margin-bottom: 12px;
}

.design-vnext .mode-my-decks h3,
.design-vnext .mode-premade-decks h3,
.design-vnext .quiz-deck-library h4 {
  margin: 2px 0 0;
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.05;
}

.design-vnext .mode-deck-gallery {
  grid-template-columns: repeat(auto-fit, minmax(150px, 190px));
  justify-content: start;
  gap: 10px 18px;
}

.design-vnext .mode-my-decks .mode-deck-card,
.design-vnext .quiz-deck-gallery .mode-deck-card {
  min-height: 174px;
}

.design-vnext .mode-deck-card-add {
  min-height: 174px;
  border-radius: 18px;
  background: rgba(255, 253, 248, .5);
  box-shadow: none;
}

.design-vnext .mode-deck-add-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

/* Build and Print start with the user's actual decks, not nested panels. */
.design-vnext:has(#modeHero[data-mode="deck"]) .mode-daf-library,
.design-vnext:has(#modeHero[data-mode="print"]) .mode-daf-library {
  align-content: start;
}

.design-vnext:has(#modeHero[data-mode="deck"]) .mode-my-decks,
.design-vnext:has(#modeHero[data-mode="print"]) .mode-my-decks {
  padding-top: 4px;
}

.design-vnext:has(#modeHero[data-mode="deck"]) .mode-daf-flow-heading {
  margin-top: 22px;
}

.design-vnext #modeDafFlow {
  scroll-margin-top: 104px;
}

.design-vnext [id$="Heading"][tabindex="-1"],
.design-vnext #reviewPanel,
.design-vnext #modeDafLibrary {
  scroll-margin-top: 104px;
}

.design-vnext #modeSelectedDeckTitle:focus {
  outline: 0;
}

.design-vnext .mode-selected-deck:has(#modeSelectedDeckTitle:focus) {
  border-color: color-mix(in srgb, var(--vnext-accent) 42%, var(--vnext-line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--vnext-accent) 12%, transparent);
}

.design-vnext:has(#modeHero[data-mode="print"]) .mode-daf-library {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 0 30px;
}

.design-vnext:has(#modeHero[data-mode="print"]) .mode-library-masthead,
.design-vnext:has(#modeHero[data-mode="print"]) #modeDafLibraryStatus {
  grid-column: 1 / -1;
}

.design-vnext:has(#modeHero[data-mode="print"]) .mode-my-decks {
  grid-column: 1;
}

.design-vnext:has(#modeHero[data-mode="print"]) .mode-premade-decks {
  grid-column: 2;
  padding-top: 4px;
}

.design-vnext:has(#modeHero[data-mode="print"]) .mode-premade-decks .mode-deck-gallery {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.design-vnext .mode-premade-decks .mode-deck-copy strong {
  display: -webkit-box;
  min-height: 2.35em;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.16;
}

/* Quiz exposes the two decisions side by side: which deck, and which side. */
.design-vnext .quiz-panel > .panel-heading {
  min-height: 0;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(216, 207, 191, .72);
}

.design-vnext .quiz-panel > .panel-heading .step-number {
  width: 44px;
  height: 44px;
  font-size: 19px;
}

.design-vnext .quiz-panel > .panel-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3.5vw, 48px);
  font-weight: 500;
  line-height: 1;
}

.design-vnext .quiz-settings {
  display: grid;
  max-width: none;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  align-items: start;
  gap: 18px 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.design-vnext .quiz-member {
  max-width: none;
}

.design-vnext .quiz-settings-heading {
  display: none;
}

.design-vnext .quiz-deck-library {
  grid-column: 1;
  grid-row: 1 / span 4;
  padding-top: 0;
}

.design-vnext .quiz-direction-choices,
.design-vnext .quiz-settings > .large,
.design-vnext .quiz-setup-hint {
  grid-column: 2;
}

.design-vnext .quiz-direction-choices {
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 0;
}

.design-vnext .quiz-direction-choices legend {
  font-size: 12px;
}

.design-vnext .quiz-direction-choice {
  min-height: 78px;
  padding: 13px 15px;
  border-radius: 16px;
}

.design-vnext .quiz-direction-choice small {
  font-size: 11px;
}

.design-vnext .quiz-progress-tracker {
  grid-column: 1 / -1;
}

/* Chavruta is a people shelf. Communication and saved work appear only after
   a person is chosen, preserving the existing call and collaboration paths. */
.design-vnext.chavruta-mode-active:not(.learn-workspace-open) .mode-library-masthead {
  display: none;
}

.design-vnext.chavruta-mode-active:not(.learn-workspace-open) .mode-daf-library {
  padding: clamp(26px, 3.5vw, 46px);
}

.design-vnext.chavruta-mode-active .mode-chavruta-shelf {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.design-vnext.chavruta-mode-active .mode-chavruta-shelf > header h3 {
  font-size: clamp(42px, 5vw, 64px);
}

.design-vnext.chavruta-mode-active .mode-chavruta-hub {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(116, 81, 110, .2);
}

.design-vnext .workspace {
  margin: 0;
}

/* Once a reader is open, Page/Text remains available as a compact switch
   instead of continuing to occupy half of the working canvas. */
.design-vnext .review-view-choice:not(.is-awaiting-choice) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
}

.design-vnext .review-view-choice:not(.is-awaiting-choice) > :is(.eyebrow, h3) {
  display: none;
}

.design-vnext .review-view-choice:not(.is-awaiting-choice) #reviewViewPicker {
  display: grid !important;
  width: min(100%, 420px);
  max-width: 420px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.design-vnext .review-view-choice:not(.is-awaiting-choice) .review-view-button,
.design-vnext.learn-mode-active.learn-workspace-open .review-view-choice:not(.is-awaiting-choice) .review-view-button {
  min-height: 46px;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 10px;
  border-width: 1px;
  border-radius: 12px;
  box-shadow: none;
}

.design-vnext .review-view-choice:not(.is-awaiting-choice) .review-view-button .review-view-icon {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

.design-vnext .review-view-choice:not(.is-awaiting-choice) .review-view-button strong,
.design-vnext.learn-mode-active.learn-workspace-open .review-view-choice:not(.is-awaiting-choice) .review-view-button strong {
  font-size: 14px;
  line-height: 1.15;
}

.design-vnext .review-view-choice:not(.is-awaiting-choice) .review-view-button small {
  display: none;
}

/* Once a view is open, keep Page/Text inside the working toolbar. This makes
   the alternate view discoverable without leaving an empty control row above
   the reader or letting the sticky header cover it. */
.design-vnext .review-view-choice.has-external-picker {
  display: none !important;
}

.design-vnext .workspace-view-picker {
  display: grid !important;
  width: 100%;
  gap: 7px;
  margin: 0;
}

.design-vnext #learnWorkspaceBanner .workspace-view-picker {
  grid-template-columns: 1fr;
}

.design-vnext #buildWorkspaceBanner .workspace-view-picker {
  grid-column: 1 / -1;
  grid-row: 1;
  width: min(100%, 380px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: end;
}

.design-vnext .workspace-view-picker .review-view-button,
.design-vnext.learn-mode-active.learn-workspace-open .workspace-view-picker .review-view-button {
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 9px;
  border-width: 1px;
  border-radius: 11px;
  box-shadow: none;
}

.design-vnext .workspace-view-picker .review-view-icon {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.design-vnext .workspace-view-picker .review-view-button strong,
.design-vnext.learn-mode-active.learn-workspace-open .workspace-view-picker .review-view-button strong {
  font-size: 12px;
  line-height: 1.1;
}

.design-vnext .workspace-view-picker .review-view-button small {
  display: none;
}

.design-vnext .panel,
.design-vnext .deck-panel {
  border-radius: var(--vnext-panel-radius);
}

.design-vnext .site-footer {
  margin-top: 6px;
}

/* First-use help should feel like part of the same product, not a second homepage. */
.design-vnext dialog::backdrop {
  background: rgba(14, 35, 32, .5);
  backdrop-filter: blur(8px);
}

.design-vnext .dialog-card.mode-guide-dialog {
  width: min(940px, calc(100vw - 30px));
  max-height: min(720px, calc(100dvh - 30px));
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(216, 207, 191, .9);
  border-radius: 28px;
  background:
    radial-gradient(circle at 96% 0, rgba(194, 138, 54, .12), transparent 19rem),
    var(--vnext-paper);
  box-shadow: var(--vnext-float-shadow);
}

.design-vnext .mode-guide-dialog > h2 {
  max-width: 18ch;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.02;
}

.design-vnext .mode-guide-grid {
  gap: 10px;
  margin: 22px 0;
}

.design-vnext .mode-guide-card,
.design-vnext .mode-guide-card:last-child {
  min-height: 92px;
  gap: 14px;
  padding: 14px 16px;
  border-color: rgba(216, 207, 191, .76);
  border-radius: 17px;
  background: rgba(255, 253, 248, .72);
  box-shadow: none;
}

.design-vnext .mode-guide-card > span {
  width: 50px;
  height: 50px;
  border-radius: 14px;
}

.design-vnext .mode-guide-card h3 {
  font-size: 20px;
}

.design-vnext .mode-guide-card p {
  margin-top: 2px;
  font-size: 14px;
}

/* Green Dark changes the room, while books and paper remain readable. */
html[data-theme="dark"] .design-vnext {
  --vnext-canvas: #06140f;
  --vnext-canvas-deep: #0b2119;
  background:
    radial-gradient(circle at 83% 5%, rgba(200, 164, 82, .08), transparent 26rem),
    radial-gradient(circle at 8% 96%, rgba(47, 125, 111, .16), transparent 31rem),
    linear-gradient(140deg, var(--vnext-canvas), var(--vnext-canvas-deep));
}

html[data-theme="dark"] .design-vnext .topbar,
html[data-theme="dark"] .design-vnext .mode-switcher {
  border-color: rgba(200, 164, 82, .22);
  background: rgba(10, 31, 24, .9);
}

html[data-theme="dark"] .design-vnext .mode-button:not(.active) {
  color: #e7dfcf;
  background: transparent;
}

html[data-theme="dark"] .design-vnext .mode-button:not(.active):hover {
  border-color: rgba(200, 164, 82, .3);
  background: rgba(242, 234, 216, .08);
}

html[data-theme="dark"] .design-vnext .learn-library,
html[data-theme="dark"] .design-vnext :is(.mode-daf-library, .quiz-panel) {
  outline: 1px solid rgba(200, 164, 82, .12);
}

/* Every working mode receives the same calm Rolex-green night room used by
   Progress.  Progress itself is deliberately excluded so its approved visual
   system remains byte-for-byte and cascade-for-cascade unchanged. */
html[data-theme="dark"] .design-vnext:not(.progress-mode-active) {
  --vnext-paper: #f3ead9;
  --vnext-cream: #e8ddca;
  --vnext-ink: #f4eddd;
  --vnext-muted: #cbc2b2;
  --vnext-line: rgba(218, 191, 127, .28);
  --vnext-surface: rgba(16, 42, 34, .96);
  --vnext-surface-deep: rgba(9, 29, 23, .98);
  background:
    radial-gradient(circle at 84% 3%, color-mix(in srgb, var(--vnext-accent) 30%, transparent), transparent 27rem),
    radial-gradient(circle at 9% 96%, rgba(200, 164, 82, .1), transparent 31rem),
    linear-gradient(140deg, #06140f, #0b2119);
}

html[data-theme="dark"] .design-vnext:not(.progress-mode-active) :is(
  .learn-library,
  .mode-daf-library,
  .quiz-panel
) {
  color: var(--vnext-ink);
  border-color: rgba(218, 191, 127, .25);
  background:
    radial-gradient(circle at 94% 0, color-mix(in srgb, var(--vnext-accent) 22%, transparent), transparent 24rem),
    linear-gradient(145deg, var(--vnext-surface), var(--vnext-surface-deep));
  box-shadow: 0 24px 56px rgba(0, 0, 0, .25);
}

html[data-theme="dark"] .design-vnext:not(.progress-mode-active) :is(
  .learn-library-title h2,
  .learn-library-title p,
  .mode-library-masthead h2,
  .mode-library-masthead p,
  .quiz-heading h2,
  .quiz-heading p,
  .mode-my-decks h3,
  .mode-premade-decks h3,
  .quiz-deck-library h4,
  .mode-chavruta-shelf h3,
  .my-pages-library h3
) {
  color: var(--vnext-ink);
}

html[data-theme="dark"] .design-vnext:not(.progress-mode-active) :is(
  .learn-library-masthead,
  .mode-library-masthead,
  .quiz-panel > .panel-heading,
  .mode-chavruta-hub
) {
  border-color: rgba(218, 191, 127, .24);
}

html[data-theme="dark"] .design-vnext:not(.progress-mode-active) .my-pages-library {
  border-color: rgba(218, 191, 127, .2);
  background: rgba(4, 22, 17, .42);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .design-vnext:not(.progress-mode-active) :is(
  .learn-saved-page,
  .mode-deck-card,
  .mode-deck-card-add,
  .quiz-direction-choice,
  .chavruta-person-card,
  .chavruta-hub-card
) {
  color: #17332f;
  border-color: rgba(218, 191, 127, .42);
  background-color: #f3ead9;
}

@media (max-width: 1199px) {
  .design-vnext .app-shell {
    display: block;
  }

  .design-vnext .topbar {
    margin-bottom: 10px;
  }

  .design-vnext .mode-switcher {
    position: sticky;
    top: 72px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 12px;
    padding: 6px;
    border-radius: 18px;
  }

  .design-vnext .mode-button,
  .design-vnext .mode-button[data-mode="learn"],
  .design-vnext .mode-button[data-mode="learn"].active {
    grid-column: auto;
    grid-row: auto;
    width: auto;
    justify-self: stretch;
    min-height: 58px;
    grid-template-columns: auto minmax(0, auto);
    align-content: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 9px;
  }

  .design-vnext .mode-button strong {
    font-size: 11px;
  }

  .design-vnext .mode-button .mode-icon,
  .design-vnext .mode-switcher .mode-icon {
    width: 34px;
    height: 34px;
  }

  .design-vnext .learn-library {
    min-height: 0;
  }

  .design-vnext .trial-banner {
    top: 146px;
    left: 0;
  }
}

@media (min-width: 701px) and (max-width: 1199px) {
  .design-vnext .topbar,
  .design-vnext .mode-switcher {
    background: #fffdf8;
    backdrop-filter: none;
  }

  html[data-theme="dark"] .design-vnext .topbar,
  html[data-theme="dark"] .design-vnext .mode-switcher {
    background: #0a1f18;
  }
}

@media (max-width: 920px) {
  .design-vnext .topbar-actions {
    gap: 5px;
  }

  .design-vnext .theme-picker,
  .design-vnext .owner-review-link {
    display: none;
  }

  .design-vnext .personal-library-shortcuts button {
    width: auto;
    min-height: 40px;
    padding: 4px 9px;
  }

  .design-vnext .learn-library {
    grid-template-columns: 1fr;
    grid-template-areas:
      "masthead"
      "navigation"
      "books"
      "recent"
      "status";
  }

  .design-vnext .my-pages-library {
    min-height: 0;
  }

  .design-vnext .learn-saved-pages {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .design-vnext:has(#modeHero[data-mode="print"]) .mode-daf-library,
  .design-vnext .quiz-settings {
    grid-template-columns: 1fr;
  }

  .design-vnext:has(#modeHero[data-mode="print"]) :is(.mode-library-masthead, .mode-my-decks, .mode-premade-decks, #modeDafLibraryStatus),
  .design-vnext .quiz-deck-library,
  .design-vnext .quiz-direction-choices,
  .design-vnext .quiz-settings > .large,
  .design-vnext .quiz-setup-hint {
    grid-column: 1;
  }

  .design-vnext .quiz-deck-library {
    grid-row: auto;
  }
}

@media (max-width: 700px) {
  .design-vnext {
    padding-bottom: 82px;
    scroll-padding-bottom: 90px;
  }

  .design-vnext :is(button, a, [tabindex]:not([tabindex="-1"])) {
    scroll-margin-bottom: 90px;
  }

  .design-vnext #learnWorkspaceBanner .workspace-view-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .design-vnext .app-shell {
    width: min(100% - 14px, 1540px);
    margin: 7px auto 20px;
  }

  .design-vnext .trial-banner {
    display: none;
  }

  .design-vnext .topbar {
    min-height: 56px;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: 16px;
  }

  .design-vnext .brand-motion {
    width: 132px;
    height: 49px;
  }

  .design-vnext .brand-orbit {
    bottom: 20px;
  }

  .design-vnext .brand-letter {
    width: 29px;
    height: 29px;
  }

  .design-vnext .brand-wordmark strong {
    font-size: 13px;
  }

  .design-vnext .topbar-actions {
    gap: 4px;
  }

  .design-vnext .personal-library-shortcuts,
  .design-vnext .owner-review-link,
  .design-vnext .theme-picker {
    display: none;
  }

  .design-vnext .account-button,
  .design-vnext .icon-button {
    min-width: 40px;
    min-height: 40px;
  }

  .design-vnext .mode-switcher {
    position: fixed;
    right: 7px;
    bottom: 7px;
    left: 7px;
    top: auto;
    z-index: 1060;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    margin: 0;
    padding: 5px;
    border-radius: 20px;
    box-shadow: 0 18px 44px rgba(17, 37, 33, .24);
  }

  .design-vnext .mode-button,
  .design-vnext .mode-button[data-mode="learn"],
  .design-vnext .mode-button[data-mode="learn"].active {
    grid-column: auto;
    grid-row: auto;
    width: auto;
    justify-self: stretch;
    min-height: 62px;
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 15px;
  }

  .design-vnext .mode-button .mode-icon,
  .design-vnext .mode-switcher .mode-icon {
    width: 30px;
    height: 30px;
    border: 0;
    font-size: 12px;
  }

  .design-vnext .mode-button strong {
    font-size: 8px;
    line-height: 1.05;
  }

  .design-vnext .mode-new-badge {
    display: none;
  }

  .design-vnext .hero {
    display: block;
    min-height: 88px;
    margin-bottom: 8px;
    padding: 16px 18px;
    border-radius: 20px;
  }

  .design-vnext .hero h1 {
    max-width: 100%;
    font-size: clamp(30px, 10vw, 40px);
  }

  .design-vnext .hero :is(.hero-books, .learn-hero-mark, .quiz-hero-mark, .chavruta-hero-mark) {
    display: none !important;
  }

  .design-vnext .learn-library {
    gap: 14px;
    padding: 20px 14px 18px;
    border-radius: 22px;
  }

  .design-vnext .learn-library-masthead {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-bottom: 14px;
  }

  .design-vnext .learn-library-title h2 {
    max-width: 14ch;
    font-size: clamp(32px, 10vw, 42px);
  }

  .design-vnext .learn-library-title > p:last-child {
    font-size: 14px;
  }

  .design-vnext .learn-library-masthead > .hero-daf-yomi {
    width: 100%;
    min-width: 0;
    min-height: 58px;
  }

  .design-vnext .learning-source-grid-root,
  .design-vnext .learning-source-grid-divisions {
    gap: 8px;
  }

  .design-vnext .learning-source-grid-root .learning-source-card,
  .design-vnext .learning-source-grid-divisions .learning-source-card {
    min-height: 190px;
    padding: 14px 9px;
    border-left-width: 6px;
    border-radius: 5px 17px 17px 5px;
    box-shadow:
      inset 3px 0 0 rgba(255, 255, 255, .1),
      4px 7px 0 color-mix(in srgb, currentColor 12%, var(--vnext-line)),
      0 12px 20px rgba(44, 42, 36, .13);
  }

  .design-vnext .learning-source-book-symbol,
  .design-vnext .learning-source-subtitle,
  .design-vnext .learning-source-action {
    display: none;
  }

  .design-vnext .learning-source-hebrew {
    font-size: clamp(22px, 7vw, 29px);
  }

  .design-vnext .learning-source-card > strong {
    font-size: clamp(12px, 4vw, 16px);
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  .design-vnext .my-pages-library {
    padding: 16px;
    border-radius: 18px;
  }

  .design-vnext .my-pages-library h3 {
    font-size: 30px;
  }

  .design-vnext .learn-saved-pages {
    grid-template-columns: 1fr;
  }

  .design-vnext :is(.mode-daf-library, .quiz-panel) {
    padding: 18px 14px;
    border-radius: 22px;
  }

  .design-vnext .mode-library-masthead h2,
  .design-vnext .quiz-heading h2 {
    font-size: 34px;
  }

  .design-vnext .dialog-card.mode-guide-dialog {
    padding: 44px 12px 10px;
    border-radius: 22px;
  }

  .design-vnext .mode-guide-dialog > h2 {
    font-size: clamp(28px, 9vw, 36px);
  }

  .design-vnext .mode-guide-grid {
    gap: 6px;
    margin: 10px 0;
  }

  .design-vnext .mode-guide-card,
  .design-vnext .mode-guide-card:last-child {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 0;
    gap: 9px;
    padding: 7px 10px;
  }

  .design-vnext .mode-guide-card > span {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 10px;
  }

  .design-vnext .mode-guide-card h3 {
    font-size: 15px;
  }

  .design-vnext .mode-guide-card p {
    margin-top: 0;
    font-size: 12px;
    line-height: 1.25;
  }

  .design-vnext .help-guide-footer {
    position: sticky;
    bottom: -10px;
    z-index: 2;
    gap: 8px;
    padding: 8px 0 0;
    background: var(--vnext-paper);
  }

  .design-vnext .help-dismiss-line {
    font-size: 12px;
  }

  .design-vnext .help-done-button {
    min-height: 44px;
    font-size: 15px;
  }
}

@media (max-width: 370px) {
  .design-vnext .learn-library {
    padding-top: 14px;
  }

  .design-vnext .learn-library-masthead {
    gap: 8px;
    padding-bottom: 8px;
  }

  .design-vnext .learn-library-title h2 {
    font-size: 30px;
  }

  .design-vnext .learn-library-title > p:last-child {
    display: none;
  }

  .design-vnext .learn-library-masthead > .hero-daf-yomi {
    min-height: 54px;
    padding-block: 7px;
  }

  .design-vnext .learning-source-grid-root .learning-source-card,
  .design-vnext .learning-source-grid-divisions .learning-source-card {
    min-height: 160px;
    padding-inline: 6px;
  }

  .design-vnext .learning-source-hebrew {
    font-size: 21px;
  }

  .design-vnext .learning-source-card > strong {
    font-size: 14px;
  }

  .design-vnext .mode-button strong {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .design-vnext,
  .design-vnext *,
  .design-vnext *::before,
  .design-vnext *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
