@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;700;800&display=swap");

*,
html ::after,
::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --font-size: 18px;
  --gemara-scale: 1.2;
  --rashi-scale: 1;
  --rashi-heading-scale: 1.06;
  --card-bg: rgba(240, 245, 250, 0.96);
  --card-bg-soft: rgba(231, 238, 246, 0.96);
  --card-border: rgba(116, 148, 215, 0.12);
  --text: #20324b;
  --muted: #4d6588;
  --accent: #ffd166;
  --accent-2: #7c3aed;
  --accent-3: #06b6d4;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Rubik", Arial, sans-serif;
  direction: rtl;
  color: #d1d6df;
  line-height: 1.85;
  font-size: var(--font-size);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.35), transparent 26%),
    radial-gradient(circle at 14% 20%, rgba(124, 58, 237, 0.18), transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(59, 130, 246, 0.16), transparent 28%),
    linear-gradient(135deg, #3d3333 0%, #607499 34%, #7f7991 66%, #8d8665 100%);
}

body.night-mode {
  font-family: "Rubik", Arial, sans-serif;
  direction: rtl;
  color: var(--text);
  line-height: 1.85;
  font-size: var(--font-size);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 15%, rgba(112, 58, 219, 0.18), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(14, 165, 233, 0.15), transparent 34%),
    radial-gradient(circle at 76% 70%, rgba(45, 212, 191, 0.12), transparent 34%),
    linear-gradient(135deg, #d4ddec 0%, #61666e 38%, #656d77 100%);
}

main,
footer {
  position: relative;
  z-index: 1;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.section-note {
  color: var(--muted);
  font-size: 0.98rem;
}

.feature-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
}

.selection-controls,
.global-search-controls,
.view-tabs,
.nav-controls {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.selection-top-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  margin-bottom: 0.45rem;
}

.selection-top-actions > * {
  flex: 1 1 0;
  min-width: 0;
}

.selection-top-actions button {
  min-height: 40px;
  height: 40px;
  padding: 0.35rem 0.55rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: 12px;
}

.selection-controls,
.global-search-controls {
  align-items: stretch;
}

.modal-selection-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.modal-selection-controls > * {
  flex: 0 0 auto;
  min-width: 0;
}

.modal-selection-controls select {
  flex: 0 0 calc(4.8rem + 10px);
  width: calc(4.8rem + 10px);
  min-width: calc(4.8rem + 10px);
  max-width: calc(4.8rem + 10px);
  min-height: 44px;
  height: 44px;
  max-height: 44px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  text-align: center;
  text-align-last: center;
}

.modal-selection-controls button {
  flex: 0 0 calc(4.8rem + 10px);
  width: calc(4.8rem + 10px);
  min-width: calc(4.8rem + 10px);
  max-width: calc(4.8rem + 10px);
  min-height: 44px;
  height: 44px;
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  line-height: 1;
  border-radius: 12px;
  text-align: center;
}

.global-search-controls > * {
  flex: 1 1 220px;
}

.modal-global-search-controls {
  margin-bottom: 0.9rem;
  align-items: stretch;
}

.modal-global-search-controls input[type="text"] {
  flex: 1 1 320px;
}

.modal-global-search-controls button {
  flex: 0 0 140px;
}

.feature-controls > * {
  flex: 0 0 auto;
}

.selection-summary {
  width: 100%;
  text-align: center;
  color: #132238;
  font-weight: 700;
}

#page-title,
.search-result-title,
.search-tractate-title,
.rashi-inline-toggle {
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  color: #f8fbff;
  font-family: inherit;
  font-weight: 600;
  background: linear-gradient(135deg, #4d63c9, #2a4c9b 58%, #213b78);
  box-shadow: 0 8px 16px rgba(34, 53, 97, 0.22);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    filter 0.3s ease;
}

button:hover {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.04);
  box-shadow: 0 10px 18px rgba(34, 53, 97, 0.28);
}

main {
  width: min(1240px, calc(100% - 24px));
  margin: 10px auto 0;
  padding: 0 0 5rem;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 1.2rem;
  align-items: start;
}

.main-column,
.side-column {
  display: grid;
  gap: 1.2rem;
}

.control-panel {
  position: sticky;
  top: 12px;
  z-index: 10;
}

.utility-panel {
  padding: 1.25rem;
}

