@font-face {
  font-family: "Daf to Deck Frank";
  src: url("/fonts/FrankRuehlCLM-Medium.otf?v=1.3.0") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "Daf to Deck Rashi";
  src: url("/fonts/Rashi-Regular.ttf?v=1.3.0") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "Daf to Deck Paleo";
  src: url("/fonts/Hebrew-Paleo-Siloam.ttf?v=1.3.0") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  --paper: #f4efe5;
  --paper-deep: #e9dfcf;
  --card: #fffdf8;
  --ink: #182d2b;
  --ink-soft: #5f6f6c;
  --teal: #174d47;
  --teal-bright: #246b61;
  --teal-pale: #e6f0ec;
  --gold: #b57a31;
  --gold-pale: #f4e5ca;
  --wine: #7a3e3b;
  --plum: #754d74;
  --blue: #425e78;
  --line: #d8cfbf;
  --shadow: 0 24px 60px rgba(37, 43, 37, 0.13);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 17% 8%, rgba(255,255,255,.9), transparent 27rem),
    linear-gradient(125deg, #f6f1e8 0%, #eee5d8 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.library-wall {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  opacity: .5;
  pointer-events: none;
}

.library-wall::before,
.library-wall::after {
  position: absolute;
  content: "";
  width: 260px;
  height: 78px;
  border-radius: 5px 5px 0 0;
  background:
    linear-gradient(90deg,
      #7e4b3d 0 18px, #d5a658 18px 23px,
      #315c59 23px 56px, #254845 56px 61px,
      #926345 61px 78px, #dfb660 78px 83px,
      #535170 83px 113px, #393a55 113px 119px,
      #a35045 119px 142px, #d2a158 142px 148px,
      #426c63 148px 179px, #2f514b 179px 184px,
      #8b5a41 184px 202px, #d9ad61 202px 207px,
      #3d5a75 207px 238px, #263e55 238px 244px,
      #875044 244px 260px);
  box-shadow: 0 9px 0 #8a6848, 0 14px 8px rgba(80, 57, 35, .22);
  filter: saturate(.65);
}

.library-wall::before {
  left: -70px;
  top: 105px;
  transform: rotate(-4deg);
}

.library-wall::after {
  right: -78px;
  top: 430px;
  transform: rotate(5deg);
}

.shelf {
  position: absolute;
  right: 2%;
  width: 180px;
  height: 46px;
  border-bottom: 7px solid rgba(117, 81, 47, .22);
  background: repeating-linear-gradient(
    90deg,
    transparent 0 7px,
    rgba(49, 82, 75, .17) 7px 20px,
    transparent 20px 25px,
    rgba(139, 80, 61, .15) 25px 38px,
    transparent 38px 44px
  );
}

.shelf-one { top: 75px; right: 8%; }
.shelf-two { top: 760px; left: 1%; }
.shelf-three { top: 1180px; right: 3%; }

.app-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 18px auto 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 18px;
  border: 1px solid rgba(216, 207, 191, .8);
  border-radius: 18px;
  background: rgba(255, 253, 248, .82);
  box-shadow: 0 10px 30px rgba(65, 57, 46, .06);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-block;
  flex: 0 0 auto;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand-motion {
  --brand-rest-offset: 17.5px;
  position: relative;
  display: block;
  width: 188px;
  height: 64px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  perspective: 700px;
  perspective-origin: 50% 29%;
}

.brand-orbit {
  position: absolute;
  inset: 0 0 25px;
  transform-origin: 50% 42%;
  transform: none;
}

.brand-letter {
  position: absolute;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
}

.brand-letter-o {
  left: calc(50% - var(--brand-rest-offset));
}

.brand-letter-samech {
  left: calc(50% + var(--brand-rest-offset));
}

.brand-letter img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 50%;
  transform: none;
  image-rendering: auto;
}

.brand-wordmark {
  position: absolute;
  left: 50%;
  bottom: 1px;
  display: flex;
  align-items: baseline;
  gap: 2px;
  transform: translateX(-50%);
  transform-origin: 50% 50%;
  white-space: nowrap;
  opacity: 1;
}

.brand-wordmark strong {
  display: block;
  color: #084d39;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
}

.brand-wordmark small {
  color: #b98220;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.brand-motion.is-waiting .brand-letter-o {
  left: 49%;
}

.brand-motion.is-waiting .brand-letter-samech {
  left: 51%;
}

.brand-motion.is-waiting .brand-wordmark {
  opacity: 0;
}

.brand-motion.is-animating .brand-orbit {
  transform-style: preserve-3d;
  will-change: transform;
  animation: online-seder-y-orbit 1.45s cubic-bezier(.12, .74, .18, 1) both;
}

.brand-motion.is-animating .brand-letter {
  transform-style: preserve-3d;
  will-change: left;
}

.brand-motion.is-animating .brand-letter-o {
  animation: online-seder-spread-left 1.45s cubic-bezier(.12, .74, .18, 1) both;
}

.brand-motion.is-animating .brand-letter-samech {
  animation: online-seder-spread-right 1.45s cubic-bezier(.12, .74, .18, 1) both;
}

.brand-motion.is-animating .brand-letter img {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
  animation: online-seder-face-forward 1.45s cubic-bezier(.12, .74, .18, 1) both;
}

.brand-motion.is-animating .brand-wordmark {
  will-change: transform, opacity;
  animation: online-seder-wordmark-pop .55s cubic-bezier(.2, 1.35, .3, 1) 1.3s both;
}

.brand-motion.is-settled .brand-orbit,
.brand-motion.is-settled .brand-letter,
.brand-motion.is-settled .brand-letter img,
.brand-motion.is-settled .brand-wordmark {
  animation: none;
  transform-style: flat;
  will-change: auto;
}

.brand-motion.is-settled .brand-orbit,
.brand-motion.is-settled .brand-letter img {
  transform: none;
}

@keyframes online-seder-y-orbit {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(1440deg); }
}

@keyframes online-seder-face-forward {
  from { transform: rotateY(0deg) scale(.64); opacity: .72; }
  to { transform: rotateY(-1440deg) scale(1); opacity: 1; }
}

@keyframes online-seder-spread-left {
  0% { left: 49%; }
  58% { left: 43%; }
  86% { left: calc(50% - var(--brand-rest-offset) - 1px); }
  100% { left: calc(50% - var(--brand-rest-offset)); }
}

@keyframes online-seder-spread-right {
  0% { left: 51%; }
  58% { left: 57%; }
  86% { left: calc(50% + var(--brand-rest-offset) + 1px); }
  100% { left: calc(50% + var(--brand-rest-offset)); }
}

@keyframes online-seder-wordmark-pop {
  0% { opacity: 0; transform: translateX(-50%) translateY(22%) scale(.72); }
  70% { opacity: 1; transform: translateX(-50%) translateY(-3%) scale(1.05); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-motion * {
    animation: none !important;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: var(--teal);
  border: 1px solid #cfdfd9;
  border-radius: 999px;
  background: #f4faf7;
  font-size: 12px;
  font-weight: 700;
}

.local-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3aa57e;
  box-shadow: 0 0 0 4px rgba(58,165,126,.12);
}

.owner-review-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 13px;
  color: #fff9ed;
  border: 1px solid #936226;
  border-radius: 999px;
  background: linear-gradient(135deg, #936226, #b77c35);
  box-shadow: 0 7px 18px rgba(147, 98, 38, .2);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.owner-review-link:hover,
.owner-review-link:focus-visible {
  outline: 3px solid rgba(181, 122, 49, .22);
  background: #7f521f;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-weight: 800;
  cursor: pointer;
}

.icon-button:hover {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 286px;
  margin: 18px 0;
  padding: 48px clamp(28px, 5vw, 72px);
  overflow: hidden;
  color: #f8f1e6;
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 12%, rgba(214, 172, 96, .22), transparent 20rem),
    linear-gradient(125deg, #113b38 0%, #1c514a 58%, #315c50 100%);
  box-shadow: var(--shadow);
  transition: background-color .22s ease, color .22s ease;
}

.hero[data-mode="deck"] {
  background:
    radial-gradient(circle at 88% 12%, rgba(229, 188, 117, .2), transparent 20rem),
    linear-gradient(125deg, #263e55 0%, #425e78 58%, #526f83 100%);
}

.hero[data-mode="learn"] {
  background:
    radial-gradient(circle at 88% 12%, rgba(194, 224, 236, .24), transparent 20rem),
    radial-gradient(circle at 72% 90%, rgba(166, 135, 191, .2), transparent 18rem),
    linear-gradient(125deg, #214957 0%, #35697a 56%, #5e668d 100%);
}

.hero[data-mode="chavruta"] {
  background:
    radial-gradient(circle at 88% 12%, rgba(228, 176, 86, .25), transparent 20rem),
    linear-gradient(125deg, #493047 0%, #68445f 58%, #835b6c 100%);
}

.hero[data-mode="quiz"] {
  background:
    radial-gradient(circle at 88% 12%, rgba(229, 188, 117, .2), transparent 20rem),
    linear-gradient(125deg, #4d3037 0%, #713f49 58%, #87555a 100%);
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .35;
  background-image:
    linear-gradient(115deg, transparent 0 54%, rgba(255,255,255,.035) 54% 55%, transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.08) 0 1px, transparent 1.5px);
  background-size: auto, 18px 18px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .17em;
}

.hero .eyebrow {
  color: #e5bc75;
}

.hero[data-mode="deck"] .eyebrow {
  color: #c9e1ef;
}

.hero[data-mode="learn"] .eyebrow {
  color: #d8edf5;
}

.hero[data-mode="chavruta"] .eyebrow {
  color: #f4cd85;
}

.hero[data-mode="quiz"] .eyebrow {
  color: #f0c6c0;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 610px;
  margin: 18px 0 23px;
  color: rgba(248, 241, 230, .8);
  font-size: 16px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-pills span {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.06);
  font-size: 11px;
  font-weight: 700;
}

.hero-books {
  position: relative;
  align-self: flex-end;
  display: flex;
  align-items: flex-end;
  min-width: 310px;
  height: 190px;
  margin-left: 40px;
  padding: 0 28px;
  border-bottom: 14px solid #b58b55;
  filter: drop-shadow(0 18px 12px rgba(0,0,0,.22));
}

.learn-hero-mark,
.quiz-hero-mark,
.chavruta-hero-mark {
  position: relative;
  z-index: 1;
  display: none;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 300px;
  min-width: 300px;
  height: 190px;
  margin-left: 44px;
  filter: drop-shadow(0 18px 12px rgba(0, 0, 0, .2));
}

.hero[data-mode="learn"] .hero-books,
.hero[data-mode="quiz"] .hero-books,
.hero[data-mode="chavruta"] .hero-books {
  display: none;
}

.hero[data-mode="learn"] .learn-hero-mark {
  display: flex;
}

.hero[data-mode="quiz"] .quiz-hero-mark {
  display: flex;
}

.hero[data-mode="chavruta"] .chavruta-hero-mark {
  display: flex;
}

.learn-hero-page {
  position: relative;
  width: 190px;
  height: 150px;
  padding: 25px 22px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .58);
  border-radius: 11px 11px 5px 5px;
  background:
    repeating-linear-gradient(0deg, rgba(32, 51, 56, .08) 0 1px, transparent 1px 9px),
    #fffaf0;
  box-shadow: inset 0 0 28px rgba(53, 105, 122, .12);
  transform: rotate(-3deg);
}

.learn-hero-page strong {
  display: block;
  color: #203d43;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 42px;
  font-weight: 700;
  text-align: center;
}

.learn-hero-line {
  position: absolute;
  left: 22px;
  height: 17px;
  border-radius: 4px;
  opacity: .64;
}

.learn-hero-line-one {
  right: 70px;
  bottom: 48px;
  background: #ecd76b;
}

.learn-hero-line-two {
  right: 30px;
  bottom: 27px;
  background: #77b6cf;
}

.learn-hero-line-three {
  right: 92px;
  bottom: 7px;
  background: #82b989;
}

.learn-hero-pencil {
  position: absolute;
  right: 30px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  color: #fffdf8;
  border: 2px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  background: #5f4d7a;
  box-shadow: 0 10px 20px rgba(23, 39, 45, .25);
  font-size: 31px;
  transform: rotate(8deg);
}

.quiz-hero-card {
  position: absolute;
  width: 192px;
  height: 142px;
  border: 2px solid rgba(255, 255, 255, .52);
  border-radius: 15px;
  box-shadow: 0 13px 24px rgba(34, 18, 23, .2);
}

.quiz-hero-card-back {
  top: 35px;
  left: 62px;
  background: rgba(240, 198, 192, .4);
  transform: rotate(8deg);
}

.quiz-hero-card-middle {
  top: 23px;
  left: 40px;
  background: rgba(255, 255, 255, .24);
  transform: rotate(-7deg);
}

.quiz-hero-card-front {
  top: 27px;
  left: 51px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-direction: column;
  box-sizing: border-box;
  padding: 16px 18px 13px;
  background:
    repeating-linear-gradient(0deg, rgba(71, 42, 48, .045) 0 1px, transparent 1px 10px),
    #fffaf2;
  transform: rotate(1deg);
}

.quiz-hero-card-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  gap: 5px;
}

.quiz-hero-card-progress i {
  height: 6px;
  border-radius: 999px;
  background: #e2d6cc;
}

.quiz-hero-card-progress i:first-child,
.quiz-hero-card-progress i:nth-child(2) {
  background: #a75e64;
}

.quiz-hero-card-progress i:nth-child(3) {
  background: #d9aa62;
}

.quiz-hero-card-question {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 12px 0 10px;
  color: #fffaf2;
  border-radius: 50%;
  background: #713f49;
  box-shadow: 0 7px 14px rgba(70, 35, 42, .2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.quiz-hero-card-prompt {
  position: relative;
  width: 82px;
  height: 5px;
  border-radius: 999px;
  background: #c7b5a5;
}

.quiz-hero-card-prompt::after {
  position: absolute;
  top: 10px;
  left: 17px;
  width: 48px;
  height: 4px;
  content: "";
  border-radius: inherit;
  background: #ded2c7;
}

.quiz-hero-card-check {
  position: absolute;
  right: 23px;
  bottom: 1px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fffaf2;
  border: 2px solid rgba(255, 255, 255, .62);
  border-radius: 50%;
  background: #487666;
  box-shadow: 0 10px 18px rgba(32, 42, 37, .24);
  font-size: 26px;
  font-weight: 900;
}

.chavruta-hero-mark {
  flex-basis: 320px;
  min-width: 320px;
}

.chavruta-person {
  position: absolute;
  top: 30px;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 76px;
}

.chavruta-person-left {
  left: 20px;
}

.chavruta-person-right {
  right: 20px;
}

.chavruta-person-head,
.chavruta-person-body {
  display: block;
  border: 2px solid rgba(255, 255, 255, .5);
}

.chavruta-person-head {
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f0c995;
  box-shadow: 0 6px 12px rgba(41, 25, 38, .18);
}

.chavruta-person-body {
  width: 70px;
  height: 64px;
  margin-top: -2px;
  border-radius: 38px 38px 10px 10px;
  background: #95657e;
  box-shadow: 0 9px 18px rgba(41, 25, 38, .18);
}

.chavruta-person-right .chavruta-person-body {
  background: #b77b57;
}

.chavruta-chat {
  position: absolute;
  top: 3px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 38px;
  gap: 5px;
  border: 2px solid rgba(255, 255, 255, .58);
  border-radius: 17px;
  background: rgba(255, 250, 240, .18);
}

.chavruta-chat-left {
  left: 69px;
}

.chavruta-chat-right {
  right: 69px;
}

.chavruta-chat::after {
  position: absolute;
  bottom: -8px;
  width: 12px;
  height: 12px;
  content: "";
  border-right: 2px solid rgba(255, 255, 255, .58);
  border-bottom: 2px solid rgba(255, 255, 255, .58);
  background: rgba(124, 79, 106, .8);
  transform: rotate(45deg);
}

.chavruta-chat-left::after {
  left: 11px;
}

.chavruta-chat-right::after {
  right: 11px;
}

.chavruta-chat i {
  z-index: 1;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f4cd85;
}

.chavruta-shared-book {
  position: absolute;
  right: 42px;
  bottom: 3px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 236px;
  height: 88px;
  filter: drop-shadow(0 11px 10px rgba(35, 22, 32, .22));
}

.chavruta-book-page {
  display: block;
  width: 116px;
  height: 74px;
  border: 2px solid rgba(255, 255, 255, .6);
  background:
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(74, 50, 62, .15) 11px 13px),
    #fff8e9;
  box-shadow: inset 0 0 22px rgba(104, 68, 95, .1);
}

.chavruta-book-page-left {
  border-radius: 7px 3px 9px 4px;
  transform: rotate(5deg) skewY(3deg);
  transform-origin: right bottom;
}

.chavruta-book-page-right {
  margin-left: -2px;
  border-radius: 3px 7px 4px 9px;
  transform: rotate(-5deg) skewY(-3deg);
  transform-origin: left bottom;
}

.book {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  margin-right: 7px;
  border-radius: 5px 7px 2px 2px;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: inset 7px 0 10px rgba(255,255,255,.08), inset -7px 0 10px rgba(0,0,0,.12);
}

.book::before,
.book::after {
  position: absolute;
  left: 5px;
  right: 5px;
  height: 2px;
  content: "";
  background: rgba(242, 215, 167, .58);
}

.book::before { top: 15px; }
.book::after { bottom: 15px; }

.book span {
  writing-mode: vertical-rl;
  color: #f2d7a7;
  font-family: "Arial Hebrew", "Noto Sans Hebrew", serif;
  font-size: 18px;
  letter-spacing: .09em;
}

.b1 { height: 139px; background: #713c39; transform: rotate(-2deg); }
.b2 { width: 59px; height: 168px; background: #394f6a; }
.b3 { height: 153px; background: #7e5a35; transform: rotate(1deg); }
.b4 { width: 49px; height: 128px; background: #4b6f61; }
.b4 span { font-size: 15px; letter-spacing: .04em; }

.bookend {
  width: 12px;
  height: 115px;
  margin-left: 7px;
  border-radius: 2px;
  background: #d2ad71;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: start;
}

.workspace.has-active-review {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.has-active-review .deck-panel {
  position: static;
  order: initial;
  width: 100%;
}

.main-column {
  min-width: 0;
}

.panel,
.deck-panel {
  border: 1px solid rgba(216, 207, 191, .95);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 16px 45px rgba(64, 57, 47, .08);
}

.panel {
  padding: clamp(24px, 4vw, 42px);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}

.panel-heading h2,
.deck-panel h2,
.preview-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.025em;
}

.panel-heading h2 {
  font-size: clamp(27px, 4vw, 38px);
}

.step-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  color: var(--teal);
  border: 1px solid #c8dbd4;
  border-radius: 50%;
  background: var(--teal-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.selection-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
}

.source-panel .panel-heading h2 {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 820;
  letter-spacing: -.045em;
}

.source-selection-grid {
  gap: 14px;
}

.source-select-card {
  position: relative;
  padding: 15px;
  overflow: hidden;
  border: 1px solid #d8cdbc;
  border-radius: 18px;
  background:
    radial-gradient(circle at 96% 0, rgba(208, 168, 101, .14), transparent 38%),
    linear-gradient(145deg, #fffefa, #f8f3e9);
  box-shadow: 0 10px 24px rgba(63, 50, 33, .07);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.source-select-card:hover,
.source-select-card:focus-within {
  border-color: #8fb0a7;
  box-shadow: 0 14px 30px rgba(39, 73, 66, .11);
  transform: translateY(-1px);
}

.source-select-label {
  display: flex !important;
  min-height: 30px;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px !important;
  color: #254740 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .015em;
}

.source-select-icon {
  display: grid;
  flex: 0 0 auto;
  min-width: 30px;
  height: 30px;
  place-items: center;
  padding: 0 7px;
  color: #fffdf8;
  border-radius: 9px;
  background: linear-gradient(145deg, #246b61, #174d47);
  font-family: "Daf to Deck Frank", serif;
  font-size: 16px;
  font-weight: 400;
  box-shadow: 0 5px 12px rgba(23, 77, 71, .2);
}

.source-select-card select {
  min-height: 62px;
  padding-right: 42px;
  border-color: #cfc4b3;
  border-radius: 13px;
  background-color: rgba(255, 255, 255, .94);
  box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgba(64, 51, 34, .05);
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -.015em;
}

.source-select-card select:focus {
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 4px rgba(36, 107, 97, .13), 0 8px 18px rgba(23, 77, 71, .1);
}

.source-submit-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.chavruta-mode-active .source-submit-actions {
  grid-template-columns: 1fr;
}

.chavruta-daf-yomi-choice {
  margin: 0 0 22px;
}

.chavruta-daf-yomi-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: 100%;
  min-height: 126px;
  padding: 20px 24px;
  color: white;
  border: 1px solid #b68c48;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 18%, rgba(243, 203, 124, .26), transparent 30%),
    linear-gradient(135deg, #174d47, #0e3734);
  box-shadow: 0 16px 32px rgba(23, 77, 71, .2);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.chavruta-daf-yomi-button:hover {
  border-color: #d9b46f;
  box-shadow: 0 19px 38px rgba(23, 77, 71, .26);
  transform: translateY(-2px);
}

.chavruta-daf-yomi-button:focus-visible {
  outline: 3px solid rgba(205, 157, 75, .48);
  outline-offset: 3px;
}

.chavruta-daf-yomi-button:disabled {
  cursor: wait;
  opacity: .68;
  transform: none;
}

.chavruta-daf-yomi-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.chavruta-daf-yomi-copy small,
.chavruta-daf-yomi-action small,
.chavruta-manual-choice-heading small {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.chavruta-daf-yomi-copy small {
  color: #f1d49e;
}

.chavruta-daf-yomi-copy strong {
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.04;
}

.chavruta-daf-yomi-copy > span {
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  font-weight: 700;
}

.chavruta-daf-yomi-action {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 10px;
  max-width: 150px;
  color: #f8e5bc;
  text-align: right;
}

.chavruta-daf-yomi-action b {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: var(--teal);
  border-radius: 50%;
  background: #f5dba9;
  font-size: 19px;
}

.chavruta-manual-choice-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 21px 0 14px;
  color: var(--ink);
}

.chavruta-manual-choice-heading > span:last-child {
  display: grid;
  gap: 2px;
}

.chavruta-manual-choice-heading small {
  color: #92703b;
}

.chavruta-manual-choice-heading strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
}

.chavruta-choice-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--teal);
  border: 1px solid #c8dbd4;
  border-radius: 50%;
  background: var(--teal-pale);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.chavruta-mode-active #findWordsButton {
  color: var(--teal);
  border: 1px solid #bfcfc9;
  background: white;
  box-shadow: none;
}

.chavruta-mode-active #findWordsButton:hover {
  border-color: var(--teal);
  background: #f2f8f5;
}

.chavruta-page-picker-hint {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.field {
  display: block;
}

.field > span,
.source-choices legend {
  display: block;
  margin: 0 0 8px;
  color: #40504d;
  font-size: 12px;
  font-weight: 800;
}

.field small {
  display: block;
  margin-top: 7px;
  color: #7a8582;
  font-size: 10px;
}

.field code {
  color: var(--teal);
  font-size: 10px;
}

select,
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid #d9d1c5;
  border-radius: 12px;
  outline: none;
  background: #fff;
}

select {
  cursor: pointer;
}

select:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover {
  border-color: #b9afa0;
}

select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 4px rgba(36, 107, 97, .12);
}

.source-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.source-choices legend {
  grid-column: 1 / -1;
}

.source-choice {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 76px;
  gap: 12px;
  padding: 13px;
  border: 1px solid #dbd4c9;
  border-radius: 14px;
  background: #fbf9f4;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.source-choice:hover {
  transform: translateY(-1px);
  border-color: #bcb2a4;
}

.source-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.source-choice:has(input:checked) {
  border-color: var(--teal);
  background: #f0f7f4;
  box-shadow: 0 0 0 1px var(--teal);
}

.choice-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: transparent;
  border: 1.5px solid #b4afa5;
  border-radius: 7px;
  background: white;
  font-size: 14px;
  font-weight: 900;
}

.source-choice input:checked + .choice-check {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

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

.source-choice strong {
  font-size: 13px;
}

.source-choice small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-family: "Arial Hebrew", "Noto Sans Hebrew", serif;
  font-size: 14px;
  direction: rtl;
}

.gemara-choice:has(input:checked) { border-top-color: var(--gold); }
.rashi-choice:has(input:checked) { border-top-color: var(--wine); }
.tosafot-choice:has(input:checked) { border-top-color: var(--blue); }

.commentary-font-field {
  max-width: 430px;
  margin-top: 20px;
}

.commentary-font-field > span {
  color: #40504d;
  font-weight: 850;
}

.commentary-font-field select {
  min-height: 55px;
  border-color: #d2c8b8;
  border-radius: 13px;
  background-color: #fffefa;
  font-size: 14px;
  font-weight: 700;
}

.source-panel .source-submit-actions {
  margin-top: 24px;
}

.studio-advanced-controls {
  margin-top: 18px;
}

.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 23px 0;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #e4ddd2;
  border-radius: 12px;
  background: #faf8f3;
  cursor: pointer;
}

.switch-line > input {
  position: absolute;
  opacity: 0;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #c8c8c3;
  transition: background .18s ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  content: "";
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .18s ease;
}

.switch-line input:checked + .switch {
  background: var(--teal-bright);
}

.switch-line input:checked + .switch::after {
  transform: translateX(16px);
}

.switch-line input:disabled + .switch {
  opacity: .45;
}

.switch-line:has(input:disabled) {
  cursor: not-allowed;
  opacity: .72;
}

.switch-line strong,
.switch-line small {
  display: block;
}

.switch-line strong {
  font-size: 11px;
}

.switch-line small {
  margin-top: 2px;
  color: #7e8885;
  font-size: 9px;
}

.primary-button,
.secondary-button,
.combine-button,
.generate-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.combine-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(23, 77, 71, .18);
}

.primary-button:hover {
  background: #0f3e3a;
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--teal);
  border: 1px solid #cbd7d3;
  background: white;
}

.secondary-button:hover {
  border-color: var(--teal);
  background: #f2f8f5;
}

.combine-button {
  color: #6f491b;
  border: 1px solid #d8ba82;
  background: var(--gold-pale);
}

.combine-button:hover {
  border-color: var(--gold);
  background: #f7dfb7;
  transform: translateY(-1px);
}

.primary-button.large {
  width: 100%;
  min-height: 56px;
  justify-content: space-between;
  padding: 0 21px;
  border-radius: 13px;
  font-size: 13px;
}

.primary-button.full {
  width: 100%;
}

.primary-button:disabled,
.secondary-button:disabled,
.combine-button:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
}

.primary-button.is-loading,
.secondary-button.is-loading {
  cursor: wait;
}

.combine-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.button-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  font-size: 17px;
}

.primary-button.is-loading .button-label::after {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 9px;
  content: "";
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.source-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid #d9dfd8;
  border-radius: 12px;
  background: #f4f7f3;
}

.source-status.warning {
  border-color: #e5cfab;
  background: #fbf4e8;
}

.source-status-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: white;
  border-radius: 50%;
  background: var(--teal-bright);
  font-family: Georgia, serif;
  font-weight: 800;
}

.source-status.warning .source-status-icon {
  background: var(--gold);
}

.source-status strong {
  display: block;
  font-size: 12px;
}

.source-status p {
  margin: 3px 0 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.source-status a {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.text-preview {
  margin-top: 0;
}

.text-preview-toggle {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 2px;
  list-style: none;
  cursor: pointer;
}

.text-preview-toggle::-webkit-details-marker {
  display: none;
}

.text-preview-toggle > span:first-child,
.text-preview-toggle strong,
.text-preview-toggle small {
  display: block;
}

.text-preview-toggle .eyebrow {
  margin-bottom: 4px;
}

.text-preview-toggle strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.text-preview-toggle-mark {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--teal);
  border: 1px solid #c8d8d2;
  border-radius: 50%;
  background: #f2f8f5;
  font-size: 21px;
  font-weight: 500;
  transition: transform .18s ease, background .18s ease;
}

.text-preview[open] .text-preview-toggle-mark {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
  transform: rotate(45deg);
}

.text-preview-body {
  padding: 0 0 2px;
}

.deck-inspector-panel {
  padding: 0;
  overflow: hidden;
}

.deck-inspector-toggle {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(24px, 4vw, 42px);
  list-style: none;
  cursor: pointer;
}

.deck-inspector-toggle::-webkit-details-marker {
  display: none;
}

.deck-inspector-toggle > span:first-child,
.deck-inspector-toggle strong,
.deck-inspector-toggle small {
  display: block;
}

.deck-inspector-toggle .eyebrow {
  margin-bottom: 4px;
}

.deck-inspector-toggle strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 29px);
  font-weight: 500;
  letter-spacing: -.025em;
}

