.td-notebook-reader {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  outline: none;
}

.td-notebook-reader:focus-visible {
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(126, 102, 213, 0.25);
}

.td-notebook-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.td-notebook-spread.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.td-notebook-spread.is-single .td-notebook-page {
  width: min(780px, 100%);
  justify-self: center;
}

.td-notebook-page {
  position: relative;
  min-width: 0;
  min-height: 690px;
  overflow: visible;
  padding: clamp(28px, 4.2vw, 54px) clamp(24px, 4vw, 50px) 48px;
  border: 1px solid rgba(35, 27, 31, 0.13);
  border-radius: 5px 17px 13px 5px;
  color: #292126;
  background:
    linear-gradient(90deg, transparent 0 38px, rgba(181, 45, 79, 0.16) 39px 40px, transparent 41px),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0 30px,
      rgba(84, 111, 137, 0.085) 31px,
      rgba(255, 255, 255, 0) 32px
    ),
    #fffdf8;
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.23),
    inset -16px 0 28px rgba(68, 48, 52, 0.025);
}

.td-notebook-reader.is-density-compact .td-notebook-page {
  min-height: 650px;
  padding-top: clamp(22px, 3.2vw, 38px);
}

.td-notebook-reader.is-density-airy .td-notebook-page {
  min-height: 740px;
}

.td-notebook-reader.is-paper-grid .td-notebook-page {
  background:
    linear-gradient(90deg, transparent 0 38px, rgba(181, 45, 79, 0.14) 39px 40px, transparent 41px),
    linear-gradient(rgba(77, 122, 154, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 122, 154, 0.075) 1px, transparent 1px),
    #fffefa;
  background-size: auto, 24px 24px, 24px 24px, auto;
}

.td-notebook-reader.is-paper-dots .td-notebook-page {
  background:
    linear-gradient(90deg, transparent 0 38px, rgba(181, 45, 79, 0.14) 39px 40px, transparent 41px),
    radial-gradient(circle, rgba(77, 103, 126, 0.18) 1px, transparent 1.2px),
    #fffefa;
  background-size: auto, 22px 22px, auto;
}

.td-notebook-reader.is-paper-plain .td-notebook-page {
  background:
    linear-gradient(90deg, transparent 0 38px, rgba(181, 45, 79, 0.12) 39px 40px, transparent 41px),
    #fffefa;
}

.td-notebook-reader.is-theme-editorial .td-notebook-page {
  border-radius: 2px;
  background-color: #fffdf7;
  box-shadow:
    0 24px 64px rgba(18, 14, 16, 0.22),
    inset 0 0 0 1px rgba(92, 70, 50, 0.035);
}

.td-notebook-reader.is-theme-technical .td-notebook-page {
  border-color: rgba(35, 73, 91, 0.18);
  color: #172b34;
  background-color: #fbfeff;
}

.td-notebook-reader.is-theme-minimal .td-notebook-page {
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
}

.td-notebook-page:nth-child(even) {
  border-radius: 17px 5px 5px 13px;
}

.td-notebook-page.is-role-cover {
  background:
    radial-gradient(circle at 82% 11%, rgba(120, 186, 213, 0.16), transparent 31%),
    radial-gradient(circle at 8% 88%, rgba(181, 45, 79, 0.12), transparent 36%),
    #fffdf8;
}

.td-notebook-paper-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(181, 45, 79, 0.36);
}

.td-notebook-reader.is-title-compact .td-notebook-paper-heading {
  gap: 4px;
  margin-bottom: 15px;
  padding-bottom: 10px;
}

.td-notebook-reader.is-title-compact .td-notebook-paper-heading h2 {
  font-size: clamp(1rem, 1.7vw, 1.3rem);
}

.td-notebook-paper-heading span {
  color: #a32c49;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.td-notebook-paper-heading h2 {
  margin: 0;
  color: #261d22;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.15rem, 2.1vw, 1.72rem);
  line-height: 1.15;
}

.td-notebook-page-body {
  min-width: 0;
}