section {
  margin-bottom: 0.8rem;
  padding: 0.85rem;
  border-radius: 20px;
  /* background: linear-gradient(180deg, x(237, 242, 248, 0.97), rgba(224, 232, 241, 0.95)); */
  border: 1px solid rgba(96, 116, 153, 0.16);
  box-shadow: 0 8px 16px rgba(34, 45, 68, 0.1);
  backdrop-filter: blur(124px);
}

.selection-area,
.features-area,
.learning-area,
.search-modal-panel,
.rashi-panel,
.search-result-card,
.search-tractate-group,
.sugya-block {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #11325a;
}

.selection-area {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(236, 242, 255, 0.94) 46%,
    rgba(244, 234, 255, 0.92) 74%,
    rgba(255, 246, 198, 0.9)
  );
}

.features-area {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.learning-area {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.96),
    rgba(242, 236, 255, 0.94) 42%,
    rgba(229, 241, 255, 0.94) 74%,
    rgba(255, 247, 205, 0.9)
  );
}

.selection-area h2,
.global-search-area h2,
.learning-area h2,
.features-area h2 {
  margin-bottom: 1rem;
  color: #062042;
  font-size: 1.8rem;
}

.global-search-results {
  display: grid;
  gap: 0.85rem;
}

.search-summary-chips {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.search-summary-chip {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(213, 223, 236, 0.95);
  color: #324867;
  border: 1px solid rgba(96, 116, 153, 0.12);
  font-size: 0.92rem;
}

.search-result-card {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background-image:
    linear-gradient(180deg, rgba(239, 244, 249, 0.84), rgba(225, 233, 242, 0.84)),
    url("https://images.unsplash.com/photo-1512820790803-83ca734da794?auto=format&fit=crop&w=1200&q=80");
  border: 1px solid rgba(99, 126, 192, 0.14);
  box-shadow: 0 10px 20px rgba(34, 45, 68, 0.1);
}

.search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.search-result-title {
  font-weight: 700;
  color: #102033;
}

.search-result-snippet {
  color: #314765;
  line-height: 1.9;
}

.search-result-snippet mark {
  background: linear-gradient(135deg, #ffd166, #ff8fab);
  color: #08111d;
  padding: 0 3px;
  border-radius: 5px;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.search-modal.hidden {
  display: none;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: none;
}

.search-modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  overflow: hidden;
  border-radius: 28px;
  background-image:
    linear-gradient(180deg, rgba(244, 247, 251, 0.78), rgba(230, 237, 245, 0.8)),
    url("https://images.unsplash.com/photo-1504052434569-70ad5836ab65?auto=format&fit=crop&w=1400&q=80");
  border: 1px solid rgba(96, 116, 153, 0.14);
  box-shadow: 0 22px 60px rgba(34, 45, 68, 0.16);
}

.search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border-bottom: 1px solid rgba(96, 116, 153, 0.12);
}

.search-modal-meta {
  margin-top: 0.35rem;
  color: #4d6588;
}

.search-modal-body {
  max-height: calc(86vh - 92px);
  overflow-y: auto;
  padding: 1.15rem;
  display: grid;
  gap: 1rem;
}

.search-tractate-group {
  padding: 1rem;
  border-radius: 22px;
  background-image:
    linear-gradient(180deg, rgba(239, 244, 249, 0.72), rgba(227, 234, 242, 0.74)),
    url("https://images.unsplash.com/photo-1521587760476-6c12a4b040da?auto=format&fit=crop&w=1200&q=80");
  border: 1px solid rgba(96, 116, 153, 0.12);
}

.search-tractate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.search-tractate-title {
  color: #102033;
}

.search-tractate-count {
  color: #4f678a;
  font-size: 0.95rem;
}

.search-tractate-results {
  display: grid;
  gap: 0.8rem;
}

.search-load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.search-load-more-btn {
  min-width: 220px;
}

select,
input[type="number"],
input[type="text"] {
  appearance: none;
  -webkit-appearance: none;
  min-width: 120px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(96, 116, 153, 0.2);
  color: #18263a;
  background: rgba(216, 225, 238, 0.96);
  font-family: inherit;
  font-size: 1rem;
}

.learning-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

#page-title {
  flex: 1 1 100%;
  width: 100%;
  text-align: center;
}

.tab-btn {
}