.deck-inspector-summary-side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.deck-inspector-count {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.deck-inspector-toggle-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--teal);
  border: 1px solid #c8d8d2;
  border-radius: 50%;
  background: #f2f8f5;
  font-size: 23px;
  transition: transform .18s ease, background .18s ease;
}

.deck-inspector-panel[open] .deck-inspector-toggle-mark {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
  transform: rotate(45deg);
}

.deck-inspector-body {
  padding: 0 clamp(24px, 4vw, 42px) clamp(24px, 4vw, 38px);
  border-top: 1px solid #e5ded3;
}

.deck-inspector-picker {
  width: min(100%, 470px);
  margin-top: 20px;
}

.deck-inspector-picker > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.deck-inspector-picker select {
  min-height: 50px;
  border-color: #b9cec7;
  background-color: #fffdf8;
  box-shadow: 0 5px 14px rgba(23, 77, 71, .06);
  font-size: 11px;
  font-weight: 750;
}

.deck-inspector-description {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.deck-inspector-panel .queue-list-wrap {
  margin-top: 18px;
}

.deck-inspector-panel .queue-list {
  max-height: 380px;
  overflow-y: auto;
}

.deck-inspector-panel .quiz-start-side {
  margin-top: 16px;
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  margin: -4px 0 13px;
}

.preview-heading h3 {
  font-size: 24px;
}

.preview-heading > span {
  padding: 5px 9px;
  color: var(--ink-soft);
  border-radius: 999px;
  background: #f0ece5;
  font-size: 9px;
  font-weight: 800;
}

.preview-list {
  overflow: hidden;
  border: 1px solid #e0d8cc;
  border-radius: 14px;
}

.preview-list details + details {
  border-top: 1px solid #e7e0d6;
}

.preview-list summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  min-height: 55px;
  padding: 0 15px;
  list-style: none;
  background: #fbf9f5;
  cursor: pointer;
}

.preview-list summary::-webkit-details-marker {
  display: none;
}

.preview-list summary strong {
  font-size: 11px;
}

.preview-list summary small {
  color: var(--ink-soft);
  font-size: 9px;
}

.preview-list details[open] summary {
  color: var(--teal);
  background: #f2f7f4;
}

.source-text {
  max-height: 280px;
  overflow: auto;
  padding: 22px;
  color: #3b4643;
  border-top: 1px solid #e4ddd2;
  background: white;
  font-family: "Arial Hebrew", "Noto Sans Hebrew", serif;
  font-size: 17px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.interactive-source-hint {
  margin: -4px 0 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.source-token {
  display: inline;
  margin: 0;
  padding: 1px 2px;
  color: inherit;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  touch-action: pan-y;
  transition: color .12s ease, background .12s ease, box-shadow .12s ease;
}

.source-token:hover {
  color: #5f431d;
  background: #f5e4bf;
}

.source-token:focus-visible {
  color: #173f3a;
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  background: #fff1d1;
}

.source-token.is-review-start {
  color: #fffdf8;
  background: var(--teal);
  box-shadow: 0 0 0 2px rgba(31, 104, 95, .18);
}

.source-token.is-phrase-preview {
  position: relative;
  z-index: 1;
  color: #fff;
  border-radius: 7px;
  background: linear-gradient(145deg, #7d4d74, #593653);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 4px rgba(125, 77, 116, .38);
}

.text-preview.is-combining-phrase .source-text {
  cursor: ew-resize;
  user-select: none;
}

.drag-combine-hint {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: #3f514d;
}

.drag-combine-hint > span:last-child,
.drag-combine-hint strong,
.drag-combine-hint small {
  display: block;
  min-width: 0;
}

.drag-combine-hint strong {
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.drag-combine-hint small {
  margin-top: 2px;
  color: #75817e;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.3;
}

.drag-combine-icon {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #fff;
  border-radius: 9px;
  background: linear-gradient(145deg, #8a617f, #64455e);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(100, 69, 94, .2);
}

.text-drag-combine-hint {
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid #d9c7d4;
  border-radius: 13px;
  background: linear-gradient(135deg, #fffafb, #f7eff5);
}

.phrase-drag-badge {
  display: flex;
  position: fixed;
  z-index: 1300;
  align-items: center;
  gap: 8px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 10px 13px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 12px;
  background: linear-gradient(145deg, #724769, #4f304a);
  box-shadow: 0 14px 32px rgba(54, 35, 51, .3);
  pointer-events: none;
}

.phrase-drag-badge > span {
  font-size: 18px;
}

.phrase-drag-badge strong {
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.is-owner-corpus-picking .source-token {
  background: rgba(245, 228, 191, .48);
  box-shadow: inset 0 -1px 0 rgba(95, 67, 29, .24);
}

.is-owner-corpus-picking .source-token:hover,
.is-owner-corpus-picking .source-token:focus-visible {
  color: #173f3a;
  background: #fff1d1;
  box-shadow: 0 0 0 2px rgba(31, 104, 95, .2);
}

.rashi-text {
  font-family: "Times New Roman", "Arial Hebrew", serif;
}

.attribution {
  margin: 11px 3px 0;
  color: #7b8582;
  font-size: 9px;
  line-height: 1.55;
}

.review-heading {
  align-items: center;
}

.review-counter {
  margin-left: auto;
  text-align: right;
}

.review-counter strong,
.review-counter span {
  display: block;
}

.review-counter strong {
  color: var(--teal);
  font-size: 15px;
}

.review-counter span {
  color: var(--ink-soft);
  font-size: 9px;
  text-transform: uppercase;
}

.progress-track {
  height: 5px;
  margin: -13px 0 23px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e3da;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #d3a358);
  transition: width .25s ease;
}

.review-stage {
  min-width: 0;
}

.review-view-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.review-view-button {
  display: flex;
  min-width: 0;
  min-height: 116px;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  color: #3e4e4a;
  border: 1px solid #d9d1c5;
  border-radius: 17px;
  background: #fbf9f4;
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.review-view-button:hover {
  border-color: #9bbab1;
  background: #f4f9f7;
  transform: translateY(-1px);
}

.review-view-button:focus-visible {
  outline: 3px solid rgba(31, 104, 95, .24);
  outline-offset: 3px;
}

.review-view-button.is-selected,
.review-view-button[aria-pressed="true"] {
  color: #143f3a;
  border-color: var(--teal);
  background: #edf6f2;
  box-shadow: 0 0 0 1px var(--teal), 0 10px 22px rgba(23, 77, 71, .1);
}

.review-view-button > span:last-child,
.review-view-button strong,
.review-view-button small {
  display: block;
  min-width: 0;
}

.review-view-button strong {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(21px, 2.5vw, 28px);
  font-weight: 850;
  letter-spacing: -.04em;
}

.review-view-button small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.review-view-icon {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 58px;
  place-items: center;
  color: var(--teal);
  border: 1px solid #bdd1ca;
  border-radius: 10px 10px 6px 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(23, 77, 71, .1) 7px 8px),
    #fffdf8;
  font-family: "Daf to Deck Frank", serif;
  font-size: 28px;
  box-shadow: 0 5px 12px rgba(57, 45, 29, .08);
}

.review-view-icon.page-icon::before,
.review-view-icon.page-icon::after {
  display: block;
  width: 29px;
  height: 2px;
  content: "";
  background: #60847c;
  box-shadow: 0 7px 0 #60847c, 0 -7px 0 #60847c;
}

.review-view-icon.page-icon::after {
  display: none;
}

.review-stage[data-review-view="text"] .daf-viewer,
.review-stage[data-review-view="page"] .review-text-view,
.review-stage[data-review-view="page"] .text-review-dock-host {
  display: none;
}

.review-text-view {
  min-width: 0;
}

.review-text-view .source-status {
  margin-top: 0;
}

.review-text-view .text-preview {
  margin-top: 20px;
}

.text-review-dock-host {
  margin-top: 18px;
}

.text-review-dock-host .review-controls-column {
  position: static;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.text-review-dock-host .review-deck-slot {
  overflow: visible;
}

.review-controls-column {
  display: flex;
  position: sticky;
  top: 12px;
  width: 100%;
  height: var(--daf-review-height);
  min-height: 600px;
  max-height: var(--daf-review-height);
  align-items: stretch;
  align-self: start;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid #ddd0bd;
  background: linear-gradient(180deg, #faf7f0 0%, #f4eee4 100%);
  box-shadow: -14px 0 32px rgba(57, 45, 29, .08);
}

.daf-review-dock-host {
  min-width: 0;
  height: var(--daf-review-height);
}

.daf-viewer {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7c9b4;
  border-radius: 20px;
  background: #fff;
  box-shadow: inset 0 0 40px rgba(57, 45, 29, .08);
}

.daf-page-workspace {
  --daf-review-height: min(84vh, 980px);
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1.86fr) minmax(320px, 1fr);
  align-items: start;
  background: #fff;
}

.daf-page-surface {
  min-width: 0;
  background: #fff;
}

.daf-viewer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid #d5c9b8;
  background: rgba(255, 253, 248, .94);
}

.daf-viewer-heading .eyebrow {
  margin-bottom: 3px;
}

.daf-viewer-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.daf-page-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #d5c9b8;
  background: #fffdf8;
}

.daf-page-navigation-button {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  color: var(--teal);
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.daf-page-navigation-button + .daf-page-navigation-button {
  justify-content: flex-end;
  border-left: 1px solid #e2d9cc;
  text-align: right;
}

.daf-page-navigation-button > span:not(.daf-page-navigation-arrow),
.daf-page-navigation-button strong,
.daf-page-navigation-button small {
  display: block;
  min-width: 0;
}

.daf-page-navigation-button strong {
  font-size: 10px;
  font-weight: 900;
}

.daf-page-navigation-button small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daf-page-navigation-button:hover:not(:disabled),
.daf-page-navigation-button:focus-visible {
  outline: 0;
  background: #edf6f2;
}

.daf-page-navigation-button:disabled {
  cursor: default;
  opacity: .45;
}

.daf-page-navigation-arrow {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.daf-viewer-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  color: var(--ink-soft);
  border-bottom: 1px solid #d5c9b8;
  background: rgba(250, 247, 240, .96);
  font-size: 9px;
  font-weight: 850;
}

.daf-view-options {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.daf-drag-combine-hint {
  flex: 0 1 230px;
  padding-right: 8px;
}

.chavruta-mode-active .daf-drag-combine-hint {
  display: none;
}

.daf-drag-combine-hint .drag-combine-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  font-size: 14px;
}

.daf-focus-toggle,
.daf-mefarshim-toggle {
  min-height: 32px;
  padding: 0 12px;
  color: var(--teal);
  border: 1px solid #b9cec7;
  border-radius: 999px;
  background: #f4faf7;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.daf-focus-toggle {
  min-height: 46px;
  padding: 0 17px;
  color: white;
  border-color: var(--teal);
  background: linear-gradient(145deg, #246b61, #174d47);
  box-shadow: 0 8px 18px rgba(23, 77, 71, .2);
  font-size: 10px;
  letter-spacing: .01em;
}

.daf-focus-toggle::before {
  margin-right: 7px;
  content: "⤢";
  font-size: 15px;
  line-height: 1;
}

.daf-focus-toggle:hover,
.daf-focus-toggle:focus-visible,
.daf-focus-toggle[aria-pressed="true"],
.daf-mefarshim-toggle:hover,
.daf-mefarshim-toggle:focus-visible,
.daf-mefarshim-toggle[aria-pressed="true"] {
  color: white;
  outline: 0;
  border-color: var(--teal);
  background: var(--teal);
}

.daf-focus-toggle:hover,
.daf-focus-toggle:focus-visible {
  background: #0f3f3a;
  box-shadow: 0 10px 22px rgba(23, 77, 71, .28);
}

.daf-owner-tools {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  color: #4d371f;
  border-bottom: 1px solid #cfae7c;
  background:
    linear-gradient(100deg, rgba(255, 250, 237, .98), rgba(246, 229, 195, .95)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(151, 102, 39, .05) 5px 6px);
}

.daf-owner-tools-heading,
.daf-owner-tool-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.daf-owner-tools-heading {
  justify-content: space-between;
  font-size: 9px;
  font-weight: 750;
}

.daf-owner-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: white;
  border-radius: 999px;
  background: #8d5c24;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.daf-owner-tool-buttons button {
  min-height: 31px;
  padding: 0 11px;
  color: #70471b;
  border: 1px solid #caa873;
  border-radius: 8px;
  background: rgba(255, 253, 248, .88);
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.daf-owner-tool-buttons button:hover,
.daf-owner-tool-buttons button:focus-visible,
.daf-owner-tool-buttons button[aria-pressed="true"] {
  color: white;
  outline: 0;
  border-color: #7e501f;
  background: #8d5c24;
}

.daf-owner-tool-buttons #dafOwnerCancelButton {
  margin-left: auto;
  color: var(--wine);
  border-color: #d4b5ad;
}

.daf-owner-tool-buttons #dafOwnerCancelButton:hover,
.daf-owner-tool-buttons #dafOwnerCancelButton:focus-visible {
  color: white;
  border-color: var(--wine);
  background: var(--wine);
}

.daf-mefarshim-toggle {
  flex: 0 1 auto;
}

.daf-zoom-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.daf-zoom-controls > span {
  margin-right: 4px;
}

.daf-zoom-controls button {
  display: inline-grid;
  min-width: 34px;
  height: 32px;
  place-items: center;
  padding: 0 9px;
  color: var(--teal);
  border: 1px solid #c8d5cf;
  border-radius: 8px;
  background: #fffdf8;
  cursor: pointer;
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.daf-zoom-controls .daf-zoom-fit {
  min-width: 43px;
  font-size: 9px;
}

.daf-zoom-controls button:hover:not(:disabled),
.daf-zoom-controls button:focus-visible {
  color: white;
  outline: 0;
  border-color: var(--teal);
  background: var(--teal);
}

.daf-zoom-controls button:disabled {
  cursor: default;
  opacity: .45;
}

.daf-zoom-controls output {
  min-width: 41px;
  color: #675f54;
  text-align: center;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.daf-viewer-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--teal);
  border: 1px solid #c9dad4;
  border-radius: 999px;
  background: #f0f7f4;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.daf-viewer-badge.is-image-only {
  color: #76501e;
  border-color: #e4c997;
  background: #fff4dc;
}

.daf-viewer-loading {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 24px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.daf-viewer-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(23, 77, 71, .18);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: daf-viewer-spin .75s linear infinite;
}

@keyframes daf-viewer-spin {
  to { transform: rotate(360deg); }
}

.daf-page-viewport {
  position: relative;
  height: var(--daf-review-height);
  min-height: 600px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
  scrollbar-color: rgba(23, 77, 71, .45) transparent;
}

.daf-page-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
  isolation: isolate;
}

.daf-page-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  line-height: 0;
}

.daf-page-canvas img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  user-select: none;
}

.daf-word-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.daf-word-overlay.is-combining-phrase {
  cursor: ew-resize;
}

.daf-word-overlay.is-owner-picking .daf-word-region {
  border-color: rgba(141, 92, 36, .42);
  background: rgba(244, 205, 130, .12);
}

.daf-word-overlay.is-owner-drawing {
  cursor: crosshair;
  pointer-events: auto;
  touch-action: none;
}

.daf-word-overlay.is-owner-drawing .daf-word-region {
  pointer-events: none;
}

.daf-owner-selected-region {
  z-index: 3;
  border-color: #a3443e !important;
  background: rgba(201, 86, 75, .26) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 5px rgba(163, 68, 62, .75) !important;
}

.daf-owner-draft-box {
  position: absolute;
  z-index: 6;
  border: 2px dashed #a3443e;
  border-radius: 2px;
  background: rgba(227, 119, 99, .16);
  pointer-events: none;
}

.daf-owner-split-line {
  position: absolute;
  z-index: 7;
  width: 2px;
  background: #a3443e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .72);
  pointer-events: none;
}

.daf-word-region {
  position: absolute;
  min-width: 4px;
  min-height: 4px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
}

.daf-word-region:hover,
.daf-word-region:focus-visible {
  border-color: rgba(181, 122, 49, .9);
  outline: 0;
  background: rgba(244, 205, 130, .32);
  box-shadow: 0 0 0 2px rgba(255, 246, 220, .78);
}

.daf-word-region.is-current {
  z-index: 2;
  border-color: #0d5048;
  background: rgba(73, 194, 166, .32);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .9),
    0 0 0 4px rgba(13, 80, 72, .68);
}

.daf-word-region.is-current-part {
  border-color: rgba(23, 77, 71, .7);
  background: rgba(73, 194, 166, .2);
}

.daf-word-region.is-phrase-preview {
  z-index: 3;
  border-color: #6b3f64;
  border-radius: 4px;
  background: rgba(144, 79, 131, .4);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 4px rgba(107, 63, 100, .42);
}

.daf-word-region.is-chavruta-highlight {
  z-index: 2;
  border-color: rgba(184, 126, 20, .68);
  background: rgba(255, 221, 81, .42);
  box-shadow: 0 0 0 1px rgba(255, 247, 193, .82);
}

.chavruta-mode-active .daf-word-region {
  touch-action: pan-x pan-y;
}

.daf-viewer-note {
  margin: 0;
  padding: 11px 15px 13px;
  color: #675f54;
  border-top: 1px solid #d5c9b8;
  background: rgba(255, 253, 248, .94);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
}

.daf-viewer-note.is-warning {
  color: #76501e;
  background: #fff8e9;
}

.review-card {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-height: 232px;
  padding: 18px 20px 16px;
  overflow: hidden;
  border: 1px solid #d7c9b4;
  border-radius: 20px;
  background:
    linear-gradient(rgba(255,255,255,.76), rgba(255,255,255,.76)),
    repeating-linear-gradient(0deg, #f4ead8 0 1px, transparent 1px 5px),
    #fffaf0;
  box-shadow: inset 0 0 55px rgba(182, 128, 57, .08);
}

.review-card::before,
.review-card::after {
  position: absolute;
  width: 50px;
  height: 50px;
  content: "";
  border-color: rgba(181,122,49,.28);
}

.review-card::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.review-card::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 9px;
}

.source-tag {
  padding: 5px 9px;
  color: var(--teal);
  border: 1px solid #c7d8d2;
  border-radius: 999px;
  background: #f0f7f4;
  font-weight: 850;
}

.occurrence-tools {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 0;
  min-height: 26px;
  margin: 6px 0 -8px;
  text-align: right;
}

.occurrence-button {
  padding: 0;
  color: #7a511f;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-color: rgba(122, 81, 31, .35);
  text-underline-offset: 3px;
}

.occurrence-button:hover:not(:disabled) {
  color: var(--teal);
  text-decoration-color: currentColor;
}

.occurrence-button:disabled {
  cursor: default;
  opacity: .66;
  text-decoration: none;
}

.occurrence-tools small {
  max-width: 360px;
  color: #8b8175;
  font-size: 8px;
  line-height: 1.35;
}

.candidate-word {
  display: grid;
  min-height: 108px;
  place-items: center;
  margin: 6px 0 0;
  padding: 12px 18px 8px;
  text-align: center;
  color: #2b241b;
  font-family: "Daf to Deck Frank", serif;
  font-size: clamp(52px, 5.25vw, 76px);
  font-synthesis: none;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.candidate-word.is-commentary {
  min-height: 112px;
  padding-block: 16px 12px;
  font-size: clamp(40px, 4.25vw, 64px);
  line-height: 1.28;
}

.candidate-word.is-phrase {
  font-size: clamp(40px, 4vw, 60px);
  line-height: 1.2;
}

.candidate-word.is-commentary.is-phrase {
  font-size: clamp(32px, 3.3vw, 50px);
  line-height: 1.34;
}

.candidate-word.is-long-word,
.candidate-word.is-commentary.is-long-word {
  font-size: clamp(31px, 3.1vw, 48px);
}

.candidate-word.is-very-long-word,
.candidate-word.is-commentary.is-very-long-word {
  font-size: clamp(27px, 2.7vw, 41px);
}

.candidate-word.font-regular {
  font-family: "Daf to Deck Frank", serif;
}

.candidate-word.font-rashi {
  padding-block: 18px 14px;
  font-family: "Daf to Deck Rashi", serif;
  line-height: 1.36;
}

.candidate-word.font-paleo {
  font-family: "Daf to Deck Paleo", serif;
}

.candidate-key {
  min-height: 16px;
  margin: 0 0 8px;
  color: #989086;
  text-align: center;
  font-size: 9px;
}

.candidate-support-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 6px;
}

.candidate-support-row .candidate-key {
  min-height: 0;
  margin: 0;
}

.nikkud-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  color: #325952;
  border: 1px solid #bdd0c9;
  border-radius: 999px;
  background: rgba(239, 247, 244, .9);
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
}

.split-phrase-button {
  min-height: 30px;
  padding: 5px 10px;
  color: #5f4134;
  border: 1px solid #d8c4b5;
  border-radius: 999px;
  background: #fbf5ef;
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
}

.split-phrase-button:hover:not(:disabled) {
  border-color: #b38b70;
  background: #f5e9df;
}

.split-phrase-button:focus-visible {
  outline: 3px solid rgba(148, 91, 58, .24);
  outline-offset: 2px;
}

.nikkud-toggle:hover:not(:disabled) {
  color: #123f3a;
  border-color: #7fa89e;
  background: #e4f1ed;
}

.nikkud-toggle:focus-visible,
.recognized-phrase-chip:focus-visible,
.learning-meaning-choice:focus-visible {
  outline: 3px solid rgba(31, 104, 95, .28);
  outline-offset: 2px;
}

.nikkud-toggle:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.nikkud-toggle-track {
  display: inline-flex;
  position: relative;
  width: 25px;
  height: 15px;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #bdc9c5;
  transition: background .15s ease;
}

.nikkud-toggle-track span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(30, 48, 44, .25);
  transition: transform .15s ease;
}

.nikkud-toggle[aria-pressed="true"] {
  color: #174d47;
  border-color: #80a99f;
  background: #e2f0eb;
}

.nikkud-toggle[aria-pressed="true"] .nikkud-toggle-track {
  background: var(--teal-bright);
}

.nikkud-toggle[aria-pressed="true"] .nikkud-toggle-track span {
  transform: translateX(10px);
}

.nikkud-toggle-state {
  min-width: 18px;
  font-size: 8px;
  text-align: left;
}

.candidate-assist-availability,
.candidate-assist-status {
  margin: -3px 0 7px;
  color: #7b8582;
  text-align: center;
  font-size: 8px;
  line-height: 1.35;
}

/* Keep secondary guidance available to screen readers without crowding the active card. */
.review-card .is-condensed-microcopy,
.review-card .occurrence-tools small,
.review-card .recognized-phrases-heading small,
.review-card .candidate-assist-status {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.card-shas-frequency {
  display: block;
  color: #6c776f;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .015em;
  line-height: 1.35;
}

#candidateShasFrequency {
  margin: -5px 0 8px;
  text-align: center;
}

.recognized-phrases {
  width: 100%;
  margin: 0 0 8px;
  padding: 7px 0 2px;
  border-top: 1px solid rgba(207, 194, 175, .72);
}

.recognized-phrases-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0;
  margin: 0 2px 5px;
}

.recognized-phrases-heading strong {
  color: #63523c;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.recognized-phrases-heading small {
  overflow: hidden;
  color: #8b8175;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recognized-phrase-list {
  display: flex;
  gap: 6px;
  max-width: 100%;
  padding: 1px 2px 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: rgba(23, 77, 71, .35) transparent;
  scrollbar-width: thin;
}

.recognized-phrase-chip {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  color: #284943;
  border: 1px solid #bfd2cc;
  border-radius: 10px;
  background: #f1f8f5;
  cursor: pointer;
}

.recognized-phrase-chip:hover:not(:disabled),
.recognized-phrase-chip[aria-pressed="true"] {
  color: #153e39;
  border-color: #79a79b;
  background: #e2f1ec;
}

.recognized-phrase-hebrew {
  font-family: "Daf to Deck Frank", serif;
  font-size: 17px;
  line-height: 1.15;
  direction: rtl;
}

.recognized-phrase-count {
  color: #687873;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.learning-meaning-suggestions {
  width: 100%;
  margin: 1px 0 10px;
}

.learning-meaning-suggestions-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 6px;
}

.learning-meaning-suggestions-heading > strong {
  color: #6c4e28;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.learning-meaning-suggestions-heading > small {
  color: #7f715e;
  font-size: 8px;
  font-weight: 750;
}

.learning-meaning-suggestions-heading a {
  color: inherit;
  text-underline-offset: 2px;
}

.suggested-translation {
  width: 100%;
  margin: 1px 0 10px;
  padding: 8px 11px;
  color: #5f4a2f;
  border: 1px solid rgba(191, 149, 83, .34);
  border-radius: 10px;
  background: rgba(249, 231, 193, .46);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.suggested-translation span {
  font-weight: 750;
}

.suggested-translation strong {
  color: #253f3a;
  font-size: 13px;
}

.owner-suggested-translation-details {
  width: 100%;
  margin: 0 0 8px;
}

.owner-suggested-translation-details > summary {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 6px 10px;
  color: #315c55;
  border: 1px solid #c6d8d2;
  border-radius: 999px;
  background: #f3f8f6;
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
  list-style: none;
}

.owner-suggested-translation-details > summary::-webkit-details-marker {
  display: none;
}

.owner-suggested-translation-details[open] > summary {
  margin-bottom: 7px;
  color: #fff;
  background: #315c55;
}

.owner-meaning-scopes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.owner-meaning-scope {
  min-width: 0;
}

.owner-meaning-scope > h4 {
  margin: 0 0 5px;
  color: #315c55;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}

.owner-suggested-translation {
  width: 100%;
  margin: 0;
  padding: 10px;
  border: 1px dashed rgba(23, 77, 71, .46);
  border-radius: 12px;
  background: rgba(229, 242, 238, .58);
}

.owner-suggested-translation .field > span {
  color: #174d47;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.owner-global-translation-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.owner-suggested-translation input {
  min-height: 42px;
  background: rgba(255, 255, 255, .94);
  font-size: 15px;
}

.owner-suggested-translation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.owner-suggested-translation-actions button {
  width: auto;
  min-height: 38px;
  padding: 7px 11px;
  font-size: 10px;
}

.owner-suggested-translation .form-error {
  margin: 8px 0 0;
}

.learning-meaning-choices {
  display: flex;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-color: rgba(23, 77, 71, .35) transparent;
  scrollbar-width: thin;
}

.learning-meaning-choice {
  display: flex;
  flex: 1 1 0;
  min-width: 116px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  color: #294640;
  border: 1px solid #d7cbb9;
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  cursor: pointer;
  text-align: center;
}

.learning-meaning-choice:hover:not(:disabled),
.learning-meaning-choice[aria-pressed="true"] {
  border-color: #8cb0a6;
  background: #edf6f3;
}

.learning-meaning-definition {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.3;
}

.direction-pad {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ". up ."
    "left down right";
  gap: 8px;
  width: 100%;
  margin: 0 auto;
  padding: 9px;
  border: 1px solid rgba(199, 188, 171, .82);
  border-radius: 18px;
  background: rgba(255, 253, 248, .9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 9px 24px rgba(62, 49, 32, .09);
}

.direction-up { grid-area: up; }
.direction-left { grid-area: left; }
.direction-down { grid-area: down; }
.direction-right { grid-area: right; }

.direction-pad.is-chavruta {
  grid-template-areas:
    ". up ."
    "left . right";
}

.direction-button {
  position: relative;
  min-width: 0;
  min-height: 68px;
  padding: 7px 6px 6px;
  flex-direction: column;
  gap: 3px;
  border-radius: 13px;
  border-bottom-width: 3px;
  font-size: 10px;
  box-shadow: 0 6px 14px rgba(38, 45, 39, .1), inset 0 1px 0 rgba(255, 255, 255, .72);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

.direction-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(38, 45, 39, .13);
}

.direction-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 3px 8px rgba(38, 45, 39, .09);
}

#directionPad .direction-up {
  border-color: #d7b674;
  background: linear-gradient(180deg, #fff7e7, #f1d9aa);
}

#directionPad .direction-left {
  border-color: #afc9c1;
  background: linear-gradient(180deg, #fff, #eaf4f0);
}

#directionPad .direction-down {
  border-color: #123f3a;
  background: linear-gradient(180deg, #23675e, #123f3a);
  box-shadow: 0 7px 17px rgba(18, 63, 58, .22), inset 0 1px 0 rgba(255, 255, 255, .16);
}

#directionPad .direction-right {
  color: var(--blue);
  border-color: #b8c9d8;
  background: linear-gradient(180deg, #fff, #eaf1f7);
}

.direction-button:focus-visible {
  outline: 3px solid rgba(31, 104, 95, .28);
  outline-offset: 3px;
}

.direction-button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.direction-arrow {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 10px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  opacity: .82;
}

.direction-label {
  display: flex;
  min-width: 0;
  align-items: center;
  flex: 0 1 auto;
  flex-direction: column;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
}

.direction-label small {
  margin-top: 2px;
  font-size: 8px;
  font-weight: 700;
  opacity: .68;
  white-space: normal;
}

.direction-button kbd {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0 3px;
  background: rgba(255, 255, 255, .48);
}

.review-deck-slot {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 2px 3px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(23, 77, 71, .42) transparent;
  scrollbar-gutter: stable;
}

.review-deck-slot .deck-panel {
  position: static;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 9px 24px rgba(57, 45, 29, .08);
}

.review-deck-slot .deck-panel h2 {
  font-size: 21px;
}

.review-deck-slot .card-count {
  width: 48px;
  height: 48px;
}

.review-deck-slot .card-count strong {
  font-size: 17px;
}

.review-deck-slot .sheet-visual {
  grid-template-rows: repeat(4, clamp(28px, 3vw, 38px));
  gap: 5px;
  margin: 15px 0 10px;
  padding: 10px;
}

.review-deck-slot .sheet-stats div {
  padding: 5px 3px;
}

.review-deck-slot .save-to-deck-box {
  margin-top: 8px;
  padding: 7px 9px;
}

.review-deck-slot .compact-switch {
  min-height: 34px;
}

.review-deck-slot .queue-list-wrap {
  margin: 9px 0;
  padding-top: 8px;
}

.review-deck-slot .queue-list {
  max-height: 104px;
  overflow-y: auto;
}

.review-deck-slot .queue-list li {
  min-height: 42px;
}

.review-deck-slot .generate-button {
  min-height: 54px;
}

.review-deck-slot .generate-button strong {
  font-size: 15px;
}

.review-deck-slot .generate-icon {
  width: 33px;
  height: 38px;
}

.review-deck-slot .output-path {
  margin-top: 6px;
}

.review-deck-slot .history-box {
  margin-top: 7px;
  padding: 7px 8px;
}

.review-deck-slot .deck-locked,
.review-deck-slot .quiz-locked {
  padding: 20px 8px;
}

.review-deck-slot #personalDeckPanel .deck-picker {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 10px;
  flex-direction: column;
}

.review-deck-slot #personalDeckPanel .deck-chooser {
  flex: 1 1 auto;
  min-height: 92px;
  max-height: none;
  align-content: start;
}

