/* Scoped to the board. Never lock scrolling or positioning of the
   surrounding Kavlyne cabinet and PDF lesson editor. */
.board-shell {
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  inset: auto;
  width: 100%;
  height: 72dvh;
  min-height: 520px;
  max-height: 900px;
  overflow: hidden;
  background: #fffdf9;

  /* Все fixed-панели доски остаются внутри доски,
     а не перекрывают весь кабинет Kavlyne */
  transform: translateZ(0);
  isolation: isolate;
}

.board-engine {
  position: absolute;
  inset: 0;
}

.excalidraw {
  --color-primary: #735e54;
  --color-primary-darker: #604c43;
  --color-primary-darkest: #493a34;
}

.excalidraw .App-toolbar,
.excalidraw .HintViewer,
.excalidraw .mobile-misc-tools-container,
.excalidraw .layer-ui__wrapper__top-right {
  display: none !important;
}

.kav-toolbar {
  position: fixed;
  z-index: 100;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 7px;

  width: min(1000px, calc(100vw - 18px));
  padding: 7px;

  border: 1px solid rgba(87, 69, 60, 0.12);
  border-radius: 18px;

  background: rgba(255, 253, 249, 0.96);

  box-shadow:
    0 8px 30px rgba(55, 42, 35, 0.10),
    0 2px 8px rgba(55, 42, 35, 0.06);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tool-scroll {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 4px;

  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tool-scroll::-webkit-scrollbar {
  display: none;
}

.kav-tool {
  flex: 0 0 45px;
  width: 45px;
  height: 45px;

  border: 0;
  border-radius: 12px;

  background: transparent;
  color: #342b27;

  display: grid;
  place-items: center;

  font:
    600 24px/1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  -webkit-tap-highlight-color: transparent;
}

.kav-tool.is-active {
  background: #eadfd8;
  color: #49372f;
}

.pen-widths {
  display: flex;
  align-items: center;
  gap: 3px;

  padding-left: 6px;

  border-left: 1px solid rgba(87, 69, 60, 0.12);
}

.width {
  width: 31px;
  height: 31px;

  display: grid;
  place-items: center;

  padding: 0;

  border: 0;
  border-radius: 9px;

  background: transparent;
}

.width.active {
  background: #eadfd8;
}

.line {
  display: block;
  width: 18px;
  border-radius: 20px;
  background: #342b27;
}

.line.thin {
  height: 1px;
}

.line.normal {
  height: 3px;
}

.line.thick {
  height: 6px;
}

.student-button {
  flex: 0 0 auto;

  height: 37px;

  padding: 0 11px;

  border: 0;
  border-radius: 11px;

  background: #eadfd8;
  color: #49372f;

  font:
    600 12px/1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  white-space: nowrap;
}

.student-button:disabled {
  opacity: 0.35;
}

.color-tools {
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  gap: 7px;

  padding-left: 8px;

  border-left: 1px solid rgba(87, 69, 60, 0.12);
}

.color-dot {
  width: 29px;
  height: 29px;

  padding: 0;

  border-radius: 50%;
  border: 3px solid #fffdf9;

  box-shadow:
    0 0 0 1px rgba(55, 42, 35, 0.18);
}

.color-dot.black {
  background: #1f1f1f;
}

.color-dot.red {
  background: #c92a2a;
}

.color-dot.is-active {
  box-shadow:
    0 0 0 2px #fffdf9,
    0 0 0 4px #80695e;
}

@media (max-width: 650px) {
  .kav-toolbar {
    width: calc(100vw - 14px);
    gap: 5px;
    padding: 6px;
  }

  .kav-tool {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .pen-widths {
    gap: 1px;
    padding-left: 4px;
  }

  .width {
    width: 26px;
    height: 30px;
  }

  .student-button {
    height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }

  .color-tools {
    gap: 5px;
    padding-left: 5px;
  }

  .color-dot {
    width: 24px;
    height: 24px;
  }
}

/* =========================================================
   KAVLYNE BOARD V3.5 — INSERT TOOLS
   ========================================================= */

.insert-button {
  flex: 0 0 auto;
  height: 37px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #49372f;
  font:
    600 12px/1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.insert-button.active,
.insert-button:active {
  background: #eadfd8;
}

.insert-panel {
  position: fixed;
  z-index: 110;

  top: calc(max(10px, env(safe-area-inset-top)) + 64px);
  left: 50%;
  transform: translateX(-50%);

  width: min(430px, calc(100vw - 20px));
  max-height: calc(100dvh - 92px);
  overflow-y: auto;

  padding: 12px;

  border: 1px solid rgba(87, 69, 60, 0.12);
  border-radius: 18px;

  background: rgba(255, 253, 249, 0.98);

  box-shadow:
    0 16px 42px rgba(55, 42, 35, 0.14),
    0 3px 10px rgba(55, 42, 35, 0.06);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.insert-section + .insert-section {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid rgba(87, 69, 60, 0.10);
}

.insert-title {
  margin: 0 0 9px 2px;
  color: #5a4941;
  font:
    600 13px/1.2
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.table-builder {
  display: grid;
  gap: 7px;
}

.counter {
  min-height: 40px;

  display: grid;
  grid-template-columns: 1fr 36px 30px 36px;
  align-items: center;

  padding: 4px 5px 4px 11px;

  border-radius: 11px;
  background: #f6f0eb;

  color: #403530;
  font:
    500 13px/1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.counter button {
  width: 32px;
  height: 32px;

  padding: 0;
  border: 0;
  border-radius: 9px;

  background: #fffdf9;
  color: #49372f;

  font-size: 20px;
}

.counter b {
  text-align: center;
  font-size: 13px;
}

.insert-main-action {
  height: 40px;

  border: 0;
  border-radius: 11px;

  background: #765e53;
  color: white;

  font:
    600 13px/1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.insert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.insert-grid button {
  min-height: 68px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  border: 0;
  border-radius: 12px;

  background: #f6f0eb;
  color: #403530;

  font:
    500 12px/1.15
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.insert-symbol {
  font-size: 25px;
  line-height: 1;
}

.formula-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.formula-row > button {
  height: 58px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 11px;

  background: #f6f0eb;
  color: #302b28;

  font:
    500 24px/1
    Georgia,
    "Times New Roman",
    serif;
}

.fraction-icon {
  width: 30px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.fraction-icon i {
  font-style: normal;
  font-size: 17px;
}

.fraction-icon em {
  width: 29px;
  height: 1.5px;
  margin: 2px 0;
  background: currentColor;
}

@media (max-width: 650px) {
  .insert-button {
    height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }

  .insert-panel {
    top: calc(max(8px, env(safe-area-inset-top)) + 59px);
    width: calc(100vw - 16px);
    border-radius: 16px;
  }
}

/* =========================================================
   V3.5.1 — MAIN TOOLS TOP / EXTRA TOOLS LEFT
   ========================================================= */

.kav-side-toolbar {
  position: fixed;
  z-index: 105;

  left: max(8px, env(safe-area-inset-left));
  top: calc(max(10px, env(safe-area-inset-top)) + 64px);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;

  padding: 6px;

  border: 1px solid rgba(87, 69, 60, 0.12);
  border-radius: 16px;

  background: rgba(255, 253, 249, 0.96);

  box-shadow:
    0 8px 28px rgba(55, 42, 35, 0.10),
    0 2px 7px rgba(55, 42, 35, 0.05);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.side-tool {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  padding: 0;
  border: 0;
  border-radius: 11px;

  background: transparent;
  color: #352c28;

  font:
    600 22px/1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  -webkit-tap-highlight-color: transparent;
}

.side-tool:active {
  transform: scale(0.93);
}

.side-tool.is-active {
  background: #eadfd8;
  color: #49372f;
}

.side-separator {
  width: 28px;
  height: 1px;
  margin: 2px 0;

  background: rgba(87, 69, 60, 0.13);
}

.insert-side {
  font-size: 26px;
}

/* Верхняя панель больше не должна ужимать основные инструменты */

.tool-scroll {
  flex: 0 0 auto !important;
  overflow: visible !important;
}

.kav-toolbar {
  justify-content: center;
}

/* Окно Вставить открывается справа от левой панели */

.insert-panel {
  left: 64px !important;
  right: auto !important;
  transform: none !important;

  width: min(430px, calc(100vw - 78px)) !important;

  top: calc(max(10px, env(safe-area-inset-top)) + 64px) !important;
}

/* старая верхняя кнопка больше нигде не нужна */

.kav-toolbar > .insert-button {
  display: none !important;
}

@media (max-width: 650px) {
  .kav-toolbar {
    width: calc(100vw - 14px);
  }

  .kav-side-toolbar {
    left: 6px;
    top: calc(max(8px, env(safe-area-inset-top)) + 58px);

    padding: 5px;
    gap: 2px;

    border-radius: 14px;
  }

  .side-tool {
    width: 38px;
    height: 38px;

    font-size: 20px;
  }

  .side-separator {
    width: 25px;
  }

  .insert-panel {
    left: 55px !important;
    top: calc(max(8px, env(safe-area-inset-top)) + 58px) !important;

    width: calc(100vw - 63px) !important;
    max-height: calc(100dvh - 75px);
  }
}

/* =========================================================
   V3.7 — TEACHER DESIGN MODE
   ========================================================= */

.design-side {
  font-size: 23px;
}

.design-panel {
  position: fixed;
  z-index: 111;

  left: 64px;
  top: calc(max(10px, env(safe-area-inset-top)) + 64px);

  width: min(390px, calc(100vw - 78px));
  max-height: calc(100dvh - 90px);
  overflow-y: auto;

  padding: 13px;

  border: 1px solid rgba(87, 69, 60, 0.12);
  border-radius: 18px;

  background: rgba(255, 253, 249, 0.98);

  box-shadow:
    0 16px 42px rgba(55, 42, 35, 0.14),
    0 3px 10px rgba(55, 42, 35, 0.06);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.design-section + .design-section {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(87, 69, 60, 0.10);
}

.design-title {
  margin: 0 0 10px 1px;

  color: #54443d;

  font:
    650 13px/1.2
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.design-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.design-color {
  width: 31px;
  height: 31px;

  padding: 0;

  border: 3px solid #fffdf9;
  border-radius: 50%;

  box-shadow:
    0 0 0 1px rgba(62, 48, 42, 0.20);

  -webkit-tap-highlight-color: transparent;
}

.transparent-color {
  position: relative;

  background:
    linear-gradient(
      135deg,
      transparent 44%,
      #c65b5b 45%,
      #c65b5b 54%,
      transparent 55%
    ),
    #fffdf9 !important;
}

.background-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.background-option {
  min-width: 0;

  padding: 6px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;

  border: 1px solid transparent;
  border-radius: 11px;

  background: #f7f2ed;
  color: #51443e;

  font:
    500 10px/1.1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.background-option.active {
  border-color: #816b61;
  background: #eee3dd;
}

.background-preview {
  width: 100%;
  aspect-ratio: 1.4 / 1;

  display: block;

  border-radius: 7px;

  box-shadow:
    inset 0 0 0 1px rgba(62, 48, 42, 0.11);
}

.grid-preview {
  background-image:
    linear-gradient(
      rgba(155, 145, 138, 0.22) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(155, 145, 138, 0.22) 1px,
      transparent 1px
    );

  background-size: 10px 10px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.sticker-grid button {
  height: 53px;

  display: grid;
  place-items: center;

  padding: 0;

  border: 0;
  border-radius: 11px;

  background: #f7f2ed;

  font-size: 27px;

  -webkit-tap-highlight-color: transparent;
}

.sticker-grid button:active {
  transform: scale(0.94);
  background: #eee3dd;
}

@media (max-width: 650px) {
  .design-panel {
    left: 55px;
    top: calc(max(8px, env(safe-area-inset-top)) + 58px);

    width: calc(100vw - 63px);
    max-height: calc(100dvh - 74px);

    border-radius: 16px;
  }

  .background-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sticker-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* V3.7.1 — selected design values */

.design-color.active {
  box-shadow:
    0 0 0 2px #fffdf9,
    0 0 0 4px #765e53;
  transform: scale(1.06);
}

.fill-color.active {
  box-shadow:
    0 0 0 2px #fffdf9,
    0 0 0 4px #765e53;
}


/* =========================================================
   KAVLYNE BOARD V3.8
   ========================================================= */

/* Старые три постоянные кнопки толщины больше не нужны */
.kav-toolbar .pen-widths {
  display: none !important;
}

/* У ученика красного пера нет */
.role-student .color-dot.red {
  display: none !important;
}

/* Математическая библиотека и оформление — преподавательские */
.role-student .insert-side {
  display: none !important;
}

/* Толщина по нажатию на карандаш */

.pen-width-popover {
  position: fixed;
  z-index: 120;

  top: calc(max(10px, env(safe-area-inset-top)) + 60px);
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 5px;

  padding: 6px;

  border: 1px solid rgba(87, 69, 60, 0.13);
  border-radius: 14px;

  background: rgba(255, 253, 249, 0.98);

  box-shadow:
    0 9px 28px rgba(55, 42, 35, 0.12),
    0 2px 6px rgba(55, 42, 35, 0.05);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pen-width-choice {
  width: 44px;
  height: 39px;

  display: grid;
  place-items: center;

  padding: 0;

  border: 0;
  border-radius: 10px;

  background: transparent;

  -webkit-tap-highlight-color: transparent;
}

.pen-width-choice.active {
  background: #eadfd8;
}

.pen-width-preview {
  display: block;

  width: 25px;

  min-height: 1px;
  max-height: 8px;

  border-radius: 20px;

  background: #282320;
}

/* В + больше не показываем то, что переехало в Оформление */

.insert-panel .moved-to-design {
  display: none !important;
}

/* Карточки урока внутри Оформления */

.design-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.design-card-grid button {
  min-height: 48px;

  padding: 8px 9px;

  border: 0;
  border-radius: 11px;

  background: #f6f0eb;
  color: #493d37;

  text-align: left;

  font:
    500 12px/1.2
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.design-card-grid button:last-child {
  grid-column: 1 / -1;
}

.design-card-grid b {
  font-weight: 600;
}

/* Формул стало больше */

.formula-row {
  grid-template-columns: repeat(5, 1fr) !important;
}

/* Быстрые мат-инструменты слева */

.quick-math-tool span {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
}

/* У преподавателя верхняя панель теперь короче */

.kav-toolbar {
  width: auto !important;
  max-width: calc(100vw - 14px);
}

@media (max-width: 650px) {
  .pen-width-popover {
    top: calc(max(8px, env(safe-area-inset-top)) + 55px);

    gap: 3px;
    padding: 5px;
  }

  .pen-width-choice {
    width: 39px;
    height: 36px;
  }

  .design-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .formula-row {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* =========================================================
   CLEAN LEFT TOOLBAR — V3.8.x
   Эти инструменты остаются в математической библиотеке,
   но больше не дублируются на главной левой панели.
   ========================================================= */

.kav-side-toolbar button[title="Треугольник"],
.kav-side-toolbar button[title="Окружность"],
.kav-side-toolbar button[title="Прямоугольник"],
.kav-side-toolbar button[title="Квадрат"],
.kav-side-toolbar button[title="Координатная плоскость"],
.kav-side-toolbar button[title="Числовая прямая"] {
  display: none !important;
}

/* =========================================================
   KAVLYNE BOARD V4.0 — OBJECT ACTIONS
   ========================================================= */

.object-actions {
  position: fixed;
  z-index: 130;

  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));

  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 4px;

  padding: 6px;

  border: 1px solid rgba(87, 69, 60, 0.12);
  border-radius: 15px;

  background: rgba(255, 253, 249, 0.97);

  box-shadow:
    0 10px 30px rgba(55, 42, 35, 0.12),
    0 2px 7px rgba(55, 42, 35, 0.05);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.object-actions button {
  min-width: 39px;
  height: 39px;

  padding: 0 10px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 10px;

  background: transparent;
  color: #40342f;

  font:
    600 18px/1
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  white-space: nowrap;

  -webkit-tap-highlight-color: transparent;
}

.object-actions button:active {
  background: #eadfd8;
  transform: scale(0.95);
}

.board-action-note {
  position: fixed;
  z-index: 150;

  left: 50%;
  bottom: calc(
    max(18px, env(safe-area-inset-bottom)) + 58px
  );

  transform: translateX(-50%);

  padding: 8px 12px;

  border-radius: 11px;

  background: rgba(64, 52, 47, 0.92);
  color: #fff;

  font:
    600 12px/1.15
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  white-space: nowrap;

  pointer-events: none;
}

/* =========================================================
   MY ELEMENTS
   ========================================================= */

.my-elements-empty {
  padding: 12px;

  border-radius: 11px;

  background: #f7f2ed;
  color: #7a6c65;

  font:
    500 12px/1.35
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.my-elements-grid {
  display: grid;
  gap: 6px;
}

.my-element-item {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 5px;
}

.my-element-insert,
.my-element-delete {
  min-height: 39px;

  border: 0;
  border-radius: 10px;

  background: #f6f0eb;
  color: #493d37;

  font:
    600 12px/1.2
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.my-element-insert {
  padding: 8px 11px;
  text-align: left;
}

.my-element-delete {
  padding: 0;
  font-size: 18px;
}

@media (max-width: 650px) {
  .object-actions {
    bottom: max(
      10px,
      env(safe-area-inset-bottom)
    );

    max-width: calc(100vw - 18px);
  }

  .object-actions button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 17px;
  }

  .board-action-note {
    bottom: calc(
      max(10px, env(safe-area-inset-bottom)) + 53px
    );
  }
}

/* V4.2 controls: keep pen widths on the toolbar and closeable side panels. */
.kav-toolbar .pen-widths { display:flex !important; gap:5px; align-items:center; padding:0 7px; border-left:1px solid rgba(87,69,60,.14); }
.kav-toolbar .pen-widths .width { width:30px; height:31px; padding:5px; border:0; border-radius:8px; background:transparent; display:grid; place-items:center; }
.kav-toolbar .pen-widths .width.active { background:#eadfd8; }
.panel-close-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:2px 4px 10px; margin-bottom:8px; border-bottom:1px solid rgba(87,69,60,.13); font:600 13px/1.3 system-ui,sans-serif; color:#54443d; }
.panel-close-button { display:grid; place-items:center; min-width:33px; height:33px; border:0; border-radius:9px; background:#eee6df; color:#473a34; font-size:23px; cursor:pointer; }
.panel-close-button:hover { background:#e4d8ce; }
/* Excalidraw's built-in style flyout conflicts with Kavlyne's custom sidebar. */
.board-shell .excalidraw .App-menu__left { display:none !important; }
@media (max-width:650px) { .kav-toolbar .pen-widths { gap:2px; padding:0 3px; } .kav-toolbar .pen-widths .width { width:24px; height:28px; } }

/* All five pen thicknesses remain available without an overlapping popover. */
.board-pen-width-options {display:flex;gap:7px;align-items:center;flex-wrap:wrap;padding:4px 0 9px}
.board-pen-width-options button {display:grid;place-items:center;width:39px;height:34px;border:1px solid #ded2c8;background:#fffdfa;border-radius:9px;cursor:pointer}
.board-pen-width-options button.active {background:#e9ded5;border-color:#b49b87}
.board-pen-width-options .board-width-mark {display:block;width:23px;background:#493a32;border-radius:10px}
.kv-auth-screen{min-height:100dvh;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(430px,.8fr);background:#f4efe6;color:#24231f;overflow:hidden;}
.kv-auth-story{position:relative;min-height:100dvh;padding:30px 54px 34px 18.5%;background:linear-gradient(90deg,rgba(246,241,231,.28),rgba(246,241,231,.96) 28%,#f7f2e9 72%),url('/assets/auth-column-0aMhnhF1.jpg') left center/auto 100% no-repeat;}
.kv-auth-story:after{content:"";position:absolute;inset:auto 4% 0 42%;height:30%;background:radial-gradient(ellipse at center,rgba(182,150,88,.08),transparent 68%);pointer-events:none;}
.kv-auth-brand,.kv-auth-card-brand{display:flex;align-items:center;gap:8px;color:#9d742e}.kv-auth-brand strong,.kv-auth-card-brand strong{display:block;color:#201f1b;font-family:"Cormorant Garamond",Georgia,serif;font-size:46px;font-weight:500;line-height:.9;letter-spacing:-.03em}.kv-auth-brand span,.kv-auth-card-brand span{display:block;margin-top:7px;color:#736b5f;font:600 8px/1.2 system-ui,sans-serif;letter-spacing:.34em}.kv-auth-story-copy{max-width:620px;margin-top:42px;position:relative;z-index:1}.kv-auth-story-copy h1{margin:0;font-family:"Cormorant Garamond",Georgia,serif;font-size:clamp(48px,5.5vw,72px);font-weight:500;line-height:.9;letter-spacing:-.045em}.kv-auth-story-copy>p{max-width:575px;margin:18px 0 22px;color:#5e574e;font-family:Georgia,serif;font-size:17px;line-height:1.45}.kv-auth-benefits{display:grid;gap:8px;max-width:590px}.kv-auth-benefit{display:grid;grid-template-columns:52px 1fr;align-items:center;gap:12px;min-height:65px;padding:9px 16px;border:1px solid rgba(185,159,117,.28);border-radius:14px;background:rgba(255,253,248,.72);box-shadow:0 8px 22px rgba(93,71,41,.05);backdrop-filter:blur(5px)}.kv-auth-benefit>span{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#876629;background:#f0e6d3}.kv-auth-benefit b{display:block;font-family:Georgia,serif;font-size:16px;font-weight:500}.kv-auth-benefit small{display:block;margin-top:3px;color:#776e63;font-family:Georgia,serif;font-size:11px;line-height:1.3}.kv-auth-story-note{display:flex;align-items:center;gap:16px;margin:20px 0 0 18px;color:#9a7951;font-family:Georgia,serif;font-style:italic;font-size:15px}.kv-auth-story-note i{width:44px;height:1px;background:#b88d45}
.kv-auth-panel-wrap{display:grid;place-items:center;padding:28px 6% 28px 0;background:radial-gradient(circle at 82% 24%,rgba(189,165,125,.14),transparent 30%),linear-gradient(135deg,#e8dfd0,#d7c9b5);position:relative}.kv-auth-card{width:min(500px,92%);min-height:86dvh;padding:42px 46px 32px;border-radius:24px;border:1px solid rgba(255,255,255,.75);background:rgba(255,253,248,.93);box-shadow:0 24px 70px rgba(63,51,36,.18);display:flex;flex-direction:column;position:relative;overflow:hidden}.kv-auth-card:after{content:"";position:absolute;left:-8%;right:-8%;bottom:-7%;height:25%;background:linear-gradient(180deg,transparent,rgba(217,200,173,.24)),radial-gradient(ellipse at 70% 80%,rgba(157,116,46,.12),transparent 65%);pointer-events:none}.kv-auth-card-brand{justify-content:center}.kv-auth-card-brand strong{font-size:40px}.kv-auth-card header{text-align:center;margin:38px 0 30px}.kv-auth-card h2{margin:0;font-family:"Cormorant Garamond",Georgia,serif;font-size:48px;line-height:.95;font-weight:500;letter-spacing:-.03em}.kv-auth-card header p{margin:8px 0 0;color:#80776d;font-family:Georgia,serif;font-size:16px}.kv-auth-fields{display:grid;gap:20px}.kv-auth-fields label>span{display:block;margin-bottom:8px;font-family:Georgia,serif;font-size:14px}.kv-auth-input{height:54px;border:1px solid #d8d0c5;border-radius:10px;display:flex;align-items:center;gap:12px;padding:0 14px;color:#847d74;background:rgba(255,255,255,.54)}.kv-auth-input:focus-within{border-color:#a88a56;box-shadow:0 0 0 3px rgba(168,138,86,.1)}.kv-auth-input input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:14px/1.2 system-ui,sans-serif;color:#28251f}.kv-auth-input input::placeholder{color:#a9a39b}.kv-auth-input button{border:0;background:transparent;color:#888179;display:grid;place-items:center;padding:4px}.kv-auth-forgot{align-self:flex-end;margin:10px 0 18px;border:0;background:transparent;color:#937039;text-decoration:underline;font-family:Georgia,serif;font-size:13px}.kv-auth-error{margin:-6px 0 14px;padding:10px 12px;border-radius:9px;background:#f6e7e2;color:#8d4437;font-size:12px;line-height:1.35}.kv-auth-primary,.kv-auth-secondary{height:56px;border-radius:12px;font-family:Georgia,serif;font-size:17px;display:flex;align-items:center;justify-content:center;gap:12px;transition:.15s ease}.kv-auth-primary{border:1px solid #4b5135;background:linear-gradient(135deg,#77794d,#5d603d);color:#fffdf7}.kv-auth-primary:hover{transform:translateY(-1px);box-shadow:0 9px 22px rgba(75,81,53,.18)}.kv-auth-primary:disabled{opacity:.65}.kv-auth-secondary{margin-top:10px;border:1px solid #b49a67;background:transparent;color:#514737}.kv-auth-for-teacher{display:flex;align-items:center;gap:14px;margin:27px 0;color:#948a7f;font-family:Georgia,serif;font-size:13px}.kv-auth-for-teacher span{height:1px;flex:1;background:#ddd4c8}.kv-auth-card-foot{margin-top:auto;padding-top:16px;display:flex;align-items:center;justify-content:center;gap:10px;color:#a17b36;position:relative;z-index:1}.kv-auth-card-foot em{font-family:Georgia,serif;color:#8d6a43;font-size:15px;line-height:1.25}
@media(max-width:980px){.kv-auth-screen{grid-template-columns:1fr}.kv-auth-story{min-height:auto;padding:28px 24px 30px;background:linear-gradient(90deg,rgba(246,241,231,.86),#f7f2e9 45%),url('/assets/auth-column-0aMhnhF1.jpg') left center/auto 100% no-repeat}.kv-auth-story-copy{margin-top:24px}.kv-auth-story-copy h1{font-size:52px}.kv-auth-benefits{grid-template-columns:1fr 1fr;max-width:none}.kv-auth-panel-wrap{padding:28px}.kv-auth-card{min-height:auto;width:min(560px,100%)}}
@media(max-width:640px){.kv-auth-screen{display:block;overflow:auto}.kv-auth-story{padding:20px 18px 26px}.kv-auth-brand strong{font-size:34px}.kv-auth-brand span{font-size:7px}.kv-auth-story-copy h1{font-size:42px;line-height:.94}.kv-auth-story-copy>p{font-size:14px}.kv-auth-benefits{grid-template-columns:1fr;gap:6px}.kv-auth-benefit{min-height:57px;padding:8px 12px;grid-template-columns:42px 1fr}.kv-auth-benefit>span{width:36px;height:36px}.kv-auth-benefit b{font-size:14px}.kv-auth-benefit small{font-size:10px}.kv-auth-story-note{margin-left:0}.kv-auth-panel-wrap{padding:18px;background:#ede4d7}.kv-auth-card{width:100%;padding:28px 20px 24px;border-radius:20px}.kv-auth-card-brand strong{font-size:34px}.kv-auth-card header{margin:28px 0 24px}.kv-auth-card h2{font-size:42px}.kv-auth-card header p{font-size:14px}.kv-auth-fields{gap:16px}.kv-auth-input{height:52px}.kv-auth-primary,.kv-auth-secondary{height:52px}.kv-auth-card-foot{padding-bottom:8px}}
@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}

:root {
  font-family: Manrope, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #3D332D;
  background: #F8F5F1;
  font-synthesis: none;
  --bg: #F8F5F1;
  --panel: #FFFDFC;
  --panel-soft: #F1E8DE;
  --line: #E5D9CD;
  --text: #3D332D;
  --muted: #8C8178;
  --brand: #C7A77F;
  --brand-deep: #A98561;
  --brand-soft: #EADBCB;
  --accent: #A98561;
  --success: #738777;
  --warning: #B28A59;
  --danger: #A86763;
  --shadow: 0 18px 50px rgba(86, 67, 51, .07);
  --radius-card: 24px;
}
* { box-sizing: border-box; }
html, body, #root { min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.center-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

.button { border: 1px solid transparent; border-radius: 14px; padding: 12px 17px; min-height: 44px; background: var(--brand); color: var(--text); font-weight: 650; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.button:hover { background: var(--brand-deep); color: #fff; }
.button.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.button.ghost { background: transparent; color: var(--text); border: 1px solid transparent; }
.button.danger { background: #fff; color: var(--danger); border-color: #d9b9b6; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.icon-text-button { border: 0; background: transparent; padding: 8px 0; color: var(--muted); display: flex; gap: 8px; align-items: center; }

.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 13px; min-height: 46px; outline: none; color: var(--text); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-deep); box-shadow: 0 0 0 3px rgba(199,167,127,.18); }
.textarea { min-height: 105px; resize: vertical; }
.label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.error-banner { background: #f7e3e2; color: #7f2e2c; border: 1px solid #ebc5c2; padding: 11px 13px; border-radius: 12px; }
.success-banner { background: #e4eee7; color: #284d37; border: 1px solid #c8dbcD; padding: 11px 13px; border-radius: 12px; }

.landing { min-height: 100vh; }
.landing-nav { max-width: 1180px; margin: 0 auto; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 14px; background: var(--brand); color: var(--text); display: grid; place-items: center; font-family: Georgia, serif; }
.landing-actions { display: flex; gap: 10px; }
.hero { max-width: 1180px; margin: 0 auto; padding: 90px 28px 80px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--accent); }
.hero h1 { font-family: Georgia, serif; font-weight: 500; font-size: clamp(46px, 7vw, 82px); line-height: .98; letter-spacing: -.045em; margin: 16px 0 24px; }
.hero p { color: var(--muted); font-size: 19px; line-height: 1.65; max-width: 700px; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.price-line { margin-top: 15px; color: var(--muted); font-size: 14px; }
.hero-demo { background: var(--panel); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; }
.demo-top { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.demo-body { padding: 18px; display: grid; gap: 14px; }
.demo-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #faf9f6; }
.live-row { display: flex; align-items: center; gap: 9px; color: #355943; font-weight: 650; }
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: #4c8b63; box-shadow: 0 0 0 4px #dceadf; }
.marketing-section { max-width: 1180px; margin: 0 auto; padding: 58px 28px; }
.section-title { max-width: 720px; margin-bottom: 28px; }
.section-title h2 { font-family: Georgia, serif; font-size: 40px; font-weight: 500; margin: 0 0 10px; }
.section-title p { color: var(--muted); line-height: 1.6; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.feature-card h3 { margin: 12px 0 7px; font-size: 16px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.step { padding: 16px; border-top: 1px solid var(--line); }
.step b { display: block; font-family: Georgia, serif; font-size: 26px; color: var(--accent); margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.cta-box { background: var(--brand); color: white; border-radius: 26px; padding: 42px; display: flex; justify-content: space-between; gap: 30px; align-items: center; }
.cta-box p { color: #d6dfd9; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--brand); color: white; padding: 70px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-family: Georgia, serif; font-size: 54px; font-weight: 500; line-height: 1.05; max-width: 560px; }
.auth-side p { color: #d6dfd9; max-width: 520px; line-height: 1.6; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px; }
.auth-form { width: min(440px, 100%); background: white; border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.auth-form h2 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.auth-form > p { margin: 0 0 22px; color: var(--muted); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-soft); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tabs button { border: 0; background: transparent; border-radius: 9px; padding: 9px; }
.tabs button.active { background: white; box-shadow: 0 3px 10px rgba(0,0,0,.06); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; border-right: 1px solid var(--line); background: #F6F0EA; padding: 22px 16px; display: flex; flex-direction: column; }
.sidebar .brand { padding: 2px 9px 20px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { display: flex; gap: 10px; align-items: center; padding: 10px 11px; border-radius: 11px; color: #5f655e; font-size: 14px; }
.nav-item.active { background: var(--panel-soft); color: var(--text); box-shadow: none; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 9px 0; }
.user-chip { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; min-width: 0; }
.avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 750; }
.user-chip div:last-child { min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: var(--muted); margin-top: 2px; }
.content { padding: 34px 38px 54px; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.page-header h1 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 38px; letter-spacing: -.02em; }
.page-header p { margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; box-shadow: 0 8px 26px rgba(86,67,51,.025); }
.card h3 { margin: 0 0 10px; }
.card p { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card strong { display: block; font-family: Georgia, serif; font-weight: 500; font-size: 36px; margin-bottom: 4px; }
.stat-card span { color: var(--muted); font-size: 14px; }
.list { display: grid; gap: 9px; }
.list-row { border: 1px solid var(--line); background: white; border-radius: 14px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-row-main { min-width: 0; }
.list-row-main strong { display: block; }
.list-row-main small { display: block; color: var(--muted); margin-top: 4px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini-button { border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 8px 10px; min-height: 36px; font-size: 13px; }
.mini-button.danger { color: var(--danger); }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 650; background: #eceae4; color: #5c625b; }
.status-pill.good { background: #e1eee5; color: #315b3f; }
.status-pill.warn { background: #f4ead8; color: #7a5a25; }
.status-pill.bad { background: #f5e1e0; color: #8b3937; }
.status-pill.info { background: #e2e8ef; color: #3e566f; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.sticky-card { position: sticky; top: 24px; }
.empty { border: 1px dashed #c9c5bb; border-radius: 16px; padding: 28px; text-align: center; color: var(--muted); }
.helper { font-size: 13px; color: var(--muted); line-height: 1.5; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-soft); border-radius: 8px; padding: 3px 6px; font-size: 12px; }
.link-box { background: #f4f3ef; border: 1px solid var(--line); padding: 10px; border-radius: 10px; font-size: 12px; word-break: break-all; }

.student-page { min-height: 100vh; background: #f5f3ee; }
.student-header { max-width: 900px; margin: 0 auto; padding: 22px 22px 0; display: flex; justify-content: space-between; align-items: center; }
.student-main { max-width: 900px; margin: 0 auto; padding: 28px 22px 60px; }
.student-hello { margin-bottom: 22px; }
.student-hello h1 { font-family: Georgia, serif; font-size: 42px; font-weight: 500; margin: 0 0 8px; }
.student-hello p { color: var(--muted); margin: 0; }
.homework-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-top: 12px; }
.lesson-banner { background: var(--brand); color: white; border-radius: 18px; padding: 20px; margin-bottom: 20px; }
.lesson-banner p { color: #d8e0db; }

.lesson-workspace { min-height: calc(100vh - 68px); display: grid; grid-template-rows: auto 1fr; gap: 14px; }
.lesson-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 12px 14px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 14px; min-height: 620px; }
.material-pane, .board-pane { background: white; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.pane-title { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.material-placeholder { height: 100%; display: grid; place-items: center; color: var(--muted); padding: 30px; text-align: center; }
.whiteboard { width: 100%; min-height: 560px; touch-action: none; display: block; background-image: linear-gradient(#eceae4 1px, transparent 1px), linear-gradient(90deg, #eceae4 1px, transparent 1px); background-size: 20px 20px; }
.presence-list { display: flex; gap: 8px; flex-wrap: wrap; }
.presence-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: #f3f2ee; padding: 6px 9px; border-radius: 999px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 50px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; }
  .sidebar .brand span:last-child, .nav-item span, .user-chip div:last-child, .sidebar-footer .icon-text-button span { display: none; }
  .sidebar-footer .icon-text-button { display: flex; width: 100%; justify-content: center; padding: 10px 0; }
  .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { justify-content: center; padding: 11px; }
  .user-chip { justify-content: center; }
  .workspace-grid { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}

@media (max-width: 680px) {
  .landing-nav { padding: 16px; }
  .landing-nav .brand span:last-child { display: none; }
  .hero { padding: 44px 18px 55px; }
  .hero h1 { font-size: 48px; }
  .hero p { font-size: 17px; }
  .marketing-section { padding: 42px 18px; }
  .feature-grid, .steps, .grid.two, .grid.three, .form-grid.two, .split { grid-template-columns: 1fr; }
  .cta-box { padding: 28px; flex-direction: column; align-items: flex-start; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form-wrap { padding: 18px; }
  .app-shell { display: block; }
  .sidebar { height: auto; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; top: auto; border-right: 0; border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .sidebar .brand, .sidebar-footer { display: none; }
  .nav-list { grid-template-columns: repeat(6, 1fr); gap: 2px; }
  .nav-item { padding: 9px 4px; }
  .nav-item:nth-child(n+7) { display: none; }
  .content { padding: 22px 16px 90px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header h1 { font-size: 32px; }
  .list-row { align-items: flex-start; flex-direction: column; }
  .row-actions { width: 100%; }
  .lesson-toolbar { align-items: flex-start; flex-direction: column; }
  .student-main { padding-left: 16px; padding-right: 16px; }
  .student-hello h1 { font-size: 36px; }
}

/* Rich lesson editors */
.workspace-grid.single { grid-template-columns: 1fr; }
.workspace-grid.with-board { grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); }
.scroll-list { max-height: 230px; overflow: auto; }
.list-row.compact { justify-content: flex-start; padding: 10px 12px; }
.student-section-title { font-family: Georgia, serif; font-weight: 500; }
.student-lesson-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.student-lesson-heading h2 { margin: 7px 0 0; font-family: Georgia, serif; font-weight: 500; }
.student-eyebrow { color: #d8e0db; }
.connection-warning { display: inline-flex; align-items: center; gap: 6px; color: #f6dbb4; font-size: 12px; }

.canvas-editor { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; background: white; }
.canvas-toolbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-bottom: 1px solid var(--line); background: #faf9f6; flex-wrap: wrap; }
.tool-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tool-button { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 6px 8px; display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--text); }
.tool-button.active { background: var(--brand); color: white; border-color: var(--brand); }
.tool-button.danger { color: var(--danger); }
.tool-button:disabled { opacity: .45; cursor: not-allowed; }
.tool-size { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.tool-size input { width: 90px; }
.canvas-readonly { position: absolute; z-index: 3; right: 10px; bottom: 10px; background: rgba(255,255,255,.9); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 7px 9px; font-size: 12px; pointer-events: none; }
.board-editor { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.board-pagebar { min-height: 42px; padding: 7px 9px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f8f7f3; }

.pdf-editor { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr); background: #e8e6df; }
.pdf-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; background: white; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.pdf-scroll { min-height: 520px; max-height: 74vh; overflow: auto; padding: 18px; display: flex; align-items: flex-start; justify-content: center; }
.pdf-page { position: relative; background: white; box-shadow: 0 10px 30px rgba(31,38,33,.13); flex: 0 0 auto; }
.pdf-render-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pdf-annotation-layer { position: absolute; inset: 0; }
.pdf-annotation-layer .canvas-editor { height: 100%; min-height: 100% !important; background: transparent; display: block; }
.pdf-annotation-layer .canvas-toolbar { position: sticky; top: 0; z-index: 3; width: max-content; max-width: calc(100% - 10px); margin: 6px; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.pdf-annotation-layer .whiteboard, .annotation-canvas { position: absolute; inset: 0; width: 100%; min-height: 100% !important; height: 100%; background: transparent; touch-action: none; display: block; }
.image-preview { min-height: 520px; display: grid; place-items: center; padding: 16px; overflow: auto; }
.image-preview img { max-width: 100%; height: auto; display: block; }
.text-preview { margin: 0; min-height: 520px; max-height: 75vh; overflow: auto; padding: 20px; white-space: pre-wrap; word-break: break-word; background: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; }
.material-iframe { width: 100%; height: 650px; border: 0; background: white; }
.homework-materials { display: grid; gap: 8px; margin-top: 14px; }
.homework-materials details { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fbfaf7; }
.homework-materials summary { cursor: pointer; padding: 11px 13px; font-weight: 650; }
.homework-material-preview { border-top: 1px solid var(--line); min-height: 260px; background: white; }
.attachment-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.spin { animation: kavlyne-spin .9s linear infinite; }
@keyframes kavlyne-spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .workspace-grid.with-board { grid-template-columns: 1fr; }
  .pdf-scroll { max-height: none; justify-content: flex-start; }
}
@media (max-width: 680px) {
  .canvas-toolbar, .pdf-toolbar, .board-pagebar, .student-lesson-heading { align-items: flex-start; flex-direction: column; }
  .tool-button span { display: none; }
  .pdf-scroll { padding: 8px; }
  .whiteboard { min-height: 430px; }
}
.homework-board-wrap { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.homework-board-wrap .whiteboard { min-height: 430px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(21,27,23,.48); display: grid; place-items: center; padding: 20px; }
.review-modal { width: min(1100px, 100%); max-height: 94vh; background: var(--bg); border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.24); overflow: hidden; display: grid; grid-template-rows: auto minmax(0,1fr); }
.review-modal-head { padding: 17px 19px; background: white; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.review-modal-head h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; }
.review-modal-head p { margin: 5px 0 0; color: var(--muted); }
.review-scroll { overflow: auto; padding: 16px; display: grid; gap: 14px; }
.review-material { min-height: 360px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }

/* Kavlyne v5.1 visual system */
.serif-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 30px; line-height: 1.05; font-weight: 600; margin: 8px 0 10px; }
.card-kicker, .sidebar-caption { text-transform: uppercase; letter-spacing: .18em; font-size: 10px; font-weight: 700; color: #9A8370; }
.sidebar-caption { padding: 0 10px 18px; }
.subscription-mini { display: block; color: var(--muted); margin-bottom: 12px; font-size: 11px; line-height: 1.35; }
.check-row { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand-deep); }
.check-row span { display: grid; gap: 3px; }
.check-row small { color: var(--muted); }
.selection-list { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding-right: 3px; }
.compact-empty { padding: 18px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }

.dashboard-page { max-width: 1180px; margin: 0 auto; }
.dashboard-hero { padding: 44px 48px; border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(115deg, #F1E8DE, #FAF6F1 62%, #EEDFCF); margin-bottom: 20px; }
.dashboard-hero h1 { margin: 14px 0 10px; max-width: 850px; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(42px, 6vw, 74px); line-height: .98; font-weight: 600; letter-spacing: -.03em; }
.dashboard-hero p { margin: 0; font-size: 19px; color: var(--muted); }
.quick-lesson-card { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: 24px; }
.quick-plus { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--brand); color: #fff; }
.quick-lesson-copy h2 { margin: 4px 0 6px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; font-weight: 600; }
.quick-lesson-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.dashboard-stats { margin-top: 18px; }
.dashboard-stats .card { transition: transform .18s ease, border-color .18s ease; }
.dashboard-stats .card:hover { transform: translateY(-2px); border-color: #D6C1AD; }
.calm-card { min-height: 180px; }

.editor-layout { display: grid; grid-template-columns: 280px minmax(0, 760px); gap: 24px; align-items: start; justify-content: center; }
.editor-tools { position: sticky; top: 24px; display: grid; gap: 14px; }
.editor-add-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }
.paper-sheet, .editor-preview { background-color: #fff; min-height: 960px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 50px rgba(75,60,49,.08); padding: 56px 58px; }
.paper-grid { background-image: linear-gradient(#E9E2DA 1px, transparent 1px), linear-gradient(90deg,#E9E2DA 1px,transparent 1px); background-size: 20px 20px; }
.paper-lined { background-image: repeating-linear-gradient(to bottom, transparent 0 27px, #E9E2DA 28px); }
.paper-dots { background-image: radial-gradient(#D8C9BA 1px, transparent 1px); background-size: 20px 20px; }
.material-block { position: relative; margin-bottom: 18px; border: 1px solid transparent; border-radius: 14px; padding: 8px; }
.material-block:hover { border-color: var(--line); background: rgba(255,253,252,.9); }
.block-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.block-input { width: 100%; border: 0; outline: 0; resize: vertical; min-height: 54px; background: transparent; font: inherit; color: var(--text); line-height: 1.6; }
.block-heading .block-input { font-family: "Cormorant Garamond", Georgia, serif; font-size: 36px; line-height: 1.05; font-weight: 600; }
.block-task, .preview-task { border-left: 3px solid var(--brand); padding-left: 16px; }
.block-theory, .preview-theory { background: rgba(241,232,222,.72); padding: 16px; border-radius: 14px; }
.formula-input, .formula-preview { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.solution-space { min-height: 180px; border: 1px dashed #D7C8BA; border-radius: 14px; display: grid; place-items: center; color: #AA9C90; background-image: linear-gradient(#F1ECE6 1px, transparent 1px), linear-gradient(90deg,#F1ECE6 1px,transparent 1px); background-size: 20px 20px; }
.preview-block { margin-bottom: 20px; line-height: 1.65; white-space: pre-wrap; }
.preview-heading h2, .preview-block h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 38px; font-weight: 600; margin: 0 0 12px; }
.block-label { display: block; color: #9A8370; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.web-material-wrap { display: grid; min-height: 600px; grid-template-rows: minmax(520px,1fr) auto; }
.web-material-frame { min-height: 620px; }
.web-material-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel-soft); color: var(--muted); font-size: 12px; }

/* lesson should feel like a tool, not a dashboard */
.lesson-workspace { max-width: none; }
.lesson-toolbar { background: var(--panel); border-radius: 18px; }
.material-pane, .board-pane { border-radius: 20px; box-shadow: none; }
.workspace-grid.with-board { grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); }
.pane-title { background: #FFFEFC; }
.presence-chip { background: var(--panel-soft); }
.whiteboard { background-color: #fff; background-image: linear-gradient(#EEE7DF 1px, transparent 1px), linear-gradient(90deg,#EEE7DF 1px,transparent 1px); }
.tool-button.active { background: var(--brand); border-color: var(--brand); color: var(--text); }

@media (max-width: 980px) {
  .quick-lesson-card { grid-template-columns: auto 1fr; }
  .quick-lesson-card > .button { grid-column: 1 / -1; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-tools { position: static; }
  .paper-sheet { min-height: 780px; }
}

@media (max-width: 680px) {
  .content { padding: 18px 14px 98px; }
  .dashboard-hero { padding: 30px 24px; border-radius: 24px; }
  .dashboard-hero h1 { font-size: 44px; }
  .quick-lesson-card { grid-template-columns: 56px 1fr; padding: 18px; border-radius: 22px; }
  .quick-plus { width: 56px; height: 56px; border-radius: 18px; }
  .quick-lesson-copy h2 { font-size: 29px; }
  .quick-lesson-copy p { font-size: 13px; }
  .sidebar { background: rgba(248,245,241,.97); backdrop-filter: blur(14px); }
  .nav-list { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 66px; min-width: 66px; display: grid !important; place-items: center; gap: 3px; padding: 7px 3px; font-size: 10px; text-align: center; }
  .nav-item span { display: block; max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .paper-sheet, .editor-preview { padding: 28px 20px; min-height: 650px; border-radius: 12px; }
  .web-material-footer { align-items: flex-start; flex-direction: column; }
}
.soft-note { display:flex; gap:9px; align-items:flex-start; border:1px solid var(--line); background:var(--panel-soft); padding:12px 13px; border-radius:14px; color:var(--muted); font-size:13px; line-height:1.5; }
.tool-color input { width:30px; height:30px; padding:2px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.mini-select { border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:10px; padding:7px 9px; font-size:12px; min-height:36px; }
.board-bg-white { background:#fff !important; background-image:none !important; }
.board-bg-grid { background-color:#fff !important; background-image:linear-gradient(#EEE7DF 1px,transparent 1px),linear-gradient(90deg,#EEE7DF 1px,transparent 1px) !important; background-size:20px 20px !important; }
.board-bg-lined { background-color:#fff !important; background-image:repeating-linear-gradient(to bottom,transparent 0 27px,#EEE7DF 28px) !important; background-size:auto !important; }
.board-bg-dots { background-color:#fff !important; background-image:radial-gradient(#D8C9BA 1px,transparent 1px) !important; background-size:20px 20px !important; }
.board-bg-coordinate { background-color:#fff !important; background-image:linear-gradient(#E7DFD7 1px,transparent 1px),linear-gradient(90deg,#E7DFD7 1px,transparent 1px),linear-gradient(#B8AA9E 2px,transparent 2px),linear-gradient(90deg,#B8AA9E 2px,transparent 2px) !important; background-size:20px 20px,20px 20px,100% 50%,50% 100% !important; background-position:0 0,0 0,0 50%,50% 0 !important; background-repeat:repeat,repeat,no-repeat,no-repeat !important; }
.preparation-banner { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:16px 18px; border:1px solid #DDC9B5; background:#F4EADF; border-radius:18px; margin-bottom:14px; }
.preparation-banner > div { display:grid; gap:4px; }
.preparation-banner span { color:var(--muted); font-size:13px; }
.connection-dot { width:8px; height:8px; border-radius:50%; background:#B6ADA5; }
.connection-dot.state-visible,.connection-dot.state-reconnected { background:var(--success); }
.connection-dot.state-hidden { background:var(--warning); }
.connection-dot.state-offline,.connection-dot.state-disconnected,.connection-dot.state-pagehide { background:var(--danger); }
.material-picker-modal { width:min(620px,calc(100vw - 28px)); max-height:82vh; display:grid; gap:16px; }
.material-picker-list { max-height:50vh; }
.after-lesson-modal { width:min(560px,calc(100vw - 28px)); }
.after-lesson-modal p { margin-top:0; }
.after-actions { display:grid; gap:9px; margin-top:18px; }
@media(max-width:680px){.preparation-banner{align-items:flex-start;flex-direction:column}.preparation-banner .button{width:100%}}

/* Student mobile lesson switch: desktop keeps material + board side by side. */
.student-workspace-toggle { display:none; margin-top:14px; padding:4px; border:1px solid var(--line); background:var(--panel-soft); border-radius:14px; gap:4px; }
.student-workspace-toggle button { flex:1; border:0; border-radius:10px; background:transparent; color:var(--muted); padding:10px 12px; font-weight:650; }
.student-workspace-toggle button.active { background:var(--panel); color:var(--text); box-shadow:0 3px 12px rgba(86,67,51,.06); }
@media(max-width:680px){
  .student-workspace-toggle{display:flex}
  .student-workspace .mobile-pane-hidden{display:none}
  .student-workspace{min-height:0!important}
}

.schedule-warning { display:grid; gap:5px; margin:0 0 18px; padding:13px 15px; border-radius:16px; border:1px solid #DDC9B5; background:#F4EADF; color:var(--text); font-size:13px; }
.schedule-warning strong { font-size:14px; }
.working-hours-modal { width:min(620px,calc(100vw - 28px)); max-height:88vh; overflow:auto; }
.working-hours-grid { display:grid; gap:8px; margin:18px 0; }
.working-hour-row { display:grid; grid-template-columns:70px 1fr auto 1fr; align-items:center; gap:9px; }
.working-day { display:flex; gap:8px; align-items:center; color:var(--text); }
.time-input { min-height:40px; padding:8px 10px; }
@media(max-width:520px){.working-hour-row{grid-template-columns:58px 1fr auto 1fr;gap:6px}.time-input{padding:7px 5px;font-size:13px}}

.material-jobs { display:grid; gap:8px; margin:0 0 16px; }
.material-job { display:grid; gap:7px; border:1px solid var(--line); background:var(--panel); border-radius:14px; padding:10px 12px; }
.material-job > div:first-child { display:flex; align-items:center; gap:8px; font-size:13px; }
.material-job small { color:var(--danger); }
.material-job.failed { border-color:#DEC0BD; background:#FBF2F1; }
.material-job-failed-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.material-job-failed-row small { flex:1; min-width:0; }
.job-progress { height:5px; background:var(--panel-soft); border-radius:999px; overflow:hidden; }
.job-progress i { display:block; height:100%; border-radius:999px; background:var(--brand-deep); transition:width .25s ease; }

.board-canvas-scroll { min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; background:#F4F0EB; }
.board-canvas-scroll.sheets .canvas-editor { width:100%; }
.board-canvas-scroll.infinite { max-height:72vh; }
.board-canvas-scroll.infinite .canvas-editor { box-shadow:0 8px 28px rgba(86,67,51,.08); }

@media print {
  body { background:#fff!important; }
  .sidebar, .page-header, .editor-tools { display:none!important; }
  .app-shell, .content, .editor-layout { display:block!important; padding:0!important; margin:0!important; }
  .paper-sheet { width:210mm; min-height:297mm; margin:0 auto!important; padding:16mm!important; border:0!important; border-radius:0!important; box-shadow:none!important; }
  .material-block { break-inside:avoid; }
  .material-block .block-meta, .material-block .mini-button { display:none!important; }
  .block-input { resize:none!important; overflow:visible!important; }
}

/* v5.1 warm palette corrections: beige surfaces keep dark readable text. */
.cta-box, .auth-side { color:var(--text); }
.cta-box p, .auth-side p { color:var(--muted); }
.lesson-banner { background:var(--panel-soft); color:var(--text); border:1px solid var(--line); }
.lesson-banner p, .student-eyebrow, .connection-warning { color:var(--muted); }

.pdf-page { margin-top: 60px; }
.pdf-annotation-layer .canvas-editor { position: relative; height: 100%; }
.pdf-annotation-layer .canvas-toolbar { position: absolute; bottom: 100%; left: 0; width: 100%; }
.pdf-annotation-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; }


/* Critical lesson workspace patch: focus modes, mobile lesson canvas and live controls. */
.lesson-toolbar-divider { width: 1px; height: 26px; background: var(--line); margin: 0 2px; }
.mini-button.active-view { background: var(--brand-soft); border-color: #D8C4AF; color: var(--text); }
.workspace-pane-hidden { display: none !important; }
.workspace-grid.mode-split.with-board { grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr) !important; }
.workspace-grid.mode-material,
.workspace-grid.mode-board { grid-template-columns: minmax(0, 1fr) !important; }
.workspace-grid.mode-material .material-pane,
.workspace-grid.mode-board .board-pane { min-width: 0; }
.material-switcher { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex: 1; }
.material-switcher .select { width: auto; }
.material-select { min-width: min(360px, 44vw); max-width: 520px; }

.lesson-focus-mode {
  position: fixed;
  inset: 0;
  z-index: 120;
  min-height: 100dvh;
  background: var(--bg);
  padding: 10px;
  gap: 10px;
  overflow: hidden;
}
.lesson-focus-mode .lesson-toolbar { border-radius: 12px; padding: 8px 10px; }
.lesson-focus-mode .workspace-grid {
  min-height: 0;
  height: calc(100dvh - 76px);
  gap: 10px;
}
.lesson-focus-mode .material-pane,
.lesson-focus-mode .board-pane {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.lesson-focus-mode .material-pane > :not(.pane-title),
.lesson-focus-mode .board-pane > :not(.pane-title) { flex: 1 1 auto; min-height: 0; }
.lesson-focus-mode .material-iframe { height: 100%; min-height: 0; flex: 1 1 auto; }
.lesson-focus-mode .whiteboard { min-height: 0; height: 100%; }
.lesson-focus-mode .board-canvas-scroll { max-height: none; height: 100%; }
.lesson-focus-mode .pdf-scroll { max-height: none; height: 100%; }

@media (max-width: 1180px) {
  .lesson-toolbar { align-items: flex-start; flex-direction: column; }
  .presence-list { width: 100%; }
  .material-pane-title { align-items: flex-start; gap: 8px; }
  .material-switcher { flex-wrap: wrap; }
}

@media (max-width: 680px) {
  .student-page-in-lesson .student-header {
    max-width: none;
    padding: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(248,245,241,.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
  }
  .student-page-in-lesson .student-header .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .student-page-in-lesson .student-main {
    max-width: none;
    padding: 0 0 18px;
  }
  .student-page-in-lesson .student-hello,
  .student-page-in-lesson .student-homework-section { display: none; }
  .student-page-in-lesson .lesson-banner {
    margin: 0;
    padding: 8px;
    border: 0;
    border-radius: 0;
    min-height: calc(100dvh - 49px);
    background: var(--bg);
  }
  .student-page-in-lesson .student-lesson-heading {
    flex-direction: row;
    align-items: center;
    padding: 2px 2px 6px;
  }
  .student-page-in-lesson .student-lesson-heading h2 { font-size: 18px; margin: 2px 0 0; }
  .student-page-in-lesson .student-eyebrow { font-size: 9px; }
  .student-page-in-lesson .student-workspace-toggle {
    margin-top: 4px;
    position: sticky;
    top: 49px;
    z-index: 25;
    background: var(--panel-soft);
  }
  .student-page-in-lesson .student-workspace {
    margin-top: 6px !important;
    min-height: 0 !important;
    display: block;
  }
  .student-page-in-lesson .material-pane,
  .student-page-in-lesson .board-pane {
    border-radius: 12px;
    min-height: 0;
  }
  .student-page-in-lesson .pane-title {
    padding: 8px 10px;
    min-height: 40px;
  }
  .student-page-in-lesson .material-iframe {
    height: calc(100dvh - 168px);
    min-height: 520px;
  }
  .student-page-in-lesson .whiteboard {
    min-height: calc(100dvh - 168px);
    height: calc(100dvh - 168px);
  }
  .student-page-in-lesson .board-canvas-scroll {
    max-height: none;
    height: calc(100dvh - 210px);
  }
  .student-page-in-lesson .pdf-scroll {
    max-height: none;
    min-height: calc(100dvh - 210px);
  }
  .lesson-focus-mode { padding: 6px; }
  .lesson-focus-mode .lesson-toolbar { max-height: 150px; overflow: auto; }
  .lesson-focus-mode .workspace-grid { height: calc(100dvh - 166px); }
  .material-switcher { width: 100%; justify-content: flex-start; }
  .material-switcher .select, .material-select { min-width: 0; width: 100%; max-width: none; }
}

.lesson-focus-mode ~ .modal-backdrop { z-index: 180; }

/* Foundation v1: active student lesson is a dedicated workspace, not a card in the portal. */
.student-live-page {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--bg, #f8f5f1);
  overflow: hidden;
}
.student-live-shell {
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  box-sizing: border-box;
}
.student-live-topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px;
  background: rgba(255,253,252,.96);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.student-live-title { display:flex; align-items:center; gap:9px; min-width:0; }
.student-live-title > div { min-width:0; display:flex; flex-direction:column; }
.student-live-title strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:14px; }
.student-live-title small { color:var(--muted); font-size:11px; }
.student-live-brand { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; background:var(--gold,#C7A77F); color:#fff; font-family:serif; font-weight:700; flex:0 0 auto; }
.student-live-status { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.student-live-toggle { margin:0 !important; display:flex !important; }
.student-live-workspace {
  min-height: 0 !important;
  height: 100%;
  margin: 0 !important;
  gap: 8px;
}
.student-live-workspace .material-pane,
.student-live-workspace .board-pane {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
}
.student-live-workspace .material-pane > :not(.pane-title),
.student-live-workspace .board-pane > :not(.pane-title) { flex:1 1 auto; min-height:0; }
.student-live-workspace .material-iframe { flex:1 1 auto; width:100%; height:100%; min-height:0; }
.student-live-workspace .pdf-scroll { max-height:none; height:100%; }
.student-live-workspace .board-canvas-scroll { max-height:none; height:100%; }
.student-live-workspace .board-editor { min-height:0; height:100%; display:flex; flex-direction:column; }
.student-live-workspace .board-canvas-scroll { flex:1 1 auto; min-height:0; }
.lesson-presence-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 220;
  max-width: min(360px, calc(100vw - 36px));
  padding: 11px 14px;
  border-radius: 14px;
  background: #3D332D;
  color: #fff;
  box-shadow: 0 12px 35px rgba(61,51,45,.22);
  font-weight: 700;
}

@media (max-width: 820px) {
  .student-live-shell { padding: 4px; gap:4px; }
  .student-live-topbar { border-radius:10px; min-height:42px; padding:3px 6px; }
  .student-live-title strong { font-size:13px; }
  .student-live-title small { display:none; }
  .student-live-brand { width:27px; height:27px; }
  .student-live-status .status-pill { padding:5px 8px; font-size:11px; }
  .student-live-status .connection-warning { font-size:10px; }
  .student-live-toggle { border-radius:10px; padding:3px; }
  .student-live-toggle button { padding:8px 10px; }
  .student-live-workspace { grid-template-columns:1fr !important; }
  .student-live-workspace .mobile-pane-hidden { display:none !important; }
  .student-live-workspace .material-pane,
  .student-live-workspace .board-pane { border-radius:10px; }
  .student-live-pane-title { min-height:34px; padding:7px 9px; font-size:12px; }
  .student-live-workspace .material-iframe { height:100% !important; min-height:0 !important; }
  .student-live-workspace .whiteboard { min-height:420px; }
}


/* Foundation v1.4: mobile presentation mode + send material to board. */
.student-view-label { font-size:12px; color:var(--muted); font-weight:700; white-space:nowrap; }
.lesson-transfer-toast {
  position:fixed; top:18px; right:18px; z-index:221; max-width:min(380px,calc(100vw - 36px));
  padding:11px 14px; border-radius:14px; background:#315b3f; color:#fff; box-shadow:0 12px 35px rgba(49,91,63,.22); font-weight:700;
}
.board-transfer-button { background:var(--brand-soft,#f2e7da); border-color:#d8c4af; font-weight:700; }
.material-transfer-bar { display:flex; justify-content:flex-end; gap:8px; padding:8px 10px; background:#fff; border-bottom:1px solid var(--line); }
.image-preview-wrap { min-height:0; height:100%; display:flex; flex-direction:column; background:#f2f0eb; }
.image-preview-wrap .image-preview { flex:1 1 auto; min-height:0; }
@media (max-width: 820px) {
  /* On a phone the student sees exactly one full-screen workspace. Tutor decides what is presented. */
  .student-live-shell { grid-template-rows:auto minmax(0,1fr); }
  .student-live-toggle { display:none !important; }
  .student-live-workspace { min-height:0; height:100%; }
  .student-live-workspace .material-pane,
  .student-live-workspace .board-pane { height:100%; min-height:0; }
  .student-live-workspace .whiteboard { min-height:100%; height:100%; }
  .student-live-workspace .board-canvas-scroll { height:100%; min-height:0; }
}


/* Foundation v1.4.2: resilient PDF viewer + explicit object selection UX. */
.pdf-annotation-readonly { pointer-events:none; }
.pdf-mode-read .pdf-page { cursor:grab; }
.pdf-mode-read .pdf-page:active { cursor:grabbing; }
.pdf-mode-actions, .pdf-zoom-actions, .pdf-page-actions { flex-wrap:wrap; }
.canvas-selection-hint { position:absolute; z-index:6; left:12px; bottom:12px; max-width:min(520px,calc(100% - 24px)); padding:8px 11px; border:1px solid #D8C4AF; border-radius:10px; background:rgba(255,252,248,.96); color:var(--text); font-size:12px; font-weight:700; box-shadow:0 5px 16px rgba(61,51,45,.10); pointer-events:none; }
@media (max-width: 820px) {
  .student-live-workspace .pdf-editor { min-height:0; height:100%; }
  .student-live-workspace .pdf-toolbar { flex:0 0 auto; padding:6px; gap:5px; flex-direction:row; align-items:center; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; }
  .student-live-workspace .pdf-toolbar::-webkit-scrollbar { display:none; }
  .student-live-workspace .pdf-toolbar .row-actions { flex:0 0 auto; gap:4px; flex-wrap:nowrap; }
  .student-live-workspace .pdf-toolbar .mini-button { min-height:36px; padding:7px 9px; white-space:nowrap; }
  .student-live-workspace .pdf-toolbar .helper { white-space:nowrap; font-size:12px; }
  .student-live-workspace .pdf-scroll { flex:1 1 auto; min-height:0; height:auto; padding:6px; justify-content:flex-start; }
  .student-live-workspace .pdf-page { margin-top:48px; }
  .student-live-workspace .pdf-mode-read .pdf-annotation-layer .canvas-toolbar { display:none; }
  .pdf-preset { font-weight:700; }
}

/* =========================================================
   KAVLYNE CABINET V2 — warm editorial / old-money interface
   ========================================================= */
:root {
  --kav-ink: #201f19;
  --kav-olive: #3f432b;
  --kav-olive-2: #53583a;
  --kav-gold: #b18b42;
  --kav-gold-soft: #d9c08b;
  --kav-cream: #fbf8f1;
  --kav-paper: #fffdf8;
  --kav-paper-2: #f7f1e7;
  --kav-line: #e6dccb;
  --kav-muted: #847b6f;
  --kav-green: #6f8a52;
  --kav-red: #b35a55;
  --kav-shadow: 0 14px 40px rgba(74, 58, 33, .07);
}

body {
  background:
    radial-gradient(circle at 70% -10%, rgba(222, 207, 173, .18), transparent 32%),
    var(--kav-cream);
  color: var(--kav-ink);
}

.kav-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  background: var(--kav-cream);
}

.kav-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--kav-line);
  background: rgba(251, 248, 241, .96);
  display: flex;
  flex-direction: column;
  z-index: 70;
}

.kav-logo {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 3px 8px 46px;
  color: var(--kav-ink);
}
.kav-logo-sprig { color: var(--kav-gold); font-size: 26px; height: 18px; transform: rotate(-18deg); }
.kav-logo strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 39px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.035em;
}
.kav-logo small {
  text-transform: uppercase;
  letter-spacing: .30em;
  font-size: 7px;
  color: #766f63;
}

.kav-nav { display: grid; gap: 8px; }
.kav-nav-item {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-radius: 12px;
  color: #302f28;
  font-family: Georgia, serif;
  font-size: 16px;
  transition: .18s ease;
}
.kav-nav-item:hover { background: rgba(221, 205, 172, .18); }
.kav-nav-item.active {
  color: #2c2d20;
  background: linear-gradient(90deg, #efe5d2, #f5eee1);
  box-shadow: inset 0 0 0 1px rgba(177, 139, 66, .08);
}
.kav-nav-item.active svg { color: #9a762e; }

.kav-sidebar-bottom {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #d8c7a8;
  display: grid;
  gap: 8px;
}
.kav-owner-link { padding-inline: 14px; font-size: 15px; }
.kav-owner-link svg:last-child { margin-left: auto; color: var(--kav-gold); }
.kav-owner-gear { font-size: 20px; }
.kav-sidebar-logout {
  border: 0;
  background: transparent;
  color: var(--kav-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 15px;
  font-size: 12px;
}

.kav-main-shell { min-width: 0; }
.kav-topbar {
  height: 78px;
  padding: 0 32px 0 42px;
  border-bottom: 1px solid var(--kav-line);
  background: rgba(255, 253, 248, .82);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 60;
}
.kav-topbar-phrase {
  flex: 1;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #5f5a4d;
  font-family: Georgia, serif;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 9px;
}
.kav-topbar-phrase i { height: 1px; background: #b99959; flex: 1; max-width: 260px; }
.kav-topbar-actions { display: flex; align-items: center; gap: 20px; }
.kav-notification-wrap { position: relative; }
.kav-icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  position: relative;
  color: #2e2e26;
}
.kav-icon-button:hover { background: #f1e9da; }
.kav-icon-button.small { width: 32px; height: 32px; }
.kav-mobile-logout { display: none; }
.kav-notification-dot {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--kav-gold);
  color: white;
  font: 700 9px/1 ui-sans-serif, sans-serif;
}
.kav-profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid var(--kav-line);
}
.kav-profile-button { border-top: 0; border-right: 0; border-bottom: 0; background: transparent; cursor: pointer; color: inherit; text-align: left; }
.kav-profile-button:hover .kav-profile-avatar { box-shadow: 0 0 0 3px rgba(183,148,80,.14); }
.kav-profile-modal { width: min(720px, calc(100vw - 24px)); max-height: min(760px, calc(100vh - 28px)); overflow: auto; padding: 20px; }
.kav-profile-divider { height: 1px; background: var(--kav-line); margin: 20px 0; }
.kav-profile-avatar,
.kav-avatar-soft {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e9dfcb;
  color: #514a3d;
  font-family: Georgia, serif;
  flex: 0 0 auto;
}
.kav-profile-chip > span:last-child { display: grid; gap: 2px; }
.kav-profile-chip strong { font: 500 15px/1.2 Georgia, serif; }
.kav-profile-chip small { color: var(--kav-muted); font-size: 10px; }

.kav-notification-popover {
  position: absolute;
  top: 50px;
  right: -70px;
  width: min(390px, calc(100vw - 30px));
  background: var(--kav-paper);
  border: 1px solid var(--kav-line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(52, 44, 30, .16);
  padding: 12px;
  z-index: 100;
}
.kav-popover-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.kav-popover-list { display: grid; gap: 6px; max-height: 430px; overflow: auto; }
.kav-popover-item { display: grid; gap: 3px; padding: 10px; border-radius: 10px; border: 1px solid transparent; }
.kav-popover-item:hover { background: #f8f2e8; }
.kav-popover-item.unread { border-color: #dfceb0; background: #fbf5e9; }
.kav-popover-item strong { font-size: 13px; }
.kav-popover-item span, .kav-popover-item small { color: var(--kav-muted); font-size: 11px; line-height: 1.45; }
.kav-empty-compact { padding: 22px 8px; text-align: center; color: var(--kav-muted); font-size: 12px; }

.kav-content { min-width: 0; padding: 26px 34px 52px; }
.kav-page { width: min(1180px, 100%); margin: 0 auto; }
.kav-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.kav-page-heading.compact { margin-top: 12px; }
.kav-page-heading h1,
.kav-dashboard-intro h1 {
  font: 500 clamp(34px, 4vw, 46px)/1.02 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.025em;
  margin: 0;
}
.kav-page-heading p,
.kav-dashboard-intro p { margin: 9px 0 0; color: var(--kav-muted); font: 15px/1.5 Georgia, serif; }

.kav-card {
  background: rgba(255, 253, 248, .92);
  border: 1px solid var(--kav-line);
  border-radius: 13px;
  box-shadow: var(--kav-shadow);
}
.kav-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.kav-card-head small { display: block; color: var(--kav-muted); font-size: 11px; margin-bottom: 4px; }
.kav-card-head h2 { margin: 0; font: 500 23px/1.1 Georgia, serif; }

.kav-dashboard-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 14px 8px 26px;
}
.kav-dashboard-intro blockquote {
  max-width: 300px;
  margin: 0;
  color: #716a5e;
  font: italic 12px/1.55 Georgia, serif;
  text-align: right;
  position: relative;
  padding: 10px 0 0 32px;
}
.kav-dashboard-intro blockquote span { position: absolute; left: 0; top: -9px; color: #d5bd89; font-size: 46px; }
.kav-dashboard-hero-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .85fr); gap: 16px; }
.kav-next-lesson-card { padding: 18px 22px; }
.kav-next-lesson-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--kav-line); display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.kav-next-time { display: grid; border-right: 1px solid var(--kav-line); }
.kav-next-time strong { font: 500 28px/1 Georgia, serif; }
.kav-next-time span { color: var(--kav-muted); font-size: 11px; margin-top: 4px; }
.kav-next-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kav-next-person > div { min-width: 0; display: grid; gap: 4px; }
.kav-next-person strong { font: 500 17px/1.1 Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kav-next-person span { color: var(--kav-muted); font-size: 12px; }
.kav-round-link {
  width: 38px;
  height: 38px;
  border: 1px solid #e5d6ba;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f8f0df;
  color: #8a692d;
}
.kav-round-link.small { width: 31px; height: 31px; }
.kav-create-lesson-card {
  min-height: 180px;
  border-radius: 13px;
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: linear-gradient(145deg, #464b30, #323621);
  color: #fffdf6;
  box-shadow: 0 16px 34px rgba(51, 55, 33, .18);
}
.kav-create-lesson-card h2 { font: 500 25px/1.1 Georgia, serif; margin: 0 0 8px; }
.kav-create-lesson-card p { margin: 0; color: #e6e0d0; font: 12px/1.55 Georgia, serif; }
.kav-create-circle { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #c8a45d; color: #d8b469; border-radius: 50%; }

.kav-history-card { margin-top: 16px; padding: 18px 20px 14px; }
.kav-text-link { color: #6d6456; font-size: 12px; display: flex; gap: 4px; align-items: center; }
.kav-history-table { margin-top: 14px; }
.kav-history-row { display: grid; grid-template-columns: 90px 1.15fr 1.25fr 1.8fr 36px; gap: 12px; align-items: center; min-height: 58px; padding: 8px 10px; border-top: 1px solid #ece4d7; font-size: 12px; }
.kav-history-row.header { min-height: 34px; border: 0; border-radius: 8px; background: #f2ede4; color: #726a5f; font-size: 10px; }
.kav-history-row .muted { color: var(--kav-muted); line-height: 1.4; }
.kav-person-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kav-person-cell i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eee4d3; font: normal 13px Georgia, serif; }
.kav-person-cell b { font: 500 13px Georgia, serif; }
.kav-dashboard-footnote { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 0 5px; color: var(--kav-muted); font-size: 10px; }

.kav-back-button,
.kav-icon-text,
.kav-quiet-button {
  border: 0;
  background: transparent;
  color: #5d574c;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
}
.kav-primary-button,
.kav-secondary-button,
.kav-end-lesson-button {
  min-height: 44px;
  border-radius: 9px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 13px;
}
.kav-primary-button { background: var(--kav-olive); color: white; }
.kav-primary-button:hover { background: #30341f; }
.kav-primary-button.large { min-height: 52px; width: 100%; font-size: 14px; }
.kav-secondary-button { background: var(--kav-paper); color: #39372f; border-color: var(--kav-line); }
.kav-secondary-button.full { width: 100%; }
.kav-secondary-button.compact { padding-inline: 12px; }
.kav-end-lesson-button { background: var(--kav-olive); color: white; min-width: 150px; }

.kav-create-layout { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr); gap: 18px; align-items: start; }
.kav-create-form-card { padding: 24px; }
.kav-create-form { display: grid; gap: 18px; }
.kav-segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #f2ece1; border-radius: 10px; }
.kav-segmented button { min-height: 42px; border: 0; border-radius: 8px; background: transparent; color: #6d6559; }
.kav-segmented button.active { background: var(--kav-paper); color: #2c2b25; box-shadow: 0 4px 14px rgba(66, 52, 34, .08); }
.label-optional { color: #aaa093; font-size: 10px; margin-left: 4px; font-weight: 400; }
.kav-board-auto-note { display: flex; gap: 12px; padding: 14px; border-radius: 10px; background: #f5efe4; color: #514d43; }
.kav-board-auto-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #e8dbc1; }
.kav-board-auto-note div { display: grid; gap: 3px; }
.kav-board-auto-note strong { font-size: 12px; }
.kav-board-auto-note span { color: var(--kav-muted); font-size: 10px; }
.kav-lesson-list-card { padding: 20px; }
.kav-lesson-list { margin-top: 14px; display: grid; }
.kav-lesson-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 3px; border-top: 1px solid var(--kav-line); }
.kav-lesson-row > div:first-child { display: grid; gap: 4px; min-width: 0; }
.kav-lesson-row strong { font: 500 14px Georgia, serif; }
.kav-lesson-row span { color: var(--kav-muted); font-size: 10px; }

/* Lesson room */
.kav-lesson-stage { width: min(1450px, 100%); margin: 0 auto; }
.kav-lesson-topbar {
  display: grid;
  grid-template-columns: auto minmax(160px, .7fr) auto minmax(360px, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--kav-line);
}
.kav-lesson-title-block { display: grid; padding-left: 16px; border-left: 1px solid var(--kav-line); min-width: 0; }
.kav-lesson-title-block strong { font: 500 20px/1.05 Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kav-lesson-title-block span { color: var(--kav-muted); font-size: 11px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kav-lesson-live-status { display: flex; gap: 7px; align-items: center; color: #65734b; font-size: 11px; white-space: nowrap; }
.kav-lesson-top-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.kav-lesson-error { margin-top: 10px; }
.kav-preparation-strip { margin-top: 10px; padding: 10px 14px; border-radius: 9px; background: #f2ead9; display: flex; gap: 10px; align-items: center; font-size: 11px; color: #6c5c3d; }
.kav-preparation-strip span { color: #887a63; }
.kav-lesson-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.kav-lesson-tabs { display: inline-flex; padding: 4px; border-radius: 9px; background: #f1ebdf; }
.kav-lesson-tabs button { min-width: 135px; min-height: 39px; border: 0; border-radius: 7px; background: transparent; display: flex; align-items: center; justify-content: center; gap: 7px; color: #645d52; }
.kav-lesson-tabs button.active { background: #eadcc0; color: #5f481d; box-shadow: inset 0 0 0 1px #dfc795; }
.kav-lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.kav-lesson-workarea { min-width: 0; }
.kav-stage-pane { min-height: 620px; background: var(--kav-paper); border: 1px solid var(--kav-line); border-radius: 12px; overflow: hidden; box-shadow: var(--kav-shadow); }
.kav-stage-pane-head { min-height: 58px; border-bottom: 1px solid var(--kav-line); padding: 9px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.kav-stage-pane-head > div:first-child { display: grid; gap: 2px; }
.kav-stage-pane-head small { color: var(--kav-muted); font-size: 9px; }
.kav-stage-pane-head strong { font: 500 14px Georgia, serif; }
.kav-stage-pane .board-editor { border: 0; border-radius: 0; }
.kav-stage-pane .board-shell { border-radius: 0 0 11px 11px; }
.kav-empty-stage { min-height: 600px; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; color: var(--kav-muted); }
.kav-empty-stage strong { color: #4a463d; font: 500 18px Georgia, serif; }
.kav-empty-stage span { max-width: 390px; font-size: 11px; line-height: 1.5; }

.kav-lesson-sidepanel { display: grid; gap: 10px; }
.kav-side-section { padding: 14px; border: 1px solid var(--kav-line); border-radius: 11px; background: rgba(255,253,248,.92); box-shadow: 0 8px 24px rgba(70,56,34,.04); }
.kav-side-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #474338; }
.kav-side-title strong { font: 500 14px Georgia, serif; }
.kav-participant-list { display: grid; gap: 7px; }
.kav-participant-list .presence-chip { display: flex; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 8px; background: #faf6ef; font-size: 10px; line-height: 1.35; }
.kav-side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; }
.kav-side-toggle button { min-height: 36px; border: 1px solid var(--kav-line); border-radius: 8px; background: white; color: #6c655a; }
.kav-side-toggle button.active { background: var(--kav-olive); color: white; border-color: var(--kav-olive); }
.kav-side-help { margin: 0 0 10px; color: var(--kav-muted); font-size: 10px; line-height: 1.5; }
.kav-side-actions { padding-block: 8px; }
.kav-quiet-button { width: 100%; justify-content: flex-start; font-size: 11px; }

.kav-empty-state { padding: 28px 12px; text-align: center; color: var(--kav-muted); font-size: 12px; }
.kav-empty-state.compact { padding: 20px 8px; }

/* Bring legacy pages into the same visual system while their workflows stay intact. */
.kav-content > .page-header,
.kav-content > :not(.kav-page):not(.kav-lesson-stage) .page-header { max-width: 1180px; margin-inline: auto; }
.kav-content .page-header h1 { font: 500 39px/1.05 "Cormorant Garamond", Georgia, serif; color: var(--kav-ink); }
.kav-content .page-header p { font: 14px/1.5 Georgia, serif; color: var(--kav-muted); }
.kav-content .card { border-radius: 12px; border-color: var(--kav-line); box-shadow: 0 8px 28px rgba(70,56,34,.04); }
.kav-content .button:not(.danger) { border-radius: 9px; }
.kav-content .button:not(.secondary):not(.ghost):not(.danger) { background: var(--kav-olive); color: white; }
.kav-content .input,
.kav-content .select,
.kav-content .textarea { border-radius: 9px; background: #fffdfa; border-color: var(--kav-line); }

/* Responsive cabinet */
@media (max-width: 1100px) {
  .kav-shell { grid-template-columns: 214px minmax(0,1fr); }
  .kav-sidebar { padding-inline: 12px; }
  .kav-nav-item { padding-inline: 12px; font-size: 14px; }
  .kav-topbar { padding-inline: 24px; }
  .kav-topbar-phrase { display: none; }
  .kav-dashboard-hero-grid { grid-template-columns: 1fr; }
  .kav-create-lesson-card { min-height: 130px; }
  .kav-history-row { grid-template-columns: 72px 1fr 1.1fr 1.3fr 34px; }
  .kav-lesson-topbar { grid-template-columns: auto 1fr auto; }
  .kav-lesson-live-status { display: none; }
  .kav-lesson-top-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .kav-lesson-layout { grid-template-columns: 1fr; }
  .kav-lesson-sidepanel { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .kav-shell { display: block; padding-bottom: 67px; }
  .kav-sidebar {
    position: fixed;
    inset: auto 0 0 0;
    height: 67px;
    width: 100%;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    border: 1px solid var(--kav-line);
    border-width: 1px 0 0;
    background: rgba(255,253,248,.98);
    backdrop-filter: blur(14px);
    z-index: 200;
  }
  .kav-logo, .kav-sidebar-bottom { display: none; }
  .kav-nav { display: flex; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .kav-nav::-webkit-scrollbar { display: none; }
  .kav-nav-item { min-height: 50px; min-width: 76px; flex: 0 0 auto; padding: 5px 3px; border-radius: 9px; justify-content: center; flex-direction: column; gap: 2px; font: 9px/1.1 ui-sans-serif,sans-serif; }
  .kav-nav-item svg { width: 18px; height: 18px; }
  .kav-topbar { height: 58px; padding: 0 12px; }
  .kav-topbar-actions { gap: 6px; }
  .kav-profile-chip { padding-left: 4px; border: 0; }
  .kav-profile-chip > span:last-child { display: none; }
  .kav-profile-avatar { width: 34px; height: 34px; }
  .kav-mobile-logout { display: grid; width: 38px; height: 38px; }
  .kav-notification-popover { right: -6px; top: 44px; width: min(360px, calc(100vw - 20px)); }
  .kav-content { padding: 14px 10px 28px; }
  .kav-dashboard-intro { padding: 8px 2px 16px; }
  .kav-dashboard-intro blockquote { display: none; }
  .kav-dashboard-intro h1 { font-size: 34px; }
  .kav-next-lesson-body { grid-template-columns: 82px 1fr auto; gap: 9px; }
  .kav-next-time strong { font-size: 22px; }
  .kav-create-lesson-card { padding: 17px; grid-template-columns: auto 1fr; }
  .kav-create-lesson-card > svg { display: none; }
  .kav-history-row.header { display: none; }
  .kav-history-row { grid-template-columns: 52px minmax(0,1fr) 34px; gap: 8px; }
  .kav-history-row > span:nth-child(3), .kav-history-row > span:nth-child(4) { display: none; }
  .kav-create-layout { grid-template-columns: 1fr; }
  .kav-lesson-topbar { display: flex; flex-wrap: wrap; padding-top: 0; }
  .kav-lesson-title-block { flex: 1; min-width: 160px; }
  .kav-lesson-top-actions { width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; }
  .kav-lesson-top-actions::-webkit-scrollbar { display: none; }
  .kav-lesson-top-actions button { white-space: nowrap; flex: 0 0 auto; }
  .kav-lesson-tabs-row { position: sticky; top: 58px; z-index: 55; background: var(--kav-cream); padding: 8px 0; }
  .kav-lesson-tabs { width: 100%; }
  .kav-lesson-tabs button { flex: 1; min-width: 0; }
  .kav-lesson-tabs-row > .kav-icon-text { display: none; }
  .kav-stage-pane { min-height: calc(100dvh - 210px); }
  .kav-stage-pane .board-shell { height: calc(100dvh - 250px); min-height: 470px; }
  .kav-lesson-sidepanel { grid-template-columns: 1fr; }
  .kav-lesson-sidepanel .kav-side-section:not(:first-child) { display: none; }
}
.kav-participant-list .presence-chip { display:flex; align-items:center; gap:9px; }
.kav-participant-avatar { width:32px; height:32px; border-radius:50%; background:#eee4d3; display:grid; place-items:center; font:500 12px Georgia,serif; flex:0 0 auto; }
.kav-participant-copy { min-width:0; display:grid; gap:3px; flex:1; }
.kav-participant-copy strong { font:500 12px Georgia,serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kav-participant-copy small { display:flex; align-items:center; gap:5px; color:var(--kav-muted); font-size:9px; }
.kav-prep-board-layout { display:grid; grid-template-columns:130px minmax(0,1fr); gap:12px; align-items:start; }
.kav-prep-pages { display:grid; gap:8px; }
.kav-prep-page-thumb { min-height:84px; border:1px solid var(--kav-line); border-radius:10px; background:#fffdf8; padding:10px; display:grid; grid-template-columns:auto 1fr auto; align-items:end; gap:6px; text-align:left; color:#625b50; }
.kav-prep-page-thumb.active { border-color:#c7a75f; box-shadow:0 0 0 2px rgba(199,167,95,.12); }
.kav-prep-page-thumb span { font:500 20px Georgia,serif; color:#98742d; }
.kav-prep-page-thumb strong { font-size:10px; align-self:end; }
.kav-prep-page-thumb i { color:#a87571; }
.kav-prep-board-stage { padding:0; overflow:hidden; }
.kav-prep-board-stage .board-shell { height:72dvh; min-height:650px; }
@media (max-width:760px){.kav-prep-board-layout{grid-template-columns:1fr}.kav-prep-pages{display:flex;overflow-x:auto}.kav-prep-page-thumb{min-width:110px;min-height:60px}.kav-prep-board-stage .board-shell{min-height:calc(100dvh - 230px);height:calc(100dvh - 230px)}}

/* =========================================================
   KAVLYNE V2 — schedule / students / materials / homework / store / owner
   ========================================================= */
.kav-page-actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.kav-link-button { border:0; background:transparent; color:#6f6659; display:inline-flex; align-items:center; gap:6px; padding:7px 8px; font-size:12px; }
.kav-link-button:hover { color:#302d27; }
.kav-icon-button.danger, .kav-profile-bottom-actions .danger { color:#a85f59; }
.kav-primary-button.full, .kav-secondary-button.full { width:100%; }
.kav-primary-button.compact { min-height:34px; padding:7px 12px; font-size:11px; }
.kav-modal-card { width:min(520px,calc(100vw - 26px)); padding:20px; max-height:90vh; overflow:auto; }
.kav-modal-card.wide { width:min(680px,calc(100vw - 26px)); }
.kav-modal-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:16px; }
.kav-modal-head small { color:var(--kav-muted); font-size:10px; }
.kav-modal-head h2 { margin:3px 0 0; font:500 27px/1 Georgia,serif; }
.kav-modal-checklist { display:grid; gap:7px; max-height:260px; overflow:auto; border:1px solid var(--kav-line); border-radius:10px; padding:9px; background:#fffdf8; }
.kav-modal-checklist label { display:flex; align-items:center; gap:9px; min-height:36px; padding:4px 6px; border-radius:8px; }
.kav-modal-checklist label:hover { background:#f7f0e4; }
.kav-soft-label { display:inline-flex; align-items:center; width:max-content; min-height:25px; padding:0 9px; border-radius:999px; background:#f2eadc; color:#786b55; font-size:10px; }
.kav-status-dot { width:7px; height:7px; display:inline-block; border-radius:50%; background:#6f8a52; margin-right:6px; }
.kav-status-dot.paused { background:#cf9e3f; }
.muted { color:var(--kav-muted); }

/* Schedule */
.kav-schedule-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:16px; align-items:start; }
.kav-calendar-card { padding:14px; overflow:hidden; }
.kav-calendar-toolbar { min-height:48px; display:grid; grid-template-columns:auto auto 1fr auto; align-items:center; gap:10px; padding:1px 1px 12px; }
.kav-calendar-toolbar h2 { margin:0; text-align:center; font:500 25px Georgia,serif; }
.kav-calendar-nav { display:flex; gap:4px; }
.kav-calendar-nav button { width:34px; height:34px; border:1px solid var(--kav-line); border-radius:9px; background:#fffdf8; display:grid; place-items:center; }
.kav-calendar-weekdays { display:grid; grid-template-columns:repeat(7,1fr); border:1px solid var(--kav-line); border-bottom:0; border-radius:10px 10px 0 0; overflow:hidden; background:#f6f0e5; }
.kav-calendar-weekdays span { min-height:31px; display:grid; place-items:center; color:#746b5d; font:11px Georgia,serif; border-right:1px solid var(--kav-line); }
.kav-calendar-weekdays span:last-child { border-right:0; }
.kav-calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); border-left:1px solid var(--kav-line); border-top:1px solid var(--kav-line); }
.kav-calendar-day { min-height:118px; padding:6px; position:relative; border-right:1px solid var(--kav-line); border-bottom:1px solid var(--kav-line); background:rgba(255,253,248,.82); }
.kav-calendar-day.outside { background:#faf7f1; color:#b3aa9d; }
.kav-calendar-day.today { box-shadow:inset 0 0 0 1px #c69b48; }
.kav-calendar-number { font:11px Georgia,serif; color:#5d564a; }
.kav-day-events { display:grid; gap:3px; margin-top:5px; }
.kav-calendar-event { border:0; border-radius:7px; padding:5px 6px; display:grid; gap:1px; text-align:left; background:#f7e8da; color:#5d4a3e; overflow:hidden; }
.kav-calendar-event.group { background:#e9efe0; color:#4a583d; }
.kav-calendar-event.status-completed { opacity:.52; }
.kav-calendar-event.status-cancelled { opacity:.4; text-decoration:line-through; }
.kav-calendar-event b { font-size:9px; }
.kav-calendar-event span { font:500 10px Georgia,serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kav-calendar-event small { font-size:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kav-more-events { color:var(--kav-muted); font-size:8px; }
.kav-upcoming-strip { margin-top:10px; padding:10px 4px 0; border-top:1px solid var(--kav-line); }
.kav-upcoming-strip > strong { display:block; margin-bottom:7px; font:500 13px Georgia,serif; }
.kav-upcoming-strip > div { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.kav-upcoming-strip button { min-height:66px; border:1px solid var(--kav-line); border-radius:9px; background:#fffdf8; display:grid; grid-template-columns:auto 1fr; gap:2px 9px; align-content:center; text-align:left; padding:8px; }
.kav-upcoming-strip b { grid-row:1 / span 2; font:500 20px Georgia,serif; }
.kav-upcoming-strip span { font:500 11px Georgia,serif; }
.kav-upcoming-strip small { color:var(--kav-muted); font-size:9px; }
.kav-schedule-detail { padding:17px; min-height:430px; position:sticky; top:94px; }
.kav-detail-head { display:flex; justify-content:space-between; align-items:center; }
.kav-detail-actions { display:flex; gap:4px; }
.kav-schedule-detail h2 { margin:14px 0 5px; font:500 30px Georgia,serif; }
.kav-detail-list { margin:18px 0; border-top:1px solid var(--kav-line); }
.kav-detail-list > div { display:grid; grid-template-columns:78px 1fr; gap:10px; padding:10px 0; border-bottom:1px solid var(--kav-line); font-size:11px; }
.kav-detail-list b { color:var(--kav-muted); font-weight:500; }
.kav-detail-buttons { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:8px; }
.kav-detail-empty { min-height:300px; display:grid; justify-items:center; align-content:center; text-align:center; gap:8px; color:var(--kav-muted); }
.kav-detail-empty strong { font:500 17px Georgia,serif; color:#49453c; }
.kav-detail-empty span { max-width:260px; font-size:11px; line-height:1.5; }

/* Students */
.kav-students-tools { display:flex; gap:8px; align-items:center; margin-bottom:12px; }
.kav-search { min-height:44px; display:flex; align-items:center; gap:8px; border:1px solid var(--kav-line); border-radius:10px; background:#fffdf8; padding:0 12px; flex:1; color:#857c70; }
.kav-search input { width:100%; border:0; outline:0; background:transparent; color:var(--kav-ink); }
.kav-search.large { min-height:52px; max-width:620px; }
.kav-filter { min-height:40px; border:1px solid var(--kav-line); border-radius:9px; background:#fffdf8; padding:0 13px; color:#6d655a; }
.kav-filter.active { background:#eee4d1; color:#55411f; }
.kav-master-detail { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:14px; align-items:start; }
.kav-master-card, .kav-profile-panel { padding:14px; }
.kav-profile-panel { position:sticky; top:94px; }
.kav-segment-tabs { display:flex; align-items:center; gap:4px; margin-bottom:10px; border-bottom:1px solid var(--kav-line); }
.kav-segment-tabs button { min-height:39px; border:0; background:transparent; padding:0 12px; color:#756c60; border-bottom:2px solid transparent; }
.kav-segment-tabs button.active { color:#2e2c26; border-bottom-color:#9f792e; }
.kav-segment-tabs b { display:inline-grid; place-items:center; min-width:20px; height:20px; border-radius:999px; background:#ede3d1; margin-left:4px; font-size:10px; }
.kav-people-head, .kav-people-row { display:grid; grid-template-columns:1.5fr 1.2fr .65fr 30px; gap:10px; align-items:center; }
.kav-people-head { min-height:36px; padding:0 9px; color:#766d60; font-size:10px; background:#f3eee5; border-radius:8px; }
.kav-people-row { width:100%; min-height:58px; padding:7px 9px; border:0; border-bottom:1px solid #eee6da; background:transparent; text-align:left; color:#443f36; }
.kav-people-row:hover, .kav-people-row.selected { background:#fbf4e8; border-radius:8px; }
.kav-people-row > span:nth-child(2), .kav-people-row > span:nth-child(3) { font-size:10px; color:#726a5f; }
.kav-profile-title { display:flex; align-items:center; gap:12px; }
.kav-profile-title h2 { margin:0 0 3px; font:500 26px Georgia,serif; }
.kav-profile-title > div > span { font-size:10px; color:#6f685d; }
.kav-profile-big-avatar { width:52px; height:52px; border-radius:50%; background:#eee4d3; display:grid; place-items:center; font:500 19px Georgia,serif; flex:0 0 auto; }
.kav-profile-big-avatar.small { width:38px; height:38px; font-size:14px; }
.kav-profile-actions { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:15px 0; }
.kav-profile-action { min-height:42px; border:1px solid var(--kav-line); border-radius:9px; background:#fffdf8; display:flex; align-items:center; justify-content:center; gap:6px; font-size:10px; }
.kav-profile-section { border-top:1px solid var(--kav-line); padding-top:13px; margin-top:13px; display:grid; gap:8px; }
.kav-profile-section > small { color:var(--kav-muted); font-size:10px; }
.kav-copy-box { min-height:38px; border:1px solid var(--kav-line); border-radius:8px; background:#faf6ef; display:flex; align-items:center; gap:8px; padding:0 8px 0 10px; min-width:0; }
.kav-copy-box span { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:9px; color:#756d61; }
.kav-copy-box button { width:27px; height:27px; border:0; background:transparent; }
.kav-member-list { display:grid; gap:5px; }
.kav-member-list > div { min-height:34px; display:grid; grid-template-columns:1fr auto auto; gap:7px; align-items:center; background:#faf6ef; border-radius:8px; padding:5px 8px; font-size:10px; }
.kav-member-list code { color:#8b6a2e; }
.kav-member-list button { border:0; background:transparent; }
.kav-profile-bottom-actions { grid-template-columns:1fr 1fr 1fr; }
.kav-profile-bottom-actions button { border:0; background:transparent; display:flex; gap:5px; align-items:center; justify-content:center; min-height:34px; font-size:9px; }

/* Materials */
.kav-material-tabs { display:grid; grid-template-columns:repeat(5,1fr); gap:7px; margin-bottom:13px; }
.kav-material-tabs button { min-height:54px; border:1px solid var(--kav-line); border-radius:10px; background:#fffdf8; display:flex; align-items:center; justify-content:center; gap:7px; color:#5f594f; position:relative; }
.kav-material-tabs button.active { background:var(--kav-olive); color:white; border-color:var(--kav-olive); }
.kav-material-tabs button:disabled { opacity:.55; }
.kav-material-tabs small { position:absolute; right:6px; top:5px; font-size:7px; text-transform:uppercase; }
.kav-material-search-row { display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.kav-breadcrumb { display:flex; gap:5px; align-items:center; flex-wrap:wrap; }
.kav-breadcrumb button { border:0; background:transparent; display:flex; align-items:center; gap:5px; color:#746b5e; font-size:10px; }
.kav-breadcrumb span { display:flex; align-items:center; gap:3px; }
.kav-material-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:13px; align-items:start; }
.kav-folder-panel { padding:14px; position:sticky; top:94px; }
.kav-folder-panel h2 { margin:0 0 10px; font:500 20px Georgia,serif; }
.kav-folder-create { display:grid; grid-template-columns:1fr auto; gap:5px; }
.kav-folder-list { display:grid; gap:5px; margin-top:10px; }
.kav-folder-list > div { display:grid; grid-template-columns:1fr auto; gap:5px; align-items:center; min-height:36px; border-bottom:1px solid #efe7db; }
.kav-folder-name { border:0; background:transparent; display:flex; gap:7px; align-items:center; text-align:left; font-size:10px; color:#5f584d; min-width:0; }
.kav-folder-list > div > div { display:flex; gap:2px; }
.kav-folder-list > div > div button { width:26px; height:26px; border:0; background:transparent; color:#776f64; }
.kav-folder-list .danger { color:#a65f58; }
.kav-material-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
.kav-material-card { min-width:0; border:1px solid var(--kav-line); border-radius:11px; background:#fffdf8; overflow:hidden; box-shadow:0 8px 24px rgba(70,56,34,.035); }
.kav-material-preview { min-height:120px; display:grid; place-items:center; align-content:center; gap:8px; background:linear-gradient(135deg,#f3ecdf,#fbf8f1); color:#6e6659; }
.kav-material-preview span { font-size:9px; background:#fffdf8; border:1px solid var(--kav-line); border-radius:999px; padding:4px 8px; }
.kav-material-card-body { padding:12px; }
.kav-material-card-body h3 { margin:0 0 5px; font:500 16px/1.2 Georgia,serif; }
.kav-material-card-body p { margin:0 0 10px; color:var(--kav-muted); font-size:9px; }
.kav-material-card-actions { display:flex; gap:4px; align-items:center; }
.kav-coming-panel { min-height:360px; display:grid; place-items:center; align-content:center; text-align:center; padding:30px; gap:8px; }
.kav-coming-panel h2 { margin:0; font:500 27px Georgia,serif; }
.kav-coming-panel p { max-width:600px; color:var(--kav-muted); line-height:1.55; }

/* Homework */
.kav-homework-toolbar { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:12px; }
.kav-homework-toolbar .kav-search { max-width:360px; }
.kav-homework-layout { display:grid; grid-template-columns:390px minmax(0,1fr); gap:13px; align-items:start; }
.kav-homework-list { padding:7px; max-height:calc(100dvh - 200px); overflow:auto; }
.kav-homework-row { width:100%; min-height:76px; border:0; border-bottom:1px solid #eee5d8; background:transparent; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; padding:9px; text-align:left; color:#4e483e; }
.kav-homework-row:hover, .kav-homework-row.selected { background:#fbf3e6; border-radius:9px; }
.kav-homework-row.assigned { cursor:default; }
.kav-homework-copy { min-width:0; display:grid; gap:2px; }
.kav-homework-copy strong { font:500 14px Georgia,serif; }
.kav-homework-copy small { color:#736a5d; font-size:10px; }
.kav-homework-copy em { color:var(--kav-muted); font-style:normal; font-size:9px; }
.kav-homework-meta { display:grid; justify-items:end; gap:7px; color:#847a6d; font-size:9px; }
.kav-homework-preview { min-height:520px; padding:14px; overflow:hidden; }
.kav-review-inline { min-height:0; }
.kav-review-head { display:flex; justify-content:space-between; gap:12px; align-items:center; padding-bottom:12px; border-bottom:1px solid var(--kav-line); }
.kav-review-head > div { display:flex; gap:10px; align-items:center; }
.kav-review-head h2 { margin:0; font:500 24px Georgia,serif; }
.kav-review-head small { color:var(--kav-muted); font-size:10px; }
.kav-review-scroll { max-height:calc(100dvh - 250px); overflow:auto; padding-top:12px; }
.kav-review-section { margin-bottom:12px; padding:13px; border:1px solid var(--kav-line); border-radius:10px; background:#fffdf8; }
.kav-review-section h3 { margin:0 0 10px; font:500 17px Georgia,serif; }
.kav-answer-text { white-space:pre-wrap; color:#5f584e; }
.kav-review-material, .kav-review-board { margin-top:10px; border:1px solid var(--kav-line); border-radius:9px; overflow:hidden; }
.kav-attachment-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:10px; }
.kav-attachment-grid a { min-height:55px; border:1px solid var(--kav-line); border-radius:8px; padding:8px; display:flex; align-items:center; gap:8px; font-size:9px; }
.kav-review-actions { display:flex; justify-content:flex-end; gap:7px; margin-top:8px; }

/* Store */
.kav-store-hero { min-height:220px; border:1px solid var(--kav-line); border-radius:13px; background:linear-gradient(105deg,#fffdf8 0%,#f7f0e3 62%,#e7dbc4 100%); display:grid; grid-template-columns:1.4fr .6fr; overflow:hidden; margin-bottom:12px; }
.kav-store-hero > div:first-child { padding:27px; }
.kav-store-hero small { color:#9a762e; text-transform:uppercase; letter-spacing:.18em; font-size:8px; }
.kav-store-hero h1 { margin:7px 0 5px; font:500 39px/1 Georgia,serif; }
.kav-store-hero p { color:var(--kav-muted); font:13px/1.5 Georgia,serif; max-width:610px; }
.kav-store-art { display:grid; align-content:center; justify-items:center; background:radial-gradient(circle at 50% 40%,#f7efe2,transparent 60%); color:#6b5d45; }
.kav-store-art span { font:500 31px Georgia,serif; }
.kav-store-art strong { margin-top:8px; max-width:160px; text-align:center; font:italic 11px/1.5 Georgia,serif; }
.kav-category-row { display:grid; grid-template-columns:repeat(6,1fr); gap:7px; margin-bottom:14px; }
.kav-category-row button { min-height:48px; border:1px solid var(--kav-line); border-radius:9px; background:#fffdf8; display:flex; align-items:center; justify-content:center; gap:7px; color:#5f594e; font:12px Georgia,serif; }
.kav-category-row button.active { background:var(--kav-olive); color:white; border-color:var(--kav-olive); }
.kav-store-grid { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:13px; align-items:start; }
.kav-product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin-top:10px; }
.kav-product-card { display:grid; grid-template-columns:135px 1fr; min-height:188px; border:1px solid var(--kav-line); border-radius:11px; background:#fffdf8; overflow:hidden; }
.kav-product-image { background:linear-gradient(145deg,#efe5d4,#faf7ef); display:grid; place-items:center; color:#5f594d; }
.kav-product-image span { font:500 42px Georgia,serif; }
.kav-product-body { padding:12px; display:flex; flex-direction:column; }
.kav-product-body > small { color:#8e7e62; font-size:8px; }
.kav-product-body h3 { margin:4px 0 5px; font:500 19px/1.05 Georgia,serif; }
.kav-product-body p { margin:0; color:var(--kav-muted); font-size:9px; line-height:1.45; }
.kav-product-body em { margin-top:8px; font-style:normal; color:#80776b; font-size:8px; }
.kav-product-body > div { margin-top:auto; display:flex; align-items:center; justify-content:space-between; gap:7px; }
.kav-product-body strong { font:500 20px Georgia,serif; }
.kav-product-body button { min-height:34px; border:0; border-radius:8px; background:var(--kav-olive); color:white; padding:0 10px; display:flex; align-items:center; gap:5px; font-size:9px; }
.kav-product-body button:disabled { opacity:.6; }
.kav-store-side { padding:20px; background:linear-gradient(150deg,#4a4f34,#303420); color:#fff8eb; position:sticky; top:94px; }
.kav-store-side h2 { font:500 23px/1.1 Georgia,serif; }
.kav-store-side p, .kav-store-side li { color:#e7dfcf; font-size:10px; line-height:1.55; }
.kav-store-side ul { padding-left:18px; }

/* Owner */
.kav-owner-page { min-height:100vh; padding:26px; background:var(--kav-cream); color:var(--kav-ink); }
.kav-owner-top { max-width:1240px; margin:0 auto 18px; display:grid; grid-template-columns:170px 1fr; gap:24px; align-items:center; }
.kav-logo.owner { padding:0; justify-items:start; }
.kav-logo.owner strong { font-size:34px; }
.kav-owner-top h1 { margin:0; font:500 39px Georgia,serif; }
.kav-owner-top p { margin:4px 0 0; color:var(--kav-muted); font:12px Georgia,serif; }
.kav-owner-stats { max-width:1240px; margin:0 auto 12px; display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.kav-owner-stats > div { min-height:82px; padding:13px; border:1px solid var(--kav-line); border-radius:11px; background:#fffdf8; display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; gap:2px 10px; align-items:center; }
.kav-owner-stats svg { grid-row:1 / span 2; color:#96712e; }
.kav-owner-stats strong { font:500 26px Georgia,serif; }
.kav-owner-stats span { color:var(--kav-muted); font-size:9px; }
.kav-owner-grid { max-width:1240px; margin:0 auto; display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:10px; align-items:start; }
.kav-owner-grid.lower { grid-template-columns:1fr 1fr; margin-top:10px; }
.kav-owner-grid > .kav-card { padding:14px; }
.kav-owner-side { display:grid; gap:10px; }
.kav-owner-side .kav-card { padding:14px; }
.kav-owner-search { min-height:36px; width:260px; display:flex; align-items:center; gap:6px; border:1px solid var(--kav-line); border-radius:8px; padding:0 9px; }
.kav-owner-search input { width:100%; border:0; outline:0; background:transparent; }
.kav-owner-table { margin-top:10px; }
.kav-owner-table > div { min-height:48px; display:grid; grid-template-columns:auto 1.6fr .8fr .6fr auto; gap:8px; align-items:center; border-top:1px solid #eee6d9; font-size:9px; }
.kav-owner-table > div > span:nth-child(2) { display:grid; }
.kav-owner-table small { color:var(--kav-muted); }
.kav-diagnostic-list { display:grid; gap:7px; }
.kav-diagnostic-list span { min-height:34px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #eee6da; font-size:10px; }
.kav-owner-feed { display:grid; margin-top:9px; }
.kav-owner-feed > div { min-height:42px; display:grid; gap:2px; padding:7px 0; border-top:1px solid #eee6d9; }
.kav-owner-feed b { font-size:10px; }
.kav-owner-feed span { color:var(--kav-muted); font-size:9px; }

@media (max-width: 1100px) {
  .kav-schedule-layout, .kav-master-detail, .kav-homework-layout, .kav-store-grid { grid-template-columns:1fr; }
  .kav-schedule-detail, .kav-profile-panel, .kav-folder-panel, .kav-store-side { position:static; }
  .kav-material-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .kav-material-tabs { grid-template-columns:repeat(3,1fr); }
  .kav-owner-grid { grid-template-columns:1fr; }
}

@media (max-width: 760px) {
  .kav-page-heading { align-items:flex-start; flex-direction:column; gap:12px; }
  .kav-page-actions { width:100%; overflow-x:auto; flex-wrap:nowrap; }
  .kav-page-actions button { flex:0 0 auto; }
  .kav-calendar-card { padding:8px; overflow-x:auto; }
  .kav-calendar-toolbar { min-width:760px; }
  .kav-calendar-weekdays, .kav-calendar-grid { min-width:760px; }
  .kav-calendar-day { min-height:105px; }
  .kav-upcoming-strip { min-width:760px; }
  .kav-students-tools, .kav-homework-toolbar, .kav-material-search-row { align-items:stretch; flex-direction:column; }
  .kav-master-card, .kav-profile-panel { padding:9px; }
  .kav-people-head { display:none; }
  .kav-people-row { grid-template-columns:1fr auto; }
  .kav-people-row > span:nth-child(2), .kav-people-row > span:nth-child(3) { grid-column:1; padding-left:39px; }
  .kav-people-row > span:last-child { grid-column:2; grid-row:1 / span 3; }
  .kav-material-tabs { display:flex; overflow-x:auto; }
  .kav-material-tabs button { min-width:150px; flex:0 0 auto; }
  .kav-material-layout { grid-template-columns:1fr; }
  .kav-folder-panel { display:none; }
  .kav-material-cards { grid-template-columns:1fr; }
  .kav-homework-layout { grid-template-columns:1fr; }
  .kav-homework-list { max-height:none; }
  .kav-homework-preview { min-height:360px; }
  .kav-review-scroll { max-height:none; }
  .kav-store-hero { grid-template-columns:1fr; }
  .kav-store-art { min-height:120px; }
  .kav-category-row { display:flex; overflow-x:auto; }
  .kav-category-row button { min-width:130px; flex:0 0 auto; }
  .kav-product-grid { grid-template-columns:1fr; }
  .kav-product-card { grid-template-columns:110px 1fr; }
  .kav-owner-page { padding:14px; }
  .kav-owner-top { grid-template-columns:1fr; }
  .kav-owner-stats { grid-template-columns:1fr 1fr; }
  .kav-owner-grid.lower { grid-template-columns:1fr; }
  .kav-owner-table > div { grid-template-columns:auto 1fr auto; }
  .kav-owner-table > div > span:nth-child(3), .kav-owner-table > div > .status-pill { display:none; }
}

/* === Kavlyne FINAL: group independent boards / previews === */
.kav-side-toggle.three { grid-template-columns:repeat(3,1fr); }
.kav-board-preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:10px 0; }
.kav-board-preview { border:1px solid var(--kav-line); background:#fffdf9; border-radius:11px; padding:6px; text-align:left; overflow:hidden; color:inherit; }
.kav-board-preview.active { border-color:#a17b31; box-shadow:0 0 0 2px rgba(161,123,49,.12); }
.kav-board-preview svg { width:100%; height:72px; display:block; border-radius:7px; background:#fff; }
.kav-board-preview > span { display:flex; justify-content:space-between; gap:6px; align-items:center; margin-top:5px; }
.kav-board-preview b { font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kav-board-preview small { font-size:8px; color:var(--kav-muted); white-space:nowrap; }
.kav-group-show-actions { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.kav-group-show-actions .kav-secondary-button { justify-content:center; padding-inline:8px; font-size:9px; }
.kav-showcase-note { display:flex; gap:8px; align-items:flex-start; border:1px solid #d8c7a9; background:#fbf4e8; border-radius:10px; padding:10px; margin-bottom:8px; color:#6a5839; font-size:10px; line-height:1.4; }
@media (max-width:720px){
  .kav-board-preview-grid{grid-template-columns:1fr 1fr;}
  .kav-side-toggle.three{grid-template-columns:1fr;}
  .kav-group-show-actions{grid-template-columns:1fr;}
}
.kav-material-picker-actions{display:flex;gap:8px;justify-content:space-between;align-items:center;margin-top:12px;flex-wrap:wrap;}

/* === Kavlyne post-Work final corrections === */
.kav-calendar-view-toggle{display:flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--kav-line);border-radius:9px;background:#f7f1e6;}
.kav-calendar-view-toggle button{min-height:30px;border:0;border-radius:7px;background:transparent;padding:0 11px;color:#786f63;font:10px Georgia,serif;}
.kav-calendar-view-toggle button.active{background:#fffdf8;color:#55462e;box-shadow:0 1px 6px rgba(95,76,44,.09);}
.kav-calendar-agenda{display:grid;border:1px solid var(--kav-line);border-radius:10px;overflow:auto;background:#fffdf8;min-height:470px;}
.kav-calendar-agenda.week{grid-template-columns:repeat(7,minmax(125px,1fr));}
.kav-calendar-agenda.day{grid-template-columns:1fr;}
.kav-agenda-day{min-width:0;border-right:1px solid var(--kav-line);background:rgba(255,253,248,.85);}
.kav-agenda-day:last-child{border-right:0;}
.kav-agenda-day.today{background:#fcf5e9;box-shadow:inset 0 3px 0 #bd984e;}
.kav-agenda-day>header{min-height:52px;padding:9px;border-bottom:1px solid var(--kav-line);display:grid;gap:2px;text-align:center;}
.kav-agenda-day>header strong{font:500 12px Georgia,serif;text-transform:capitalize;}
.kav-agenda-day>header span{font-size:9px;color:var(--kav-muted);}
.kav-agenda-day>div{padding:7px;display:grid;gap:6px;align-content:start;}
.kav-agenda-event{min-height:57px;border:0;border-radius:8px;padding:7px;background:#f5e5d6;color:#59483d;text-align:left;display:grid;gap:2px;}
.kav-agenda-event.group{background:#e7eddd;color:#46543b;}
.kav-agenda-event b{font-size:9px;}.kav-agenda-event span{font:500 11px Georgia,serif;}.kav-agenda-event small{font-size:8px;opacity:.75;}
.kav-agenda-empty{padding:16px 4px;color:#aaa093;font-size:9px;text-align:center;}

.kav-student-summary{display:grid;gap:0!important;padding:0!important;overflow:hidden;}
.kav-student-summary>div{padding:11px 0;border-bottom:1px solid #eee6da;display:grid;gap:3px;}
.kav-student-summary>div:last-child{border-bottom:0;}
.kav-student-summary small{color:var(--kav-muted);font-size:8px;letter-spacing:.04em;}
.kav-student-summary strong{font:500 13px Georgia,serif;color:#4c463d;}
.kav-student-summary span{color:#857b6f;font-size:9px;line-height:1.35;}

.kav-material-layout.files-only{grid-template-columns:minmax(0,1fr);}
.kav-temp-files-note{margin:0 0 12px;padding:12px 14px;border:1px solid #dcccae;border-radius:10px;background:#fbf4e7;display:grid;gap:3px;color:#62543d;}
.kav-temp-files-note strong{font:500 13px Georgia,serif;}.kav-temp-files-note span{font-size:9px;line-height:1.45;color:#81735f;}

.kav-prep-page-thumb{padding:0!important;display:block!important;overflow:hidden;position:relative;min-height:118px!important;}
.kav-prep-thumb-open{width:100%;min-height:90px;border:0;background:transparent;padding:6px;display:grid;grid-template-rows:62px auto;gap:5px;text-align:left;color:inherit;}
.kav-prep-thumb-open>span{display:flex!important;align-items:center;gap:6px;font:inherit!important;color:inherit!important;}
.kav-prep-thumb-open b{width:21px;height:21px;border-radius:6px;background:#f0e6d3;color:#8d6b2b;display:grid;place-items:center;font-size:9px;}
.kav-prep-thumb-open strong{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.kav-prep-thumb-svg,.kav-prep-thumb-empty{width:100%;height:62px;border:1px solid #eee4d4;border-radius:7px;background:#fff;display:block;}
.kav-prep-thumb-empty{display:grid;place-items:center;color:#aaa095;font-size:8px;}
.kav-prep-thumb-actions{display:flex;justify-content:flex-end;gap:3px;padding:0 6px 6px;}
.kav-prep-thumb-actions button{width:25px;height:25px;border:0;border-radius:6px;background:#f5efe5;color:#726658;display:grid;place-items:center;}
.kav-prep-thumb-actions button.danger{color:#a26b68;background:#fbf0ef;}

@media(max-width:760px){
  .kav-calendar-toolbar{min-width:680px;grid-template-columns:auto auto minmax(180px,1fr) auto auto;}
  .kav-calendar-agenda.week{min-width:870px;}
  .kav-calendar-agenda.day{min-width:0;}
  .kav-prep-page-thumb{min-width:135px!important;min-height:108px!important;}
}


/* Student presenter-only mode: tutor fully controls what the student sees. */
.student-live-shell.presenter-only {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: var(--bg, #f8f5f1);
}
.student-presenter-workspace {
  display: block !important;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}
.student-presenter-workspace .student-presented-pane {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0 !important;
  border: 0 !important;
}
.student-presenter-workspace .material-iframe,
.student-presenter-workspace .whiteboard,
.student-presenter-workspace .board-canvas-scroll,
.student-presenter-workspace .pdf-editor,
.student-presenter-workspace .pdf-scroll {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}
.student-live-connection-warning {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 240;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(61,51,45,.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(61,51,45,.16);
}

/* Kavlyne PDF lesson editor v2 */
.material-editor-page { min-height: calc(100vh - 40px); }
.material-editor-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin: -6px -6px 18px;
  background: rgba(250,247,241,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.material-editor-title { min-width: 0; flex: 1; display: grid; gap: 2px; }
.material-editor-title input {
  width: 100%; border: 0; outline: 0; background: transparent;
  font: 600 16px/1.25 var(--sans); color: var(--ink);
}
.material-editor-title small { color: var(--muted); font-size: 11px; }
.material-editor-top-actions { display: flex; align-items: center; gap: 8px; }
.material-editor-mode { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.material-editor-mode button {
  border: 0; background: transparent; color: var(--muted); border-radius: 9px;
  padding: 8px 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.material-editor-mode button.active { background: var(--panel-soft); color: var(--ink); }
.material-document-settings {
  position: fixed; z-index: 50; top: 76px; right: 18px; width: min(340px, calc(100vw - 36px));
  display: flex; align-items: end; gap: 10px; padding: 14px;
  box-shadow: 0 18px 50px rgba(49,42,34,.14);
}
.material-document-settings .label { flex: 1; }
.material-editor-error { max-width: 900px; margin: 0 auto 16px; }
.material-editor-workspace { display: flex; justify-content: center; padding: 8px 12px 96px; }
.material-editor-workspace .paper-sheet {
  width: min(100%, 794px); min-height: 1123px; padding: 64px 64px;
  border-radius: 4px; transition: border-color .18s ease, box-shadow .18s ease;
}
.material-block { position: relative; }
.material-block.is-active {
  border-color: rgba(152,126,91,.55);
  background: rgba(255,253,249,.92);
  box-shadow: 0 0 0 2px rgba(183,148,80,.08);
}
.block-context-toolbar {
  position: absolute; right: 8px; top: -34px; z-index: 12;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 6px 5px 10px; border-radius: 11px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(49,42,34,.12);
}
.block-context-toolbar span { margin-right: 4px; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.block-context-toolbar button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.block-context-toolbar button:hover { background: var(--panel-soft); }
.block-context-toolbar button.danger { color: #a65e58; }
.paper-sheet.is-preview .material-block { border-color: transparent!important; background: transparent!important; box-shadow: none!important; }
.block-preview { min-height: 1.2em; white-space: pre-wrap; font-size: 16px; line-height: 1.55; color: var(--ink); }
.block-heading .block-preview { font-family: var(--serif); font-size: 38px; line-height: 1.08; font-weight: 600; }
.block-theory .block-preview, .block-example .block-preview, .block-task .block-preview { padding: 14px 16px; border-radius: 12px; }
.block-theory .block-preview { background: #f7f2e8; }
.block-example .block-preview { background: #f6f4ef; }
.block-task .block-preview { border: 1px solid var(--line); }
.material-floating-add {
  position: fixed; z-index: 35; right: 28px; bottom: 28px;
  border: 0; border-radius: 999px; padding: 14px 20px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--olive); color: #fff; font-weight: 700;
  box-shadow: 0 14px 36px rgba(55,61,36,.26); cursor: pointer;
}
.material-floating-add:hover { transform: translateY(-1px); }
.material-add-backdrop { align-items: flex-end; }
.material-add-sheet {
  width: min(620px, calc(100vw - 24px)); margin: 0 auto 18px;
  max-height: min(72vh, 680px); overflow: auto; padding: 18px;
  border-radius: 20px;
}
.material-add-group { margin-top: 16px; }
.material-add-group > small { display: block; margin-bottom: 8px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.material-add-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.material-add-options button {
  min-height: 48px; border: 1px solid var(--line); background: #fff; border-radius: 13px;
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; text-align: left;
  color: var(--ink); font-weight: 650; cursor: pointer;
}
.material-add-options button:hover { background: var(--panel-soft); }
.material-empty-add {
  width: 100%; min-height: 120px; border: 1px dashed var(--line); background: transparent;
  border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); cursor: pointer;
}

@media (max-width: 760px) {
  .material-editor-page { margin: -12px -12px 0; }
  .material-editor-topbar {
    margin: 0; padding: 8px 10px; gap: 7px;
    top: 58px;
  }
  .material-editor-title input { font-size: 14px; }
  .material-editor-title small { display: none; }
  .material-editor-mode { display: none; }
  .material-save-button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
  .material-save-button span { display: none; }
  .material-editor-top-actions { gap: 4px; }
  .material-editor-top-actions .kav-icon-button { width: 40px; height: 40px; }
  .material-document-settings { top: 112px; right: 10px; width: calc(100vw - 20px); }
  .material-editor-workspace { padding: 10px 6px 126px; overflow-x: hidden; }
  .material-editor-workspace .paper-sheet {
    width: 100%; min-height: calc(100vh - 190px);
    padding: 30px 18px 44px; border-radius: 8px;
    box-shadow: 0 8px 28px rgba(75,60,49,.08);
  }
  .material-block { padding: 6px 2px; margin-bottom: 16px; border-radius: 10px; }
  .material-block:hover { border-color: transparent; background: transparent; }
  .material-block.is-active { padding: 8px 6px; border-color: rgba(152,126,91,.45); background: #fffdf9; }
  .block-context-toolbar {
    position: static; width: 100%; margin: 0 0 8px;
    justify-content: flex-end; box-shadow: none; border: 0; border-bottom: 1px solid var(--line);
    border-radius: 0; padding: 0 0 7px;
  }
  .block-context-toolbar span { margin-right: auto; }
  .block-input { font-size: 16px; }
  .block-heading .block-input { font-size: 34px; line-height: 1.08; }
  .solution-space { min-height: 150px; }
  .material-floating-add {
    right: 16px; bottom: calc(88px + env(safe-area-inset-bottom));
    padding: 13px 17px;
  }
  .material-add-backdrop { padding: 0 8px env(safe-area-inset-bottom); }
  .material-add-sheet {
    width: 100%; margin: 0 0 8px; border-radius: 22px 22px 16px 16px;
    max-height: 68vh; padding: 16px;
  }
  .material-add-options { grid-template-columns: 1fr; }
  .material-add-options button { min-height: 52px; font-size: 15px; }
}

@media print {
  .material-editor-topbar, .material-floating-add, .material-add-backdrop, .material-document-settings { display:none!important; }
  .material-editor-workspace { display:block!important; padding:0!important; }
}

/* Create material hub + simplified library */
.kav-create-material-home{
  margin:18px 0 22px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;
  padding:22px 24px;border-radius:22px;background:#454b31;color:#fff;text-decoration:none;
  border:1px solid rgba(255,255,255,.08);box-shadow:0 16px 40px rgba(52,57,38,.14);
}
.kav-create-material-home small{display:block;color:#d8caa9;text-transform:uppercase;letter-spacing:.08em;font-weight:750;margin-bottom:3px}
.kav-create-material-home h2{font-family:var(--serif);font-size:30px;margin:0 0 5px;font-weight:500}
.kav-create-material-home p{margin:0;color:#eee8dc;max-width:760px}
.kav-create-material-home-icon{width:54px;height:54px;border:1px solid #c2a25f;border-radius:50%;display:grid;place-items:center;color:#d2b46f}
.kav-create-material-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:22px}
.kav-create-material-head small{color:var(--muted);text-transform:uppercase;letter-spacing:.08em;font-weight:750}
.kav-create-material-head h1{font-family:var(--serif);font-size:42px;margin:3px 0 6px}
.kav-create-material-head p{margin:0;color:var(--muted)}
.kav-builder-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.kav-builder-choice{position:relative;overflow:hidden;min-height:330px;padding:28px;border:1px solid var(--line);border-radius:24px;background:#fffdf9;display:flex;flex-direction:column}
.kav-builder-choice.trainer{background:#444a30;color:#fff;border-color:#444a30}
.kav-builder-choice.trainer p,.kav-builder-choice.trainer small{color:#eee5d4}
.kav-builder-choice small{text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-weight:750}
.kav-builder-choice h2{font-family:var(--serif);font-size:36px;line-height:1.05;margin:10px 0 14px;font-weight:500}
.kav-builder-choice p{font-size:16px;color:var(--muted);max-width:510px;margin:0 0 24px}
.kav-builder-icon{width:58px;height:58px;border-radius:18px;background:#f0e7d6;display:grid;place-items:center;color:#8f713b;margin-bottom:22px}
.kav-builder-choice.trainer .kav-builder-icon{background:rgba(255,255,255,.1);color:#d0b169}
.kav-builder-actions{margin-top:auto}
.kav-builder-choice.trainer .kav-primary-button{background:#f8f2e7;color:#303421}
.kav-builder-work{padding:24px}
.kav-builder-source-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}
.kav-builder-source{min-height:126px;border:1px solid var(--line);border-radius:18px;background:#fffdf9;padding:20px;display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left;color:var(--ink);cursor:pointer}
.kav-builder-source:hover{background:#f7f1e7}
.kav-builder-source strong{font-size:17px}.kav-builder-source span{font-size:13px;color:var(--muted)}
.kav-builder-status{display:flex;align-items:center;gap:8px;margin:14px 0;padding:12px 14px;border-radius:13px;background:#f2ece0;color:var(--ink)}
.kav-builder-status.success{background:#eef1e8;color:#47503a}
.kav-trainer-draft{display:grid;gap:16px;margin-top:20px}
.kav-trainer-task-list{display:grid;gap:12px}
.kav-trainer-task{padding:16px;border:1px solid var(--line);border-radius:16px;background:#fffdf9;display:grid;gap:10px}
.kav-trainer-task-head{display:flex;justify-content:space-between;align-items:center}
.kav-inline-checks{display:flex;gap:18px;flex-wrap:wrap;color:var(--muted);font-size:14px}
.kav-inline-checks label{display:flex;gap:6px;align-items:center}
.kav-library-note{display:flex;gap:8px;align-items:flex-start;margin:0 0 16px;padding:13px 15px;border-radius:14px;background:#f2ece1;color:var(--muted)}
.kav-library-note strong{color:var(--ink);white-space:nowrap}
.kav-material-library{padding:20px}
.kav-material-count{min-width:36px;height:36px;padding:0 10px;border-radius:99px;background:var(--panel-soft);display:grid;place-items:center;color:var(--muted);font-weight:700}
.kav-library-row{padding:15px 0}
.material-top-add{background:#444a30!important;color:#fff!important;border-color:#444a30!important}
.kav-store-grid{display:block!important}
@media(max-width:760px){
  .kav-create-material-home{padding:18px;gap:12px}.kav-create-material-home h2{font-size:27px}.kav-create-material-home p{font-size:14px}
  .kav-create-material-home-icon{width:46px;height:46px}
  .kav-create-material-head h1{font-size:34px}
  .kav-builder-choice-grid,.kav-builder-source-grid{grid-template-columns:1fr}
  .kav-builder-choice{min-height:260px;padding:22px}.kav-builder-choice h2{font-size:32px}
  .kav-builder-work{padding:16px}
  .kav-library-note{display:block}.kav-library-note strong{display:block;margin-bottom:3px}
  .kav-library-row{align-items:flex-start;gap:10px}.kav-library-row .row-actions{flex-wrap:wrap;justify-content:flex-end}
  .material-top-add{display:grid!important}
}

/* 2026-10-08 mobile materials + preparation board actions */
.kav-material-library,
.kav-material-library .list,
.kav-library-row,
.kav-library-row .list-row-main { min-width:0; max-width:100%; }
.kav-library-row { width:100%; overflow:hidden; }
.kav-library-row .list-row-main { flex:1 1 auto; overflow:hidden; }
.kav-library-row .list-row-main strong,
.kav-library-row .list-row-main small {
  overflow-wrap:anywhere;
  word-break:break-word;
}
.kav-library-row .row-actions { flex:0 0 auto; }
.kav-board-action-message { margin-top:8px; color:var(--kav-olive); font-weight:650; }
.kav-board-top-actions { justify-content:flex-end; }

@media (max-width:760px) {
  .kav-material-library { padding:14px; overflow:hidden; }
  .kav-library-row {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    align-items:start;
    gap:12px;
    padding:14px;
  }
  .kav-library-row .list-row-main { width:100%; }
  .kav-library-row .row-actions {
    width:100%;
    justify-content:flex-start;
    flex-wrap:wrap;
    gap:7px;
  }
  .kav-library-row .row-actions .mini-button {
    max-width:100%;
    white-space:normal;
  }
  .kav-board-top-actions {
    display:grid!important;
    grid-template-columns:1fr 1fr;
    width:100%;
    overflow:visible!important;
    gap:8px;
  }
  .kav-board-top-actions > button {
    width:100%;
    min-height:48px;
    justify-content:center;
    white-space:normal;
    line-height:1.15;
  }
  .kav-board-top-actions > button:last-child { grid-column:1 / -1; }
}

/* Editor accessibility: add action remains visible while scrolling. */
.material-inserted-image { display:block; max-width:100%; width:auto; max-height:650px; object-fit:contain; margin:8px auto; border-radius:8px; }
@media print { .material-inserted-image { max-height:235mm; break-inside:avoid; } }

.block-important { background:#f4eedf; border-left:4px solid #9e895d!important; padding:12px 16px!important; border-radius:8px; }
.block-important .block-preview { font-weight:550; white-space:pre-wrap; }
@media print { .block-important { print-color-adjust:exact; -webkit-print-color-adjust:exact; } }

.material-solution-wrapper { min-width:0; }
.material-solution-controls { display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:8px 0 12px; font-size:12px; color:#655e50; }
.material-solution-controls label { display:inline-flex; gap:6px; align-items:center; }
.material-solution-controls select { max-width:155px; border:1px solid #ded6c9; background:#fffdf9; border-radius:8px; padding:6px; }
.material-solution-input,.material-solution-worked { width:100%; box-sizing:border-box; border:1px solid #ded6c9; border-radius:12px; background:#faf8f3; padding:16px; color:#332f28; font:inherit; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; }
.material-solution-input { resize:vertical; }
@media print { .material-solution-controls {display:none!important;} .material-solution-input {display:none!important;} .material-solution-worked {break-inside:avoid;} }

.material-solution-print { display:none; }
@media print { .material-solution-print { display:block!important; white-space:pre-wrap; border:1px solid #ded6c9; border-radius:12px; padding:16px; } }
/* Keep the editor's add sheet above the fixed mobile navigation (z-index 200). */
.material-add-backdrop { z-index: 300; }

.material-math {overflow-x:auto;padding:8px 0;}
.formula-error {white-space:pre-wrap;color:#754f4a;}
.formula-error small {display:block;}
@media print {
 @page {size:A4;margin:15mm;}
 .kav-sidebar,.kav-topbar,.material-editor-page>.helper,.material-editor-page>.error-banner,.material-editor-page>[role="alert"] {display:none!important;}
 .kav-shell,.kav-main-shell,.kav-main,.kav-content {display:block!important;margin:0!important;padding:0!important;width:100%!important;min-height:0!important;}
 .material-editor-workspace .paper-sheet {width:100%!important;min-height:0!important;padding:0!important;}
 .material-math {overflow:visible;}
 .material-editor-page textarea,.block-context-toolbar {display:none!important;}
}

.material-page-break {border-top:1px dashed #b7ad9a;padding:10px;color:#817764;}
@media print { .block-pagebreak {break-before:page;break-inside:auto;height:0;margin:0!important;padding:0!important;} .material-page-break {display:none;} }

/* PDF editor: keep the complete toolbar available while navigating long pages.
   Fixed to the viewport, independent of internal board scrolling and page length. */
.material-editor-page { padding-top: 84px; }
.material-editor-topbar {
  position: fixed;
  top: 78px;
  left: calc(258px + 34px);
  right: 34px;
  z-index: 65;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--kav-line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 9px 24px rgba(61,51,45,.09);
}
.material-editor-page .material-floating-add { display: none; }
@media (max-width: 1100px) and (min-width: 761px) {
  .material-editor-topbar { left: calc(214px + 24px); right: 24px; }
}
@media (max-width: 760px) {
  .material-editor-page { padding-top: 76px; }
  .material-editor-topbar { top: 58px; left: 10px; right: 10px; margin: 0; padding: 8px 10px; }
  .material-editor-title input { min-width: 0; }
}
@media print {
  .material-editor-page { padding-top: 0 !important; }
  .material-editor-topbar { display: none !important; }
}