.tab-btn.active {
  background: linear-gradient(135deg, #94344c, #6b62c5);
}

.content-container {
  display: flex;
  gap: 0.85rem;
}

.content {
  flex: 1;
  font-size: 1.12rem;
  color: #101820;
}

.content,
.content p,
.content span,
.content div,
.content article,
.content strong,
.content b {
  color: #101820;
}

.linked-learning {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sugya-block {
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(136, 127, 127, 0.97),
    rgba(239, 233, 255, 0.92) 56%,
    rgba(255, 246, 199, 0.88)
  );
  border: 1px solid rgba(60, 67, 78, 0.16);
  box-shadow: 0 8px 14px rgba(43, 56, 84, 0.1);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.sugya-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 22px rgba(34, 45, 68, 0.14);
}

.sugya-meta {
  color: #7a5a18;
  margin-bottom: 0.7rem;
  font-size: 1.08rem;
}

.gemara-text {
  font-size: calc(var(--font-size) * var(--gemara-scale));
  line-height: 2.26;
  color: #000000 !important;
}

.sugya-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
}

.sugya-row.has-rashi {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr);
}

.gemara-side {
  min-width: 0;
}

.rashi-dropdown {
  border-radius: 14px;
  border: 1px solid rgba(41, 48, 61, 0.493);
  background: linear-gradient(180deg, rgba(224, 232, 241, 0.9), rgba(237, 242, 248, 0.82));
  overflow: hidden;
}

.rashi-inline-toggle {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  font-weight: 700;
  color: #f8fbff;
  background: linear-gradient(135deg, #5067cf, #2a4f9f 58%, #223c7a);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(34, 53, 97, 0.2);
}

.rashi-inline-toggle::-webkit-details-marker {
  display: none;
}

.rashi-inline-toggle::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  margin-left: 0.45rem;
  font-size: 1rem;
}

.rashi-dropdown[open] .rashi-inline-toggle::before {
  content: "-";
}

.rashi-dropdown-content {
  padding: 0.7rem 0.8rem 0.25rem;
  border-top: 1px solid rgba(96, 116, 153, 0.12);
}

.rashi-under h3 {
  color: #245f8a;
  margin-bottom: 0.65rem;
  font-size: calc(var(--font-size) * var(--rashi-heading-scale));
}

.rashi-text {
  color: #16263a !important;
  line-height: 2.02;
  margin-bottom: 0.6rem;
  font-size: calc(var(--font-size) * var(--rashi-scale));
}

.rashi-panel {
  flex: 0 0 240px;
  padding: 0.8rem;
  border-radius: 16px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.96),
    rgba(230, 241, 255, 0.92) 48%,
    rgba(243, 233, 255, 0.91) 74%,
    rgba(255, 244, 194, 0.88)
  );
  border: 1px solid rgba(96, 116, 153, 0.14);
}

.hidden {
  display: none !important;
}

.loading,
.error,
.welcome {
  padding: 1.1rem;
  text-align: center;
  border-radius: 16px;
  font-size: 0.98rem;
}

.loading,
.welcome {
  color: #23344d;
}

.welcome {
  background: linear-gradient(135deg, rgba(211, 219, 234, 0.9), rgba(199, 214, 229, 0.88));
}

.welcome h3 {
  color: #38527a;
  margin-bottom: 0.6rem;
}

.error {
  background: linear-gradient(135deg, #f5c4cc, #e8b8c8);
  color: #5e2434;
}

.floating-page-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(247, 250, 253, 0.9);
  border: 1px solid rgba(96, 116, 153, 0.16);
  box-shadow: 0 8px 16px rgba(34, 45, 68, 0.12);
  backdrop-filter: none;
}

.floating-page-nav button {
  min-width: 110px;
  min-height: 42px;
  border-radius: 999px;
  box-shadow: none;
}

footer {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto 18px;
  padding: 1rem;
  text-align: center;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(238, 242, 248, 0.97), rgba(227, 234, 243, 0.95));
  border: 1px solid rgba(96, 116, 153, 0.18);
  color: #22324c;
}

a {
  color: #4f62a7;
  text-decoration: none;
}

body.night-mode .selection-area h2,
body.night-mode .global-search-area h2,
body.night-mode .learning-area h2,
body.night-mode .features-area h2 {
  color: #f5f8ff;
}