.review-deck-slot #personalDeckPanel .deck-actions {
  margin-top: 6px;
  padding: 6px;
}

.review-deck-slot #personalDeckPanel {
  min-height: 100%;
}

.review-deck-slot #deckMemberContent {
  min-height: 100%;
  flex-direction: column;
}

.review-deck-slot #deckMemberContent:not(.hidden) {
  display: flex;
}

.review-deck-slot #personalDeckPanel .queue-list-wrap,
.review-deck-slot #personalDeckPanel .quiz-start-side {
  display: none;
}

body.daf-focus-mode {
  overflow: hidden;
}

body.daf-focus-mode #reviewPanel {
  position: fixed;
  inset: 0;
  z-index: 1200;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7f2e9;
}

body.daf-focus-mode #reviewPanel > .panel-heading,
body.daf-focus-mode #reviewPanel > .progress-track,
body.daf-focus-mode #reviewViewPicker,
body.daf-focus-mode #chavrutaStudyHint,
body.daf-focus-mode .review-text-view,
body.daf-focus-mode .text-review-dock-host {
  display: none !important;
}

body.daf-focus-mode .review-stage,
body.daf-focus-mode .daf-viewer {
  width: 100%;
  height: 100dvh;
}

body.daf-focus-mode .daf-viewer {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.daf-focus-mode .daf-page-workspace {
  --focus-review-clearance: clamp(144px, 18dvh, 180px);
  display: block;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

body.daf-focus-mode .daf-page-surface {
  height: 100%;
}

body.daf-focus-mode .daf-page-viewport {
  height: 100%;
  min-height: 0;
  padding-bottom: var(--focus-review-clearance);
  scroll-padding-bottom: var(--focus-review-clearance);
}

body.daf-focus-mode .daf-review-dock-host {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 1210;
  width: min(1060px, calc(100% - 24px));
  height: auto;
  margin: 0 auto;
  pointer-events: none;
}

body.daf-focus-mode .review-controls-column {
  display: grid;
  position: static;
  grid-template-columns: minmax(220px, .72fr) minmax(360px, 1.28fr);
  align-items: stretch;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: var(--focus-review-clearance);
  gap: 8px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(203, 188, 164, .92);
  border-radius: 17px;
  background: rgba(249, 245, 237, .94);
  box-shadow: 0 18px 52px rgba(31, 39, 34, .3);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

body.daf-focus-mode .review-card {
  width: 100%;
  height: 124px;
  min-height: 0;
  max-height: 124px;
  padding: 10px 13px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.daf-focus-mode .direction-pad {
  position: static;
  z-index: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: "left up down right";
  align-self: end;
  height: 70px;
  gap: 6px;
  margin: 0;
  padding: 6px;
  background: rgba(255, 253, 248, .96);
}

body.daf-focus-mode .direction-button {
  min-height: 56px;
  height: 56px;
  padding: 8px 4px 6px;
}

body.daf-focus-mode .direction-arrow {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  font-size: 17px;
}

body.daf-focus-mode .direction-label {
  font-size: 9px;
}

body.daf-focus-mode .direction-label small {
  font-size: 7px;
}

body.daf-focus-mode .candidate-word {
  min-height: 52px;
  margin-top: 2px;
  padding: 4px 8px;
  font-size: clamp(34px, 4vw, 48px);
}

body.daf-focus-mode .candidate-word.is-commentary {
  min-height: 58px;
  padding: 5px 8px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.28;
}

body.daf-focus-mode .candidate-word.is-commentary.is-phrase,
body.daf-focus-mode .candidate-word.is-long-word {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.3;
}

body.daf-focus-mode .candidate-word.is-very-long-word,
body.daf-focus-mode .candidate-word.is-commentary.is-very-long-word {
  font-size: clamp(21px, 2.3vw, 30px);
}

body.daf-focus-mode .candidate-support-row {
  min-height: 30px;
  margin: 3px 0 4px;
}

/* Five-word commentary phrases keep the full prompt and both phrase tools above the fold. */
body.daf-focus-mode .review-card:has(.candidate-word.is-many-word-phrase) {
  padding: 6px 10px;
}

body.daf-focus-mode .review-card:has(.candidate-word.is-many-word-phrase) .review-meta {
  height: 22px;
  min-height: 22px;
  line-height: 1;
}

body.daf-focus-mode .review-card:has(.candidate-word.is-many-word-phrase) .source-tag {
  padding: 3px 7px;
}

body.daf-focus-mode .candidate-word.is-many-word-phrase {
  height: 56px;
  min-height: 56px;
  margin: 0;
  padding: 1px 4px;
}

body.daf-focus-mode .candidate-word.font-rashi.is-many-word-phrase,
body.daf-focus-mode .candidate-word.is-commentary.is-many-word-phrase {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.16;
}

body.daf-focus-mode .candidate-word.font-rashi.is-extra-dense-word,
body.daf-focus-mode .candidate-word.is-commentary.is-extra-dense-word {
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.14;
}

body.daf-focus-mode .review-card:has(.candidate-word.is-many-word-phrase) .candidate-support-row {
  height: 30px;
  min-height: 30px;
  flex-wrap: nowrap;
  gap: 5px;
  margin: 0;
}

body.daf-focus-mode .review-card:has(.candidate-word.is-many-word-phrase) .split-phrase-button,
body.daf-focus-mode .review-card:has(.candidate-word.is-many-word-phrase) .nikkud-toggle {
  height: 30px;
  min-height: 30px;
  padding: 3px 8px;
  font-size: 8px;
}

body.daf-focus-mode .review-controls-column:has(.direction-pad.hidden) .review-card,
body.daf-focus-mode .review-complete:not(.hidden) {
  grid-column: 1 / -1;
}

body.daf-focus-mode .owner-suggested-translation-details {
  display: none;
}

body.daf-focus-mode .review-controls-column:has(.review-complete:not(.hidden)) .direction-pad {
  display: none;
}

body.daf-focus-mode .review-complete {
  max-height: 124px;
  padding: 10px 14px;
  overflow: auto;
}

body.daf-focus-mode .review-complete .complete-mark {
  width: 32px;
  height: 32px;
  box-shadow: 0 0 0 4px var(--teal-pale);
  font-size: 16px;
}

body.daf-focus-mode .review-complete h3 {
  margin: 5px 0 2px;
  font-size: 18px;
}

body.daf-focus-mode .review-complete p {
  margin-bottom: 7px;
  font-size: 9px;
}

body.daf-focus-mode .review-deck-slot {
  display: none !important;
}

body.daf-focus-mode .daf-focus-toggle::before {
  margin-right: 7px;
  content: "×";
  font-size: 20px;
  line-height: 1;
}

body.daf-focus-mode .daf-focus-toggle {
  position: fixed;
  top: 13px;
  right: 14px;
  z-index: 1225;
  min-height: 48px;
  padding: 0 20px;
  color: white;
  border: 1px solid rgba(255, 255, 255, .72);
  background: #153f3a;
  box-shadow: 0 12px 28px rgba(20, 52, 47, .32);
  font-size: 11px;
}

body.daf-focus-mode .toast-region {
  top: auto;
  right: 12px;
  bottom: calc(clamp(144px, 18dvh, 180px) + 18px);
  z-index: 1220;
  width: min(320px, calc(100% - 24px));
  gap: 0;
}

body.daf-focus-mode .toast {
  padding: 10px 12px;
  font-size: 10px;
  line-height: 1.35;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-family: inherit;
  font-size: 8px;
  opacity: .55;
}

.action-keycap {
  min-width: 54px;
  height: 25px;
  padding: 0 9px;
  border-color: rgba(255,255,255,.72);
  border-bottom-width: 3px;
  background: rgba(255,255,255,.1);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  opacity: 1;
}

.translation-actions .action-keycap {
  margin-left: 3px;
}

#translationSpaceKey {
  min-width: 86px;
  height: 35px;
  gap: 7px;
  padding: 0 10px;
  border-radius: 8px;
  border-bottom-width: 4px;
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.13);
  font-size: 10px;
  line-height: 1;
}

#translationSpaceKey::after {
  content: "↵";
  font-size: 17px;
  line-height: 1;
}

.translation-form {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 11px;
  border: 1px solid rgba(202, 185, 158, .72);
  border-radius: 14px;
  background: rgba(255, 253, 248, .82);
  box-shadow: inset 0 1px 0 #fff, 0 5px 16px rgba(82, 62, 36, .06);
}

.translation-field > span {
  text-align: center;
}

.translation-field input {
  min-height: 54px;
  border-color: #cfc2af;
  background: rgba(255, 255, 255, .94);
  text-align: center;
  font-size: 18px;
}

.translation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 9px;
}

.translation-actions .primary-button {
  flex: 1 1 230px;
  width: auto;
  max-width: 330px;
  min-width: 0;
  min-height: 58px;
  padding: 7px 12px 7px 16px;
  justify-content: space-between;
}

.translation-actions .primary-button > span:first-child {
  overflow-wrap: anywhere;
  text-align: left;
}

.translation-actions .text-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 13px;
  border: 1px solid #c7d8d2;
  border-radius: 10px;
  background: rgba(255,255,255,.7);
  text-decoration: none;
}

.translation-escape-key {
  display: inline-grid;
  min-width: 40px;
  height: 27px;
  place-items: center;
  padding: 0 7px;
  color: var(--teal);
  border: 1px solid #9cb8b0;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #f8fcfa;
  box-shadow: inset 0 -1px 0 rgba(23, 77, 71, .08);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
  opacity: 1;
}

.translation-actions .text-button:hover,
.translation-actions .text-button:focus-visible {
  border-color: #86aba1;
  outline: 0;
  background: #f0f7f4;
  text-decoration: none;
}

#translationSubmitButton > span[aria-hidden="true"] {
  display: none;
}

.text-button {
  padding: 5px;
  color: var(--teal);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.text-button:hover {
  text-decoration: underline;
}

.text-button.danger {
  color: #9c4c47;
}

.review-complete {
  padding: 50px 20px 30px;
  text-align: center;
}

.review-complete h3 {
  margin: 14px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
}

.review-complete p {
  max-width: 520px;
  margin: 0 auto 22px;
  color: var(--ink-soft);
  font-size: 12px;
}

.review-complete > div:last-child {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.complete-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  color: white;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 8px var(--teal-pale);
  font-size: 26px;
  font-weight: 900;
}

.deck-panel {
  position: sticky;
  top: 18px;
  padding: 24px;
}

.deck-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.deck-panel h2 {
  font-size: 28px;
}

.card-count {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  color: var(--teal);
  border: 1px solid #c9d9d3;
  border-radius: 50%;
  background: var(--teal-pale);
}

.card-count strong,
.card-count span {
  display: block;
  line-height: 1;
}

.card-count strong {
  font-size: 20px;
}

.card-count span {
  margin-top: 3px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.sheet-visual {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 26px);
  gap: 5px;
  margin: 24px 0 13px;
  padding: 11px;
  border: 1px solid #d8cbb8;
  border-radius: 12px;
  background: #f8f0e3;
  box-shadow: inset 0 0 15px rgba(134,93,42,.08);
}

.sheet-visual span {
  border: 1px dashed #cbbda8;
  border-radius: 3px;
  background: rgba(255,255,255,.5);
  transition: background .2s ease, border-color .2s ease;
}

.sheet-visual span.filled {
  border-style: solid;
  border-color: #6d998d;
  background: linear-gradient(135deg, #e8f3ef, #bcd8cf);
}

.sheet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.sheet-stats div {
  padding: 8px 5px;
  text-align: center;
  border-radius: 8px;
  background: #f7f4ee;
}

.sheet-stats strong,
.sheet-stats span {
  display: block;
}

.sheet-stats strong {
  font-size: 14px;
}

.sheet-stats span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 7px;
  line-height: 1.2;
  text-transform: uppercase;
}

.queue-list-wrap {
  margin: 22px 0;
  padding-top: 17px;
  border-top: 1px solid #e3dcd1;
}

.queue-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.queue-heading strong {
  font-size: 10px;
  text-transform: uppercase;
}

.queue-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px;
  color: #89928f;
  border: 1px dashed #d7d0c4;
  border-radius: 10px;
}

.queue-empty span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: #f1ede6;
  font-size: 18px;
}

.queue-empty p {
  margin: 0;
  font-size: 9px;
}

.queue-list {
  max-height: 280px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.queue-list li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 5px;
  border-bottom: 1px solid #eee8df;
}

.queue-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--ink-soft);
  border-radius: 6px;
  background: #f2eee7;
  font-size: 8px;
  font-weight: 850;
}

.queue-copy strong,
.queue-copy span {
  display: block;
}

.queue-copy strong {
  overflow: hidden;
  font-family: "Arial Hebrew", "Noto Sans Hebrew", serif;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: left;
}

.queue-copy strong.font-regular { font-family: "Daf to Deck Frank", serif; }
.queue-copy strong.font-rashi { font-family: "Daf to Deck Rashi", serif; }
.queue-copy strong.font-paleo { font-family: "Daf to Deck Paleo", serif; }

.queue-copy span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-copy .card-shas-frequency {
  overflow: hidden;
  margin-top: 2px;
  color: #6c776f;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  color: #9b6a64;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.queue-remove:hover {
  color: white;
  background: #a75e56;
}

.generate-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 66px;
  padding: 11px 13px 11px 17px;
  color: #fff8e9;
  border-radius: 14px;
  background: linear-gradient(135deg, #9b622b, #bd843f);
  box-shadow: 0 12px 25px rgba(160,105,47,.22);
  text-align: left;
}

.generate-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(160,105,47,.29);
}

.generate-button:disabled {
  cursor: not-allowed;
  opacity: .43;
  box-shadow: none;
}

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

.generate-button strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.generate-button small {
  margin-top: 3px;
  opacity: .72;
  font-size: 8px;
}

.generate-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 43px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 5px;
  background: rgba(255,255,255,.1);
  font-size: 8px;
  font-weight: 900;
}

.output-path {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
  text-align: center;
}

.output-path span {
  font-weight: 800;
}

.history-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 21px;
  padding: 12px;
  border: 1px solid #e3dcd2;
  border-radius: 11px;
  background: #f8f5ef;
}

.history-box strong,
.history-box span {
  display: block;
}

.history-box strong {
  font-size: 9px;
}

.history-box span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: grid;
  width: min(380px, calc(100% - 44px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  color: white;
  border-radius: 12px;
  background: #244944;
  box-shadow: 0 14px 35px rgba(0,0,0,.18);
  font-size: 11px;
  animation: toast-in .22s ease both;
}

.toast.error {
  background: #83453f;
}

.toast.warning {
  color: #46331d;
  background: #f1d8a9;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(9px); }
}

dialog {
  width: min(540px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(12, 31, 29, .63);
  backdrop-filter: blur(4px);
}

.dialog-card {
  position: relative;
  margin: 0;
  padding: 38px;
  border: 1px solid #e2dace;
  border-radius: 20px;
  background: var(--card);
  text-align: center;
}

.dialog-card h2 {
  margin: 5px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
}

.dialog-card > p:not(.eyebrow):not(.print-note) {
  max-width: 410px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 11px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 50%;
  background: #f0ece5;
  font-size: 19px;
  cursor: pointer;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 73px;
  margin: 0 auto 17px;
  color: white;
  border-radius: 8px;
  background: linear-gradient(135deg, #9b622b, #bd843f);
  box-shadow: 0 11px 23px rgba(160,105,47,.22);
  font-size: 11px;
  font-weight: 900;
}

.dialog-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 23px 0;
}

.dialog-facts span {
  padding: 12px 6px;
  color: var(--ink-soft);
  border-radius: 10px;
  background: var(--paper-deep);
  font-size: 9px;
}

.dialog-facts strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.dialog-card menu {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 25px 0 0;
  padding: 0;
}

#dafOwnerEditorDialog {
  width: min(760px, calc(100% - 32px));
}

.daf-owner-editor-dialog {
  max-height: min(860px, calc(100vh - 34px));
  overflow: auto;
  text-align: left;
}

.daf-owner-editor-dialog > .eyebrow,
.daf-owner-editor-dialog > h2 {
  text-align: center;
}

.daf-owner-selected-word {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 19px 0;
  padding: 12px 15px;
  border: 1px solid #d4c4aa;
  border-radius: 12px;
  background: #faf4e8;
}

.daf-owner-selected-word strong {
  font-family: "Daf to Deck Frank", serif;
  font-size: 31px;
  font-weight: 400;
}

.daf-owner-selected-word span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  text-align: right;
}

.daf-owner-operation-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 13px;
  border: 1px solid #ddd0bd;
  border-radius: 12px;
}

.daf-owner-operation-picker legend {
  padding: 0 5px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 900;
}

.daf-owner-operation-picker button {
  min-height: 38px;
  color: var(--teal);
  border: 1px solid #b9cec7;
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.daf-owner-operation-picker button:hover,
.daf-owner-operation-picker button:focus-visible,
.daf-owner-operation-picker button[aria-pressed="true"] {
  color: white;
  outline: 0;
  border-color: var(--teal);
  background: var(--teal);
}

.daf-owner-operation-help {
  min-height: 38px;
  margin: 12px 0 0 !important;
  padding: 10px 12px;
  color: #5d4931 !important;
  border-radius: 9px;
  background: #f5eee2;
  font-size: 10px !important;
}

.daf-owner-target-fields,
.daf-owner-run-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.daf-owner-run-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.daf-owner-target-preview {
  grid-column: 1 / -1;
  min-height: 42px;
  margin: 0 !important;
  padding: 7px 10px;
  color: var(--teal) !important;
  border: 1px dashed #b9cec7;
  border-radius: 9px;
  font-family: "Daf to Deck Frank", serif;
  font-size: 23px !important;
  text-align: center;
}

.daf-owner-draw-summary {
  margin-top: 12px;
  padding: 9px 11px;
  color: var(--ink-soft);
  border: 1px solid #ded5c8;
  border-radius: 9px;
  background: #fbf9f5;
  font-size: 9px;
}

.daf-owner-editor-dialog .form-error {
  margin-top: 10px !important;
  text-align: left;
}

.success-dialog code {
  display: block;
  max-width: 100%;
  margin: 18px 0 0;
  padding: 10px;
  overflow: auto;
  color: var(--teal);
  border: 1px solid #d9e3df;
  border-radius: 9px;
  background: #f1f7f4;
  font-size: 9px;
  white-space: nowrap;
}

.print-note {
  margin: 11px 0 0;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
}

.help-dialog ol {
  margin: 25px 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.help-dialog li {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid #ebe5db;
}

.help-dialog li > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--teal);
  border-radius: 50%;
  background: var(--teal-pale);
  font-weight: 850;
}

.help-dialog li strong {
  font-size: 11px;
}

.help-dialog li p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

/* Mode navigation, accounts, synchronized decks, and learning mode */
.account-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  padding: 4px 11px 4px 5px;
  color: var(--teal);
  border: 1px solid #cbd9d4;
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.account-button:hover {
  border-color: var(--teal);
  background: #f0f7f4;
}

.account-avatar,
.member-avatar {
  display: grid;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--teal);
  font-weight: 850;
  text-transform: uppercase;
}

.account-avatar {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.mode-switcher {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 10px;
  border: 1px solid rgba(216, 207, 191, .95);
  border-radius: 20px;
  background: rgba(255, 253, 248, .94);
  box-shadow: 0 14px 38px rgba(64, 57, 47, .11);
}

.mode-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  gap: 14px;
  padding: 13px 18px;
  color: var(--ink);
  border: 1px solid #d8cfbf;
  border-radius: 15px;
  background: #fffdf8;
  box-shadow: 0 5px 15px rgba(49, 43, 36, .06);
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, color .16s ease, background-color .16s ease;
}

.mode-button:hover {
  color: var(--ink);
  border-color: #c8bda9;
  background: #fff;
  box-shadow: 0 9px 22px rgba(49, 43, 36, .1);
  transform: translateY(-2px);
}

.mode-button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.mode-button.active {
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(23, 77, 71, .22);
  transform: translateY(-2px);
}

.mode-button[data-mode="print"].active {
  background: var(--teal);
}

.mode-button[data-mode="deck"].active {
  background: var(--blue);
  box-shadow: 0 10px 25px rgba(66, 94, 120, .24);
}

.mode-button[data-mode="chavruta"].active {
  background: #68445f;
  box-shadow: 0 10px 25px rgba(104, 68, 95, .27);
}

.mode-button[data-mode="quiz"].active {
  background: var(--wine);
  box-shadow: 0 10px 25px rgba(122, 62, 59, .24);
}

.mode-button[data-mode="learn"].active {
  background: #35697a;
  box-shadow: 0 10px 25px rgba(53, 105, 122, .27);
}

.mode-button > span:last-child,
.mode-button strong,
.mode-button small {
  display: block;
}

.mode-button strong {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.01em;
}

.mode-button small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  opacity: .78;
}

/*
 * Simple mode: keep the useful controls prominent and remove duplicate helper
 * copy from the visual hierarchy. The underlying markup remains available for
 * accessibility and for restoring the richer presentation later.
 */
.source-panel > .panel-heading .eyebrow,
.review-heading .eyebrow,
.review-counter span,
.review-view-button small,
.drag-combine-hint small,
.daf-viewer-heading .eyebrow,
.daf-viewer-badge,
.daf-zoom-controls > span,
.direction-label small,
#directionPad .direction-button kbd,
.mode-button small,
.text-preview summary small {
  display: none;
}

.review-view-picker {
  gap: 10px;
  margin-bottom: 14px;
}

.review-view-button {
  min-height: 76px;
  gap: 12px;
  padding: 12px 16px;
}

.review-view-button strong {
  font-size: clamp(18px, 2vw, 23px);
}

.review-view-icon {
  width: 40px;
  height: 44px;
  font-size: 23px;
}

.review-view-icon.page-icon::before,
.review-view-icon.page-icon::after {
  width: 23px;
}

.daf-viewer-heading {
  align-items: center;
  padding-block: 10px;
}

.daf-viewer-heading h3 {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 850;
}

.drag-combine-hint strong {
  font-size: 11px;
}

.mode-button {
  min-height: 66px;
}

.mode-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 2px solid currentColor;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
}

.mode-switcher .mode-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.mode-button[data-mode="print"]:not(.active) .mode-icon { color: var(--teal); }
.mode-button[data-mode="deck"]:not(.active) .mode-icon { color: var(--blue); }
.mode-button[data-mode="chavruta"]:not(.active) .mode-icon { color: #68445f; }
.mode-button[data-mode="quiz"]:not(.active) .mode-icon { color: var(--wine); }
.mode-button[data-mode="learn"]:not(.active) .mode-icon { color: #35697a; }

.mode-button.active .mode-icon {
  background: rgba(255,255,255,.1);
}

.mode-icon-chavruta {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 15px;
  letter-spacing: -.05em;
}

.mode-icon-learn {
  font-family: Georgia, serif;
  font-size: 18px;
}

.chavruta-panel {
  min-width: 0;
  overflow: hidden;
  border-color: rgba(104, 68, 95, .28);
  background:
    radial-gradient(circle at 100% 0, rgba(211, 153, 67, .1), transparent 15rem),
    rgba(255, 253, 248, .98);
}

.chavruta-panel #chavrutaMemberContent:not(.hidden) {
  display: block;
}

.chavruta-locked {
  padding: 44px 14px;
}

.chavruta-lock-mark {
  color: #68445f;
  border-color: #dccbd6;
  background: #f5edf2;
  font-family: "Daf to Deck Frank", Georgia, serif;
}

.chavruta-panel-heading,
.chavruta-session-heading,
.chavruta-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chavruta-panel-heading,
.chavruta-session-heading {
  align-items: flex-start;
}

.chavruta-panel-heading h2,
.chavruta-session-heading h2,
.chavruta-section-heading h3 {
  margin: 0;
}

.chavruta-refresh-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  color: #68445f;
  border: 1px solid #d9c7d2;
  border-radius: 999px;
  background: #fbf5f8;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.chavruta-refresh-button:hover,
.chavruta-refresh-button:focus-visible {
  color: white;
  outline: 0;
  border-color: #68445f;
  background: #68445f;
}

.chavruta-refresh-button span:first-child {
  font-size: 15px;
  line-height: 1;
}

.chavruta-intro {
  margin: 9px 0 18px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.chavruta-friend-form {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid #decfd8;
  border-radius: 14px;
  background: #fbf6f9;
}

.chavruta-friend-form .primary-button {
  width: 100%;
}

.chavruta-lobby-section {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid #e4d9dc;
}

.chavruta-section-heading h3 {
  color: #463942;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .01em;
}

.chavruta-count {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  padding: 0 6px;
  color: #68445f;
  border-radius: 999px;
  background: #f1e6ed;
  font-size: 9px;
  font-weight: 900;
}

.chavruta-empty {
  margin: 9px 0 0;
  padding: 12px;
  color: #7c6f76;
  border: 1px dashed #d9ccd3;
  border-radius: 11px;
  background: rgba(255,255,255,.66);
  font-size: 9px;
  text-align: center;
}

.chavruta-list {
  display: grid;
  max-height: 190px;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0 2px 0 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: rgba(104, 68, 95, .35) transparent;
}

.chavruta-list > li {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e1d7dc;
  border-radius: 11px;
  background: #fff;
}

.chavruta-list-copy,
.chavruta-list-copy strong,
.chavruta-list-copy small {
  display: block;
  min-width: 0;
}

.chavruta-list-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chavruta-list-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.chavruta-list-actions {
  display: flex;
  gap: 5px;
}

.chavruta-list-actions button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #d9cbd3;
  border-radius: 8px;
  background: #fbf6f9;
  cursor: pointer;
  font-size: 8px;
  font-weight: 900;
}

.chavruta-list-actions button:hover,
.chavruta-list-actions button:focus-visible {
  color: white;
  outline: 0;
  border-color: #68445f;
  background: #68445f;
}

.chavruta-live-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #68445f;
  border: 1px solid #d9c6d2;
  border-radius: 999px;
  background: #f6edf2;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.chavruta-live-badge.is-connected {
  color: #174d47;
  border-color: #b8d2c9;
  background: #eaf5f1;
}

.chavruta-live-badge.is-connected::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  content: "";
  border-radius: 50%;
  background: #2d8b72;
  box-shadow: 0 0 0 4px rgba(45, 139, 114, .13);
}

.chavruta-session-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 15px 0;
}