.td-notebook-page-number {
  position: absolute;
  right: 24px;
  bottom: 18px;
  color: rgba(63, 49, 55, 0.48);
  font-size: 0.68rem;
  font-weight: 850;
}

.td-notebook-page-navigation {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.td-notebook-page-navigation button {
  position: absolute;
  top: min(46%, 330px);
  width: 38px;
  height: 42px;
  border: 1px solid rgba(46, 34, 39, 0.16);
  border-radius: 13px;
  color: #3b2c33;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 28px rgba(25, 18, 21, 0.18);
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
}

.td-notebook-page-navigation .is-previous {
  left: 10px;
}

.td-notebook-page-navigation .is-next {
  right: 10px;
}

.td-notebook-page-navigation button:disabled {
  opacity: 0.28;
  cursor: default;
}

.td-notebook-page-navigation span {
  display: none;
}

.student-notebook-blocks.is-paper {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px 14px;
  padding: 0;
}

.student-notebook-blocks.is-paper .student-notebook-block {
  grid-column: 1 / -1;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: #292126;
  background: transparent;
  box-shadow: none;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-width-half {
  grid-column: span 6;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-width-third {
  grid-column: span 4;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-width-wide {
  grid-column: 2 / span 10;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-align-start {
  align-self: start;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-align-center {
  align-self: center;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-density-compact {
  padding-top: 9px;
  padding-bottom: 9px;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-density-spacious {
  padding-top: 17px;
  padding-bottom: 17px;
}

.student-notebook-blocks.is-paper .student-notebook-block::before {
  display: none;
}

.student-notebook-blocks.is-paper .student-notebook-block-heading {
  min-height: 0;
  padding: 0 0 7px;
  border-bottom: 1px solid rgba(53, 41, 47, 0.16);
  cursor: default;
}

.student-notebook-blocks.is-paper .student-notebook-block-heading-copy > span {
  color: #a32c49;
  font-size: 0.56rem;
}

.student-notebook-blocks.is-paper .student-notebook-block-heading-copy strong {
  color: #281f24;
  font-size: 0.9rem;
}

.student-notebook-blocks.is-paper .student-notebook-block-heading-copy small {
  color: #74666d;
}

.student-notebook-blocks.is-paper .student-notebook-block-content {
  gap: 10px;
  padding: 8px 0 0;
  border: 0;
}

.student-notebook-blocks.is-paper .student-notebook-block-content p,
.student-notebook-blocks.is-paper .student-notebook-block-content ol {
  color: #30272c;
  font-size: 0.79rem;
  line-height: 1.66;
  overflow-wrap: anywhere;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-definition,
.student-notebook-blocks.is-paper .student-notebook-block.is-algorithm,
.student-notebook-blocks.is-paper .student-notebook-block.is-warning,
.student-notebook-blocks.is-paper .student-notebook-block.is-accent-blue,
.student-notebook-blocks.is-paper .student-notebook-block.is-accent-green,
.student-notebook-blocks.is-paper .student-notebook-block.is-accent-amber,
.student-notebook-blocks.is-paper .student-notebook-block.is-accent-red,
.student-notebook-blocks.is-paper .student-notebook-block.is-accent-rose {
  padding: 13px 15px;
  border: 1px solid rgba(181, 45, 79, 0.2);
  border-radius: 5px 13px 8px 11px;
  background: rgba(181, 45, 79, 0.055);
}

.student-notebook-blocks.is-paper .student-notebook-block.is-definition,
.student-notebook-blocks.is-paper .student-notebook-block.is-accent-blue {
  border-color: rgba(52, 130, 169, 0.25);
  background: rgba(81, 156, 193, 0.07);
}

.student-notebook-blocks.is-paper .student-notebook-definition-part {
  color: #30272c;
  background: rgba(255, 255, 255, 0.55);
}

.student-notebook-blocks.is-paper .student-notebook-definition-part p {
  color: #30272c;
}

.student-notebook-blocks.is-paper .notebook-math-card {
  overflow-x: auto;
  color: #201a1d;
  background: rgba(255, 255, 255, 0.72);
}

.student-notebook-blocks.is-paper .student-notebook-curated-asset {
  color: #284f62;
  background: rgba(81, 156, 193, 0.06);
}

.student-notebook-blocks.is-paper .student-notebook-curated-asset :is(
  span,
  figcaption,
  .student-notebook-curated-asset-source
) {
  color: #526b76;
}

.student-notebook-blocks.is-paper .student-notebook-block:is(
  .is-diff-added,
  .is-diff-changed,
  .is-diff-moved,
  .is-diff-removed
) {
  position: relative;
  margin: -8px;
  padding: 8px;
  border-radius: 12px;
}

.student-notebook-blocks.is-paper .student-notebook-block.is-diff-added {
  background: rgba(57, 139, 85, 0.1);
  box-shadow: inset 0 0 0 1px rgba(57, 139, 85, 0.3);
}

.student-notebook-blocks.is-paper .student-notebook-block.is-diff-changed,
.student-notebook-blocks.is-paper .student-notebook-block.is-diff-moved {
  background: rgba(36, 103, 168, 0.08);
  box-shadow: inset 0 0 0 1px rgba(36, 103, 168, 0.28);
}

.student-notebook-blocks.is-paper .student-notebook-block.is-diff-removed {
  background: rgba(181, 45, 79, 0.08);
  box-shadow: inset 0 0 0 1px rgba(181, 45, 79, 0.28);
}

.student-notebook-diff-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #1f4e36;
  background: rgba(57, 139, 85, 0.13);
  font-size: 0.56rem;
  font-weight: 950;
}

.is-diff-changed .student-notebook-diff-badge,
.is-diff-moved .student-notebook-diff-badge {
  color: #174b77;
  background: rgba(36, 103, 168, 0.13);
}

.is-diff-removed .student-notebook-diff-badge {
  color: #81223b;
  background: rgba(181, 45, 79, 0.13);
}

.student-notebook-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed rgba(65, 48, 55, 0.18);
  border-radius: 14px;
  color: #4c3f45;
  background: rgba(255, 255, 255, 0.45);
}

.student-notebook-empty span {
  color: #766970;
  font-size: 0.78rem;
  line-height: 1.5;
}

.student-notebook-unfiled {
  overflow: hidden;
  border: 1px solid rgba(120, 186, 213, 0.2);
  border-radius: 16px;
  background: rgba(26, 22, 25, 0.84);
}

.student-notebook-unfiled-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: #f4e9ec;
  cursor: pointer;
  list-style: none;
}

.student-notebook-unfiled-heading::-webkit-details-marker {
  display: none;
}

.student-notebook-unfiled-heading span {
  font-size: 0.8rem;
  font-weight: 900;
}

.student-notebook-unfiled-heading small {
  color: #8fbfd2;
  font-size: 0.66rem;
}

.student-notebook-unfiled-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.student-notebook-unfiled-entry {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.student-notebook-unfiled-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}

.student-notebook-unfiled-entry-head strong {
  color: #f8eff1;
  font-size: 0.76rem;
}

.student-notebook-unfiled-entry-head small {
  grid-column: 1;
  color: #93868b;
  font-size: 0.64rem;
}

.student-notebook-unfiled-entry-head button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(120, 186, 213, 0.2);
  border-radius: 10px;
  color: #dff4fc;
  background: rgba(48, 111, 137, 0.12);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 720px) {
  .td-notebook-page {
    min-height: 610px;
    padding: 28px 22px 44px;
    border-radius: 10px;
  }

  .td-notebook-page-navigation button {
    top: 50%;
    width: 34px;
    height: 40px;
  }

  .td-notebook-page-navigation .is-previous {
    left: 4px;
  }

  .td-notebook-page-navigation .is-next {
    right: 4px;
  }

  .student-notebook-blocks.is-paper {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-notebook-blocks.is-paper .student-notebook-block:is(
    .is-width-wide,
    .is-width-half,
    .is-width-third
  ) {
    grid-column: 1;
  }
}