body.night-mode .selection-area,
body.night-mode .features-area,
body.night-mode .learning-area,
body.night-mode .search-modal-panel,
body.night-mode .rashi-panel,
body.night-mode .search-result-card,
body.night-mode .search-tractate-group,
body.night-mode .sugya-block,
body.night-mode .selection-summary,
body.night-mode #page-title,
body.night-mode .search-result-title,
body.night-mode .search-tractate-title,
body.night-mode .search-status,
body.night-mode .gemara-text,
body.night-mode .rashi-text,
body.night-mode .rashi-inline-toggle {
  color: #393b3e;
}

body.night-mode section {
  background: linear-gradient(180deg, rgba(214, 223, 236, 0.97), rgba(196, 208, 226, 0.95));
  border-color: var(--card-border);
  box-shadow: 0 12px 24px rgba(34, 45, 68, 0.12);
}

body.night-mode select,
body.night-mode input[type="number"],
body.night-mode input[type="text"] {
  border-color: rgba(146, 167, 213, 0.14);
  color: #22324c;
  background: rgba(236, 241, 247, 0.96);
}

body.night-mode .sugya-block {
  background: linear-gradient(180deg, rgba(220, 228, 239, 0.98), rgba(204, 215, 231, 0.97));
  border-color: rgba(99, 126, 192, 0.16);
  box-shadow: 0 10px 20px rgba(34, 45, 68, 0.12);
}

body.night-mode .sugya-meta {
  color: #ffd786;
}

body.night-mode .gemara-text {
  color: #20324b;
}

body.night-mode .rashi-under {
  border-top-color: rgba(118, 153, 224, 0.14);
  background: linear-gradient(180deg, rgba(226, 233, 242, 0.82), rgba(208, 219, 233, 0.48));
}

body.night-mode .rashi-dropdown {
  border-color: rgba(105, 133, 194, 0.16);
  background: linear-gradient(180deg, rgba(228, 235, 243, 0.95), rgba(213, 223, 236, 0.88));
}

body.night-mode .rashi-inline-toggle {
  color: #27466f;
  background: linear-gradient(135deg, rgba(128, 164, 219, 0.28), rgba(112, 136, 211, 0.18));
}

body.night-mode .rashi-under h3 {
  color: #88d7ff;
}

body.night-mode .rashi-text {
  color: #314765;
}

body.night-mode .rashi-panel {
  background: linear-gradient(180deg, rgba(220, 228, 239, 0.97), rgba(202, 214, 231, 0.95));
  border-color: rgba(105, 133, 194, 0.12);
}

body.night-mode .loading,
body.night-mode .welcome {
  color: #314765;
}

body.night-mode .welcome {
  background: linear-gradient(135deg, rgba(224, 231, 241, 0.94), rgba(208, 219, 233, 0.9));
}

body.night-mode .section-note {
  color: #314765;
}

body.night-mode .search-status {
  color: #22324c;
  background: rgba(236, 241, 247, 0.96);
  border-color: rgba(116, 148, 215, 0.14);
}

body.night-mode .floating-page-nav {
  background: rgba(228, 235, 243, 0.94);
  border-color: rgba(105, 133, 194, 0.16);
}

body.night-mode .search-summary-chip {
  background: rgba(223, 231, 241, 0.95);
  color: #324867;
}

body.night-mode .search-result-card,
body.night-mode .search-tractate-group,
body.night-mode .search-modal-panel {
  background: linear-gradient(180deg, rgba(239, 244, 249, 0.98), rgba(225, 233, 242, 0.96));
  color: #22324c;
}

body.night-mode .search-result-title,
body.night-mode .search-tractate-title {
  color: #20324b;
}

body.night-mode .search-result-snippet,
body.night-mode .search-modal-meta,
body.night-mode .search-tractate-count {
  color: #314765;
}

body.night-mode .welcome h3 {
  color: #38527a;
}

body.night-mode footer {
  background: linear-gradient(180deg, rgba(200, 212, 229, 0.96), rgba(184, 198, 218, 0.95));
  border-color: rgba(105, 133, 194, 0.12);
  color: #2c425f;
}