.chavruta-session-facts > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e3d9dd;
  border-radius: 10px;
  background: rgba(255,255,255,.78);
}

.chavruta-session-facts dt {
  color: #8a7a82;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.chavruta-session-facts dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: #392d35;
  font-size: 9px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chavruta-session-facts #chavrutaSelectedWord {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 14px;
}

.chavruta-media-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid #5c3d56;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 30%, rgba(229, 186, 110, .2), transparent 12rem),
    linear-gradient(145deg, #31232f, #593d54);
  box-shadow: inset 0 0 35px rgba(0,0,0,.25);
}

.chavruta-media-tile {
  position: absolute;
  overflow: hidden;
  background: transparent;
}

.chavruta-remote-media {
  inset: 0;
}

.chavruta-local-media {
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 34%;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(255,255,255,.88);
  border-radius: 10px;
  background: #4e374a;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.chavruta-media-tile video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .16s ease;
}

.chavruta-media-tile video.has-video {
  opacity: 1;
}

.chavruta-media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 241, 216, .84);
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(38px, 7vw, 72px);
}

.chavruta-local-media .chavruta-media-placeholder {
  font-size: clamp(18px, 3vw, 31px);
}

.chavruta-media-label {
  position: absolute;
  left: 9px;
  bottom: 8px;
  z-index: 3;
  max-width: calc(100% - 18px);
  overflow: hidden;
  padding: 3px 7px;
  color: white;
  border-radius: 999px;
  background: rgba(20, 15, 20, .66);
  font-size: 7px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chavruta-media-status {
  min-height: 18px;
  margin: 8px 2px 0;
  color: var(--ink-soft);
  font-size: 8px;
  text-align: center;
}

.chavruta-call-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.chavruta-call-actions button {
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  font-size: 9px;
}

.chavruta-call-actions .chavruta-start-call,
.chavruta-call-actions .chavruta-answer-call {
  grid-column: 1 / -1;
  background: #68445f;
}

.chavruta-call-actions .chavruta-play-media {
  grid-column: 1 / -1;
  border-color: #68445f;
  color: #68445f;
  background: #fff8ed;
}

.chavruta-call-actions .chavruta-end-session {
  grid-column: 1 / -1;
  justify-self: center;
}

.chavruta-call-notice {
  margin-top: 13px;
  padding: 11px;
  color: #675563;
  border: 1px solid #e3d0d9;
  border-radius: 12px;
  background: #fcf5f8;
}

.chavruta-call-notice strong {
  color: #56374f;
  font-size: 9px;
}

.chavruta-call-notice p {
  margin: 4px 0 0;
  font-size: 7.5px;
  line-height: 1.45;
}

.chavruta-study-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  padding: 10px 13px;
  color: #573d52;
  border: 1px solid #dfcdd7;
  border-radius: 12px;
  background: #fcf5f8;
  font-size: 10px;
  line-height: 1.45;
}

.chavruta-study-hint strong {
  flex: 0 0 auto;
}

.chavruta-study-tools {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid #d8cbd3;
  border-radius: 13px;
  background: rgba(255,255,255,.78);
}

.chavruta-study-tools-heading,
.chavruta-notes-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.chavruta-study-tools-heading h3 {
  margin: 0;
  color: #463942;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.chavruta-study-tools > p {
  margin: 7px 0;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.45;
}

.chavruta-study-tools textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 9px;
  color: var(--ink);
  border: 1px solid #d6c8d0;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: 10px;
  line-height: 1.5;
}

.chavruta-notes-actions {
  margin-top: 8px;
}

.chavruta-notes-actions span {
  color: var(--ink-soft);
  font-size: 8px;
}

.chavruta-notes-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 8px;
}

.chavruta-mode-active .source-panel .source-choices,
.chavruta-mode-active .source-panel .commentary-font-field,
.chavruta-mode-active .source-panel .options-row,
.chavruta-mode-active .review-panel > .panel-heading,
.chavruta-mode-active .review-panel > .progress-track,
.chavruta-mode-active #dafFocusModeButton,
.chavruta-mode-active #reviewCard,
.chavruta-mode-active #reviewComplete,
.chavruta-mode-active #directionPad {
  display: none !important;
}

.chavruta-mode-active .source-panel {
  padding-top: 20px;
  padding-bottom: 20px;
}

.chavruta-mode-active .source-panel .panel-heading {
  margin-bottom: 14px;
}

.chavruta-mode-active .daf-page-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.chavruta-mode-active .review-controls-column {
  min-height: 0;
  max-height: 0;
}

.chavruta-mode-active .review-deck-slot {
  min-height: 100%;
}

.chavruta-mode-active .review-deck-slot #chavrutaPanel {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 70;
  width: min(350px, calc(100vw - 28px));
  height: auto;
  max-height: min(48vh, 520px);
  overflow-y: auto;
  border: 1px solid rgba(104, 68, 95, .34);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(31, 22, 29, .22);
}

.review-deck-slot #chavrutaPanel {
  min-height: 100%;
}

.review-deck-slot #chavrutaPanel .chavruta-list {
  max-height: 110px;
}

.review-deck-slot #chavrutaPanel .chavruta-lobby-section {
  margin-top: 11px;
  padding-top: 9px;
}

.review-deck-slot #chavrutaPanel .chavruta-media-stage {
  max-height: 250px;
}

/* Learn mode keeps the printed daf central and stores only mapped token ranges. */
.learn-mode-active .source-panel .commentary-font-field,
.learn-mode-active .source-panel .source-submit-actions,
.learn-mode-active .review-panel > .panel-heading,
.learn-mode-active .review-panel > .progress-track,
.learn-mode-active #reviewViewPicker,
.learn-mode-active .review-text-view,
.learn-mode-active #dafFocusModeButton,
.learn-mode-active .daf-drag-combine-hint,
.learn-mode-active #reviewCard,
.learn-mode-active #reviewComplete,
.learn-mode-active #directionPad {
  display: none !important;
}

.learn-mode-active .source-panel {
  padding-top: 20px;
  padding-bottom: 20px;
}

.learn-mode-active .source-panel .panel-heading {
  margin-bottom: 14px;
}

.learn-mode-active .daf-page-workspace {
  grid-template-columns: minmax(0, 1.86fr) minmax(300px, 1fr);
}

.learn-mode-active .review-controls-column,
.learn-mode-active .review-deck-slot,
.learn-mode-active .review-deck-slot #learnPanel {
  min-height: var(--daf-review-height);
}

.learn-mode-active .review-deck-slot #learnPanel {
  height: var(--daf-review-height);
  overflow-y: auto;
}

.learn-mode-active .daf-word-region {
  touch-action: none;
}

.learn-study-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  color: #244d5b;
  border: 1px solid rgba(53, 105, 122, .24);
  border-radius: 14px;
  background: linear-gradient(135deg, #edf7f9, #f5f2fb);
  font-size: 11px;
}

.learn-study-hint > span:last-child,
.learn-study-hint strong,
.learn-study-hint small {
  display: block;
}

.learn-study-hint small {
  margin-top: 2px;
  color: #60727b;
  font-size: 9px;
}

.learn-study-hint-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: white;
  border-radius: 11px;
  background: #35697a;
  font-size: 17px;
  font-weight: 900;
}

.learn-panel {
  min-width: 0;
  border-color: rgba(53, 105, 122, .28);
  background:
    radial-gradient(circle at 100% 0, rgba(153, 125, 178, .1), transparent 15rem),
    rgba(255, 253, 248, .98);
}

.learn-panel #learnMemberContent:not(.hidden) {
  display: block;
}

.learn-lock-mark {
  color: #35697a;
  border-color: #c9dce3;
  background: #edf7f9;
}

.learn-panel-heading,
.learn-selection-heading,
.learn-highlight-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.learn-panel-heading h2,
.learn-selection-heading h3 {
  margin: 0;
}

.learn-finished-count {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  color: #fff;
  border: 4px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  background: linear-gradient(145deg, #35697a, #5f668e);
  box-shadow: 0 8px 18px rgba(53, 105, 122, .24);
  font-size: 22px;
}

.learn-page-label {
  margin: 16px 0;
  padding: 10px 12px;
  color: #244d5b;
  border: 1px solid #d7e2e5;
  border-radius: 11px;
  background: #f3f8f8;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.learn-selection-editor {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d8cfbf;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 7px 18px rgba(57, 55, 48, .06);
}

.learn-selection-heading {
  align-items: flex-start;
}

.learn-selection-heading .text-button {
  min-height: 30px;
  padding: 5px 8px;
}

.learn-selected-text {
  min-height: 42px;
  margin: 12px 0;
  padding: 9px 11px;
  color: #302921;
  border: 1px solid #e1d7c8;
  border-radius: 11px;
  background: #fffdf8;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 22px;
  line-height: 1.45;
  text-align: right;
}

.learn-color-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.learn-color-picker legend {
  margin-bottom: 7px;
  font-size: 9px;
  font-weight: 850;
}

.learn-color-option {
  display: grid;
  grid-template-columns: auto 22px 1fr;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid #ded6ca;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.learn-color-option:has(input:checked) {
  border-color: #35697a;
  box-shadow: 0 0 0 2px rgba(53, 105, 122, .12);
}

.learn-color-option input {
  margin: 0;
}

.learn-color-swatch {
  display: block;
  width: 22px;
  height: 16px;
  border: 1px solid rgba(58, 52, 44, .14);
  border-radius: 4px;
}

[data-learn-color="challenge-question"] .learn-color-swatch { background: #cf5048; }
[data-learn-color="information-question"] .learn-color-swatch { background: #b85612; }
[data-learn-color="statement"] .learn-color-swatch { background: #ebcb3b; }
[data-learn-color="proof"] .learn-color-swatch { background: #a77aca; }
[data-learn-color="explanation"] .learn-color-swatch { background: #3d96b8; }
[data-learn-color="answer"] .learn-color-swatch { background: #539660; }

.learn-note-field {
  margin-top: 12px;
}

.learn-note-field textarea {
  min-height: 84px;
  resize: vertical;
}

.learn-highlight-actions {
  margin-top: 10px;
}

.learn-highlight-actions button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 9px;
}

.learn-page-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e1d7c8;
}

.learn-finished-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.learn-finished-button[aria-pressed="true"] {
  background: #517d58;
  box-shadow: 0 8px 18px rgba(81, 125, 88, .22);
}

.learn-save-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
}

.daf-word-region.is-learn-highlight {
  z-index: 2;
  border: 0;
  background: color-mix(in srgb, var(--learn-category-color) 42%, transparent) !important;
  box-shadow: none;
}

.daf-word-region.is-learn-selection {
  z-index: 4;
  border-color: #234f5e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .88), 0 0 0 4px rgba(35, 79, 94, .62);
}

/* Chavruta instructor relationships expose progress summaries, not study contents. */
.chavruta-instructor {
  margin: 14px 0;
  border: 1px solid #ded0da;
  border-radius: 14px;
  background: #fbf7fa;
}

.chavruta-instructor > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: #563b51;
  cursor: pointer;
  list-style: none;
}

.chavruta-instructor > summary::-webkit-details-marker {
  display: none;
}

.chavruta-instructor > summary > span:first-child {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #f0e4ec;
}

.chavruta-instructor > summary strong,
.chavruta-instructor > summary small {
  display: block;
}

.chavruta-instructor > summary small {
  margin-top: 1px;
  color: #756672;
  font-size: 8px;
}

.chavruta-instructor-body {
  padding: 0 12px 13px;
  border-top: 1px solid #e7dce3;
}

.instructor-own-code,
.instructor-join-form,
.instructor-list-section {
  margin-top: 12px;
}

.instructor-own-code h3,
.instructor-list-section h3 {
  margin: 0;
  font-size: 10px;
}

.instructor-own-code button,
.instructor-join-form button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 8px;
}

.instructor-code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #9a718e;
  border-radius: 10px;
  background: #fff;
  font-size: 8px;
}

.instructor-code-display strong {
  color: #563b51;
  font-size: 15px;
  letter-spacing: .12em;
}

.instructor-join-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.instructor-join-form .form-error {
  grid-column: 1 / -1;
}

.instructor-privacy-note {
  margin: 5px 0 8px;
  color: #756672;
  font-size: 8px;
  line-height: 1.45;
}

.instructor-student-list .chavruta-list-copy small {
  white-space: normal;
}

.instructor-student-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.instructor-student-pages > span {
  padding: 3px 6px;
  color: #50636a;
  border: 1px solid #d9e2e4;
  border-radius: 999px;
  background: #f6faf9;
  font-size: 7px;
  font-weight: 750;
}

.learn-save-status.is-error {
  color: var(--danger);
}

.learn-save-status.is-success {
  color: #46704d;
}

/* The first-entry guide remains available from the Help button after dismissal. */
#helpDialog {
  width: min(960px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

#helpDialog .dialog-close {
  width: 44px;
  height: 44px;
  font-size: 24px;
}

.mode-guide-dialog {
  width: 100%;
  max-height: calc(100dvh - 32px);
  padding: clamp(38px, 5vw, 58px);
  overflow-y: auto;
  text-align: left;
  overscroll-behavior: contain;
}

.mode-guide-dialog > h2 {
  margin: 0;
  padding-right: 58px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
}

.mode-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0 26px;
}

.mode-guide-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  min-height: 112px;
  gap: 17px;
  padding: 17px 20px;
  color: var(--ink);
  border: 2px solid #ded6ca;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 7px 18px rgba(49, 43, 36, .07);
  text-align: left;
}

.mode-guide-card:last-child {
  grid-column: 1 / -1;
}

.mode-guide-card > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: white;
  border-radius: 15px;
  background: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

.mode-guide-card-deck > span { background: var(--blue); }
.mode-guide-card-quiz > span { background: var(--wine); }
.mode-guide-card-learn > span { background: #35697a; }
.mode-guide-card-chavruta > span { background: #68445f; }

.mode-guide-card h3 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 800;
}

.mode-guide-card p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: clamp(15.5px, 1.6vw, 17px);
  font-weight: 600;
  line-height: 1.35;
}

.help-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.help-done-button {
  flex: 0 0 auto;
  min-width: 180px;
  min-height: 56px;
  font-size: 18px;
}

.help-dismiss-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
}

.help-dismiss-line input {
  width: 22px;
  height: 22px;
  margin: 0;
}

.save-to-deck-box {
  margin: 20px 0 0;
  padding: 13px;
  border: 1px solid #dbe3df;
  border-radius: 12px;
  background: #f4f8f6;
}

.translation-shortcut-hint {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 8px;
  text-align: right;
}

.save-to-deck-box strong {
  font-size: 10px;
}

.save-to-deck-box p {
  margin: 3px 0 5px;
  color: var(--ink-soft);
  font-size: 8px;
}

.compact-switch {
  min-height: 48px;
  padding: 5px;
  border: 0;
  background: transparent;
}

.mini-field {
  margin-top: 8px;
}

.mini-field select {
  min-height: 42px;
  font-size: 10px;
}

.personal-deck-panel {
  min-height: 360px;
}

.personal-deck-panel #deckMemberContent:not(.hidden) {
  min-height: inherit;
}

.deck-locked,
.quiz-locked {
  padding: 35px 10px;
  text-align: center;
}

.deck-locked h2,
.quiz-locked h3 {
  margin: 16px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.deck-locked p,
.quiz-locked p {
  margin: 0 auto 18px;
  color: var(--ink-soft);
  font-size: 10px;
}

.lock-mark {
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  margin: 0 auto;
  color: var(--teal);
  border: 1px solid #c7d9d3;
  border-radius: 50%;
  background: var(--teal-pale);
  font-size: 27px;
}

.deck-picker {
  min-width: 0;
  margin-top: 16px;
}

.deck-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.deck-picker-heading span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.deck-chooser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  max-height: 178px;
  gap: 7px;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #ddd5c8;
  border-radius: 14px;
  background: #f5f0e8;
  scrollbar-color: rgba(23, 77, 71, .42) transparent;
  scrollbar-gutter: stable;
}

.deck-choice {
  display: grid;
  width: 100%;
  min-height: 56px;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  border: 1px solid #ded5c6;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 3px 9px rgba(57, 45, 29, .04);
  cursor: pointer;
  text-align: left;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.deck-choice:hover {
  transform: translateY(-1px);
  border-color: #9fc3ba;
  box-shadow: 0 6px 14px rgba(23, 77, 71, .08);
}

.deck-choice:focus-visible {
  outline: 3px solid rgba(31, 104, 95, .28);
  outline-offset: 2px;
}

.deck-choice[aria-pressed="true"] {
  color: var(--teal);
  border-color: #6ea99a;
  background: linear-gradient(135deg, #f1f8f5, #e3f0eb);
  box-shadow: 0 0 0 2px rgba(110, 169, 154, .14), 0 7px 16px rgba(23, 77, 71, .1);
}

.deck-choice-icon {
  position: relative;
  display: block;
  width: 27px;
  height: 31px;
  border: 1px solid #b8894f;
  border-radius: 3px 5px 5px 3px;
  background: linear-gradient(90deg, #9a6232 0 5px, #d3a467 5px 100%);
  box-shadow: 3px 3px 0 #eadcc7, 5px 5px 0 #cdbb9f;
}

.deck-choice-icon::before,
.deck-choice-icon::after {
  position: absolute;
  right: 4px;
  left: 9px;
  height: 1px;
  content: "";
  background: rgba(99, 55, 26, .42);
}

.deck-choice-icon::before { top: 11px; }
.deck-choice-icon::after { top: 16px; }

.deck-choice-copy {
  min-width: 0;
}

.deck-choice-copy strong,
.deck-choice-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-choice-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 600;
}

.deck-choice-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
}

.deck-choice-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--teal);
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.72);
  transition: opacity .14s ease, transform .14s ease;
}

.deck-choice[aria-pressed="true"] .deck-choice-mark {
  opacity: 1;
  transform: scale(1);
}

.deck-choice-add {
  grid-template-columns: 44px minmax(0, 1fr);
  border-style: dashed;
  border-color: #9ebbb3;
  background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(236,246,242,.8));
}

.deck-choice-add:hover,
.deck-choice-add:focus-visible {
  border-color: var(--teal);
  background: #edf7f3;
}

.deck-choice-add-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--teal);
  border: 2px dashed #82aa9f;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.deck-choice-add-icon::before,
.deck-choice-add-icon::after {
  display: none;
}

.deck-choice-add .deck-choice-copy strong {
  color: var(--teal);
  font-family: inherit;
  font-weight: 850;
}

.deck-chooser-empty {
  margin: 0;
  padding: 16px 12px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 9px;
}

.deck-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 8px;
  border: 1px solid #ddd5c8;
  border-radius: 13px;
  background: #f5f0e8;
}

.deck-actions-context {
  grid-column: 1 / -1;
  margin: 0 2px 1px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
  line-height: 1.35;
}

.deck-actions .secondary-button {
  width: 100%;
  min-height: 44px;
  border-color: #b9cec7;
  background: #fff;
  box-shadow: 0 3px 9px rgba(57, 45, 29, .05);
}

.deck-actions .text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid #d5cec2;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 3px 9px rgba(57, 45, 29, .04);
  font-size: 10px;
  text-decoration: none;
}

.deck-actions .text-button:hover,
.deck-actions .text-button:focus-visible {
  outline: 0;
  border-color: #91b8ae;
  background: #edf6f2;
  text-decoration: none;
}

.deck-actions .text-button.danger {
  color: #93433f;
  border-color: #e2c7c3;
  background: #fffafa;
}

.deck-actions .text-button.danger:hover,
.deck-actions .text-button.danger:focus-visible {
  border-color: #c9867f;
  background: #faecea;
}

.sync-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  font-size: 8px;
  font-weight: 800;
}

.sync-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3aa57e;
}

.sync-label.is-pending i {
  background: var(--ochre);
  box-shadow: 0 0 0 3px rgba(185, 118, 37, .12);
}

.quiz-panel {
  min-height: 570px;
}

.quiz-panel .panel-heading {
  padding-bottom: 22px;
  border-bottom: 1px solid #e7e0d5;
}

.quiz-panel > .panel-heading {
  align-items: flex-end;
  gap: 0;
}

.quiz-panel > .panel-heading .step-number {
  display: none;
}

.quiz-panel > .panel-heading h2 {
  margin: 4px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .98;
}

.mode-launcher-subheading {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 650;
}

.quiz-account-button {
  margin-left: auto;
}

.quiz-member {
  max-width: 920px;
  margin: 0 auto;
}

.quiz-setup {
  max-width: 920px;
  margin: 22px auto 28px;
  padding: 28px;
  border: 1px solid #ddd5c8;
  border-radius: 18px;
  background: #faf7f1;
}

.quiz-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.quiz-settings-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.quiz-settings-heading > span {
  max-width: 250px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
  text-align: right;
}

.quiz-direction-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.quiz-direction-choices legend {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
}

.quiz-direction-choice {
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid #ddd5c8;
  border-radius: 12px;
  background: #fffdf8;
  cursor: pointer;
}

.quiz-direction-choice:has(input:checked) {
  color: var(--teal);
  border-color: #a9cbc2;
  background: #eef6f2;
  box-shadow: 0 5px 14px rgba(23, 77, 71, .08);
}

.quiz-direction-choice:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.quiz-direction-choice input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--teal);
}

.quiz-direction-choice span,
.quiz-direction-choice strong,
.quiz-direction-choice small {
  display: block;
}

.quiz-direction-choice strong {
  font-size: 11px;
}

.quiz-direction-choice small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.quiz-direction-both:has(input:checked) {
  color: var(--wine);
  border-color: #d8b9b5;
  background: #fbf1ef;
}

.quiz-setup .primary-button {
  margin-top: 15px;
}

.quiz-setup-hint {
  margin: 11px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  text-align: center;
}

.quiz-progress-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 2px 20px;
  color: var(--ink-soft);
  font-size: 10px;
}

.quiz-card-scene {
  min-height: 460px;
  perspective: 1200px;
}

.quiz-card {
  position: relative;
  min-height: 460px;
  text-align: center;
  transform-style: preserve-3d;
  transition: transform 190ms cubic-bezier(.2, .72, .25, 1);
}

.quiz-card.is-flipped {
  transform: rotateY(180deg);
}

.quiz-card.flip-instant {
  transition: none;
}

.quiz-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  padding: 30px;
  flex-direction: column;
  border: 1px solid #d7c9b4;
  border-radius: 20px;
  background:
    linear-gradient(rgba(255,255,255,.79), rgba(255,255,255,.79)),
    repeating-linear-gradient(0deg, #f4ead8 0 1px, transparent 1px 5px),
    #fffaf0;
  box-shadow: inset 0 0 55px rgba(182, 128, 57, .08);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.quiz-card-back {
  color: #f8f1e6;
  border-color: #315c55;
  background:
    radial-gradient(circle at 15% 12%, rgba(229, 188, 117, .15), transparent 14rem),
    linear-gradient(145deg, #123e3a 0%, #1c514a 100%);
  box-shadow: inset 0 0 60px rgba(0,0,0,.11);
  transform: rotateY(180deg);
}

.quiz-word {
  display: grid;
  place-items: center;
  width: min(100%, 780px);
  min-height: 190px;
  margin: 13px 0 7px;
  color: #2b241b;
  font-family: "Daf to Deck Frank", serif;
  font-size: clamp(64px, 8.5vw, 104px);
  font-synthesis: none;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.quiz-word.font-rashi { font-family: "Daf to Deck Rashi", serif; }
.quiz-word.font-paleo { font-family: "Daf to Deck Paleo", serif; }

.quiz-word.is-english {
  direction: ltr;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6.3vw, 76px);
  line-height: 1.1;
}

.quiz-side-label {
  margin: -2px 0 19px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.quiz-shas-frequency {
  margin: 0 0 9px;
  color: #6c776f;
  font-size: 9px;
}

.reveal-answer-button {
  width: min(100%, 390px);
  min-height: 66px;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px 9px 21px;
  border-radius: 14px;
  font-size: 15px;
}

.reveal-answer-button .action-keycap {
  min-width: 92px;
  height: 38px;
  border-radius: 8px;
  border-bottom-width: 4px;
  font-size: 11px;
}

.quiz-answer-label {
  color: #e5bc75;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.quiz-answer {
  display: grid;
  place-items: center;
  width: min(100%, 780px);
  min-height: 195px;
  margin: 10px auto 20px;
  color: #fffdf8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6.3vw, 76px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.quiz-answer.font-regular {
  font-family: "Daf to Deck Frank", serif;
  font-size: clamp(64px, 8.5vw, 102px);
}

.quiz-answer.font-rashi {
  font-family: "Daf to Deck Rashi", serif;
  font-size: clamp(64px, 8.5vw, 102px);
}

.quiz-answer.font-paleo {
  font-family: "Daf to Deck Paleo", serif;
  font-size: clamp(64px, 8.5vw, 102px);
}

.quiz-shas-frequency-back {
  margin: -11px 0 15px;
  color: rgba(255,255,255,.72);
}

.quiz-original-prompt {
  width: min(100%, 520px);
  margin-top: auto;
  padding-top: 15px;
  color: rgba(255,255,255,.7);
  border-top: 1px solid rgba(255,255,255,.15);
}

.quiz-original-prompt span,
.quiz-original-prompt strong {
  display: block;
}

.quiz-original-prompt span {
  margin-bottom: 4px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.quiz-original-prompt strong {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.quiz-direction-pad {
  margin-top: 16px;
}

.needs-review-button {
  color: var(--wine);
  border-color: #dec3c0;
}

#endQuizButton {
  display: block;
  margin: 13px auto 0;
}

.quiz-summary {
  margin: 80px auto;
  text-align: center;
}

.quiz-summary h3 {
  margin: 20px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 500;
}

.quiz-summary p {
  color: var(--ink-soft);
  font-size: 12px;
}

.quiz-summary-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
}

.quiz-progress-tracker {
  margin: 32px auto 8px;
  padding: 24px;
  border: 1px solid #d9d0c2;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 12px 30px rgba(60, 51, 42, .06);
}

.progress-tracker-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.progress-tracker-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.progress-tracker-heading > div > p:last-child {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.progress-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 20px 0 16px;
}

.progress-totals > div {
  padding: 13px;
  border: 1px solid #ddd5c8;
  border-radius: 12px;
  background: #faf7f1;
  text-align: center;
}

.progress-totals strong,
.progress-totals span {
  display: block;
}

.progress-totals strong {
  font-size: 24px;
}

.progress-totals span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.progress-totals .known-total {
  color: var(--teal);
  border-color: #c5dad3;
  background: #eef6f2;
}

.progress-totals .struggling-total {
  color: var(--wine);
  border-color: #e1c7c3;
  background: #fbf1ef;
}

.progress-day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}

.progress-day-button {
  min-width: 0;
  padding: 8px 4px;
  color: var(--ink-soft);
  border: 1px solid #ddd5c8;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.progress-day-button span,
.progress-day-button small {
  display: block;
}

.progress-day-button small {
  margin-top: 2px;
  opacity: .72;
}

.progress-day-button.has-progress::after {
  display: block;
  width: 5px;
  height: 5px;
  margin: 5px auto 0;
  content: "";
  border-radius: 50%;
  background: var(--gold);
}

.progress-day-button.active {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.progress-day-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.progress-day-button.active::after {
  background: #e5bc75;
}

.progress-loading,
.progress-empty {
  margin: 20px 0 5px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 10px;
}

.progress-word-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.progress-word-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid #ddd5c8;
  border-radius: 13px;
}

.progress-word-group > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}

.progress-word-group > div span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  font-weight: 900;
}

.progress-word-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.progress-word-group li {
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  font-family: "Daf to Deck Frank", serif;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.progress-word-group li.font-rashi { font-family: "Daf to Deck Rashi", serif; }
.progress-word-group li.font-paleo { font-family: "Daf to Deck Paleo", serif; }

.known-words {
  color: var(--teal);
  border-color: #c5dad3;
  background: #eef6f2;
}

.struggling-words {
  color: var(--wine);
  border-color: #e1c7c3;
  background: #fbf1ef;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 4px 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.account-dialog-card {
  min-height: 410px;
}

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 22px 0 18px;
  padding: 4px;
  border-radius: 11px;
  background: #eee9e0;
}

.account-tabs button {
  min-height: 38px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.account-tabs button.active {
  color: var(--teal);
  background: white;
  box-shadow: 0 4px 12px rgba(45, 49, 42, .08);
}

.account-form {
  display: grid;
  gap: 13px;
  text-align: left;
}

.account-forgot-button {
  justify-self: end;
  margin-top: -7px;
}

.password-reset-dialog-card {
  min-height: 0;
}

.account-recovery-privacy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.password-reset-success {
  padding: 12px 0 2px;
  text-align: center;
}

.password-reset-success h2 {
  margin-top: 14px;
}

.password-reset-success p {
  margin: 0 0 20px;
}

.field em {
  color: var(--ink-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
}

.no-email-warning {
  padding: 11px;
  color: #65441f;
  border: 1px solid #e4c99b;
  border-radius: 10px;
  background: #fbf2e2;
}

.no-email-warning strong {
  font-size: 10px;
}

.no-email-warning p {
  margin: 3px 0 7px;
  font-size: 8px;
}

.no-email-warning label,
.consent-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 8px;
  line-height: 1.45;
}

.no-email-warning input,
.consent-line input {
  flex: 0 0 auto;
  margin-top: 1px;
}

.form-error {
  margin: 0;
  padding: 9px;
  color: #7a312d;
  border-radius: 8px;
  background: #f9e8e6;
  font-size: 9px;
}

.account-member {
  padding: 25px 0 8px;
  text-align: center;
}

.member-avatar {
  width: 74px;
  height: 74px;
  margin: 0 auto 15px;
  font-family: Georgia, serif;
  font-size: 28px;
}

.account-member h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
}

.account-member p {
  margin: 5px 0 20px;
  color: var(--ink-soft);
  font-size: 10px;
}

.member-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}

.destructive-button {
  background: #823f3b;
  box-shadow: 0 8px 18px rgba(122, 62, 59, .2);
}

.destructive-button:hover {
  background: #6f302d;
}

.danger-mark {
  color: white;
  background: var(--wine);
}

.dialog-field {
  margin-top: 22px;
  text-align: left;
}

.duplicate-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  color: #76501e;
  border-radius: 50%;
  background: var(--gold-pale);
  font-size: 17px;
  font-weight: 900;
}

.duplicate-dialog-card > p strong {
  font-family: "Daf to Deck Frank", serif;
  font-size: 19px;
}

.privacy-copy {
  margin: 22px 0;
  text-align: left;
}

.privacy-copy p {
  margin: 0 0 11px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .hero-books,
  .learn-hero-mark,
  .quiz-hero-mark,
  .chavruta-hero-mark {
    opacity: .6;
    transform: scale(.85);
    transform-origin: right bottom;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) 315px;
  }

  .panel {
    padding: 28px;
  }

  .review-stage {
    flex-direction: column;
  }

  .daf-page-workspace {
    --daf-review-height: min(82vh, 900px);
  }
}

@media (max-width: 850px) {
  .mode-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: 275px;
  }

  .hero-books,
  .learn-hero-mark,
  .quiz-hero-mark,
  .chavruta-hero-mark {
    position: absolute;
    right: -50px;
    bottom: 0;
    opacity: .22;
  }

  .hero-copy {
    max-width: 620px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .main-column,
  .deck-panel {
    width: 100%;
  }

  .deck-panel {
    position: static;
    order: -1;
  }

  .sheet-visual {
    grid-template-rows: repeat(4, 18px);
  }

  .personal-deck-panel {
    order: -1;
  }

  .daf-page-workspace {
    grid-template-columns: 1fr;
  }

  .chavruta-mode-active .daf-page-workspace {
    grid-template-columns: 1fr;
  }

  .chavruta-mode-active .review-controls-column {
    min-height: 0;
    max-height: none;
  }

  .learn-mode-active .review-controls-column,
  .learn-mode-active .review-deck-slot,
  .learn-mode-active .review-deck-slot #learnPanel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .review-controls-column {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    grid-column: 1;
    grid-row: auto;
    overflow: visible;
    border-top: 1px solid #ddd0bd;
    border-left: 0;
    box-shadow: none;
  }

  .daf-review-dock-host {
    height: auto;
  }

  .review-deck-slot {
    overflow: visible;
  }

  .chavruta-panel {
    width: 100%;
  }
}

@media (max-width: 590px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    margin-top: 10px;
  }

  .source-submit-actions {
    grid-template-columns: 1fr;
  }

  .review-view-picker {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .review-view-button {
    min-height: 82px;
    padding: 12px 14px;
  }

  .owner-meaning-scopes,
  .owner-global-translation-fields {
    grid-template-columns: 1fr;
  }

  .review-view-icon {
    width: 43px;
    height: 48px;
    font-size: 23px;
  }

  .chavruta-daf-yomi-button {
    align-items: flex-start;
    min-height: 0;
    padding: 18px;
  }

  .chavruta-daf-yomi-copy strong {
    font-size: clamp(27px, 9vw, 36px);
  }

  .chavruta-daf-yomi-action {
    max-width: 100px;
  }

  .chavruta-daf-yomi-action small {
    font-size: 8px;
  }

  .topbar {
    min-height: 62px;
    padding: 8px 11px;
  }

  .brand-motion {
    --brand-rest-offset: 14px;
    width: 150px;
    height: 54px;
  }

  .brand-orbit {
    bottom: 22px;
  }

  .brand-letter {
    width: 31px;
    height: 31px;
  }

  .brand-wordmark {
    bottom: 0;
  }

  .brand-wordmark strong {
    font-size: 14px;
  }

  .brand-wordmark small {
    font-size: 7px;
  }

  .daf-viewer-heading {
    padding: 13px;
  }

  .daf-viewer-heading h3 {
    font-size: 17px;
  }

  .daf-page-viewport {
    height: 68vh;
    min-height: 380px;
  }

  .daf-viewer-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .daf-view-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daf-drag-combine-hint {
    grid-column: 1 / -1;
    padding: 3px 1px 5px;
  }

  .daf-focus-toggle,
  .daf-mefarshim-toggle {
    width: 100%;
  }

  .daf-zoom-controls {
    justify-content: center;
  }

  body.daf-focus-mode .daf-page-workspace {
    --focus-review-clearance: clamp(204px, 32dvh, 270px);
    height: auto;
  }

  body.daf-focus-mode .daf-review-dock-host {
    right: 6px;
    bottom: 6px;
    left: 6px;
    width: calc(100% - 12px);
  }

  body.daf-focus-mode .review-controls-column {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 6px;
    border-radius: 15px;
  }

  body.daf-focus-mode .review-card {
    height: 124px;
    min-height: 0;
    max-height: 124px;
    padding: 9px 12px;
  }

  body.daf-focus-mode .candidate-word {
    min-height: 45px;
    font-size: clamp(32px, 10vw, 43px);
  }

  body.daf-focus-mode .candidate-word.font-rashi.is-many-word-phrase,
  body.daf-focus-mode .candidate-word.is-commentary.is-many-word-phrase {
    font-size: clamp(17px, 4.6vw, 19px);
  }

  body.daf-focus-mode .candidate-word.font-rashi.is-extra-dense-word,
  body.daf-focus-mode .candidate-word.is-commentary.is-extra-dense-word {
    font-size: clamp(14px, 3.8vw, 16px);
  }

  body.daf-focus-mode .direction-pad {
    gap: 5px;
    padding: 6px;
  }

  body.daf-focus-mode .direction-button {
    height: 54px;
    min-height: 54px;
  }

  body.daf-focus-mode .daf-focus-toggle {
    top: 7px;
    right: 7px;
    min-height: 46px;
    padding: 0 14px;
    font-size: 10px;
  }

  body.daf-focus-mode .toast-region {
    right: 6px;
    bottom: calc(clamp(204px, 32dvh, 270px) + 10px);
    width: min(300px, calc(100% - 12px));
  }

  .brand small,
  .local-badge {
    display: none;
  }

  .owner-review-link {
    min-height: 33px;
    padding: 0 9px;
    font-size: 8px;
  }

  .daf-owner-tools-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .daf-owner-tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daf-owner-tool-buttons button,
  .daf-owner-tool-buttons #dafOwnerCancelButton {
    width: 100%;
    margin-left: 0;
  }

  .daf-owner-operation-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daf-owner-target-fields,
  .daf-owner-run-fields {
    grid-template-columns: 1fr;
  }

  .daf-owner-selected-word {
    align-items: stretch;
    flex-direction: column;
  }

  .daf-owner-selected-word span {
    text-align: left;
  }

  .account-button {
    padding-right: 5px;
  }

  .account-button > span:last-child {
    display: none;
  }

  .mode-switcher {
    gap: 5px;
    margin-top: 10px;
    padding: 5px;
  }

  .mode-button {
    min-height: 78px;
    gap: 6px;
    padding: 8px 6px;
    text-align: center;
  }

  #helpDialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .dialog-card.mode-guide-dialog {
    max-height: calc(100dvh - 20px);
    padding: 62px 18px 24px;
  }

  .mode-guide-dialog > h2 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .mode-guide-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 22px 0 20px;
  }

  .mode-guide-card,
  .mode-guide-card:last-child {
    grid-column: auto;
    grid-template-columns: 48px 1fr;
    min-height: 88px;
    gap: 13px;
    padding: 11px 14px;
    border-radius: 14px;
  }

  .mode-guide-card > span {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 12px;
  }

  .mode-guide-card h3 {
    font-size: clamp(17px, 5.5vw, 21px);
  }

  .mode-guide-card p {
    margin-top: 3px;
    font-size: 15px;
  }

  .help-guide-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .help-done-button {
    width: 100%;
    min-height: 54px;
  }

  .help-dismiss-line {
    align-items: flex-start;
    font-size: 15px;
  }

  .instructor-join-form {
    grid-template-columns: 1fr;
  }

  .instructor-join-form button {
    width: 100%;
  }

  .learn-panel-heading {
    align-items: flex-start;
  }

  .learn-highlight-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .learn-highlight-actions button {
    width: 100%;
  }

  .chavruta-session-facts {
    grid-template-columns: 1fr;
  }

  .chavruta-list > li {
    grid-template-columns: 1fr;
  }

  .chavruta-list-actions {
    justify-content: flex-start;
  }

  .chavruta-media-stage {
    aspect-ratio: 4 / 3;
  }

  .mode-button strong {
    font-size: 12px;
  }

  .mode-button small {
    max-width: 105px;
    font-size: 7px;
    line-height: 1.2;
  }

  .mode-icon {
    width: 31px;
    height: 31px;
  }

  .hero {
    min-height: 300px;
    padding: 38px 24px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 45px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 14px;
  }

  .panel,
  .deck-panel {
    padding: 21px;
    border-radius: 18px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .step-number {
    width: 38px;
    height: 38px;
  }

  .panel-heading h2 {
    font-size: 27px;
  }

  .selection-grid,
  .options-row {
    grid-template-columns: 1fr;
  }

  .source-choices {
    grid-template-columns: 1fr;
  }

  .source-choice {
    min-height: 61px;
  }

  .review-counter {
    display: none;
  }

  .review-card {
    min-height: 330px;
    padding: 24px 18px;
  }

  .candidate-word {
    font-size: 52px;
  }

  .candidate-support-row {
    min-height: 44px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nikkud-toggle {
    min-height: 44px;
    padding: 7px 11px;
    font-size: 10px;
  }

  .recognized-phrases-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .recognized-phrases-heading small {
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
  }

  .recognized-phrase-chip {
    min-height: 44px;
    padding: 7px 11px;
  }

  .learning-meaning-suggestions-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .learning-meaning-choice {
    flex-basis: 132px;
    min-height: 52px;
    padding: 8px 10px;
  }

  .occurrence-tools {
    align-items: center;
    margin-bottom: -12px;
    text-align: center;
  }

  .direction-pad {
    gap: 6px;
  }

  .translation-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .translation-actions .primary-button {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .translation-actions .text-button {
    width: 100%;
    justify-content: center;
  }

  .deck-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-actions .secondary-button {
    grid-column: 1 / -1;
  }

  .direction-button {
    min-height: 74px;
    gap: 4px;
    padding: 8px 4px;
    flex-direction: column;
    font-size: 10px;
  }

  .direction-arrow {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }

  .direction-label {
    align-items: center;
    flex: 0 1 auto;
    text-align: center;
  }

  .direction-label small {
    display: none;
  }

  .direction-button kbd {
    width: 19px;
    min-width: 19px;
    height: 18px;
    padding: 0 4px;
  }

  .review-complete > div:last-child,
  .dialog-card menu {
    flex-direction: column;
  }

  .dialog-card menu .primary-button,
  .dialog-card menu .secondary-button {
    width: 100%;
  }

  .preview-list summary {
    grid-template-columns: 1fr auto;
  }

  .dialog-card {
    padding: 33px 22px 25px;
  }

  .quiz-panel {
    min-height: 500px;
  }

  .quiz-setup {
    margin: 25px auto;
    padding: 18px;
  }

  .quiz-settings-heading {
    flex-direction: column;
  }

  .quiz-settings-heading > span {
    max-width: none;
    text-align: left;
  }

  .quiz-direction-choices {
    grid-template-columns: 1fr;
  }

  .quiz-card-scene,
  .quiz-card,
  .quiz-card-face {
    min-height: 420px;
  }

  .quiz-card-face {
    padding: 22px 14px;
  }

  .quiz-word {
    min-height: 170px;
    font-size: clamp(50px, 15vw, 74px);
  }

  .quiz-word.is-english,
  .quiz-answer {
    font-size: clamp(36px, 10vw, 54px);
  }

  .quiz-answer {
    min-height: 175px;
  }

  .quiz-answer.font-regular,
  .quiz-answer.font-rashi,
  .quiz-answer.font-paleo {
    font-size: clamp(48px, 14vw, 70px);
  }

  .reveal-answer-button {
    min-height: 62px;
    padding-left: 16px;
    font-size: 13px;
  }

  .reveal-answer-button .action-keycap {
    min-width: 78px;
    height: 35px;
    font-size: 10px;
  }

  .quiz-summary-actions {
    flex-direction: column;
  }

  .quiz-summary-actions button {
    width: 100%;
  }

  .progress-tracker-heading {
    flex-direction: column;
  }

  .progress-day-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .progress-word-groups {
    grid-template-columns: 1fr;
  }
}

/* 2.3.74 — seamless Learn workspace, clear categories, and collision-safe heroes. */
.learn-selection-toolbar.hidden,
.learn-selection-presentation.hidden,
.learn-text-size-controls.hidden,
.learn-banner-legend.hidden {
  display: none !important;
}

.learn-workspace-banner {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(250px, .8fr) auto;
  width: 100%;
  min-height: 168px;
  gap: 24px;
  align-items: center;
  padding: 26px 30px;
}

.learn-banner-location,
.learn-banner-drag,
.learn-banner-legend,
.learn-banner-actions {
  min-width: 0;
}

.learn-banner-location {
  display: grid;
  gap: 8px;
}

.learn-banner-eyebrow {
  color: #8a5c18 !important;
  font-size: 11px !important;
  font-weight: 900;
  letter-spacing: .14em;
}

.learn-banner-selectors {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, .8fr);
  gap: 10px;
}

.learn-banner-selectors label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.learn-banner-selectors label > span {
  color: var(--ink-soft) !important;
  font-size: 11px !important;
  font-weight: 850;
}

.learn-banner-selectors select {
  width: 100%;
  min-height: 52px;
  padding: 8px 38px 8px 12px;
  color: var(--teal-dark);
  border: 2px solid rgba(23, 77, 71, .24);
  border-radius: 13px;
  background: #fffdf8;
  font-size: 16px;
  font-weight: 850;
  text-overflow: ellipsis;
}

.learn-banner-drag {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.learn-banner-drag .drag-word-demo {
  --drag-pointer-travel: -174px;
  min-width: 222px;
  transform: none;
}

.learn-banner-drag > strong {
  color: var(--teal-dark) !important;
  font-size: 17px !important;
}

.learn-banner-legend {
  display: none;
  gap: 10px;
  align-items: center;
}

.review-stage[data-review-view="text"] .learn-banner-legend {
  display: grid;
}

.review-stage[data-review-view="text"] .learn-workspace-banner {
  grid-template-columns: minmax(300px, 1fr) minmax(230px, .8fr) minmax(255px, .8fr) auto;
}

.learn-banner-legend > div:first-child {
  display: grid;
  gap: 2px;
}

.learn-banner-legend > div:first-child strong {
  font-size: 15px !important;
}

.learn-banner-legend > div:first-child small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.learn-banner-legend-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.learn-banner-legend-chips > span {
  display: inline-flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--learn-category-color) 72%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--learn-category-color) 20%, white);
}

.learn-banner-legend-chips i {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--learn-category-color);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

.learn-banner-legend-chips b {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-banner-legend-chips > span[data-learn-color="statement"] i { color: #17332f; }

.learn-banner-actions {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 9px;
  align-items: stretch !important;
}

.learn-workspace-banner .learn-banner-actions .secondary-button {
  min-width: 172px;
  min-height: 54px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 900;
  white-space: normal;
}

#learnBannerFinishedButton {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 9px 20px rgba(23, 77, 71, .2);
}

#learnBannerPrintButton {
  color: #68445f;
  border-color: rgba(104, 68, 95, .28);
  background: #fbf5fa;
}

.learn-source-summary-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.review-stage[data-review-view="text"] .preview-list > details > summary > strong {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 850;
}

.learn-text-size-controls {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(23, 77, 71, .24);
  border-radius: 999px;
  background: #fff;
}

.learn-text-size-controls button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--teal);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
}

.learn-text-size-controls button + button { border-inline-start: 1px solid var(--line); }
.learn-text-size-controls button:disabled { opacity: .35; cursor: default; }

.text-preview[data-learn-text-scale="0"] { --learn-hebrew-size: 16px; --learn-commentary-size: 14px; --learn-note-size: 17px; }
.text-preview[data-learn-text-scale="1"] { --learn-hebrew-size: 18px; --learn-commentary-size: 16px; --learn-note-size: 19px; }
.text-preview[data-learn-text-scale="2"] { --learn-hebrew-size: clamp(18px, 1.65vw, 24px); --learn-commentary-size: clamp(16px, 1.35vw, 19px); --learn-note-size: 21px; }
.text-preview[data-learn-text-scale="3"] { --learn-hebrew-size: clamp(21px, 1.9vw, 28px); --learn-commentary-size: clamp(19px, 1.58vw, 23px); --learn-note-size: 23px; }
.text-preview[data-learn-text-scale="4"] { --learn-hebrew-size: clamp(24px, 2.2vw, 32px); --learn-commentary-size: clamp(22px, 1.82vw, 27px); --learn-note-size: 26px; }

.learn-mode-active.learn-workspace-open .review-text-view .source-text {
  font-size: var(--learn-hebrew-size, clamp(18px, 1.65vw, 24px));
}

.learn-mode-active.learn-workspace-open .review-text-view #rashiText,
.learn-mode-active.learn-workspace-open .review-text-view #tosafotText {
  font-size: var(--learn-commentary-size, clamp(16px, 1.35vw, 19px));
}

.learn-inline-passage-note {
  font-family: Garamond, Georgia, "Times New Roman", serif;
  font-size: var(--learn-note-size, 21px);
  line-height: 1.58;
}

.learn-selection-editor {
  z-index: 1260;
}

.learn-selection-editor[data-tool-mode="note"] .learn-selected-text,
.learn-selection-editor[data-tool-mode="note"] .learn-selection-presentation {
  display: none !important;
}

.learn-selection-presentation {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 10px;
}

.learn-selected-text.font-rashi,
.learn-selection-meaning-row strong.font-rashi {
  font-family: "Daf to Deck Rashi", "Times New Roman", serif;
}

.learn-selected-text.font-regular,
.learn-selection-meaning-row strong.font-regular {
  font-family: "Daf to Deck Frank", Georgia, serif;
}

.learn-selection-meaning-row {
  grid-template-columns: minmax(86px, .62fr) minmax(180px, 1.45fr) auto;
}

.learn-selection-deck-word {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: var(--teal);
  border: 1px solid rgba(23, 77, 71, .22);
  border-radius: 10px;
  background: #fffdf8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.learn-selection-deck-choice {
  display: block;
}

.learn-selection-deck-choice .field {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
}

.daf-word-region.is-learn-sentence-end-edge {
  overflow: visible;
}

.daf-word-region.is-learn-sentence-end-edge::after {
  content: "";
  position: absolute;
  left: -7px;
  bottom: -6px;
  z-index: 3;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid rgba(23, 77, 71, .66);
  border-left: 2px solid rgba(23, 77, 71, .66);
  border-bottom-left-radius: 2px;
  filter: drop-shadow(0 0 1px #fffdf8);
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 25vw, 340px);
  min-height: 330px;
  gap: clamp(22px, 3.5vw, 52px);
  padding: clamp(42px, 5vw, 66px) clamp(30px, 4.5vw, 66px);
  overflow: hidden;
}

.hero-copy { min-width: 0; max-width: none; }
.hero h1 {
  max-width: 13ch;
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1.06;
  text-wrap: balance;
  overflow-wrap: normal;
}
.hero-pills { flex-wrap: wrap; margin-top: clamp(18px, 2vw, 26px); }
.hero-books,.learn-hero-mark,.quiz-hero-mark,.chavruta-hero-mark {
  width: 100%;
  min-width: 0;
  height: 210px;
  margin-left: 0;
  transform: none;
}

@media (max-width: 1320px) {
  .review-stage[data-review-view="text"] .learn-workspace-banner {
    grid-template-columns: minmax(280px, 1fr) minmax(220px, .75fr) minmax(245px, .8fr);
  }
  .review-stage[data-review-view="text"] .learn-banner-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .learn-workspace-banner,
  .review-stage[data-review-view="text"] .learn-workspace-banner {
    grid-template-columns: 1fr 1fr;
  }
  .learn-banner-legend { align-self: stretch; }
  .learn-banner-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .learn-workspace-banner .learn-banner-actions .secondary-button { min-width: 0; }
  .hero { grid-template-columns: minmax(0, 1fr) 230px; }
  .hero h1 { font-size: clamp(38px, 5.4vw, 54px); }
}

@media (max-width: 700px) {
  .learn-workspace-banner,
  .review-stage[data-review-view="text"] .learn-workspace-banner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 20px;
  }
  .learn-banner-selectors { grid-template-columns: 1fr; }
  .learn-banner-actions,
  .review-stage[data-review-view="text"] .learn-banner-actions { grid-column: auto; grid-template-columns: 1fr; }
  .learn-banner-legend-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-selection-toolbar {
    display: grid;
    grid-template-columns: repeat(6, 42px);
    width: auto;
    max-width: calc(100vw - 16px);
    border-radius: 22px;
  }
  .learn-selection-meaning-row { grid-template-columns: 1fr; }
  .learn-selection-deck-word { justify-self: stretch; justify-content: center; }
  .learn-selection-deck-choice .field { grid-template-columns: 1fr; }
  .hero { display: block; min-height: 270px; padding: 38px 22px; }
  .hero h1 { max-width: 100%; font-size: clamp(35px, 10vw, 48px); }
}

/* Chavruta uses the Learn workspace; calling floats above it instead of
   shrinking the daf into a sidebar. */
.chavruta-mode-active #reviewViewPicker {
  display: grid !important;
}

.chavruta-mode-active .review-text-view {
  display: block !important;
}

.chavruta-mode-active .chavruta-study-tools {
  display: none;
}

.chavruta-mode-active.learn-mode-active .daf-page-workspace {
  grid-template-columns: minmax(0, 1.86fr) minmax(300px, 1fr);
}

.chavruta-mode-active.learn-mode-active .review-controls-column,
.chavruta-mode-active.learn-mode-active .review-deck-slot,
.chavruta-mode-active.learn-mode-active .review-deck-slot #learnPanel {
  min-height: var(--daf-review-height);
  max-height: none;
}

.chavruta-mode-active.learn-mode-active .review-deck-slot #learnPanel {
  height: var(--daf-review-height);
  overflow-y: auto;
}

.chavruta-mode-active .chavruta-media-stage {
  position: fixed;
  top: 118px;
  right: 22px;
  z-index: 90;
  width: min(460px, calc(100vw - 28px));
  height: 240px;
  max-height: none !important;
  aspect-ratio: auto !important;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 18px 52px rgba(19, 12, 18, .34);
}

.chavruta-mode-active .chavruta-media-stage.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.chavruta-mode-active .chavruta-remote-media,
.chavruta-mode-active .chavruta-local-media {
  top: 10px;
  bottom: 10px;
  width: calc(50% - 15px);
  height: auto;
  aspect-ratio: auto;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 12px;
  background: #4e374a;
  box-shadow: 0 7px 20px rgba(0,0,0,.25);
}

.chavruta-mode-active .chavruta-remote-media {
  right: auto;
  left: 10px;
}

.chavruta-mode-active .chavruta-local-media {
  right: 10px;
  left: auto;
}

.chavruta-page-share-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(104, 68, 95, .16);
}

.chavruta-page-share-actions > button:first-child {
  grid-column: 1 / -1;
}

.chavruta-page-share-actions .field {
  min-width: 0;
}

.chavruta-page-share-actions .field span {
  font-size: 9px;
}

.chavruta-page-share-actions select,
.chavruta-page-share-actions button {
  min-height: 40px;
  font-size: 10px;
}

@media (max-width: 700px) {
  .chavruta-mode-active.learn-mode-active .daf-page-workspace {
    grid-template-columns: 1fr;
  }

  .chavruta-mode-active.learn-mode-active .review-controls-column,
  .chavruta-mode-active.learn-mode-active .review-deck-slot,
  .chavruta-mode-active.learn-mode-active .review-deck-slot #learnPanel {
    height: auto;
    min-height: 0;
  }

  .chavruta-mode-active .chavruta-media-stage {
    top: 92px;
    right: 12px;
    width: min(360px, calc(100vw - 24px));
    height: 190px;
  }

  .chavruta-mode-active .review-deck-slot #chavrutaPanel {
    right: 12px;
    bottom: 12px;
    width: min(340px, calc(100vw - 24px));
    max-height: 42vh;
  }
}

/* Learn Phase 1: a range-based personal notebook, with the daf kept primary. */
.learn-mode-active .daf-page-viewport {
  overscroll-behavior: auto;
}

.learn-study-hint {
  font-size: 14px;
}

.learn-study-hint small,
.learn-panel .eyebrow {
  font-size: 12px;
}

.learn-device-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  color: var(--teal);
  border: 1px solid rgba(36, 107, 97, .22);
  border-radius: 12px;
  background: var(--teal-pale);
  font-size: 12px;
  font-weight: 600;
}

.learn-device-notice .text-button {
  min-height: 34px;
  font-size: 12px;
}

.learn-sheet-controls {
  display: none;
}

.learn-coach {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(181, 122, 49, .32);
  border-radius: 14px;
  background: var(--gold-pale);
  font-size: 12px;
}

.learn-coach > span:nth-child(2),
.learn-coach strong {
  display: block;
}

.learn-coach strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.learn-coach .text-button {
  min-height: 36px;
  font-size: 12px;
}

.learn-coach-gesture,
.learn-empty-demo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 58px;
}

.learn-coach-gesture i,
.learn-empty-demo i {
  display: grid;
  place-items: center;
  width: 25px;
  height: 28px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  background: var(--card);
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-style: normal;
}

.learn-coach-gesture b,
.learn-empty-demo b {
  position: absolute;
  inset-inline-start: 10px;
  bottom: -9px;
  color: var(--gold);
  animation: learn-drag-demo 1.8s ease-in-out infinite;
}

@keyframes learn-drag-demo {
  0%, 20% { transform: translateX(0); opacity: .35; }
  70% { transform: translateX(24px); opacity: 1; }
  100% { transform: translateX(24px); opacity: 0; }
}

.learn-panel-heading {
  align-items: end;
}

.learn-panel-heading h2 {
  font-size: 20px;
  font-weight: 800;
}

.learn-finished-count {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  padding: 7px 10px;
  color: var(--teal);
  border: 1px solid rgba(36, 107, 97, .22);
  border-radius: 999px;
  background: var(--teal-pale);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.learn-page-navigation {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}

.learn-page-label {
  margin: 0;
  min-height: 42px;
  font-size: 14px;
  font-weight: 800;
}

.learn-page-nav {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--teal);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  font-size: 18px;
}

.learn-page-nav:disabled {
  cursor: default;
  opacity: .4;
}

.learn-legend {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
}

.learn-legend summary {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.learn-legend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 10px 11px;
}

.learn-legend-chips > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--learn-category-color) 68%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--learn-category-color) 22%, white);
  font-size: 12px;
  font-weight: 600;
}