body.night-mode a {
  color: #4f62a7;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }

  .content-container {
    flex-direction: column;
  }

  .sugya-row.has-rashi {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --font-size: 20px;
  }

  .selection-controls,
  .global-search-controls,
  .nav-controls,
  .selection-top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .selection-top-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .selection-top-actions button {
    min-height: 36px;
    height: 36px;
    padding: 0.3rem 0.45rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .feature-controls {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  .view-tabs {
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
  }

  .view-tabs .tab-btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .modal-selection-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  section {
    padding: 1rem;
  }

  .global-search-controls {
    gap: 0.7rem;
  }

  .global-search-controls > * {
    flex: 1 1 100%;
  }

  #global-search-input {
    min-height: 58px;
    padding: 0.8rem 0.9rem;
    font-size: 0.98rem;
  }

  #global-search-btn {
    min-height: 58px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }

  .search-modal {
    padding: 10px;
  }

  .search-modal-panel {
    max-height: 90vh;
    border-radius: 22px;
  }

  .search-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .floating-page-nav {
    width: calc(100% - 18px);
    max-width: 420px;
    bottom: 10px;
    gap: 0.65rem;
    padding: 0.55rem;
  }

  .floating-page-nav button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
  }

  .search-modal-body {
    max-height: calc(90vh - 120px);
    padding: 0.9rem;
  }

  button,
  select,
  input[type="number"],
  input[type="text"] {
    width: 100%;
    font-size: 1rem;
  }

  .feature-controls > * {
    width: auto;
  }

  .feature-controls #search-input {
    width: 100%;
  }

  .selection-controls {
    gap: 0.7rem;
  }

  .selection-controls > * {
    flex: 0 0 auto;
  }

  .selection-controls button,
  .selection-controls select,
  .selection-controls input[type="number"] {
    min-height: 56px;
    padding: 0.65rem 0.85rem;
    font-size: 0.96rem;
    border-radius: 18px;
  }

  .selection-controls select,
  .selection-controls input[type="number"] {
    min-height: 34px;
    height: 34px;
    max-height: 34px;
    padding: 0.2rem 0.65rem;
    line-height: 1;
  }

  .selection-area h2,
  .global-search-area h2,
  .learning-area h2,
  .features-area h2 {
    font-size: 1.55rem;
  }

  .gemara-text {
    font-size: calc(var(--font-size) * 1.3);
    line-height: 2.1;
  }

  .rashi-text {
    font-size: calc(var(--font-size) * 1.08);
    line-height: 1.95;
  }

  .content {
    font-size: 1.04rem;
  }
}

@media (max-width: 480px) {
  :root {
    --font-size: 19px;
  }

  header,
  footer,
  main {
    width: min(100% - 14px, 100%);
  }

  section {
    padding: 1rem;
  }

  #global-search-input {
    min-height: 54px;
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
  }

  #global-search-btn {
    min-height: 54px;
    padding: 0.8rem 0.9rem;
    font-size: 0.96rem;
  }

  .gemara-text {
    font-size: calc(var(--font-size) * 1.2);
    line-height: 2.02;
  }

  .rashi-under h3 {
    font-size: calc(var(--font-size) * 1.18);
  }

  .selection-controls {
    gap: 0.6rem;
  }

  .modal-selection-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    justify-content: stretch;
    width: 100%;
  }

  .modal-selection-controls > * {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .modal-selection-controls select,
  .modal-selection-controls button {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .selection-controls > * {
    flex: 0 0 auto;
  }

  .selection-controls button,
  .selection-controls select,
  .selection-controls input[type="number"] {
    min-height: 50px;
    padding: 0.55rem 0.75rem;
    font-size: 0.92rem;
    border-radius: 16px;
  }

  .selection-controls select,
  .selection-controls input[type="number"] {
    min-height: 28px;
    height: 28px;
    max-height: 28px;
    padding: 0.1rem 0.55rem;
    line-height: 1;
    font-size: 0.9rem;
  }

  .selection-controls.modal-selection-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
  }

  .selection-controls.modal-selection-controls > * {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .selection-controls.modal-selection-controls select,
  .selection-controls.modal-selection-controls button {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 40px;
    height: 40px;
    max-height: 40px;
    padding: 0.2rem 0.45rem;
    font-size: 0.82rem;
    border-radius: 16px;
  }
}
div[aria-label*="Acrobat" i],
div[aria-label*="Adobe Acrobat" i],
button[aria-label*="Acrobat" i],
[title*="Acrobat" i] {
  display: none !important;
}