.learn-legend-chips i {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: white;
  border-radius: 50%;
  background: var(--learn-category-color);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

[data-learn-color="challenge-question"] { --learn-category-color: #cf5048; }
[data-learn-color="information-question"] { --learn-category-color: #b85612; }
[data-learn-color="statement"] { --learn-category-color: #ebcb3b; }
[data-learn-color="proof"] { --learn-category-color: #a77aca; }
[data-learn-color="explanation"] { --learn-category-color: #3d96b8; }
[data-learn-color="answer"] { --learn-category-color: #539660; }
[data-learn-color="maskana"] { --learn-category-color: var(--teal); }
[data-learn-color="hava-amina"] { --learn-category-color: #a39480; }

.learn-legend-chips [data-learn-color="statement"] i,
.learn-banner-legend-chips [data-learn-color="statement"] i {
  color: #17332f;
}

.learn-notebook {
  min-height: 180px;
}

.learn-notebook-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.learn-notebook-heading h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.learn-filter-button {
  min-height: 34px;
  padding: 5px 10px;
  color: var(--plum);
  border: 1px solid rgba(117, 77, 116, .26);
  border-radius: 999px;
  background: #fbf7fa;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.learn-filter-button[aria-pressed="true"] {
  color: white;
  background: var(--plum);
}

.learn-notebook-empty {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 170px;
  padding: 22px 16px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  font-size: 14px;
}

.learn-empty-demo {
  transform: scale(1.15);
}

.learn-notebook-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-note-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--learn-category-color);
  border-radius: 12px;
  background: var(--card);
}

.learn-note-jump {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: start;
}

.learn-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--learn-category-color);
  font-size: 12px;
}

.learn-note-meta strong {
  font-weight: 800;
}

.learn-note-flag {
  color: var(--wine);
  font-size: 16px;
}

.learn-note-passage {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 20px;
  line-height: 1.35;
  text-align: right;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.learn-note-body {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.learn-note-actions {
  display: flex;
  align-items: center;
  align-self: stretch;
  padding-inline-end: 6px;
  opacity: 0;
  transition: opacity .16s ease;
}

.learn-note-row:hover .learn-note-actions,
.learn-note-row:focus-within .learn-note-actions {
  opacity: 1;
}

.learn-note-actions .text-button {
  min-height: 34px;
  padding: 5px 7px;
  font-size: 12px;
}

.learn-selection-editor {
  width: min(650px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  overflow-y: auto;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.learn-selection-editor::backdrop {
  background: rgba(24, 45, 43, .52);
  backdrop-filter: blur(3px);
}

.learn-selection-heading h3 {
  font-size: 20px;
  font-weight: 800;
}

.learn-selection-heading .text-button {
  min-height: 40px;
  font-size: 12px;
}

.learn-selection-meaning {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(23, 77, 71, .2);
  border-radius: 14px;
  background: color-mix(in srgb, var(--teal-pale) 72%, white);
}

.learn-selection-meaning-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--teal);
}

.learn-selection-meaning-heading h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
}

.learn-selection-meaning-heading span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.learn-selection-word-meanings {
  display: grid;
  gap: 8px;
}

.learn-selection-meaning-row {
  display: grid;
  grid-template-columns: minmax(90px, .72fr) minmax(0, 1.45fr);
  align-items: center;
  gap: 10px;
}

.learn-selection-meaning-row > span,
.learn-selection-meaning-row > strong {
  min-width: 0;
  overflow: hidden;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-selection-meaning-row input,
.learn-selection-deck-choice select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font-size: 13px;
}

.learn-selection-deck-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding-top: 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.learn-selection-deck-choice > label:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  white-space: nowrap;
}

.learn-selection-deck-choice > .field {
  margin: 0;
}

.learn-selection-deck-choice input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal-bright);
}

.learn-no-highlight-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0 0 12px;
  padding: 6px 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.learn-no-highlight-option:has(input:checked) {
  color: var(--teal);
  border-color: rgba(23, 77, 71, .4);
  background: var(--teal-pale);
}

.learn-no-highlight-option input {
  margin: 0;
  accent-color: var(--teal-bright);
}

.learn-color-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.learn-color-picker legend {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 800;
}

.learn-color-option {
  grid-template-columns: auto 22px minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 7px 9px;
  border-inline-start: 3px solid var(--learn-category-color);
  font-size: 12px;
  font-weight: 600;
}

.learn-color-option:has(input:checked) {
  border-color: var(--learn-category-color);
  background: color-mix(in srgb, var(--learn-category-color) 15%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--learn-category-color) 26%, transparent);
}

.learn-color-swatch {
  background: color-mix(in srgb, var(--learn-category-color) 72%, white) !important;
}

.learn-color-option kbd,
.learn-shortcuts kbd,
.learn-flag-toggle kbd {
  min-width: 26px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.learn-flag-toggle {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  margin-top: 12px;
  padding: 8px 10px;
  color: var(--wine);
  border: 1px solid rgba(122, 62, 59, .28);
  border-radius: 12px;
  background: color-mix(in srgb, var(--wine) 6%, white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.learn-note-field > span,
.learn-note-field textarea,
.learn-highlight-actions button,
.learn-save-status {
  font-size: 12px;
}

.learn-highlight-actions button {
  min-height: 44px;
}

.learn-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.learn-shortcuts > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.learn-page-actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.learn-finished-button {
  min-height: 44px;
  color: var(--teal);
  background: var(--teal-pale);
  box-shadow: none;
  font-size: 12px;
}

.learn-finished-button[aria-pressed="true"] {
  color: white;
  background: var(--teal-bright);
}

.learn-print-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding-inline: 14px;
  color: #76501f;
  border-color: #d8c39a;
  background: #fff7e6;
  box-shadow: none;
  font-size: 12px;
}

.learn-print-button:hover:not(:disabled) {
  border-color: #bc9252;
  background: #ffefcd;
}

.learn-page-overflow {
  position: relative;
}

.learn-page-overflow > summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  list-style: none;
}

.learn-page-overflow > summary::-webkit-details-marker {
  display: none;
}

.learn-page-overflow > button {
  position: absolute;
  z-index: 10;
  inset-inline-end: 0;
  bottom: calc(100% + 6px);
  width: max-content;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 10px 24px rgba(24, 45, 43, .14);
  font-size: 12px;
}

.learn-undo-toast {
  display: flex;
  align-items: center;
  gap: 12px;
}

.learn-undo-toast .text-button {
  color: inherit;
  border-color: currentColor;
  font-size: 12px;
}

.daf-word-region.is-learn-highlight {
  border: 0;
  background: color-mix(in srgb, var(--learn-category-color) 42%, transparent) !important;
  box-shadow: none;
}

.daf-word-region.is-learn-pulse {
  animation: learn-highlight-pulse .75s ease-in-out 2;
}

@keyframes learn-highlight-pulse {
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--learn-category-color) 45%, transparent); }
}

@media (max-width: 480px) {
  .learn-mode-active .daf-page-workspace {
    display: block;
  }

  .learn-mode-active .review-deck-slot {
    position: sticky;
    z-index: 20;
    bottom: 0;
    min-height: 0;
    margin-top: -10px;
  }

  .learn-mode-active .review-deck-slot #learnPanel {
    height: min(52dvh, 520px);
    min-height: 74px;
    max-height: 52dvh;
    padding: 14px;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 34px rgba(24, 45, 43, .18);
    transition: height .2s ease, max-height .2s ease;
  }

  .learn-mode-active .review-deck-slot #learnPanel[data-learn-sheet-size="peek"] {
    height: 92px;
    max-height: 92px;
    overflow: hidden;
  }

  .learn-mode-active .review-deck-slot #learnPanel[data-learn-sheet-size="full"] {
    height: min(82dvh, 780px);
    max-height: 82dvh;
  }

  .learn-sheet-controls {
    position: sticky;
    z-index: 4;
    top: -14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: -8px 0 12px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    backdrop-filter: blur(8px);
  }

  .learn-sheet-controls button {
    min-height: 36px;
    padding: 5px 8px;
    color: var(--ink-soft);
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
  }

  .learn-sheet-controls button[aria-pressed="true"] {
    color: white;
    background: var(--teal);
  }

  .learn-device-notice,
  .learn-coach {
    grid-template-columns: 1fr auto;
  }

  .learn-coach-gesture {
    display: none;
  }

  .learn-coach > span:nth-child(2) {
    min-width: 0;
  }

  .learn-legend-chips > span {
    width: 100%;
  }

  .learn-note-actions {
    opacity: 1;
  }

  .learn-selection-editor {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 82dvh;
    margin: 0;
    border-radius: 20px 20px 0 0;
  }

  .learn-color-picker {
    grid-template-columns: 1fr;
  }

  .learn-selection-meaning-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .learn-page-actions {
    position: sticky;
    bottom: 0;
    padding-bottom: 2px;
    background: var(--card);
  }
}

/* ── Learn library: six animated Sedarim and one durable page shelf ─────── */
.personal-library-shortcuts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(216, 207, 191, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
}

.personal-library-shortcuts button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  color: #38534f;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.personal-library-shortcuts button:hover,
.personal-library-shortcuts button:focus-visible {
  color: white;
  outline: 0;
  background: var(--teal);
  transform: translateY(-1px);
}

.personal-library-shortcuts button > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 13px;
}

.account-library-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  margin: 15px 0 4px;
}

.learn-mode-active.learn-workspace-open .hero {
  display: none;
}

.learn-library {
  position: relative;
  isolation: isolate;
  min-height: 690px;
  margin: 18px 0;
  padding: clamp(24px, 4vw, 58px);
  overflow: hidden;
  border: 1px solid rgba(164, 139, 99, .5);
  border-radius: 30px;
  background:
    radial-gradient(circle at 85% 6%, rgba(231, 196, 126, .24), transparent 24rem),
    radial-gradient(circle at 9% 94%, rgba(44, 105, 94, .15), transparent 26rem),
    repeating-linear-gradient(0deg, rgba(78, 62, 42, .025) 0 1px, transparent 1px 8px),
    #fffdf8;
  box-shadow: 0 30px 80px rgba(58, 47, 32, .13);
}

.learn-library::before,
.learn-library::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.learn-library::before {
  top: -210px;
  right: -160px;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(181, 122, 49, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(181, 122, 49, .035), 0 0 0 82px rgba(23, 77, 71, .025);
}

.learn-library::after {
  right: 5%;
  bottom: 25px;
  left: 5%;
  height: 16px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #b48a54, #795536);
  box-shadow: 0 13px 22px rgba(72, 47, 25, .2);
}

.learn-library-masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 22px;
}

.learn-library-title h2,
.learn-stage-heading h3,
.my-pages-library h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.04em;
}

.learn-library-title h2 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: .98;
}

.learn-library-title > p:last-child {
  margin: 11px 0 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 650;
}

.learn-library-score {
  display: grid;
  flex: 0 0 min(300px, 34%);
  gap: 2px;
  padding: 16px 18px;
  color: #fff9ed;
  border: 1px solid rgba(218, 178, 100, .58);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 8%, rgba(244, 205, 127, .23), transparent 8rem),
    linear-gradient(145deg, #143f3b, #1f5c53);
  box-shadow: 0 14px 28px rgba(23, 77, 71, .18);
}

.learn-library-score-kicker {
  color: #e9ca8c;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.learn-library-score strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.1;
}

.learn-library-progress-track {
  position: relative;
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}

.learn-library-progress-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--learn-progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #c9913f, #f0d28c);
  box-shadow: 0 0 15px rgba(236, 194, 109, .52);
  transition: width .65s cubic-bezier(.22, .78, .22, 1);
}

.learn-library-navigation {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 5px 8px;
  border-top: 1px solid rgba(216, 207, 191, .75);
  border-bottom: 1px solid rgba(216, 207, 191, .75);
}

.learn-library-back {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  color: var(--teal);
  border: 0;
  border-radius: 999px;
  background: var(--teal-pale);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.learn-library-breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--ink-soft);
  list-style: none;
  font-size: 12px;
  font-weight: 750;
}

.learn-library-breadcrumbs li + li::before {
  margin-inline-end: 8px;
  color: #b59e7d;
  content: "/";
}

.learn-library-breadcrumbs li[aria-current="page"] {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-library-stage {
  position: relative;
  min-height: 360px;
}

.seder-book-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  align-items: end;
  gap: clamp(10px, 1.8vw, 24px);
  min-height: 378px;
  padding: 18px 8px 34px;
  perspective: 1600px;
}

.seder-book-card {
  --seder-deep: #274d49;
  --seder-mid: #3f756b;
  --seder-light: #7da69d;
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 12px;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 950px;
}

.seder-book-card[data-seder-id="zeraim"] { --seder-deep: #255649; --seder-mid: #3f806e; --seder-light: #78ab91; }
.seder-book-card[data-seder-id="moed"] { --seder-deep: #273f67; --seder-mid: #486a92; --seder-light: #8aa4bd; }
.seder-book-card[data-seder-id="nashim"] { --seder-deep: #743a3f; --seder-mid: #a35d60; --seder-light: #c88b86; }
.seder-book-card[data-seder-id="nezikin"] { --seder-deep: #513754; --seder-mid: #76547b; --seder-light: #a58ba9; }
.seder-book-card[data-seder-id="kodashim"] { --seder-deep: #755126; --seder-mid: #a7793d; --seder-light: #d1aa69; }
.seder-book-card[data-seder-id="tohorot"] { --seder-deep: #355c65; --seder-mid: #5b8690; --seder-light: #94b2b8; }

.seder-volume {
  position: relative;
  width: min(100%, 170px);
  height: 268px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 19px 13px rgba(46, 35, 25, .25));
  transition: filter .25s ease, transform .25s ease;
}

.seder-book-card:nth-child(even) .seder-volume {
  height: 286px;
}

.seder-book-card:nth-child(3n) .seder-volume {
  height: 252px;
}

.seder-book-card:hover .seder-volume,
.seder-book-card:focus-visible .seder-volume {
  filter: drop-shadow(0 25px 16px rgba(46, 35, 25, .3));
  transform: translateY(-8px) rotateY(-4deg);
}

.seder-book-card:focus-visible {
  outline: 3px solid rgba(181, 122, 49, .36);
  outline-offset: 8px;
  border-radius: 12px;
}

.seder-cover,
.seder-page-block,
.seder-spine {
  position: absolute;
  display: block;
}

.seder-page-block {
  z-index: 0;
  inset: 9px 2px 2px 9px;
  border-radius: 4px 9px 7px 3px;
  background:
    repeating-linear-gradient(0deg, #f9edcf 0 3px, #dfcaa0 3px 4px),
    #f7e8c6;
  box-shadow: inset -7px 0 13px rgba(103, 74, 35, .19);
  transform: translateZ(-7px);
}

.seder-spine {
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 17px;
  border: 1px solid rgba(237, 214, 164, .34);
  border-radius: 6px 0 0 5px;
  background: linear-gradient(90deg, var(--seder-deep), var(--seder-light) 48%, var(--seder-deep));
  box-shadow: inset -3px 0 5px rgba(0, 0, 0, .18);
  transform: translateZ(4px);
}

.seder-cover {
  z-index: 2;
  inset: 0;
  overflow: hidden;
  color: #f7e4bb;
  border: 2px solid color-mix(in srgb, var(--seder-light) 52%, #f1d49e);
  border-radius: 6px 12px 7px 5px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, .13), transparent 7rem),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, .018) 5px 6px),
    linear-gradient(145deg, var(--seder-mid), var(--seder-deep));
  box-shadow: inset 12px 0 18px rgba(255, 255, 255, .07), inset -12px 0 18px rgba(0, 0, 0, .16);
  transform: translateZ(7px);
  transform-origin: left center;
  transform-style: preserve-3d;
}

.seder-gold-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  height: var(--seder-progress, 0%);
  opacity: .82;
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, .16) 8px 9px),
    linear-gradient(180deg, #e8c46e, #b97c27);
  box-shadow: 0 -4px 16px rgba(240, 199, 112, .42);
  transition: height .8s cubic-bezier(.2, .8, .2, 1);
}

.seder-gold-fill::before {
  position: absolute;
  top: -4px;
  right: 0;
  left: 0;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, #9d6723, #f7dda2 45%, #a36c27);
  box-shadow: 0 0 9px rgba(252, 222, 157, .68);
}

.seder-cover-frame {
  position: absolute;
  inset: 16px 13px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(245, 216, 157, .64);
  border-radius: 48% 48% 8px 8px / 23% 23% 8px 8px;
  box-shadow: inset 0 0 0 4px rgba(246, 218, 162, .09);
}

.seder-cover-frame::before,
.seder-cover-frame::after {
  position: absolute;
  right: 13%;
  left: 13%;
  height: 1px;
  content: "";
  background: rgba(245, 216, 157, .58);
}

.seder-cover-frame::before { top: 18%; }
.seder-cover-frame::after { bottom: 18%; }

.seder-book-title {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0 8px;
  text-align: center;
  text-shadow: 0 2px 3px rgba(32, 22, 15, .35);
}

.seder-book-title strong {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(27px, 2.5vw, 38px);
  font-weight: 400;
  line-height: 1;
}

.seder-book-title small {
  color: rgba(255, 243, 214, .86);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.seder-book-meta {
  display: grid;
  min-height: 42px;
  justify-items: center;
  color: var(--ink-soft);
  text-align: center;
  font-size: 11px;
}

.seder-book-meta strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.seder-book-card.is-opening {
  z-index: 5;
}

.seder-book-card.is-opening .seder-volume {
  animation: seder-volume-zoom .72s cubic-bezier(.18, .72, .2, 1) both;
}

.seder-book-card.is-opening .seder-cover {
  animation: seder-cover-open .72s cubic-bezier(.2, .72, .16, 1) both;
}

@keyframes seder-volume-zoom {
  0% { transform: translateY(0) scale(1); }
  48% { transform: translateY(-18px) scale(1.08); }
  100% { transform: translateY(-10px) scale(1.16); }
}

@keyframes seder-cover-open {
  0% { transform: translateZ(7px) rotateY(0deg); }
  100% { transform: translateZ(7px) rotateY(-126deg); }
}

.learn-masechta-view,
.learn-daf-chooser {
  animation: learn-library-enter .42s cubic-bezier(.18, .75, .2, 1) both;
}

@keyframes learn-library-enter {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.learn-stage-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 24px;
}

.learn-stage-heading h3,
.my-pages-library h3 {
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1;
}

.masechta-book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 32px;
}

.masechta-book {
  --masechta-hue: 150;
  --masechta-progress: 0%;
  position: relative;
  display: grid;
  min-height: 174px;
  align-content: space-between;
  gap: 16px;
  padding: 20px 18px 17px 27px;
  overflow: hidden;
  color: var(--ink);
  border: 2px solid hsl(var(--masechta-hue) 31% 52% / .78);
  border-left-width: 10px;
  border-radius: 7px 17px 17px 7px;
  background:
    linear-gradient(0deg, rgba(217, 169, 75, .48) 0 var(--masechta-progress), transparent var(--masechta-progress)),
    radial-gradient(circle at 94% 6%, hsl(var(--masechta-hue) 45% 48% / .13), transparent 10rem),
    #fffdf8;
  box-shadow: inset 5px 0 0 hsl(var(--masechta-hue) 28% 45% / .15), 0 10px 24px rgba(57, 45, 29, .08);
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.masechta-book::before,
.masechta-book::after {
  position: absolute;
  left: 14px;
  width: 4px;
  height: 4px;
  content: "";
  border-radius: 50%;
  background: hsl(var(--masechta-hue) 36% 44%);
  box-shadow: 0 8px 0 hsl(var(--masechta-hue) 36% 44%), 0 16px 0 hsl(var(--masechta-hue) 36% 44%);
}

.masechta-book::before { top: 21px; }
.masechta-book::after { bottom: 37px; }

.masechta-book:hover,
.masechta-book:focus-visible {
  outline: 0;
  border-color: hsl(var(--masechta-hue) 44% 40%);
  box-shadow: inset 5px 0 0 hsl(var(--masechta-hue) 28% 45% / .2), 0 17px 34px rgba(57, 45, 29, .14);
  transform: translateY(-4px) rotate(.2deg);
}

.masechta-book-title {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
}

.masechta-book-title strong {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(28px, 3vw, 39px);
  font-weight: 400;
  line-height: 1;
}

.masechta-book-title span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
}

.masechta-progress {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  color: #4f5e5a;
  font-size: 11px;
  font-weight: 800;
}

.masechta-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(64, 64, 55, .12);
}

.masechta-progress-track i {
  display: block;
  width: var(--masechta-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b77926, #e9c26b);
}

.learn-daf-heading {
  align-items: center;
}

.learn-tractate-progress {
  padding: 9px 13px;
  color: #82591e;
  border: 1px solid rgba(181, 122, 49, .32);
  border-radius: 999px;
  background: rgba(244, 229, 202, .66);
  font-size: 12px;
  font-weight: 850;
}

.learn-daf-range-rail {
  display: flex;
  gap: 7px;
  margin: 0 -2px 17px;
  padding: 2px 2px 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.learn-daf-range-rail button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.learn-daf-range-rail button[aria-pressed="true"] {
  color: #fff9ed;
  border-color: var(--teal);
  background: var(--teal);
}

.learn-daf-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.learn-daf-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d3c8b8;
  border-radius: 13px;
  background: #fffdf8;
  box-shadow: 0 7px 16px rgba(63, 50, 33, .06);
}

.learn-daf-number {
  grid-column: 1 / -1;
  padding: 7px 7px 5px;
  color: var(--ink-soft);
  border-bottom: 1px solid #e2d9cb;
  background: #f8f3e9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.learn-amud-choice {
  position: relative;
  min-height: 52px;
  padding: 5px;
  color: var(--teal);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.learn-amud-choice + .learn-amud-choice {
  border-inline-start: 1px solid #e2d9cb;
}

.learn-amud-choice:hover,
.learn-amud-choice:focus-visible {
  outline: 0;
  background: var(--teal-pale);
}

.learn-amud-choice.is-finished::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: #c18a34;
  box-shadow: 0 0 0 3px rgba(193, 138, 52, .15);
}

.learn-amud-choice[aria-selected="true"] {
  color: #fff8e9;
  background: linear-gradient(145deg, #1f675d, #174d47);
}

.learn-daf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 15px;
}

.learn-daf-pagination button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.learn-daf-pagination button:disabled {
  cursor: default;
  opacity: .35;
}

.learn-daf-page-status {
  min-width: 130px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.my-pages-library {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 25px 0 42px;
  border-top: 1px solid rgba(216, 207, 191, .82);
}

.my-pages-library > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.my-flashcards-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: #fff9ed;
  border: 0;
  border-radius: 999px;
  background: #425e78;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.learn-saved-pages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.learn-saved-page {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 17px;
  border: 1px solid #d7cdbc;
  border-radius: 16px;
  background: rgba(255, 255, 255, .77);
  box-shadow: 0 8px 20px rgba(63, 50, 33, .06);
}

.learn-saved-page-open {
  width: 100%;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: start;
}

.learn-saved-page-open:hover,
.learn-saved-page-open:focus-visible {
  outline: 3px solid rgba(23, 77, 71, .14);
  outline-offset: 6px;
}

.learn-saved-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.learn-saved-page-heading > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.learn-saved-page-heading strong {
  overflow: hidden;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-saved-page-heading small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.learn-saved-page-finished {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: linear-gradient(145deg, #d4a04d, #a96d22);
  box-shadow: 0 6px 12px rgba(181, 122, 49, .22);
  font-size: 14px;
  font-weight: 900;
}

.learn-saved-page-views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.learn-saved-page-views button {
  min-height: 42px;
  padding: 7px;
  color: var(--teal);
  border: 1px solid #bed1ca;
  border-radius: 10px;
  background: #f5faf8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.learn-saved-page-views button:last-child {
  color: #5f4d74;
  border-color: #d3c7df;
  background: #faf7fc;
}

.learn-saved-page-views button:hover,
.learn-saved-page-views button:focus-visible {
  outline: 3px solid rgba(23, 77, 71, .14);
  transform: translateY(-1px);
}

.learn-saved-page-delete {
  min-height: 38px;
  padding: 6px 10px;
  color: #84443f;
  border: 1px solid rgba(132, 68, 63, .28);
  border-radius: 10px;
  background: rgba(132, 68, 63, .055);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.learn-saved-page-delete:hover,
.learn-saved-page-delete:focus-visible {
  outline: 3px solid rgba(132, 68, 63, .14);
  background: rgba(132, 68, 63, .1);
}

.learn-saved-page-delete:disabled {
  cursor: wait;
  opacity: .58;
}

.learn-saved-pages-empty {
  margin: 0;
  padding: 24px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
}

.learn-library-status {
  min-height: 20px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.learn-library-status.is-error {
  color: var(--wine);
}

.learn-mode-active.learn-workspace-open .source-panel {
  display: none !important;
}

.learn-mode-active.learn-workspace-open .review-panel {
  margin-top: 0;
}

.learn-mode-active.learn-workspace-open #reviewViewPicker {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 680px;
  margin: 0 auto 18px;
}

.learn-mode-active.learn-workspace-open .review-view-button small {
  display: none;
}

.learn-mode-active.learn-workspace-open .review-view-button {
  min-height: 58px;
}

.learn-mode-active.learn-workspace-open .review-stage[data-review-view="text"] .review-text-view {
  display: block !important;
}

.learn-mode-active.learn-workspace-open .review-stage[data-review-view="page"] .review-text-view {
  display: none !important;
}

.learn-mode-active.learn-workspace-open .review-text-view .text-drag-combine-hint {
  display: none;
}

.learn-mode-active.learn-workspace-open .review-text-view .text-preview {
  margin-top: 0;
}

.learn-mode-active.learn-workspace-open .review-text-view .source-text {
  max-height: min(62vh, 660px);
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(18px, 1.65vw, 24px);
  line-height: 1.7;
}

.learn-mode-active.learn-workspace-open .review-text-view #rashiText,
.learn-mode-active.learn-workspace-open .review-text-view #tosafotText {
  font-family: "Daf to Deck Rashi", "Arial Hebrew", serif;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.78;
}

.learn-mode-active.learn-workspace-open #gemaraPreview {
  --learn-source-accent: var(--teal);
}

.learn-mode-active.learn-workspace-open #rashiPreview {
  --learn-source-accent: var(--wine);
}

.learn-mode-active.learn-workspace-open #tosafotPreview {
  --learn-source-accent: var(--blue);
}

.learn-mode-active.learn-workspace-open .preview-list > details > summary {
  border-inline-start: 4px solid var(--learn-source-accent);
  background: color-mix(in srgb, var(--learn-source-accent) 7%, white);
}

.learn-mode-active.learn-workspace-open .review-text-view .source-token {
  position: relative;
  border-radius: 5px;
  cursor: pointer;
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-weight: 700;
}

.learn-mode-active.learn-workspace-open .source-token.is-learn-highlight {
  color: inherit;
  border: 0;
  background: color-mix(in srgb, var(--learn-category-color) 38%, transparent);
  box-shadow: none;
}

.learn-mode-active.learn-workspace-open .source-token.is-learn-selection {
  outline: 3px solid rgba(23, 77, 71, .28);
  outline-offset: 2px;
}

.learn-text-nikkud {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  margin-inline-start: auto;
  padding: 6px 11px;
  color: #35697a;
  border: 1px solid rgba(53, 105, 122, .28);
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 11px;
}

.learn-text-nikkud > span {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 20px;
}

.learn-text-nikkud[aria-pressed="true"] {
  color: white;
  border-color: #35697a;
  background: #35697a;
}

.learn-vocabulary {
  margin: 16px 0;
  padding: 15px;
  border: 1px solid rgba(181, 122, 49, .28);
  border-radius: 15px;
  background:
    radial-gradient(circle at 94% 4%, rgba(232, 195, 116, .16), transparent 8rem),
    #fffdf8;
}

.learn-vocabulary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.learn-vocabulary-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.learn-vocabulary-heading > strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #7d531e;
  border: 1px solid rgba(181, 122, 49, .34);
  border-radius: 50%;
  background: var(--gold-pale);
  font-size: 13px;
}

.learn-vocabulary-empty {
  margin: 0;
  padding: 13px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 11px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.learn-vocabulary-form {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d9cfbf;
  border-radius: 12px;
  background: white;
}

.learn-vocabulary-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.learn-vocabulary-selected > span,
.learn-vocabulary-form .field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.learn-vocabulary-selected strong {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 28px;
  font-weight: 400;
}

.learn-vocabulary-form input {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
}

.learn-vocabulary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.learn-vocabulary-actions button {
  min-height: 40px;
  padding: 7px 12px;
  font-size: 12px;
}

.learn-vocabulary-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-vocabulary-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e0d6c8;
  border-radius: 10px;
  background: white;
}

.learn-vocabulary-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff8ea;
  border-radius: 50%;
  background: linear-gradient(145deg, #c28a36, #95601f);
  font-size: 11px;
  font-weight: 900;
}

.learn-vocabulary-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.learn-vocabulary-copy strong {
  overflow: hidden;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-vocabulary-copy span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-vocabulary-edit {
  min-height: 34px;
  padding: 5px 8px;
  color: var(--teal);
  border: 0;
  border-radius: 8px;
  background: var(--teal-pale);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.source-token {
  position: relative;
}

.learn-vocabulary-marker {
  position: absolute;
  z-index: 5;
  display: grid;
  min-width: 10px;
  height: 10px;
  padding: 0 2px;
  place-items: center;
  color: white;
  border: .5px solid rgba(255, 255, 255, .92);
  border-radius: 4px;
  background: #885719;
  box-shadow: 0 1px 3px rgba(82, 49, 17, .22);
  font-family: Inter, sans-serif;
  font-size: 6px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  top: -5px;
  right: auto;
  inset-inline-end: -3px;
}

.source-token > .learn-vocabulary-marker {
  top: -.38em;
  right: auto;
  inset-inline-end: -.16em;
}

@media (max-width: 1120px) {
  .local-badge {
    display: none;
  }

  .seder-book-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    min-height: 690px;
  }

  .masechta-book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .learn-daf-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .personal-library-shortcuts {
    order: 3;
    width: 100%;
  }

  .personal-library-shortcuts button {
    flex: 1 1 0;
    justify-content: center;
  }

  .learn-library {
    min-height: 0;
    padding: 24px 18px 42px;
    border-radius: 22px;
  }

  .learn-library-masthead {
    align-items: stretch;
    flex-direction: column;
  }

  .learn-library-score {
    flex-basis: auto;
  }

  .seder-book-grid {
    grid-template-columns: repeat(2, minmax(118px, 1fr));
    min-height: 0;
    gap: 22px 14px;
  }

  .seder-volume,
  .seder-book-card:nth-child(even) .seder-volume,
  .seder-book-card:nth-child(3n) .seder-volume {
    width: min(100%, 150px);
    height: 224px;
  }

  .masechta-book-grid,
  .learn-saved-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learn-daf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .brand small {
    display: none;
  }

  .personal-library-shortcuts button {
    padding-inline: 7px;
  }

  .personal-library-shortcuts button > span {
    display: none;
  }

  .learn-library-title h2 {
    font-size: 40px;
  }

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

  .learn-library-navigation {
    margin-inline: -4px;
  }

  .seder-book-grid {
    padding-inline: 0;
  }

  .seder-book-title strong {
    font-size: 28px;
  }

  .seder-book-title small {
    font-size: 10px;
  }

  .masechta-book-grid,
  .learn-saved-pages {
    grid-template-columns: 1fr;
  }

  .masechta-book {
    min-height: 145px;
  }

  .learn-daf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learn-stage-heading,
  .my-pages-library > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .learn-tractate-progress {
    align-self: flex-start;
  }

  .my-flashcards-link {
    width: 100%;
    justify-content: space-between;
  }

  .learn-mode-active.learn-workspace-open #reviewViewPicker {
    gap: 7px;
  }

  .learn-mode-active.learn-workspace-open .review-view-button {
    min-height: 54px;
    padding: 8px;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hero-daf-yomi {
  display: inline-flex;
  width: fit-content;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 8px 10px 8px 16px;
  color: var(--teal);
  border: 1px solid rgba(23, 77, 71, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 9px 20px rgba(28, 64, 59, .1);
  cursor: pointer;
  text-align: left;
}

.hero-daf-yomi > span:first-child {
  display: grid;
  gap: 1px;
}

.hero-daf-yomi small {
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
}

.hero-daf-yomi strong {
  font-size: 16px;
  font-weight: 850;
}

.hero-daf-yomi-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--teal);
  font-size: 18px;
}

.hero-daf-yomi:hover,
.hero-daf-yomi:focus-visible {
  outline: 3px solid rgba(23, 77, 71, .16);
  outline-offset: 3px;
  transform: translateY(-2px);
}

.hero-daf-yomi:disabled {
  cursor: wait;
  opacity: .58;
  transform: none;
}

.mode-daf-library {
  position: relative;
  margin: 22px 0;
  padding: clamp(22px, 3.6vw, 46px);
  overflow: hidden;
  border: 1px solid rgba(204, 189, 165, .9);
  border-radius: 30px;
  background:
    radial-gradient(circle at 9% 3%, rgba(220, 175, 91, .15), transparent 20rem),
    repeating-linear-gradient(0deg, rgba(74, 60, 43, .025) 0 1px, transparent 1px 9px),
    #fffdf8;
  box-shadow: 0 20px 50px rgba(64, 49, 31, .1);
}

.mode-library-workspace-open .source-panel {
  display: none;
}

.mode-daf-library::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 310px;
  height: 310px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(49, 107, 99, .11), transparent 67%);
  pointer-events: none;
}

.mode-library-masthead {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.mode-library-masthead h2 {
  margin: 4px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .98;
}

.mode-my-decks h3 {
  margin: 4px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 700;
  line-height: .98;
}

.mode-library-masthead > div > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 650;
}

.mode-library-font {
  display: grid;
  min-width: 210px;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
}

.mode-library-font select {
  min-height: 48px;
  padding: 8px 38px 8px 14px;
  color: var(--ink);
  border: 1px solid #d3c6b4;
  border-radius: 13px;
  background: rgba(255, 255, 255, .9);
  font: inherit;
}

.mode-library-stage {
  min-height: 330px;
}

.mode-seder-grid {
  min-height: 348px;
  padding-bottom: 12px;
}

.mode-seder-book .seder-volume {
  height: 245px;
}

.mode-seder-book:nth-child(even) .seder-volume {
  height: 260px;
}

.mode-seder-book:nth-child(3n) .seder-volume {
  height: 232px;
}

.mode-masechta-book {
  min-height: 140px;
  align-content: center;
  background:
    radial-gradient(circle at 94% 6%, hsl(var(--masechta-hue) 45% 48% / .14), transparent 10rem),
    #fffdf8;
}

.mode-my-decks {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid rgba(216, 207, 191, .82);
}

.mode-my-decks > header {
  margin-bottom: 17px;
}

.mode-my-decks h3 {
  margin-bottom: 0;
  font-size: clamp(34px, 4vw, 50px);
}

.mode-deck-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mode-deck-card {
  --deck-deep: #315c57;
  --deck-mid: #5a8c80;
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 194px;
  place-items: center;
  gap: 10px;
  padding: 18px 14px 15px;
  color: var(--ink);
  border: 1px solid rgba(54, 80, 76, .2);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255,255,255,.94), rgba(242, 239, 229, .88));
  box-shadow: 0 10px 24px rgba(54, 47, 36, .08);
  cursor: pointer;
  text-align: center;
}

.mode-deck-card-2 { --deck-deep: #6f4650; --deck-mid: #aa7375; }
.mode-deck-card-3 { --deck-deep: #445d7a; --deck-mid: #718da9; }
.mode-deck-card-4 { --deck-deep: #765529; --deck-mid: #b08348; }
.mode-deck-card-5 { --deck-deep: #584568; --deck-mid: #8b7097; }
.mode-deck-card-6 { --deck-deep: #3e6970; --deck-mid: #72a0a4; }

.mode-deck-card:hover,
.mode-deck-card:focus-visible,
.mode-deck-card[aria-pressed="true"] {
  outline: 0;
  border-color: var(--deck-deep);
  box-shadow: 0 18px 34px rgba(54, 47, 36, .15), 0 0 0 4px color-mix(in srgb, var(--deck-mid) 22%, transparent);
  transform: translateY(-4px);
}

.mode-deck-card:disabled {
  cursor: default;
  filter: grayscale(.45);
  opacity: .55;
  transform: none;
}

.mode-deck-art {
  position: relative;
  display: block;
  width: 104px;
  height: 82px;
}

.mode-deck-sheet {
  position: absolute;
  inset: 4px 7px;
  display: block;
  border: 2px solid rgba(255, 255, 255, .58);
  border-radius: 9px;
  box-shadow: 0 9px 15px rgba(35, 25, 20, .16);
}

.mode-deck-sheet-back {
  background: color-mix(in srgb, var(--deck-mid) 56%, #f5dfc2);
  transform: translate(-9px, 4px) rotate(-8deg);
}

.mode-deck-sheet-middle {
  background: color-mix(in srgb, var(--deck-mid) 76%, white);
  transform: translate(8px, 1px) rotate(7deg);
}

.mode-deck-sheet-front {
  display: grid;
  place-items: center;
  color: #fff8e9;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(255,255,255,.09) 9px 10px),
    linear-gradient(145deg, var(--deck-mid), var(--deck-deep));
}

.mode-deck-sheet-front b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
}

.mode-deck-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mode-deck-copy strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-deck-copy small {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.mode-deck-card-add {
  color: var(--teal);
  border: 2px dashed rgba(23, 77, 71, .27);
  background: rgba(235, 245, 241, .5);
}

.mode-deck-add-mark {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 18px;
  background: var(--teal-pale);
  font-size: 34px;
}

.quiz-deck-library {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #dfd2c3;
  border-radius: 22px;
  background:
    radial-gradient(circle at 95% 0, rgba(130, 77, 89, .12), transparent 15rem),
    rgba(255, 253, 248, .9);
}

.quiz-deck-library-heading {
  margin-bottom: 17px;
}

.quiz-deck-library h4 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1;
}

.quiz-deck-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quiz-deck-gallery .mode-deck-card {
  min-height: 178px;
}

.chavruta-mode-active #builderWorkspace {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  align-items: start;
}

.chavruta-mode-active .chavruta-panel {
  border-color: rgba(104, 68, 95, .3);
  background:
    radial-gradient(circle at 100% 0, rgba(126, 78, 108, .14), transparent 15rem),
    #fffdf9;
}

.chavruta-mode-active .chavruta-panel-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.chavruta-mode-active .chavruta-intro,
.chavruta-mode-active .chavruta-section-heading h3,
.chavruta-mode-active .chavruta-list-copy strong {
  font-size: 13px;
}

.chavruta-mode-active #chavrutaFriendsList > li {
  min-height: 72px;
  padding: 13px;
  border-color: rgba(104, 68, 95, .22);
  border-radius: 15px;
  background: linear-gradient(145deg, #fff, #faf3f7);
  box-shadow: 0 7px 17px rgba(75, 45, 63, .07);
}

@media (max-width: 900px) {
  .mode-deck-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chavruta-mode-active #builderWorkspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero-daf-yomi {
    width: 100%;
  }

  .mode-daf-library {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .mode-library-masthead {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-library-font {
    min-width: 0;
  }

  .mode-seder-grid {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .mode-library-masthead h2 {
    font-size: 39px;
  }

  .mode-deck-gallery,
  .quiz-deck-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .mode-deck-card {
    min-height: 164px;
    padding-inline: 9px;
  }

  .mode-deck-art {
    width: 84px;
    height: 68px;
  }
}

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

/* 2.3.73 — mode-specific workspaces and truly inline learning tools. */
.hero {
  min-height: 330px;
  padding-block: clamp(46px, 5.5vw, 72px);
}

.hero h1 {
  font-size: clamp(46px, 5.3vw, 76px);
}

.hero-books,
.learn-hero-mark,
.quiz-hero-mark,
.chavruta-hero-mark {
  height: 226px;
  transform: scale(1.06);
}

.review-view-picker {
  gap: 20px;
}

.review-view-button {
  min-height: 170px;
  padding: clamp(24px, 3vw, 38px);
  border-width: 2px;
  border-radius: 26px;
}

.review-view-button strong {
  font-size: clamp(30px, 3vw, 44px);
}

.build-workspace-banner,
.learn-workspace-banner {
  width: 100%;
  min-height: 118px;
  margin: 0;
  padding: 24px 28px;
  flex: 1 0 100%;
}

.build-workspace-banner .build-drag-coach strong,
.learn-workspace-banner strong {
  font-size: 22px;
}

.build-workspace-banner .build-drag-coach small,
.learn-workspace-banner span {
  font-size: 15px;
}

.daf-view-options {
  flex: 1 1 760px;
  flex-wrap: wrap;
}

.daf-viewer-toolbar {
  min-height: 98px;
  padding: 16px 20px;
  align-items: center;
}

.build-deck-picker {
  min-width: min(340px, 42vw);
}

.build-deck-picker > span {
  color: #8a5c18;
  font-size: 12px;
}

.build-deck-picker select {
  min-height: 56px;
  color: var(--teal-dark);
  border: 2px solid rgba(23, 77, 71, .3);
  border-radius: 13px;
  background: #fffdf8;
  font-size: 17px;
  font-weight: 900;
}

.deck-mode-active.deck-workspace-open .daf-review-dock-host {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
}

.deck-mode-active.deck-workspace-open .daf-page-viewport {
  height: auto;
  min-height: 0;
  overflow: visible;
  overscroll-behavior: auto;
}

.deck-mode-active.deck-workspace-open .daf-viewer,
.deck-mode-active.deck-workspace-open .daf-page-workspace,
.deck-mode-active.deck-workspace-open .daf-page-surface {
  overflow: visible;
}

.deck-mode-active .source-text,
.deck-mode-active #gemaraText {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(20px, 1.72vw, 27px);
  line-height: 1.78;
}

.deck-mode-active #rashiText,
.deck-mode-active #tosafotText {
  font-family: "Daf to Deck Rashi", "Times New Roman", serif;
  font-size: clamp(18px, 1.52vw, 24px);
  line-height: 1.75;
}

.deck-mode-active #rashiText.use-regular-script,
.deck-mode-active #tosafotText.use-regular-script {
  font-family: "Daf to Deck Frank", Georgia, serif;
}

.deck-card-popover-word.font-rashi {
  font-family: "Daf to Deck Rashi", "Times New Roman", serif;
}

.deck-card-popover-word.font-regular {
  font-family: "Daf to Deck Frank", Georgia, serif;
}

.deck-word-action {
  width: 54px;
  min-height: 54px;
  padding: 8px;
  overflow: hidden;
  gap: 0;
  transition: width .18s ease, gap .18s ease, padding .18s ease;
}

.deck-word-action > span {
  flex: 0 0 34px;
}

.deck-word-action > strong {
  width: 0;
  opacity: 0;
  white-space: nowrap;
  transition: opacity .12s ease;
}

.deck-word-action:hover,
.deck-word-action:focus-visible {
  width: 150px;
  gap: 9px;
  padding-right: 15px;
}

.deck-word-action:hover > strong,
.deck-word-action:focus-visible > strong {
  width: auto;
  opacity: 1;
}

.learn-selection-toolbar {
  position: fixed;
  z-index: 1220;
  display: flex;
  width: max-content;
  max-width: calc(100vw - 20px);
  align-items: center;
  gap: 7px;
  padding: 8px;
  overflow: visible;
  border: 1px solid rgba(23, 77, 71, .25);
  border-radius: 999px;
  background: rgba(255, 253, 248, .98);
  box-shadow: 0 16px 42px rgba(24, 50, 46, .24);
  animation: deck-action-pop .18s ease-out both;
}

.learn-selection-toolbar > button {
  --tool-color: #698078;
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: var(--tool-color);
  box-shadow: 0 3px 10px rgba(34, 50, 45, .18);
  cursor: pointer;
}

.learn-selection-toolbar > button[data-learn-quick-color="challenge-question"] { --tool-color: #d95850; }
.learn-selection-toolbar > button[data-learn-quick-color="information-question"] { --tool-color: #b85612; }
.learn-selection-toolbar > button[data-learn-quick-color="statement"] { --tool-color: #ebcb3b; color: #17332f; }
.learn-selection-toolbar > button[data-learn-quick-color="proof"] { --tool-color: #9c6ad0; }
.learn-selection-toolbar > button[data-learn-quick-color="explanation"] { --tool-color: #429fc5; }
.learn-selection-toolbar > button[data-learn-quick-color="answer"] { --tool-color: #4d9e68; }
.learn-selection-toolbar > button[data-learn-tool="meaning"] { --tool-color: #174d47; }
.learn-selection-toolbar > button[data-learn-tool="note"] { --tool-color: #8a5c18; }
.learn-selection-toolbar > button[data-learn-tool="erase"] { --tool-color: #68716e; }
.learn-selection-toolbar > button[data-learn-tool="indent"] { --tool-color: #596b82; }
.learn-selection-toolbar > button[data-learn-tool="sentence-end"] { --tool-color: #596b82; }

.learn-selection-toolbar i {
  font-style: normal;
  font-size: 19px;
  font-weight: 900;
}

.learn-selection-toolbar button > span {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 3;
  padding: 6px 9px;
  color: #fff;
  border-radius: 7px;
  background: #17352f;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity .14s ease, transform .14s ease;
  white-space: nowrap;
}

.learn-selection-toolbar button:hover > span,
.learn-selection-toolbar button:focus-visible > span {
  opacity: 1;
  transform: translate(-50%, 0);
}

.learn-selection-editor[data-tool-mode="meaning"] .learn-color-picker,
.learn-selection-editor[data-tool-mode="meaning"] .learn-no-highlight-option,
.learn-selection-editor[data-tool-mode="meaning"] .learn-note-field,
.learn-selection-editor[data-tool-mode="meaning"] .learn-paragraph-toggle,
.learn-selection-editor[data-tool-mode="note"] .learn-color-picker,
.learn-selection-editor[data-tool-mode="note"] .learn-no-highlight-option,
.learn-selection-editor[data-tool-mode="note"] .learn-selection-meaning,
.learn-selection-editor[data-tool-mode="note"] .learn-paragraph-toggle {
  display: none !important;
}

.learn-selection-editor[data-tool-mode="meaning"] .learn-selection-meaning {
  display: block;
}

.learn-mode-active .learn-sheet-controls,
.learn-mode-active .learn-device-notice,
.learn-mode-active .learn-coach,
.learn-mode-active .learn-panel-heading,
.learn-mode-active .learn-page-navigation > button,
.learn-mode-active .learn-page-actions {
  display: none !important;
}

.learn-mode-active .learn-page-navigation {
  grid-template-columns: 1fr;
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword:not(.is-learn-highlight),
.deck-mode-active .source-token.is-commentary-catchword:not(.is-learn-highlight) {
  padding: .04em .2em;
  border-radius: .22em;
  background: #e2e4e2;
  box-shadow: inset 0 -2px 0 rgba(48, 65, 61, .14);
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword,
.deck-mode-active .source-token.is-commentary-catchword {
  font-size: 1.42em;
  font-weight: 950;
}

.mode-find-chavruta,
.mode-chavruta-daf-yomi {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 18px 24px;
  color: var(--ink);
  border: 2px solid rgba(54, 106, 122, .3);
  border-radius: 20px;
  background: linear-gradient(135deg, #edf6f4, #eef1f8);
  cursor: pointer;
  text-align: left;
}

.mode-find-chavruta > span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: #174d47;
  color: #fff;
  font-size: 28px;
}

.mode-find-chavruta > strong { margin-right: auto; font-size: 22px; }
.mode-find-chavruta > small { color: var(--ink-soft); font-weight: 800; }
.mode-find-chavruta[aria-pressed="true"] { border-color: #174d47; box-shadow: 0 0 0 4px rgba(23, 77, 71, .12); }

.mode-chavruta-daf-yomi {
  width: 100%;
  color: #fff;
  border-color: #174d47;
  background: linear-gradient(135deg, #174d47, #2d7d70);
}

.mode-chavruta-daf-yomi > span:first-child { display: grid; gap: 3px; }
.mode-chavruta-daf-yomi small { color: #f1c86c; font-weight: 900; letter-spacing: .12em; }
.mode-chavruta-daf-yomi strong { font-size: 25px; }

@media (max-width: 850px) and (min-width: 591px) {
  .hero { min-height: 286px; padding-block: 38px; }
  .hero h1 { font-size: clamp(40px, 6.5vw, 56px); }
  .hero-books,.learn-hero-mark,.quiz-hero-mark,.chavruta-hero-mark { height: 190px; transform: scale(.9); }
}

@media (max-width: 780px) {
  .build-workspace-banner,
  .learn-workspace-banner,
  .build-banner-controls,
  .learn-workspace-banner > div:last-child {
    align-items: stretch;
    flex-direction: column;
  }
  .build-deck-picker { min-width: 0; }
  .learn-selection-toolbar { gap: 4px; padding: 6px; }
  .learn-selection-toolbar > button { width: 35px; height: 35px; flex-basis: 35px; }
}

@media (max-width: 590px) {
  .hero { min-height: 250px; padding-block: 38px; }
  .review-view-picker { grid-template-columns: 1fr; }
  .review-view-button { min-height: 130px; }
}

/* 2.3.73 — print-only output, full-page deck building, and inline learning. */
.review-view-choice {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.review-view-choice > :is(.eyebrow, h3) {
  margin: 0;
  text-align: center;
}

.review-view-choice > h3 {
  color: var(--ink);
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(30px, 3.4vw, 48px);
}

.review-view-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.review-view-button {
  min-height: 132px;
  padding: 24px 28px;
  border-width: 2px;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(42, 55, 48, .08);
}

.review-view-button strong { font-size: clamp(25px, 2.35vw, 36px); }
.review-view-button small { margin-top: 6px; font-size: 15px; }
.review-view-button .review-view-icon { width: 64px; height: 64px; font-size: 30px; }

.review-view-choice.is-awaiting-choice {
  margin-block: clamp(30px, 5vw, 72px);
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 253, 248, .98), rgba(242, 238, 228, .96));
  box-shadow: 0 22px 60px rgba(43, 52, 46, .12);
}

.build-workspace-banner,
.learn-workspace-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 22px 0 18px;
  padding: 18px 22px;
  border: 1px solid rgba(65, 94, 118, .28);
  border-radius: 22px;
  background: linear-gradient(135deg, #edf3f8, #f8f4e9);
  box-shadow: 0 14px 34px rgba(44, 62, 72, .08);
}

.build-drag-coach {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 18px;
}

.build-drag-coach > span:last-child,
.learn-workspace-banner > div:first-child {
  display: grid;
  gap: 3px;
}

.build-drag-coach strong,
.learn-workspace-banner strong { color: var(--ink); font-size: 18px; }
.build-drag-coach small,
.learn-workspace-banner span { color: var(--ink-soft); font-size: 14px; }
.build-drag-coach .drag-word-demo { flex: 0 0 222px; }

.build-banner-controls,
.learn-workspace-banner > div:last-child {
  display: flex;
  align-items: end;
  gap: 10px;
}

.build-deck-picker {
  display: grid;
  min-width: min(280px, 32vw);
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.build-deck-picker select { min-height: 48px; }

.learn-workspace-banner {
  border-color: rgba(53, 105, 122, .28);
  background: linear-gradient(135deg, #e9f4f6, #f4eef8);
}

.learn-workspace-banner .secondary-button,
.build-workspace-banner .secondary-button { min-height: 48px; white-space: nowrap; }

.deck-mode-active.deck-workspace-open .source-panel,
.deck-mode-active #deckInspector,
.deck-mode-active #personalDeckPanel,
.deck-mode-active #reviewDock,
.deck-mode-active .daf-drag-combine-hint,
.deck-mode-active #dafMefarshimToggle,
.deck-mode-active #dafFocusModeButton {
  display: none !important;
}

.deck-mode-active .workspace,
.deck-mode-active .main-column,
.deck-mode-active .review-panel { width: 100%; max-width: none; }

.deck-mode-active .workspace { display: block; }
.deck-mode-active .review-panel { padding: clamp(20px, 2.8vw, 42px); }
.deck-mode-active .daf-page-workspace { grid-template-columns: minmax(0, 1fr); }
.deck-mode-active .daf-page-surface { min-width: 0; }
.deck-mode-active .daf-page-viewport { min-height: min(75vh, 1040px); }
.deck-mode-active .preview-list { max-width: none; }
.deck-mode-active .source-text { font-size: clamp(26px, 2.35vw, 36px); line-height: 2.05; }
.deck-mode-active .rashi-text,
.deck-mode-active #tosafotText { font-size: clamp(24px, 2.05vw, 32px); line-height: 1.95; }

.deck-word-action,
.deck-card-popover {
  position: fixed;
  z-index: 1200;
}

.deck-word-action {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  gap: 9px;
  padding: 8px 15px 8px 9px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 999px;
  background: #174d47;
  box-shadow: 0 14px 35px rgba(16, 48, 43, .28);
  cursor: pointer;
  transform-origin: center bottom;
  animation: deck-action-pop .18s ease-out both;
}

.deck-word-action > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #174d47;
  border-radius: 50%;
  background: #f4cf58;
  font-size: 24px;
  line-height: 1;
}

@keyframes deck-action-pop {
  from { opacity: 0; transform: translateY(8px) scale(.84); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.deck-card-popover {
  display: grid;
  width: min(410px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  gap: 14px;
  padding: 20px;
  overflow: auto;
  color: #24322f;
  border: 2px solid #c89c3e;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff2b7, #f8df86);
  box-shadow: 0 24px 70px rgba(54, 43, 21, .32);
  animation: deck-action-pop .2s ease-out both;
}

.deck-card-popover > header,
.deck-card-popover > footer,
.deck-card-popover-switches {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck-card-popover > header { justify-content: space-between; }
.deck-card-popover > footer { justify-content: flex-end; }
.deck-card-popover .source-tag { background: rgba(255, 255, 255, .58); }
.deck-card-popover-close {
  width: 38px;
  height: 38px;
  color: #5a482a;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .58);
  cursor: pointer;
  font-size: 25px;
}

.deck-card-popover-word {
  color: #172c29;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(45px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.deck-card-popover .field > span { color: #51462f; font-size: 15px; }
.deck-card-popover input {
  min-height: 58px;
  color: #172c29;
  border-color: rgba(93, 73, 35, .28);
  background: rgba(255, 255, 255, .86);
  font-size: 18px;
}

.deck-card-suggested { margin: -4px 0 0; color: #6b5730; font-size: 14px; }
.deck-card-suggested strong { color: #174d47; }

.build-deck-inspector-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.build-deck-inspector-dialog .dialog-card {
  max-height: calc(100dvh - 24px);
  padding: clamp(24px, 4vw, 42px);
  overflow: auto;
}

.build-deck-inspector-empty { color: var(--ink-soft); }

.learn-selection-editor[open] {
  position: fixed;
  inset: auto;
  z-index: 1180;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100dvh - 96px);
  margin: 0;
  padding: clamp(16px, 2vw, 22px);
  overflow: auto;
  border: 1px solid rgba(53, 105, 122, .42);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 24px 70px rgba(28, 45, 42, .3);
  animation: deck-action-pop .18s ease-out both;
}

.learn-selection-editor::backdrop { background: transparent; }
.learn-selection-editor .learn-selected-text { margin: 8px 0 10px; }
.learn-selection-editor .learn-paragraph-toggle { margin-bottom: 10px; padding: 10px 12px; }
.learn-selection-editor .learn-color-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.learn-selection-editor .learn-color-option { min-height: 52px; padding: 8px 9px; }
.learn-selection-editor .learn-no-highlight-option { margin: 9px 0 0; }
.learn-selection-editor .learn-selection-meaning {
  margin: 10px 0 0;
  padding: 0;
  overflow: hidden;
}
.learn-selection-editor .learn-selection-meaning-heading {
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.learn-selection-editor .learn-selection-meaning-heading::-webkit-details-marker { display: none; }
.learn-selection-editor .learn-selection-meaning-heading::after {
  content: "+";
  margin-inline-start: auto;
  font-size: 20px;
  line-height: 1;
}
.learn-selection-editor .learn-selection-meaning[open] .learn-selection-meaning-heading::after { content: "−"; }
.learn-selection-editor .learn-selection-word-meanings,
.learn-selection-editor .learn-selection-deck-choice { margin-inline: 12px; }
.learn-selection-editor .learn-selection-deck-choice { margin-bottom: 12px; }
.learn-selection-editor .learn-note-field textarea { min-height: 150px; }

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword:not(.is-learn-highlight),
.deck-mode-active .source-token.is-commentary-catchword:not(.is-learn-highlight) {
  color: inherit;
  background: transparent;
  box-shadow: none;
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword,
.deck-mode-active .source-token.is-commentary-catchword {
  padding-inline: .08em;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 1.28em;
  font-weight: 900;
}

.mode-daf-library .mode-library-masthead h2,
.learn-library .learn-library-masthead h2 {
  padding-top: .12em;
  line-height: 1.08;
}

/* Claude's Rolex-green room, refined so every work surface keeps readable ink. */
html[data-theme="dark"] {
  color-scheme: dark;
  --gd-bg: #06110d;
  --gd-bg-deep: #030b08;
  --gd-nav: rgba(10, 29, 22, .94);
  --gd-green: #0f291f;
  --gd-green-raised: #15362a;
  --gd-line: #2c4f42;
  --gd-gold: #c8a452;
  --gd-gold-bright: #d9b866;
  --gd-cream: #f2ead8;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 17% 8%, rgba(47, 125, 111, .16), transparent 27rem),
    radial-gradient(circle at 83% 96%, rgba(200, 164, 82, .06), transparent 30rem),
    linear-gradient(125deg, var(--gd-bg), #071713 72%, var(--gd-bg-deep));
}

html[data-theme="dark"] .library-wall { opacity: .14; }

html[data-theme="dark"] .topbar {
  color: var(--gd-cream);
  border-color: rgba(200, 164, 82, .28);
  background: var(--gd-nav);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .topbar :is(.brand, .brand strong, .brand small, .account-button, .help-button) {
  color: var(--gd-cream);
}

html[data-theme="dark"] .brand-motion {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .brand-wordmark strong {
  color: #084d39;
}

html[data-theme="dark"] .brand-wordmark small {
  color: #a97418;
}

html[data-theme="dark"] .topbar :is(.account-button, .help-button, .theme-picker) {
  border-color: var(--gd-line);
}

html[data-theme="dark"] .topbar .personal-library-shortcuts,
html[data-theme="dark"] .topbar :is(.account-button, #helpButton, .theme-picker) {
  border-color: rgba(200, 164, 82, .3);
  background: var(--gd-green-raised);
}

html[data-theme="dark"] .topbar .personal-library-shortcuts button,
html[data-theme="dark"] .topbar .account-button,
html[data-theme="dark"] .topbar #helpButton,
html[data-theme="dark"] .topbar .theme-picker button {
  color: var(--gd-cream);
}

html[data-theme="dark"] .topbar .theme-picker button[aria-pressed="true"] {
  color: #12251f;
  background: var(--gd-gold-bright);
}

html[data-theme="dark"] .topbar .local-badge {
  color: #19302c;
  border-color: rgba(200, 164, 82, .36);
  background: #eee5d3;
}

html[data-theme="dark"] .mode-switcher {
  border-color: rgba(200, 164, 82, .22);
  background: rgba(8, 25, 19, .92);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .38);
}

html[data-theme="dark"] .mode-button:not(.active) {
  color: #19302c;
  border-color: rgba(200, 164, 82, .24);
  background: #eee5d3;
}

html[data-theme="dark"] .mode-button:not(.active):hover {
  border-color: var(--gd-gold);
  background: #f7efdf;
}

html[data-theme="dark"] .hero {
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48), inset 0 0 0 1px rgba(200, 164, 82, .2);
  filter: saturate(.92) brightness(.84);
}

html[data-theme="dark"] :is(.mode-daf-library, .learn-library, .panel, .deck-panel, .quiz-panel) {
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
}

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

html[data-theme="dark"] :is(.daf-viewer, .preview-list, .quiz-card-scene, .quiz-progress-tracker,
  .progress-totals > div, .progress-day-button, .progress-word-group, .learn-saved-page,
  .learn-vocabulary, .mode-deck-card, .sheet-visual, .sheet-stats > div,
  .learn-selection-editor, .deck-card-popover) {
  color-scheme: light;
}

html[data-theme="dark"] :is(.site-footer, .site-footer .text-button) { color: #d8e0dc; }

@media (max-width: 980px) {
  .build-workspace-banner,
  .learn-workspace-banner { align-items: stretch; flex-direction: column; }
  .build-banner-controls { align-items: stretch; flex-wrap: wrap; }
  .build-deck-picker { min-width: min(100%, 360px); flex: 1 1 260px; }
}

@media (max-width: 700px) {
  .review-view-picker { grid-template-columns: 1fr; }
  .review-view-button { min-height: 108px; padding: 18px; }
  .review-view-button small { display: none; }
  .build-drag-coach { align-items: flex-start; flex-direction: column; }
  .learn-workspace-banner > div:last-child,
  .build-banner-controls { display: grid; grid-template-columns: 1fr; }
  .learn-selection-editor .learn-color-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Compact mode banners and the shared three-word gesture. */
.hero {
  min-height: 218px;
  padding: 29px clamp(24px, 4vw, 54px);
}

.hero h1 {
  font-size: clamp(38px, 4.8vw, 58px);
}

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

.hero-books,
.learn-hero-mark,
.quiz-hero-mark,
.chavruta-hero-mark {
  height: 150px;
  margin-left: 28px;
  transform: scale(.83);
  transform-origin: center right;
}

.drag-word-demo {
  position: relative;
  display: inline-flex;
  min-width: 126px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-bottom: 10px;
  direction: rtl;
}

.drag-word-demo i {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 37px;
  height: 31px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid #cdbf9e;
  border-radius: 7px;
  background: var(--card);
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 15px;
  font-style: normal;
  animation: drag-word-highlight 2.8s ease-in-out infinite;
}

.drag-word-demo i:nth-child(2) { animation-delay: .18s; }
.drag-word-demo i:nth-child(3) { animation-delay: .36s; }

.drag-word-demo b {
  position: absolute;
  right: 7px;
  bottom: 0;
  z-index: 2;
  width: 17px;
  height: 17px;
  border: 2px solid var(--teal);
  border-radius: 50% 50% 50% 4px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(23, 77, 71, .24);
  animation: drag-word-pointer 2.8s ease-in-out infinite;
}

@keyframes drag-word-highlight {
  0%, 18% { background: var(--card); box-shadow: none; }
  38%, 76% { background: #e8cd52; box-shadow: 0 0 0 2px rgba(181, 122, 49, .18); }
  100% { background: var(--card); box-shadow: none; }
}

@keyframes drag-word-pointer {
  0%, 14% { transform: translateX(0) rotate(-12deg); opacity: .35; }
  68%, 78% { transform: translateX(-105px) rotate(-12deg); opacity: 1; }
  100% { transform: translateX(-105px) rotate(-12deg); opacity: 0; }
}

.drag-combine-hint .drag-word-demo {
  flex: 0 0 auto;
  transform: scale(.78);
  transform-origin: center;
  margin-inline: -12px -8px;
}

.learn-study-hint .drag-word-demo {
  flex: 0 0 126px;
  transform: scale(.78);
  transform-origin: center;
  margin-inline: -12px -7px;
}

/* Deck-first launchers. */
.mode-my-decks,
.mode-premade-decks,
.mode-chavruta-shelf {
  position: relative;
  z-index: 1;
  margin: 18px 0 24px;
  padding: 20px;
  border: 1px solid rgba(203, 187, 162, .72);
  border-radius: 22px;
  background: rgba(255, 255, 255, .58);
}

.mode-my-decks > header,
.mode-premade-decks > header,
.mode-chavruta-shelf > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.mode-premade-decks h3,
.mode-chavruta-shelf h3 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 3.6vw, 44px);
  line-height: 1;
}

.mode-deck-card.is-locked::after {
  position: absolute;
  top: 12px;
  right: 12px;
  content: "LOCKED";
  padding: 4px 7px;
  color: #6b5635;
  border-radius: 999px;
  background: #f2dfb8;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

.mode-chavruta-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mode-chavruta-card {
  display: grid;
  min-height: 132px;
  place-items: center;
  gap: 5px;
  padding: 15px;
  border: 1px solid #d7c9d4;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #f5edf3);
  cursor: pointer;
}

.mode-chavruta-card > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: #68445f;
  font-size: 20px;
  font-weight: 900;
}

.mode-chavruta-card[aria-pressed="true"] {
  border-color: #68445f;
  box-shadow: 0 0 0 4px rgba(104, 68, 95, .16);
}

.mode-chavruta-card small,
.mode-chavruta-empty,
.mode-instructor-actions small { color: var(--ink-soft); }

.mode-instructor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mode-instructor-actions > div {
  display: grid;
  margin-right: auto;
}

.mode-instructor-actions b {
  color: #68445f;
  font-size: 22px;
  letter-spacing: .08em;
}

.mode-daf-flow-heading {
  margin: 34px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.mode-daf-flow-heading h3 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
}

/* PDF grid selection keeps the proven duplex mirror while changing capacity. */
.sheet-visual {
  grid-template-columns: repeat(var(--pdf-columns, 3), 1fr);
  grid-template-rows: repeat(var(--pdf-rows, 4), minmax(22px, 1fr));
  min-height: 145px;
}

.pdf-grid-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 9px;
  margin: 0 0 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-deep);
}

.dialog-pdf-grid-picker {
  margin: 18px 0;
}

.pdf-grid-picker legend {
  padding: 0 5px;
  font-size: 11px;
  font-weight: 900;
}

.pdf-grid-picker label {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
}

.pdf-grid-picker select {
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.pdf-grid-picker small {
  grid-column: 1 / -1;
  color: var(--teal);
  text-align: center;
  font-weight: 800;
}

/* Learn editor clarity. */
.learn-source-toggle {
  margin-inline-start: auto;
  padding: 5px 9px;
  color: var(--teal);
  border: 1px solid rgba(23, 77, 71, .22);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
}

.learn-mode-active.learn-workspace-open .review-text-view #rashiText.use-regular-script,
.learn-mode-active.learn-workspace-open .review-text-view #tosafotText.use-regular-script {
  font-family: "Daf to Deck Frank", "Arial Hebrew", serif;
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword {
  font-size: 1.14em;
  font-weight: 900;
}

.learn-paragraph-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d6cbbb;
  border-radius: 12px;
  background: #fbf8f1;
}

.learn-paragraph-toggle > span { display: grid; gap: 2px; }
.learn-paragraph-toggle small { color: var(--ink-soft); }

.learn-note-field textarea { min-height: 145px; }

.learn-paragraph-break-marker {
  display: block;
  height: 18px;
  margin: 8px 0 12px;
  border-top: 2px solid rgba(181, 122, 49, .28);
}

.learn-note-passage {
  font-size: 21px;
  font-weight: 800;
  -webkit-line-clamp: 1;
}

.learn-legend summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.learn-legend summary small {
  color: var(--ink-soft);
  font-size: 10px;
}

/* Saved learning should read visually as a shelf of pages. */
.learn-saved-pages {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.learn-saved-page {
  min-height: 330px;
  align-content: space-between;
  padding: 24px 18px 17px 29px;
  overflow: hidden;
  border-radius: 8px 18px 18px 8px;
  background:
    linear-gradient(90deg, rgba(91, 74, 51, .11) 0 10px, transparent 10px),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(73, 111, 104, .08) 27px 28px),
    #fffef9;
  box-shadow: 0 14px 26px rgba(63, 50, 33, .12), inset 3px 0 rgba(181, 122, 49, .22);
}

.learn-saved-page::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 30px;
  content: "";
  background: linear-gradient(225deg, var(--paper) 49%, #dfd3bd 51%);
}

/* Account trial and theme controls. */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 14px;
  color: #563c17;
  border: 1px solid #d8b16c;
  border-radius: 14px;
  background: #fff1d3;
}

.trial-banner button {
  margin-left: auto;
  color: white;
  border: 0;
  border-radius: 999px;
  background: var(--teal);
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 800;
}

.account-try-button {
  width: 100%;
  min-height: 48px;
  margin: 4px 0 8px;
  color: var(--teal);
  border: 2px solid var(--teal);
  border-radius: 12px;
  background: var(--teal-pale);
  cursor: pointer;
  font-weight: 900;
}

.account-try-warning {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
}

.theme-picker {
  display: inline-flex;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.theme-picker button {
  min-height: 26px;
  padding: 0 8px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

.theme-picker button[aria-pressed="true"] {
  color: white;
  background: var(--teal);
}

html[data-theme="light"] { color-scheme: light; }

@media (max-width: 850px) {
  .hero { min-height: 196px; padding: 24px; }
  .hero-books,.learn-hero-mark,.quiz-hero-mark,.chavruta-hero-mark { height: 130px; transform: scale(.72); }
  .mode-chavruta-gallery,.learn-saved-pages { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mode-instructor-actions { align-items: stretch; flex-direction: column; }
  .mode-instructor-actions > div,
  .mode-instructor-disclosure { width: 100%; margin-right: 0; }
}

@media (max-width: 590px) {
  .hero { min-height: 0; }
  .hero-books,.learn-hero-mark,.quiz-hero-mark,.chavruta-hero-mark { display: none !important; }
  .theme-picker { order: 5; }
  .theme-picker button { padding-inline: 6px; }
  .trial-banner { align-items: flex-start; flex-direction: column; }
  .trial-banner button { margin-left: 0; }
  .mode-chavruta-gallery,.learn-saved-pages { grid-template-columns: 1fr; }
}

/* 2.3.73 — clearer launchers, annotation editing, and print setup. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 25vw, 330px);
  min-height: 250px;
  gap: clamp(18px, 3vw, 44px);
  padding: 34px clamp(28px, 4.5vw, 62px);
}

.hero-copy {
  min-width: 0;
  max-width: none;
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(37px, 4.25vw, 58px);
  line-height: 1.01;
  text-wrap: balance;
}

.hero-books,
.learn-hero-mark,
.quiz-hero-mark,
.chavruta-hero-mark {
  width: 100%;
  min-width: 0;
  height: 176px;
  margin-left: 0;
  transform: scale(.92);
  transform-origin: center;
}

@media (max-width: 850px) and (min-width: 591px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 180px;
    min-height: 226px;
    gap: 10px;
    padding: 28px 24px;
  }

  .hero h1 { font-size: clamp(34px, 6vw, 46px); }

  .hero-books,
  .learn-hero-mark,
  .quiz-hero-mark,
  .chavruta-hero-mark {
    position: relative;
    right: auto;
    bottom: auto;
    width: 230px;
    min-width: 230px;
    height: 150px;
    opacity: .9;
    transform: scale(.72);
    transform-origin: center;
  }
}

#generateDialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

#generateDialog .dialog-card {
  max-height: calc(100dvh - 24px);
  padding: clamp(24px, 4vw, 42px);
  overflow: auto;
}

#generateDialog .dialog-pdf-grid-picker {
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
  gap: 10px 12px;
  padding: 18px;
}

#generateDialog .dialog-pdf-grid-picker legend {
  padding-inline: 8px;
  font-size: 14px;
}

#generateDialog .dialog-pdf-grid-picker label {
  gap: 7px;
  font-size: 12px;
}

#generateDialog .dialog-pdf-grid-picker select {
  min-height: 48px;
  font-size: 15px;
}

.dialog-facts .dialog-fact {
  display: grid;
  min-height: 88px;
  align-content: center;
  gap: 5px;
  padding: 14px 8px;
  color: var(--ink-soft);
  border-radius: 12px;
  background: var(--paper-deep);
  font-size: 12px;
  overflow: visible;
}

.dialog-facts .dialog-fact > strong {
  display: block;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
}

.dialog-facts .dialog-fact > span {
  display: block;
  padding: 0;
  color: inherit;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  line-height: 1.2;
}

.drag-word-demo {
  --drag-pointer-travel: -183px;
  min-width: 222px;
  gap: 7px;
  padding: 8px 0 22px;
}

.drag-word-demo i {
  min-width: 58px;
  height: 44px;
  padding-inline: 8px;
  border-radius: 10px;
  font-size: 20px;
}

.drag-word-demo .drag-mouse {
  position: absolute;
  right: 7px;
  bottom: -2px;
  z-index: 3;
  width: 26px;
  height: 34px;
  overflow: visible;
  filter: drop-shadow(0 3px 4px rgba(23, 77, 71, .25));
  animation: drag-word-pointer 2.8s ease-in-out infinite;
}

.drag-word-demo .drag-mouse rect {
  fill: #fffdf5;
  stroke: var(--teal);
  stroke-width: 2.5;
}

.drag-word-demo .drag-mouse path,
.drag-word-demo .drag-mouse circle {
  fill: var(--teal);
  stroke: var(--teal);
  stroke-width: 1.5;
}

@keyframes drag-word-pointer {
  0%, 14% { transform: translateX(0); opacity: .42; }
  68%, 78% { transform: translateX(var(--drag-pointer-travel)); opacity: 1; }
  100% { transform: translateX(var(--drag-pointer-travel)); opacity: 0; }
}

.drag-combine-hint .drag-word-demo,
.learn-study-hint .drag-word-demo {
  flex: 0 0 222px;
  margin-inline: 0;
  transform: none;
}

.learn-selection-editor {
  width: min(760px, calc(100vw - 24px));
}

.learn-note-field textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
}

.learn-paragraph-toggle {
  margin: 0 0 14px;
  padding: 14px 16px;
}

.learn-paragraph-break-marker {
  display: block;
  height: auto;
  min-height: 16px;
  margin: 10px 0 14px;
  border-top: 2px solid rgba(181, 122, 49, .34);
  direction: ltr;
}

.learn-inline-passage-note {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 12px 14px;
  color: #24332f;
  border-inline-start: 4px solid #b78435;
  border-radius: 0 10px 10px 0;
  background: #f2eadb;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.learn-inline-note-catchword {
  color: #174d47;
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 19px;
  text-align: right;
}

.learn-inline-note-body { white-space: pre-wrap; }

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword:not(.is-learn-highlight) {
  padding-inline: .1em;
  background: transparent;
  box-shadow: none;
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 1.28em;
  font-weight: 900;
}

.learn-vocabulary-marker {
  top: 50%;
  right: auto;
  inset-inline-start: -.48em;
  inset-inline-end: auto;
  min-width: 12px;
  height: 12px;
  font-size: 7px;
  transform: translateY(-50%);
}

.review-text-view .source-token > .learn-vocabulary-marker {
  position: relative;
  top: auto;
  inset: auto;
  display: inline-flex;
  min-width: 12px;
  height: 12px;
  margin-inline-end: 3px;
  vertical-align: middle;
  transform: none;
}

.mode-deck-card-wrap {
  position: relative;
  display: grid;
  min-width: 0;
}

.mode-deck-card-wrap > .mode-deck-card {
  width: 100%;
  height: 100%;
}

.mode-deck-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #a62828;
  border: 1px solid rgba(166, 40, 40, .34);
  border-radius: 50%;
  background: #fff3ef;
  box-shadow: 0 4px 12px rgba(116, 36, 28, .14);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.mode-selected-deck {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(49, 92, 87, .26);
  border-radius: 18px;
  background: rgba(244, 248, 244, .88);
}

.mode-selected-deck > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.mode-selected-deck h4 { margin: 2px 0 0; font-size: 24px; }
.mode-selected-deck-actions { display: flex; gap: 9px; }
.mode-selected-deck-empty { margin: 0; color: var(--ink-soft); }
.mode-selected-deck-cards { display: grid; gap: 10px; }

.mode-deck-card-editor {
  display: grid;
  grid-template-columns: minmax(150px, .72fr) minmax(220px, 1.28fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}

.mode-deck-card-editor label { display: grid; gap: 5px; }
.mode-deck-card-editor label > span { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.mode-deck-card-editor input { min-height: 44px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.mode-deck-card-editor input[name="word"] { font-family: "Daf to Deck Frank", Georgia, serif; font-size: 21px; }
.mode-deck-card-editor-actions { display: flex; gap: 7px; }

.mode-instructor-actions {
  align-items: flex-start;
}

.mode-instructor-disclosure {
  flex: 1 1 auto;
  margin-right: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}

.mode-instructor-disclosure > summary {
  padding: 12px 14px;
  color: #68445f;
  cursor: pointer;
  font-weight: 900;
}

.source-token-static {
  cursor: default;
}

.source-token-static:hover {
  color: inherit;
  background: transparent;
}

.mode-instructor-private {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 14px;
}

.mode-instructor-private > div { display: grid; margin-right: auto; }

@media (max-width: 700px) {
  .mode-deck-card-editor { grid-template-columns: 1fr; }
  .mode-selected-deck > header { align-items: stretch; flex-direction: column; }
  .mode-selected-deck-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .mode-instructor-private { align-items: stretch; flex-direction: column; }
  .learn-selection-editor[open] {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 84px);
    padding: 14px;
  }
  .learn-selection-editor .learn-color-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 590px) {
  .hero { display: block; padding: 25px 22px; }
  .hero h1 { max-width: none; font-size: clamp(34px, 11vw, 45px); }
  .drag-word-demo { --drag-pointer-travel: -153px; min-width: 192px; }
  .drag-combine-hint .drag-word-demo,
  .learn-study-hint .drag-word-demo {
    flex-basis: 192px;
    transform: scale(.86);
    transform-origin: center;
  }
  .dialog-facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .drag-word-demo i {
    background: #e8cd52 !important;
    box-shadow: 0 0 0 2px rgba(181, 122, 49, .18) !important;
  }

  .drag-word-demo .drag-mouse {
    opacity: 1 !important;
    transform: translateX(-82px) !important;
  }
}

/* Final 2.3.73 cascade guard: these intentional workspace dimensions win. */
.hero {
  min-height: 330px;
  padding: clamp(46px, 5.5vw, 72px) clamp(32px, 5vw, 72px);
}

.hero h1 { font-size: clamp(46px, 5.3vw, 76px); }

.hero-books,
.learn-hero-mark,
.quiz-hero-mark,
.chavruta-hero-mark {
  height: 226px;
  transform: scale(1.06);
}

.build-workspace-banner,
.learn-workspace-banner {
  min-height: 118px;
  margin: 0;
  padding: 24px 28px;
}

.review-view-button,
.learn-mode-active.learn-workspace-open .review-view-button {
  min-height: 170px;
  padding: clamp(24px, 3vw, 38px);
}

.review-view-button strong,
.learn-mode-active.learn-workspace-open .review-view-button strong {
  font-size: clamp(30px, 3vw, 44px);
}

.deck-mode-active .source-text,
.deck-mode-active #gemaraText {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: clamp(20px, 1.72vw, 27px);
  line-height: 1.78;
}

.deck-mode-active #rashiText,
.deck-mode-active #tosafotText {
  font-family: "Daf to Deck Rashi", "Times New Roman", serif;
  font-size: clamp(18px, 1.52vw, 24px);
  line-height: 1.75;
}

.deck-mode-active #rashiText.use-regular-script,
.deck-mode-active #tosafotText.use-regular-script {
  font-family: "Daf to Deck Frank", Georgia, serif;
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword:not(.is-learn-highlight),
.deck-mode-active .source-token.is-commentary-catchword:not(.is-learn-highlight) {
  padding: .04em .2em;
  border-radius: .22em;
  background: #e2e4e2;
  box-shadow: inset 0 -2px 0 rgba(48, 65, 61, .14);
}

.learn-mode-active.learn-workspace-open .source-token.is-commentary-catchword,
.deck-mode-active .source-token.is-commentary-catchword {
  font-family: "Daf to Deck Frank", Georgia, serif;
  font-size: 1.42em;
  font-weight: 950;
}

/* Final QA: keep each workspace banner roomy, singular, and easy to scan. */
.mode-library-font,
.deck-mode-active.deck-workspace-open .text-drag-combine-hint,
.learn-mode-active.learn-workspace-open #dafMefarshimToggle {
  display: none !important;
}

.build-workspace-banner {
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(500px, 1.1fr);
  min-height: 156px;
  gap: 30px;
  padding: 28px 30px;
  align-items: center;
}

.build-drag-coach {
  display: grid;
  grid-template-columns: 222px minmax(150px, 1fr);
  gap: 20px;
  align-items: center;
}

.build-banner-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

.deck-mode-active.deck-workspace-open .daf-viewer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  gap: 12px;
  align-items: center;
}

.deck-mode-active.deck-workspace-open .daf-view-options {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  flex: none;
}

.deck-mode-active.deck-workspace-open .daf-zoom-controls {
  grid-column: 2;
  justify-self: end;
}

@media (max-width: 850px) and (min-width: 591px) {
  .hero { min-height: 286px; padding: 38px 28px; }
  .hero h1 { font-size: clamp(40px, 6.5vw, 56px); }
  .hero-books,.learn-hero-mark,.quiz-hero-mark,.chavruta-hero-mark { height: 190px; transform: scale(.9); }
}

@media (max-width: 1100px) {
  .build-workspace-banner {
    grid-template-columns: 1fr;
    min-height: 230px;
  }
}

@media (max-width: 590px) {
  .hero { min-height: 250px; padding: 38px 22px; }
  .review-view-button,
  .learn-mode-active.learn-workspace-open .review-view-button { min-height: 130px; }

  .build-workspace-banner {
    min-height: 0;
    gap: 22px;
    padding: 22px;
  }

  .build-drag-coach,
  .build-banner-controls {
    grid-template-columns: 1fr;
  }
}

/* Final 2.3.78 cascade guard. */
.learn-workspace-banner {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(250px, .8fr) auto;
  min-height: 168px;
  gap: 24px;
  padding: 26px 30px;
  align-items: center;
}
.review-stage[data-review-view="text"] .learn-workspace-banner {
  grid-template-columns: minmax(300px, 1fr) minmax(230px, .8fr) minmax(255px, .8fr) auto;
}
.learn-banner-actions { display: grid !important; align-items: stretch !important; }
.learn-workspace-banner .learn-banner-actions .secondary-button {
  min-height: 54px;
  white-space: normal;
}
.learn-selection-editor { z-index: 1260; }
.learn-selection-editor[data-tool-mode="note"] .learn-selected-text { display: none !important; }
.learn-selection-meaning-row {
  grid-template-columns: minmax(86px, .62fr) minmax(180px, 1.45fr) auto;
}
.learn-mode-active.learn-workspace-open .review-text-view .source-text {
  font-size: var(--learn-hebrew-size, clamp(18px, 1.65vw, 24px));
}
.learn-mode-active.learn-workspace-open .review-text-view #rashiText,
.learn-mode-active.learn-workspace-open .review-text-view #tosafotText {
  font-size: var(--learn-commentary-size, clamp(16px, 1.35vw, 19px));
}
.learn-inline-passage-note {
  font-family: Garamond, Georgia, "Times New Roman", serif;
  font-size: var(--learn-note-size, 21px);
  line-height: 1.58;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 25vw, 340px);
  min-height: 330px;
  gap: clamp(22px, 3.5vw, 52px);
  padding: clamp(42px, 5vw, 66px) clamp(30px, 4.5vw, 66px);
  overflow: hidden;
}
.hero-copy { min-width: 0; max-width: none; }
.hero h1 {
  max-width: 13ch;
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1.06;
  text-wrap: balance;
}
.hero-pills { flex-wrap: wrap; margin-top: clamp(18px, 2vw, 26px); }
.hero-books,.learn-hero-mark,.quiz-hero-mark,.chavruta-hero-mark {
  width: 100%; min-width: 0; height: 210px; margin-left: 0; transform: none;
}
@media (max-width: 1320px) {
  .review-stage[data-review-view="text"] .learn-workspace-banner {
    grid-template-columns: minmax(280px, 1fr) minmax(220px, .75fr) minmax(245px, .8fr);
  }
  .review-stage[data-review-view="text"] .learn-banner-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  .learn-workspace-banner,
  .review-stage[data-review-view="text"] .learn-workspace-banner { grid-template-columns: 1fr 1fr; }
  .learn-banner-actions { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) 230px; }
  .hero h1 { font-size: clamp(38px, 5.4vw, 54px); }
}
@media (max-width: 700px) {
  .learn-workspace-banner,
  .review-stage[data-review-view="text"] .learn-workspace-banner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 20px;
  }
  .learn-banner-actions,
  .review-stage[data-review-view="text"] .learn-banner-actions { grid-column: auto; grid-template-columns: 1fr; }
  .learn-selection-meaning-row { grid-template-columns: 1fr; }
  .hero { display: block; min-height: 270px; padding: 38px 22px; }
  .hero h1 { max-width: 100%; font-size: clamp(35px, 10vw, 48px); }
  .hero-books,.learn-hero-mark,.quiz-hero-mark,.chavruta-hero-mark { display: none !important; }
}

@media (max-width: 590px) {
  .daf-view-options > .learn-workspace-banner {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
}

.mode-chavruta-pages {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.mode-chavruta-pages > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.mode-chavruta-pages > header h3 { margin: 2px 0 0; }

.mode-chavruta-pages-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.chavruta-pages-more {
  display: flex;
  justify-self: center;
  min-width: min(100%, 240px);
  margin: 14px auto 0;
}

.mode-chavruta-send-tools {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: color-mix(in srgb, var(--teal-pale) 66%, var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
}

.mode-chavruta-send-tools label { display: grid; gap: 5px; }
.mode-chavruta-send-tools label > span { font-size: .8rem; font-weight: 850; color: var(--ink-soft); }
.mode-chavruta-send-tools select { min-width: 0; min-height: 44px; }
.mode-chavruta-send-tools .secondary-button { min-height: 44px; white-space: nowrap; }

.mode-chavruta-page-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon title" "icon meta";
  gap: 3px 12px;
  align-items: center;
  min-height: 86px;
  padding: 16px 18px;
  color: var(--ink);
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(37, 43, 37, 0.09);
  transition: transform 150ms ease, border-color 150ms ease;
}

.mode-chavruta-page-card > span {
  grid-area: icon;
  display: grid;
  width: 44px;
  height: 54px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-pale);
  border: 1px solid color-mix(in srgb, var(--teal) 32%, transparent);
  border-radius: 8px 14px 14px 8px;
}

.mode-chavruta-page-card strong { grid-area: title; font-size: 1.04rem; }
.mode-chavruta-page-card small { grid-area: meta; color: var(--ink-soft); }
.mode-chavruta-page-card:hover { transform: translateY(-2px); border-color: var(--teal); }

@media (max-width: 850px) {
  .mode-chavruta-send-tools { grid-template-columns: 1fr auto; }
}
