
    /* =========================================================
       1. BASE
       ========================================================= */

    * {
      box-sizing: border-box;
    }

    html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;

  background:
    linear-gradient(
      145deg,
      var(--board-bg-a, #eaf0f6),
      var(--board-bg-b, #f8fafc)
    );

  color: #111827;
  overflow: hidden;
}

    button,
    input,
    textarea,
    select {
      font-family: inherit;
    }

    button:disabled {
      opacity: 0.65;
      cursor: not-allowed;
    }

    a {
      color: inherit;
      text-decoration: none;
    }

    .top-line {
      height: 4px;
      background: #3b241f;
    }

    .hidden {
      display: none !important;
    }

    /* =========================================================
       2. HEADER
       ========================================================= */

    header {
      height: 56px;
      background: #ffffff;
      border-bottom: 1px solid #e5e7eb;
      padding: 7px 12px;
      display: flex;
      align-items: center;
      position: relative;
      z-index: 60;
    }

    .top-nav {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }

    .brand-row {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .logo {
  display: inline-flex;
  align-items: center;

  white-space: nowrap;
  line-height: 1;

  flex: 0 0 auto;
}

    .class-select-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }

    .class-select-wrap label {
      font-size: 10px;
      font-weight: 900;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      white-space: nowrap;
    }

    .class-select {
      border: 1px solid #d1d5db;
      border-radius: 999px;
      padding: 8px 12px;
      font-weight: 900;
      color: #143f3a;
      background: #f1fdf6;
      max-width: 280px;
      outline: none;
    }

    .class-select-native-hidden {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      opacity: 0 !important;
      pointer-events: none !important;
      overflow: hidden !important;
    }

    .class-switcher {
      position: relative;
      flex: 0 0 auto;
      min-width: 220px;
      z-index: 300;
    }

    .class-switcher-trigger {
      width: auto;
      min-width: 220px;
      min-height: 38px;

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

      padding: 7px 11px;

      border:
        1px solid
        #b9d8c8;

      border-radius:
        999px;

      background:
        #f1fdf6;

      color:
        #143f3a;

      font: inherit;
      font-size: 12px;
      font-weight: 900;

      cursor: pointer;
      outline: none;

      box-shadow:
        0 1px 2px
        rgba(
          15,
          23,
          42,
          0.04
        );
    }

    .class-switcher-trigger:hover {
      border-color:
        #86cfa8;

      background:
        #ecfbf2;
    }

    .class-switcher-trigger:focus-visible {
      outline:
        3px solid
        rgba(
          59,
          130,
          246,
          0.28
        );

      outline-offset:
        2px;
    }

    .class-switcher-trigger-icon {
      flex: 0 0 auto;
      line-height: 1;
    }

        .class-switcher-trigger-copy {
      min-width: 0;
      flex: 1 1 auto;

      display: grid;
      gap: 1px;

      text-align: left;
    }

    .class-switcher-trigger-label {
      display: block;
    }

    .class-switcher-trigger-separator {
      flex: 0 0 auto;

      color:
        #94a3b8;

      font-size:
        14px;

      font-weight:
        900;
    }

    .class-switcher-trigger-count {
      flex: 0 0 auto;

      color:
        #475569;

      font-size:
        12px;

      font-weight:
        850;

      line-height:
        1;

      white-space:
        nowrap;
    }

    .class-switcher-trigger-label {
      flex: 1 1 auto;
      min-width: 0;

      color:
        #143f3a;

      text-align: left;

      white-space: nowrap;
    }

    .class-switcher-chevron {
      flex: 0 0 auto;

      color:
        #45685f;

      font-size:
        11px;

      transition:
        transform
        0.16s ease;
    }

    .class-switcher.open
    .class-switcher-chevron {
      transform:
        rotate(180deg);
    }

    .class-switcher-menu {
      position: absolute;

      top:
        calc(100% + 8px);

      left: 0;

      width:
        max(280px, 100%);

      max-width:
        min(
          420px,
          calc(
            100vw - 24px
          )
        );

      max-height:
        min(
          460px,
          calc(
            100vh - 90px
          )
        );

      display:
        flex;

      flex-direction:
        column;

      overflow:
        hidden;

      padding:
        8px;

      border:
        1px solid
        #dbe6df;

      border-radius:
        16px;

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

      box-shadow:
        0 18px 45px
        rgba(
          15,
          23,
          42,
          0.18
        );

      backdrop-filter:
        blur(16px);

      opacity: 0;
      visibility: hidden;
      pointer-events: none;

      transform:
        translateY(-5px);

      transition:
        opacity
        0.14s ease,
        transform
        0.14s ease,
        visibility
        0.14s ease;

      z-index:
        9999;
    }

    .class-switcher.open
    .class-switcher-menu {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;

      transform:
        translateY(0);
    }

        .class-switcher-list {
      min-height: 0;

      overflow-y:
        auto;

      overscroll-behavior:
        contain;

      padding-right:
        2px;
    }


    .class-switcher-actions {
      flex: 0 0 auto;

      display:
        grid;

      gap:
        4px;

      padding-top:
        7px;

      margin-top:
        7px;

      border-top:
        1px solid #e5e7eb;

      background:
        #ffffff;
    }

    .class-switcher-heading {
      padding:
        7px
        10px
        6px;

      color:
        #7a8b9a;

      font-size:
        9px;

      font-weight:
        900;

      line-height:
        1;

      letter-spacing:
        0.8px;

      text-transform:
        uppercase;
    }

    .class-switcher-item {
      width: 100%;

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

      padding:
        9px
        10px;

      margin:
        1px 0;

      border:
        0;

      border-radius:
        11px;

      background:
        transparent;

      color:
        #173f39;

      font:
        inherit;

      font-size:
        12px;

      font-weight:
        850;

      line-height:
        1.25;

      text-align:
        left;

      cursor:
        pointer;
    }

    .class-switcher-item:hover {
      background:
        #f1f8f4;
    }

    .class-switcher-item.active {
      background:
        #e9f9ef;

      color:
        #116b40;
    }

    .class-switcher-item-icon {
      width:
        24px;

      height:
        24px;

      display:
        grid;

      place-items:
        center;

      flex:
        0 0 24px;

      border-radius:
        8px;

      background:
        #f3f6f5;

      font-size:
        13px;
    }

    .class-switcher-item.active
    .class-switcher-item-icon {
      background:
        #d7f5e2;
    }

    .class-switcher-item-copy {
      min-width: 0;
      flex: 1 1 auto;
    }

    .class-switcher-item-title {
      display: block;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .class-switcher-item-student-count {
      display: block;

      margin-top:
        2px;

      color:
        #7a8b9a;

      font-size:
        10px;

      font-weight:
        750;

      line-height:
        1.15;
    }

    .class-switcher-item.active
    .class-switcher-item-student-count {
      color:
        #4f7f68;
    }

    .class-switcher-check {
      flex: 0 0 auto;

      color:
        #16a15d;

      font-size:
        14px;

      font-weight:
        900;
    }

    @media (max-width: 820px) {
      .class-switcher {
        min-width:
          180px;
      }

      .class-switcher-trigger {
        min-width:
          180px;
      }

      .class-switcher-menu {
        width:
          min(
            330px,
            calc(
              100vw - 24px
            )
          );
      }
    }

    .nav-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.class-board-demo-tour-button {
  display: none;
}

body.class-board-demo-mode .class-board-demo-tour-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #3b241f;
  font-size: 14px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 8px 20px rgba(245, 158, 11, 0.34),
    0 0 0 6px rgba(251, 191, 36, 0.16);
  animation: classBoardTourAttention 2.4s ease-in-out infinite;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

body.class-board-demo-mode .class-board-demo-tour-button:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.04);
  box-shadow:
    0 12px 26px rgba(245, 158, 11, 0.42),
    0 0 0 8px rgba(251, 191, 36, 0.2);
}

body.class-board-demo-mode .class-board-demo-tour-button:active {
  transform: scale(.97);
}

.class-board-demo-tour-icon {
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  animation: classBoardTourSparkle 1.8s ease-in-out infinite;
}

.class-board-demo-tour-arrow {
  font-size: 17px;
  transition: transform .18s ease;
}

.class-board-demo-tour-button:hover .class-board-demo-tour-arrow {
  transform: translateX(4px);
}

@keyframes classBoardTourAttention {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      0 8px 20px rgba(245, 158, 11, 0.34),
      0 0 0 6px rgba(251, 191, 36, 0.16);
  }

  50% {
    transform: translateY(-4px);
    box-shadow:
      0 13px 28px rgba(245, 158, 11, 0.42),
      0 0 0 10px rgba(251, 191, 36, 0.08);
  }
}

@keyframes classBoardTourSparkle {
  0%, 100% {
    transform: rotate(-8deg) scale(1);
  }

  50% {
    transform: rotate(10deg) scale(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.class-board-demo-mode .class-board-demo-tour-button,
  .class-board-demo-tour-icon {
    animation: none;
  }
}

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 9px 13px;
      font-weight: 900;
      border: none;
      cursor: pointer;
      font-size: 13px;
      white-space: nowrap;
      min-height: 36px;
      gap: 6px;
    }

    .btn-primary {
      background:
        var(--board-accent);

      color:
        var(--board-ink);
    }

    .btn-dark {
      background:
        var(--board-ink);

      color:
        #ffffff;
    }

    .btn-light {
      background:
        #ffffff;

      color:
        var(--board-ink);

      border:
        1px solid
        var(--board-border);
    }

    .btn-soft {
      background:
        color-mix(
          in srgb,
          var(--board-accent) 11%,
          #ffffff
        );

      color:
        var(--board-ink);

      border:
        1px solid
        color-mix(
          in srgb,
          var(--board-accent) 35%,
          var(--board-border)
        );
    }

    .btn-danger {
      background: #fee2e2;
      color: #991b1b;
      border: 1px solid #fecaca;
    }

    /* =========================================================
   TIMETABLE AI — GEMINI-STYLE EDIT BUTTON
   ========================================================= */

.timetable-ai-edit-button {
  position: relative;

  min-height: 38px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  padding:
    8px
    15px;

  border:
    1px solid
    rgba(
      124,
      58,
      237,
      0.28
    );

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      rgba(
        255,
        255,
        255,
        0.98
      ),
      rgba(
        245,
        243,
        255,
        0.97
      )
    );

  color:
    #4c1d95;

  font-size:
    11.5px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;

  overflow:
    hidden;

  box-shadow:
    0 7px 18px
    rgba(
      99,
      102,
      241,
      0.13
    ),
    inset 0 1px 0
    rgba(
      255,
      255,
      255,
      0.95
    );

  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}





.timetable-ai-edit-button:hover,
.timetable-ai-edit-button:focus-visible {
  border-color:
    rgba(
      124,
      58,
      237,
      0.52
    );

  background:
    linear-gradient(
      135deg,
      #ffffff,
      #f5f3ff
    );

  box-shadow:
    0 10px 24px
    rgba(
      99,
      102,
      241,
      0.20
    ),
    0 0 0 4px
    rgba(
      139,
      92,
      246,
      0.07
    );

  transform:
    translateY(-1px);

  outline:
    none;
}


.timetable-ai-edit-button:active {
  transform:
    scale(0.97);
}


.timetable-ai-edit-mark {
  width: 25px;
  height: 25px;

  display: inline-grid;
  place-items: center;

  flex:
    0 0 25px;

  border-radius:
    9px;

  background:
    linear-gradient(
      135deg,
      #4285f4,
      #7c3aed,
      #ec4899
    );

  color:
    #ffffff;

  font-size:
    12px;

  line-height:
    1;

  font-weight:
    950;

  box-shadow:
    0 5px 12px
    rgba(
      124,
      58,
      237,
      0.24
    );
}

    /* =========================================================
   ASK AI — FLOATING ASSISTANT
   ========================================================= */

.ask-class-board-launch-button {
  position: fixed;

  right: 18px;
  bottom: 80px;

  z-index: 9000;

  width: auto;
  min-width: 168px;
  height: 44px;
  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: flex-start;

  gap: 9px;

  padding:
    6px
    13px
    6px
    7px;

  border:
    1px solid
    rgba(
      120,
      101,
      78,
      0.22
    );

  border-radius:
    999px;

  background:
    linear-gradient(
      145deg,
      rgba(
        255,
        255,
        255,
        0.98
      ),
      rgba(
        250,
        247,
        241,
        0.98
      )
    );

  color:
    #26352f;

  box-shadow:
    0 8px 22px
    rgba(
      69,
      50,
      34,
      0.13
    ),
    inset
    0
    1px
    0
    rgba(
      255,
      255,
      255,
      0.95
    );

  backdrop-filter:
    blur(14px);

  cursor:
    grab;

  user-select:
    none;

  touch-action:
    none;

  overflow:
    hidden;

  transition:
    transform
    0.18s ease,
    border-color
    0.18s ease,
    box-shadow
    0.18s ease,
    background
    0.18s ease;

  animation:
    askAiFloatingEnter
    0.3s ease-out;
}


.ask-class-board-launch-button:hover,
.ask-class-board-launch-button:focus-visible {
  border-color:
    rgba(
      99,
      102,
      241,
      0.32
    );

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #faf7ff
    );

  box-shadow:
    0 12px 28px
    rgba(
      69,
      50,
      34,
      0.15
    ),
    0 0 0 3px
    rgba(
      124,
      58,
      237,
      0.045
    );

  outline:
    none;

  transform:
    translateY(-2px);
}


.ask-class-board-launch-button.dragging {
  cursor:
    grabbing;

  transition:
    none;

  transform:
    scale(1.03);

  box-shadow:
    0 18px 38px
    rgba(
      79,
      70,
      229,
      0.30
    );
}


.ask-class-board-launch-icon {
  position:
    relative;

  width:
    31px;

  height:
    31px;

  min-width:
    31px;

  display:
    inline-grid;

  place-items:
    center;

  flex:
    0 0 31px;

  border-radius:
    11px;

  background:
    linear-gradient(
      135deg,
      #7c3aed 0%,
      #6366f1 48%,
      #22c55e 100%
    );

  color:
    #ffffff;

  font-size:
    14px;

  line-height:
    1;

  font-weight:
    950;

  box-shadow:
    0 4px 10px
    rgba(
      99,
      102,
      241,
      0.24
    ),
    inset
    0
    1px
    0
    rgba(
      255,
      255,
      255,
      0.28
    );

  transition:
    transform
    0.18s ease,
    box-shadow
    0.18s ease;
}


.ask-class-board-launch-button:hover
.ask-class-board-launch-icon,
.ask-class-board-launch-button:focus-visible
.ask-class-board-launch-icon {
  transform:
    rotate(-3deg)
    scale(1.06);

  box-shadow:
    0 6px 14px
    rgba(
      99,
      102,
      241,
      0.30
    );
}

.ask-class-board-launch-label {
  color:
    #26352f;

  font-size:
    12px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    -0.15px;
}


.ask-class-board-launch-label {
  min-width:
    19px;

  color:
    #312e81;

  font-size:
    12px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;
}


.ask-class-board-launch-label-short {
  display:
    none;
}


.ask-class-board-launch-label-full {
  display:
    inline;
}


body.ask-class-board-open
.ask-class-board-launch-button {
  display:
    none !important;
}


.ask-class-board-header-restore {
  width:
    34px;

  min-width:
    34px;

  height:
    34px;

  display:
    none;

  align-items:
    center;

  justify-content:
    center;

  padding:
    0;

  border:
    1px solid
    rgba(
      124,
      58,
      237,
      0.28
    );

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #f5f3ff,
      #eff6ff
    );

  color:
    #6d28d9;

  font-size:
    15px;

  line-height:
    1;

  font-weight:
    950;

  cursor:
    pointer;

  box-shadow:
    0 3px 8px
    rgba(
      99,
      102,
      241,
      0.12
    );
}


.ask-class-board-header-restore:hover,
.ask-class-board-header-restore:focus-visible {
  border-color:
    #8b5cf6;

  background:
    #ede9fe;

  outline:
    none;

  transform:
    translateY(-1px);
}


body.ask-class-board-guide-hidden
#askClassBoardFloatingButton {
  display:
    none !important;
}


body.ask-class-board-guide-hidden
#askClassBoardHeaderRestore {
  display:
    inline-flex;
}


@keyframes askAiFloatingEnter {
  from {
    opacity:
      0;

    transform:
      translateY(10px)
      scale(0.94);
  }

  to {
    opacity:
      1;

    transform:
      translateY(0)
      scale(1);
  }
}


@media (
  max-width:
  700px
) {
  .ask-class-board-launch-button {
    right: 12px;

    bottom:
      calc(
        76px +
        env(
          safe-area-inset-bottom
        )
      );

    width: 44px;
    min-width: 44px;

    height: 44px;
    min-height: 44px;

    padding: 6px;

    justify-content: center;
  }

  .ask-class-board-launch-label-full,
  .ask-class-board-launch-label-short {
    display: none !important;
  }

  .ask-class-board-launch-icon {
    margin: 0;
  }
}


/*
  Ask AI must always sit above every Class Board modal,
  including Settings and Daily Content.
*/

.ask-class-board-modal {
  position:
    fixed;

  top:
    auto;

  right:
    22px;

  bottom:
    92px;

  left:
    auto;

  z-index:
    1100000 !important;

  width:
    min(
      440px,
      calc(
        100vw -
        32px
      )
    );

  display:
    block;

  padding:
    0;

  background:
    transparent;

  backdrop-filter:
    none;

  pointer-events:
    none;
}


/* =========================================================
   TIMETABLE AI — INTEGRATED EDITOR PANEL
   ========================================================= */

body.timetable-ai-context
.ask-class-board-modal {
  top:
    92px;

  right:
    max(
      28px,
      calc(
        (
          100vw -
          min(
            1180px,
            calc(
              100vw -
              24px
            )
          )
        ) /
        2 +
        18px
      )
    );

  bottom:
    auto;

  width:
    min(
      390px,
      calc(
        100vw -
        48px
      )
    );
}


body.timetable-ai-context
.ask-class-board-modal-card {
  max-height:
    calc(
      100vh -
      130px
    );

  border-radius:
    20px;

  box-shadow:
    0 18px 50px
    rgba(
      15,
      23,
      42,
      0.20
    ),
    0 0 0 1px
    rgba(
      124,
      58,
      237,
      0.07
    );

  animation:
    timetableAiDrawerIn
    0.22s
    cubic-bezier(
      0.2,
      0.8,
      0.2,
      1
    );
}


@keyframes timetableAiDrawerIn {
  from {
    opacity:
      0;

    transform:
      translateX(
        18px
      );
  }

  to {
    opacity:
      1;

    transform:
      translateX(
        0
      );
  }
}


@media (
  max-width:
  760px
) {
  body.timetable-ai-context
  .ask-class-board-modal {
    top:
      78px;

    right:
      12px;

    bottom:
      auto;

    width:
      calc(
        100vw -
        24px
      );
  }
}


.ask-class-board-modal-card {
  position:
    relative;

  width:
    100%;

  max-height:
    min(
      680px,
      calc(
        100vh -
        130px
      )
    );

  display:
    grid;

  gap:
    16px;

  padding:
    18px;

  overflow-y:
    auto;

  border:
    1px solid
    rgba(
      148,
      163,
      184,
      0.34
    );

  border-radius:
    26px;

  background:
    linear-gradient(
      145deg,
      rgba(
        255,
        255,
        255,
        0.98
      ),
      rgba(
        248,
        250,
        252,
        0.97
      )
    );

  color:
    #111827;

  box-shadow:
    0 24px 70px
    rgba(
      15,
      23,
      42,
      0.22
    ),
    0 8px 24px
    rgba(
      99,
      102,
      241,
      0.12
    ),
    inset 0 1px 0
    rgba(
      255,
      255,
      255,
      0.9
    );

  backdrop-filter:
    blur(24px);

  pointer-events:
    auto;

  animation:
    askAiModalIn
    0.22s
    cubic-bezier(
      0.2,
      0.8,
      0.2,
      1
    );
}


.ask-class-board-modal-card::before {
  content:
    "";

  position:
    absolute;

  top:
    0;

  right:
    38px;

  left:
    38px;

  height:
    3px;

  border-radius:
    0 0 999px 999px;

  background:
    linear-gradient(
      90deg,
      #4285f4,
      #8b5cf6,
      #ec4899,
      #f59e0b
    );

  opacity:
    0.85;
}


@keyframes askAiModalIn {
  from {
    opacity:
      0;

    transform:
      translateY(12px)
      scale(0.96);
  }

  to {
    opacity:
      1;

    transform:
      translateY(0)
      scale(1);
  }
}


@media (
  max-width:
  700px
) {
  .ask-class-board-modal {
    right:
      12px;

    bottom:
      82px;

    width:
      calc(
        100vw -
        24px
      );
  }


  .ask-class-board-modal-card {
    max-height:
      calc(
        100vh -
        110px
      );

    border-radius:
      22px;
  }
}





.ask-class-board-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}


.ask-class-board-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  padding:
    6px
    10px;

  border-radius:
    999px;

  background:
    linear-gradient(
      90deg,
      #f5f3ff,
      #eff6ff
    );

  color:
    #4f46e5;

  font-size:
    10px;

  font-weight:
    950;

  letter-spacing:
    0.5px;
}


.ask-class-board-close {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  padding: 0;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    999px;

  background:
    #ffffff;

  color:
    #64748b;

  cursor:
    pointer;
}


.ask-class-board-close:hover {
  background:
    #f8fafc;

  color:
    #111827;
}


.ask-class-board-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}


.ask-class-board-hero-orb {
  width: 48px;
  height: 48px;

  flex:
    0 0
    48px;

  display: grid;
  place-items: center;

  border-radius:
    16px;

  background:
    linear-gradient(
      135deg,
      #6366f1,
      #8b5cf6,
      #3b82f6
    );

  color:
    #ffffff;

  font-size:
    21px;

  box-shadow:
    0 9px 22px
    rgba(
      99,
      102,
      241,
      0.26
    );
}


.ask-class-board-hero-copy h2 {
  margin: 0;

  color:
    #111827;

  font-size:
    25px;

  line-height:
    1.1;

  font-weight:
    950;

  letter-spacing:
    -0.7px;
}


.ask-class-board-hero-copy p {
  margin:
    5px
    0
    0;

  color:
    #64748b;

  font-size:
    13px;

  line-height:
    1.4;

  font-weight:
    750;
}


.ask-class-board-suggestions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}


.ask-class-board-suggestion {
  min-height: 32px;

  padding:
    6px
    11px;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    999px;

  background:
    #f8fafc;

  color:
    #475569;

  font-size:
    10.5px;

  font-weight:
    900;

  cursor:
    pointer;
}


.ask-class-board-suggestion:hover {
  border-color:
    #c4b5fd;

  background:
    #f5f3ff;

  color:
    #5b21b6;
}


.ask-class-board-guide-chat {
  max-height:
    250px;

  display:
    grid;

  gap:
    9px;

  overflow-y:
    auto;

  padding:
    10px;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    18px;

  background:
    #f8fafc;

  scroll-behavior:
    smooth;
}


.ask-class-board-guide-chat[hidden] {
  display:
    none !important;
}


.ask-class-board-guide-message {
  max-width:
    88%;

  padding:
    10px
    12px;

  border-radius:
    15px;

  font-size:
    12px;

  line-height:
    1.42;

  font-weight:
    800;

  white-space:
    pre-wrap;

  overflow-wrap:
    anywhere;
}


.ask-class-board-guide-message.teacher {
  justify-self:
    end;

  border-bottom-right-radius:
    5px;

  background:
    #312e81;

  color:
    #ffffff;
}


.ask-class-board-guide-message.ai {
  justify-self:
    start;

  border:
    1px solid
    #ddd6fe;

  border-bottom-left-radius:
    5px;

  background:
    #ffffff;

  color:
    #334155;
}


.ask-class-board-guide-message.ai::before {
  content:
    "✦ Class Board";

  display:
    block;

  margin-bottom:
    5px;

  color:
    #6d28d9;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.3px;
}


.ask-class-board-guide-message.working {
  color:
    #64748b;

  font-style:
    italic;
}


.ask-class-board-input-wrap {
  display: grid;
  gap: 8px;
}


.ask-class-board-input-wrap label {
  display: none;
}


.ask-class-board-input {
  width: 100%;

  min-height:
    104px;

  padding:
    17px
    18px;

  border:
    1px solid
    #dbe3ee;

  border-radius:
    22px;

  background:
    #f8fafc;

  color:
    #111827;

  font-size:
    16px;

  line-height:
    1.45;

  font-weight:
    700;

  resize:
    none;

  outline:
    none;

  transition:
    border-color
    0.15s ease,
    box-shadow
    0.15s ease,
    background
    0.15s ease;
}


.ask-class-board-input::placeholder {
  color:
    #94a3b8;
}


.ask-class-board-input:focus {
  border-color:
    #a78bfa;

  background:
    #ffffff;

  box-shadow:
    0 0 0 4px
    rgba(
      139,
      92,
      246,
      0.09
    );
}


.ask-class-board-helper {
  color:
    #94a3b8;

  font-size:
    10px;

  font-weight:
    800;
}


.ask-class-board-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}


.ask-class-board-submit-button {
  min-height:
    40px;

  padding:
    8px
    16px;

  border:
    0;

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #6366f1,
      #7c3aed,
      #3b82f6
    ) !important;

  color:
    #ffffff !important;

  box-shadow:
    0 8px 18px
    rgba(
      99,
      102,
      241,
      0.20
    );
}


.ask-class-board-submit-button:hover {
  filter:
    brightness(1.05);
}


@media (max-width: 700px) {
  .ask-class-board-modal {
    padding:
      12px;
  }

  .ask-class-board-modal-card {
    padding:
      17px;

    border-radius:
      22px;
  }

  .ask-class-board-hero-copy h2 {
    font-size:
      22px;
  }

  .ask-class-board-suggestions {
    overflow-x:
      auto;

    flex-wrap:
      nowrap;
  }

  .ask-class-board-suggestion {
    flex:
      0 0
      auto;
  }
}



    /* High-response tactile feedback animations for all layout buttons */
    .btn {
      transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.15s ease !important;
    }

    .btn:hover {
      filter: brightness(0.92);
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    }

    .btn:active {
      transform: scale(0.95) !important; /* Physical compression pop reaction on mouse down */
    }

    /* Distinct indicators for active timer operating states */
    .timer-btn-running {
      background: #143f3a !important;
      color: #ffffff !important;
      box-shadow: 0 0 12px rgba(20, 63, 58, 0.3) !important;
    }

    .timer-btn-paused {
      background: #ef4444 !important;
      color: #ffffff !important;
      border-color: #ef4444 !important;
      box-shadow: 0 0 12px rgba(239, 68, 68, 0.3) !important;
    }

    /* =========================================================
       3. BOARD LAYOUT
       ========================================================= */

    main {
  position: relative;

  height: calc(100vh - 60px);
  padding: 6px;
  overflow: hidden;

  background:
    radial-gradient(
      circle at 15% 0%,
      color-mix(
        in srgb,
        var(--board-accent) 7%,
        transparent
      ),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      var(--board-bg-a),
      var(--board-bg-b)
    );
}




    .board-shell {
  height: 100%;
  width: 100%;
  display: grid;

  /*
   * Slightly wider timetable rail.
   * Gives lesson titles and Specialist class badges
   * enough room without taking too much space
   * from the main Class Board.
   */
  grid-template-columns:
    250px
    minmax(0, 1fr)
    270px;

  gap: 8px;
  min-height: 0;
}

    .left-rail,
    .right-rail,
    .centre-board {
      min-height: 0;
      overflow: hidden;
    }

    .left-rail,
    .right-rail {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /*
      Independently collapsible timetable and widget rails.
      The narrow collapsed rail always retains a clear restore control.
    */

    .board-shell {
      transition:
        grid-template-columns 0.2s ease,
        gap 0.2s ease;
    }

    .left-rail,
    .right-rail {
      transition:
        width 0.2s ease,
        opacity 0.2s ease;
    }

    .rail-visibility-button {
      min-height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 6px 9px;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      background: #f8fafc;
      color: #143f3a;
      font-size: 10px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
      cursor: pointer;
    }

    .rail-visibility-button:hover {
      border-color: #86efac;
      background: #eefbf4;
    }

    .timetable-hide-button {
  width: auto;
  min-width: 66px;

  height: 29px;
  min-height: 29px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 5px;

  padding: 0 10px;
}

.timetable-hide-label {
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

    .right-rail-controls {
      min-height: 38px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      padding:
        3px
        4px
        3px
        10px;
      border: 1px solid #dbe3e8;
      border-radius: 999px;
      background:
        rgba(
          255,
          255,
          255,
          0.88
        );
      box-shadow:
        0 4px 12px
        rgba(15, 23, 42, 0.05);
      flex: 0 0 auto;
    }

    .right-rail-controls-title {
      margin-right: auto;
      color: #143f3a;
      font-size: 10.5px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0.2px;
      white-space: nowrap;
    }

    .right-rail-controls
    .rail-hide-widgets-button {
      flex: 0 0 auto;
    }

        .rail-hide-widgets-button {
      width: 28px !important;
      min-width: 28px !important;
      max-width: 28px !important;
      height: 28px;
      min-height: 28px !important;
      display: inline-flex !important;
      align-items: center;
      justify-content: flex-start !important;
      gap: 0;
      padding: 0 8px !important;
      border-radius: 999px !important;
      white-space: nowrap;
      overflow: hidden;
      transition:
        width 0.22s ease,
        min-width 0.22s ease,
        max-width 0.22s ease,
        gap 0.22s ease,
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
    }

    .rail-hide-widgets-icon {
      width: 14px;
      min-width: 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      line-height: 1;
    }

    .rail-hide-widgets-label {
      max-width: 0;
      opacity: 0;
      overflow: hidden;
      color: inherit;
      font-size: 10px;
      line-height: 1;
      font-weight: 950;
      transition:
        max-width 0.22s ease,
        opacity 0.14s ease;
    }

    .rail-hide-widgets-button:hover,
    .rail-hide-widgets-button:focus-visible {
      width: 100px !important;
      min-width: 100px !important;
      max-width: 100px !important;

      gap: 6px;

      border-color:
        var(--board-accent-2) !important;

      background:
        color-mix(
          in srgb,
          var(--board-accent) 11%,
          #ffffff
        ) !important;

      color:
        var(--board-ink) !important;

      outline: none;

      transform:
        translateY(-1px);
    }

    .rail-hide-widgets-button:hover
    .rail-hide-widgets-label,
    .rail-hide-widgets-button:focus-visible
    .rail-hide-widgets-label {
      max-width: 76px;
      opacity: 1;
    }

    .rail-hide-widgets-button:active {
      transform: scale(0.97);
    }

    

    .rail-widget-edit-button {
      width: auto;
      min-width: 88px;
      max-width: none;
      height: 28px;
      min-height: 28px;

      display: inline-flex;
      align-items: center;
      justify-content: center;

      gap: 5px;
      padding: 0 9px;

      border:
        1px solid
        var(--board-border);

      border-radius: 999px;

      background:
        color-mix(
          in srgb,
          var(--board-card) 94%,
          var(--board-surface-soft)
        );

      color:
        var(--board-ink);

      line-height: 1;
      font-weight: 950;

      white-space: nowrap;
      overflow: visible;
      cursor: pointer;

      box-shadow:
        0 3px 8px
        rgba(15, 23, 42, 0.05);

      transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
    }

    .rail-widget-edit-icon {
      width: 14px;
      min-width: 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      line-height: 1;
    }

    .rail-widget-edit-label {
      max-width: none;
      opacity: 1;
      overflow: visible;
      color: inherit;
      font-size: 9.5px;
      line-height: 1;
      font-weight: 950;
    }

    .rail-widget-edit-button:hover,
    .rail-widget-edit-button:focus-visible {
      border-color:
        var(--board-accent-2);

      background:
        color-mix(
          in srgb,
          var(--board-accent) 14%,
          #ffffff
        );

      color:
        var(--board-ink);

      outline: none;

      transform:
        translateY(-1px);
    }

    .rail-widget-edit-button:active {
  transform: scale(0.97);
}


/* =========================================================
   RIGHT RAIL — QUICK CLASS POINTS
   ========================================================= */

.rail-quick-points-button {
  height: 30px;
  min-height: 30px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 5px;

  padding:
    0
    12px;

  border:
    2px solid
    #fbbf24;

  border-radius:
    999px;

  background:
    #fef3c7;

  color:
    #78350f;

  font-size:
    10.5px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;

  box-shadow:
    0 3px 8px
    rgba(
      146,
      64,
      14,
      0.08
    );

  transition:
    transform
    0.15s ease,
    background
    0.15s ease,
    border-color
    0.15s ease,
    box-shadow
    0.15s ease;
}


.rail-quick-points-button:hover,
.rail-quick-points-button:focus-visible {
  border-color:
    #fbbf24;

  background:
    #fef3c7;

  box-shadow:
    0 5px 12px
    rgba(
      146,
      64,
      14,
      0.12
    );

  outline:
    none;

  transform:
    translateY(-1px);
}


.rail-quick-points-button:active {
  transform:
    scale(0.94);
}


/*
 * Keep the quick reward action clearly
 * separated on the left of the widget controls.
 */
.right-rail-controls
.rail-quick-points-button {
  margin-right:
    auto;
}


.collapsed-rail-controls {
      display: none;
      width: 100%;
      min-height: 0;
      flex: 1;
      flex-direction: column;
      align-items: stretch;
      gap: 7px;
    }

    .collapsed-rail-controls .rail-visibility-button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 2px;
  border-radius: 11px;
  font-size: 15px;
}

/*
  In Present to Class, make the timetable
  restore control feel like an Agenda tab.
*/
body.focus-mode
.left-rail-collapsed-controls
.rail-visibility-button:first-child {
  position: relative;

  min-height: 84px;

  padding:
    9px
    3px;

  flex-direction: column;

  gap: 5px;

  border-color:
    #bbf7d0;

  background:
    #f0fdf4;

  color:
    #166534;
}

body.focus-mode
.left-rail-collapsed-controls
.rail-visibility-button:first-child::after {
  content: "AGENDA";

  font-size: 8px;

  line-height: 1;

  font-weight: 950;

  letter-spacing: 0.7px;

  writing-mode: vertical-rl;

  transform: rotate(180deg);
}

body.focus-mode
.left-rail-collapsed-controls
.rail-visibility-button:first-child:hover {
  border-color:
    #5fdc9a;

  background:
    #dcfce7;
}

    body.left-rail-collapsed .board-shell {
      grid-template-columns:
        38px
        minmax(0, 1fr)
        270px;
    }

    body.right-rail-collapsed .board-shell {
  grid-template-columns:
    250px
    minmax(0, 1fr)
    100px;
}

    body.left-rail-collapsed.right-rail-collapsed
    .board-shell {
      grid-template-columns:
        38px
        minmax(0, 1fr)
        100px;
    }

    .right-rail-collapsed-controls .rail-visibility-button {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    body.left-rail-collapsed
    .left-rail
    .timetable-panel {
      display: none;
    }

    body.left-rail-collapsed
    .left-rail
    .left-rail-collapsed-controls {
      display: flex;
    }

    body.right-rail-collapsed
    .right-rail
    .right-rail-controls,
    body.right-rail-collapsed
    .right-rail
    .widget-slot {
      display: none;
    }

    body.right-rail-collapsed
    .right-rail
    .right-rail-collapsed-controls {
      display: flex;
    }

    /*
      When the timetable is collapsed, Back to my Dashboard becomes
      a compact home icon rather than displaying its full label.
    */

    .collapsed-back-to-teacher-button {
      min-height: 42px;
      border-color: #bfdbfe;
      background: #eff6ff;
      color: #1e3a5f;
    }

    .collapsed-back-to-teacher-button:hover {
      border-color: #93c5fd;
      background: #dbeafe;
    }

    .centre-board {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 56px; /* Compressed track footprint to maximize lesson canvas room */
  gap: 8px;
}

    .panel {
      background:
        color-mix(
          in srgb,
          var(--board-card) 94%,
          var(--board-surface-soft)
        );

      border:
        1px solid
        var(--board-border);

      border-radius: 17px;

      box-shadow:
        0 8px 22px
        rgba(
          15,
          23,
          42,
          0.05
        );

      overflow: hidden;
      min-height: 0;
      flex-shrink: 0;
    }

    .panel-head {
      min-height: 40px;
      padding: 8px 10px;

      border-bottom:
        1px solid
        var(--board-border);

      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 7px;

      background:
        color-mix(
          in srgb,
          var(--board-surface-soft) 34%,
          #ffffff
        );
    }

    .panel-head h2 {
      margin: 0;
      font-size: 15px;

      color:
        var(--board-ink);

      letter-spacing: -0.25px;
    }

    /* Smart Tactile Shortcut Feedback */
    .timetable-panel-head {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
}

.timetable-day-navigation {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns:
    30px
    minmax(0, 1fr)
    30px;
  align-items: center;
  gap: 6px;
}

.timetable-day-heading {
  margin: 0;
  min-width: 0;
  color: var(--board-ink);
  font-size: 17px !important;
  line-height: 1;
  font-weight: 950 !important;
  letter-spacing: -0.4px;
  white-space: nowrap;
  text-align: center;
}

.timetable-day-nav-button {
  width: 29px;
  height: 29px;
  min-width: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--board-ink);
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.timetable-day-nav-button:hover:not(:disabled) {
  border-color:
    var(--board-accent);

  background:
    color-mix(
      in srgb,
      var(--board-accent) 12%,
      #ffffff
    );

  transform:
    translateY(-1px);
}

.timetable-day-nav-button:active:not(:disabled) {
  transform: scale(0.94);
}

.timetable-day-nav-button:disabled {
  opacity: 0.28;
  cursor: default;
}

.timetable-panel-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.timetable-day-heading {
  margin: 0;
  min-width: 72px;
  color: var(--board-ink);
  font-size: 17px !important;
  line-height: 1;
  font-weight: 950 !important;
  letter-spacing: -0.4px;
  white-space: nowrap;
  text-align: center;
}

.timetable-day-nav-button {
  width: 25px;
  height: 25px;
  min-width: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--board-ink);
  font-size: 19px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.timetable-day-nav-button:hover:not(:disabled) {
  border-color: #86efac;
  background: #eefbf4;
  transform: translateY(-1px);
}

.timetable-day-nav-button:active:not(:disabled) {
  transform: scale(0.94);
}

.timetable-day-nav-button:disabled {
  opacity: 0.28;
  cursor: default;
}

.timetable-back-button {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 13px;
  background: #eff6ff;
  color: #1e3a5f;
  font-size: 11.5px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
}

.timetable-back-button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
  transform: translateY(-1px);
}

.timetable-back-button:active {
  transform: scale(0.97);
}

    .panel-actions {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .icon-btn {
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #143f3a;
  border-radius: 999px;
  width: 27px;
  height: 27px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.timetable-header-action {
  width: 29px;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
  transition:
    width 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.timetable-header-action .timetable-header-action-icon {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}

.timetable-header-action .timetable-header-action-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  transition:
    max-width 0.18s ease,
    opacity 0.14s ease;
}

.timetable-header-action:hover,
.timetable-header-action:focus-visible {
  width: 112px;
  justify-content: flex-start;
  background: #eefbf4;
  border-color: #86efac;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
  outline: none;
}

.timetable-header-action:hover .timetable-header-action-label,
.timetable-header-action:focus-visible .timetable-header-action-label {
  max-width: 92px;
  opacity: 1;
}

/* Keep the header Edit timetable button permanently open */
header .timetable-header-action {
  width: 124px !important;
  min-width: 124px !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  padding: 0 12px !important;
}

header .timetable-header-action .timetable-header-action-label {
  max-width: 92px !important;
  opacity: 1 !important;
}

@media (hover: none) {
  .timetable-header-action:hover {
  width: 29px;
    justify-content: center;
  }

  .timetable-header-action:hover .timetable-header-action-label {
    max-width: 0;
    opacity: 0;
  }
}

    .panel-body {
      padding: 9px;
      min-height: 0;
    }

    /*
      Interactive widget displays

      The visible tool itself acts as the primary action, so
      separate Roll here and Spin here buttons are unnecessary.
    */

    .widget-interactive-stage {
      position: relative;
      width: 100%;
      min-width: 0;
      display: grid;
      place-items: center;
      gap: 5px;
      margin: 0 0 8px;
      padding: 8px;

      border:
        1px solid
        color-mix(
          in srgb,
          var(--board-accent) 34%,
          var(--board-border)
        );

      border-radius: 14px;

      background:
        linear-gradient(
          145deg,
          #ffffff,
          color-mix(
            in srgb,
            var(--board-surface-soft) 58%,
            #ffffff
          )
        );

      color:
        var(--board-ink);

      font: inherit;
      text-align: center;
      cursor: pointer;

      box-shadow:
        0 5px 12px
        rgba(15, 23, 42, 0.05);

      transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
    }

    .widget-interactive-stage:hover,
    .widget-interactive-stage:focus-visible {
      border-color:
        var(--board-accent-2);

      background:
        linear-gradient(
          145deg,
          #ffffff,
          color-mix(
            in srgb,
            var(--board-accent) 13%,
            #ffffff
          )
        );

      box-shadow:
        0 8px 18px
        color-mix(
          in srgb,
          var(--board-ink) 10%,
          transparent
        );

      outline: none;
      transform: translateY(-1px);
    }

    .widget-interactive-stage:active {
      transform: scale(0.98);
    }

    .widget-interaction-hint {
      color: #64748b;
      font-size: 9px;
      line-height: 1;
      font-weight: 900;
      letter-spacing: 0.2px;
    }

    .widget-spinner-stage {
      min-height: 92px;
      align-content: center;
      padding:
        12px
        10px;
    }

    .widget-spinner-icon {
      font-size: 25px;
      line-height: 1;
      transition:
        transform 0.2s ease;
    }

    .widget-spinner-stage:hover
    .widget-spinner-icon {
      transform: rotate(18deg);
    }

    .widget-spinner-stage
    .widget-live-stage {
      width: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;

      color:
        var(--board-ink);

      font-size: 15px;
      line-height: 1.18;
      font-weight: 950;
      overflow-wrap: anywhere;
    }

    .widget-dice-stage {
      min-height: 0;
      height: auto;
      align-content: center;
      justify-content: center;
      gap: 6px;
      padding:
        12px
        10px
        16px;
    }

    .widget-dice-stage
    .widget-interaction-hint {
      margin: 0 0 2px;
      font-size: 8.5px;
      line-height: 1;
    }

    .widget-dice-stage
    .dice-arena-floor {
      width: 100%;
      display: grid;
      place-items: center;
    }

    .widget-dice-stage
    .cube-3d-die {
      flex: 0 0 auto;
    }

    .widget-dice-stage
    .widget-interaction-hint {
      margin: 0;
      font-size: 9px;
      line-height: 1;
    }

    /* =========================================================
       4. TIMETABLE
       ========================================================= */

           .timetable-order-edit-number {
  min-width:
    72px;

  min-height:
    38px;

  display:
    grid;

  place-items:
    center;

  padding:
    7px
    10px;

  border:
    1px solid
    #d9fbe8;

  border-radius:
    10px;

  background:
    #f1fdf6;

  color:
    #166534;

  font-size:
    12px;

  line-height:
    1;

  font-weight:
    950;
}


.timetable-order-edit-label {
  color:
    #64748b;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    850;

  text-transform:
    uppercase;

  letter-spacing:
    0.3px;
}


.timetable-order-edit-number
strong {
  color:
    #166534;

  font-size:
    14px;

  line-height:
    1;

  font-weight:
    950;
}


.timetable-mode-switch {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 7px;
      flex: 0 0 auto;
    }

    #timetableModal
#classTimetableEditor {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#timetableModal
#classTimetableEditor[hidden] {
  display: none !important;
}

#timetableModal
#classTimetableEditor
.modal-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

#timetableModal
.modal-card {
  display: grid;
  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto;
  overflow: hidden;
}

#timetableModal
#classTimetableEditor {
  height: 100%;
}

#specialistTimetableEditor {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
}

#specialistTimetableEditor[hidden] {
  display: none !important;
}

.specialist-timetable-editor-shell {
  display: grid;
  gap: 14px;
}

.specialist-timetable-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #d9fbe8;
  border-radius: 16px;
  background: #f1fdf6;
}

.specialist-timetable-editor-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.specialist-timetable-editor-heading strong {
  color: #143f3a;
  font-size: 17px;
  line-height: 1.1;
  font-weight: 950;
}

.specialist-timetable-editor-heading span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.specialist-timetable-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid #d9fbe8;
  border-radius: 14px;
  background: #f1fdf6;
}

.specialist-timetable-control {
  display: grid;
  gap: 5px;
}

.specialist-timetable-control > span {
  color: #64748b;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.specialist-timetable-control select,
.specialist-timetable-control input {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-weight: 900;
}

.specialist-week-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.specialist-week-control strong {
  min-width: 64px;
  text-align: center;
  color: #143f3a;
  font-size: 12px;
  font-weight: 950;
}

.specialist-timetable-controls
.specialist-timetable-class-count {
  margin-left: 0;
  margin-bottom: 4px;
}

.specialist-day-tabs {
  display: grid;
  grid-template-columns:
    repeat(5, minmax(112px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.specialist-period-list {
  display: grid;
  gap: 8px;
}

.specialist-period-row {
  display: grid;
  grid-template-columns:
    110px
    minmax(170px, 1fr)
    minmax(170px, 1fr)
    minmax(160px, 0.8fr)
    auto;
  gap: 8px;
  align-items: center;
}

.specialist-period-row > input,
.specialist-period-row > select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.specialist-period-row > select {
  color: #143f3a;
  font-weight: 900;
}

.specialist-period-row
.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.specialist-timetable-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 15px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
}

.specialist-timetable-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.specialist-timetable-footer-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.specialist-timetable-save-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 700px) {
  .specialist-timetable-actions {
    align-items: stretch;
    flex-direction: column;
  }

    .specialist-timetable-footer-primary {
    width: 100%;
  }

  .specialist-timetable-footer-primary
  .btn {
    flex: 1;
  }

  .specialist-timetable-save-actions {
    width: 100%;
  }

  .specialist-timetable-save-actions
  .btn {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .specialist-period-row {
    grid-template-columns:
      105px
      minmax(160px, 1fr)
      minmax(150px, 1fr)
      minmax(150px, 0.8fr);
  }

  .specialist-period-row
  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

        

    .timetable-mode-button {
      min-height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 8px 13px;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      background: #ffffff;
      color: #475569;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
      transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
    }

    .timetable-mode-button:hover {
      border-color: #86efac;
      background: #f0fdf4;
      color: #166534;
    }

    .timetable-mode-button:active {
      transform: scale(0.97);
    }

    .timetable-mode-button.active {
  border-color:
    #f59e0b !important;

  background:
    #fff7ed !important;

  color:
    #c2410c !important;

  box-shadow:
    0 2px 6px
    rgba(
      245,
      158,
      11,
      0.16
    ) !important;

  font-weight:
    950;
}


.timetable-mode-button.active:hover,
.timetable-mode-button.active:focus-visible {
  border-color:
    #f59e0b !important;

  background:
    #fff7ed !important;

  color:
    #c2410c !important;

  box-shadow:
    0 2px 6px
    rgba(
      245,
      158,
      11,
      0.16
    ) !important;

  outline:
    none;
}

    .specialist-timetable-intro {
      margin: 0 16px 14px;
      padding: 18px;
      border: 1px solid #d9fbe8;
      border-radius: 18px;
      background:
        linear-gradient(
          135deg,
          #f8fffb,
          #f1fdf6
        );
    }

    .specialist-timetable-intro[hidden] {
      display: none !important;
    }
    #classTimetableFooter[hidden] {
  display: none !important;
}

    .specialist-timetable-intro-card {
      display: grid;
      gap: 10px;
    }

    .specialist-timetable-intro-title {
      color: #143f3a;
      font-size: 18px;
      line-height: 1.1;
      font-weight: 950;
    }

    .specialist-timetable-intro-text {
      max-width: 620px;
      color: #64748b;
      font-size: 13px;
      line-height: 1.45;
      font-weight: 800;
    }

    .specialist-timetable-class-count {
      width: fit-content;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border: 1px solid #bbf7d0;
      border-radius: 999px;
      background: #ffffff;
      color: #166534;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
    }

    .timetable-panel {
      height: 100%;

      display:
        grid;

      grid-template-rows:
        auto
        minmax(0, 1fr);

      min-height:
        0;
    }

    /* Timetable Live Row Progress Bar - Projector Optimized */
    .row-progress-container {
  width:
    100%;

  flex:
    0
    0
    auto;

  margin:
    6px
    0
    2px;

  display:
    flex;

  flex-direction:
    column;

  gap:
    4px;
}


/*
 * Keep By order especially compact because
 * the row already shows readiness + countdown.
 */
.order-only-row
.row-progress-container {
  margin-top:
    6px;

  margin-bottom:
    0;

  gap:
    3px;
}

    .row-time-left {
      font-size: 13px; /* Scaled up for cross-room readability */
      font-weight: 950;
      color: #dc2626; 
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .row-progress-track {
  width:
    100%;

  height:
    8px;

  min-height:
    8px;

  flex:
    0
    0
    8px;

  background:
    rgba(
      0,
      0,
      0,
      0.12
    );

  border-radius:
    999px;

  overflow:
    hidden;
}

    .row-progress-bar {
      height: 100%;
      width: 0%;
      background: #dc2626; 
      border-radius: 999px;
      transition: width 1s linear;
      box-shadow: 0 0 4px rgba(220, 38, 38, 0.2); /* Soft warning glow */
    }

    /* Focus-Safe Central Header Countdown Pill */
    .stage-progress-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      padding: 0 16px;
      border-radius: 16px;
      background: #fee2e2;
      border: 1px solid #fecaca;
      color: #dc2626;
      font-weight: 950;
      font-size: 14px;
      white-space: nowrap;
      box-shadow: 0 4px 12px rgba(220, 38, 38, 0.06);
    }

    .timetable-panel .panel-body {
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.timetable-panel-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
}

    .timetable-panel .panel-body::-webkit-scrollbar,
    .stage-body::-webkit-scrollbar,
    .widget-slot .panel-body::-webkit-scrollbar,
    .modal-body::-webkit-scrollbar {
      width: 8px;
    }

    .timetable-panel .panel-body::-webkit-scrollbar-thumb,
    .stage-body::-webkit-scrollbar-thumb,
    .widget-slot .panel-body::-webkit-scrollbar-thumb,
    .modal-body::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 999px;
    }

    .timetable-list {
  min-height: 0;
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 2px 3px 14px 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

    .time-row {
  display: grid;

  /*
 * Normal clock timetable keeps enough room
 * for times such as 10:30 and 11:00.
 */
grid-template-columns:
  50px
  minmax(0, 1fr);

align-items: stretch;

border:
  1px solid
  #e5e7eb;

border-radius:
  13px;

overflow:
  hidden;

background:
  #f8fafc;

/*
 * Allow Specialist rows to breathe.
 * Rows can grow naturally when they contain
 * a class/teacher badge underneath.
 */
min-height:
  62px;

cursor:
  pointer;
}


/*
 * By order only needs room for 1, 2, 3...
 * Give the lesson content more horizontal space.
 */
.time-row.order-only-row {
  grid-template-columns:
    38px
    minmax(0, 1fr);

  min-height:
    56px;
}


.time-row.order-only-row
.period {
  padding-top:
    7px;

  padding-bottom:
    7px;
}


.time-row.order-only-row
.lesson-readiness-status {
  margin-top:
    3px;
}


.time-row.order-only-row
.row-progress-container {
  margin-top:
    4px;

  margin-bottom:
    0;

  gap:
    2px;
}


.time-row.order-only-row
.row-time-left {
  font-size:
    11.5px;
}


.time {
  background:
    var(--board-ink) !important;

  color:
    #ffffff;

  font-weight:
    900;

  font-size:
    11.5px;

  line-height:
    1.08;

  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  padding:
    6px
    3px;

  text-align:
    center;

  transition:
    background
    0.3s ease;
}


/*
 * In By order mode, the left block shows
 * a simple lesson number rather than a time.
 */
.time-row.order-only-row
.time {
  font-size:
    13px;

  font-weight:
    950;

  padding:
    6px
    2px;
}


.period {
  position:
    relative;

  min-width:
    0;

  /*
   * Keep room for the edit pencil, but waste
   * less horizontal space than before.
   */
  padding:
    8px
    29px
    8px
    11px;

  display:
    flex;

  flex-direction:
    column;

  justify-content:
    center;
}


/*
 * A live period contains extra information:
 * readiness, time remaining and progress.
 *
 * Start that content from the top so the
 * progress bar can never be pushed below
 * the clipped edge of the timetable card.
 */
/*
 * The live timetable card contains more content
 * than a normal period.
 *
 * Let the entire GRID ROW grow naturally from
 * its content instead of trying to force a
 * particular height.
 */
.time-row.current-period {
  height:
    max-content !important;

  min-height:
    max-content !important;

  grid-auto-rows:
    max-content;

  align-items:
    stretch;

  overflow:
    hidden;
}


/*
 * The lesson side determines the height of
 * the live card.
 */
.time-row.current-period
.period {
  height:
    auto !important;

  min-height:
    max-content !important;

  display:
    flex;

  flex-direction:
    column;

  align-items:
    stretch;

  justify-content:
    flex-start;

  padding:
    9px
    29px
    10px
    11px;

  overflow:
    visible;
}


/*
 * Nothing inside the live period is allowed
 * to shrink out of view.
 */
.time-row.current-period
.period
> strong,

.time-row.current-period
.period
> span,

.time-row.current-period
.lesson-readiness-status,

.time-row.current-period
.row-progress-container {
  flex:
    0
    0
    auto;
}


/*
 * Countdown and progress always occupy their
 * own visible space.
 */
.time-row.current-period
.row-progress-container {
  width:
    100%;

  margin:
    5px
    0
    2px;

  display:
    flex;

  flex-direction:
    column;

  gap:
    4px;
}


.time-row.current-period
.row-progress-track {
  width:
    100%;

  height:
    8px;

  min-height:
    8px;

  display:
    block;

  flex:
    0
    0
    8px;
}


.time-row.current-period
.row-progress-bar {
  width:
    auto;

  height:
    100%;

  min-height:
    8px;

  display:
    block;
}


/*
 * The brown time/order panel simply stretches
 * to match whatever height the lesson side needs.
 */
.time-row.current-period
.time {
  height:
    100%;

  align-self:
    stretch;
}


.period strong {
  display:
    -webkit-box;

  min-width:
    0;

  margin:
    0
    0
    4px;

  color:
    #111827;

  font-size:
    13px;

  line-height:
    1.18;

  font-weight:
    900;

  white-space:
    normal;

  overflow:
    hidden;

  overflow-wrap:
    normal;

  word-break:
    normal;

  -webkit-box-orient:
    vertical;

  -webkit-line-clamp:
    2;

  line-clamp:
    2;
}


.period span {
  min-width:
    0;

  color:
    #6b7280;

  font-size:
    10.5px;

  line-height:
    1.2;

  display:
    block;

  white-space:
    nowrap;

  overflow:
    hidden;

  text-overflow:
    ellipsis;
}


.specialist-sidebar-class {
  width:
    fit-content;

  max-width:
    100%;

  min-height:
    21px;

  margin-top:
    3px;

  display:
    inline-flex !important;

  align-items:
    center;

  gap:
    4px;

  padding:
    3px
    7px;

  border:
    1px solid
    #bbf7d0;

  border-radius:
    999px;

  background:
    #eefbf4;

  color:
    #166534 !important;

  font-size:
    9.5px !important;

  line-height:
    1.1 !important;

  font-weight:
    950;

  white-space:
    nowrap;

  overflow:
    hidden;

  text-overflow:
    ellipsis;

  flex:
    0 0 auto;
}

.specialist-sidebar-period {
  cursor: pointer;
}

.timetable-lesson-edit-button {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #ffffff;
  color: #166534;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform:
    translateY(-50%)
    scale(0.88);
  box-shadow:
    0 4px 10px rgba(15, 23, 42, 0.08);
  transition:
    opacity 0.14s ease,
    visibility 0.14s ease,
    transform 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.time-row:hover
.timetable-lesson-edit-button,
.time-row:focus-within
.timetable-lesson-edit-button {
  opacity: 1;
  visibility: visible;
  transform:
    translateY(-50%)
    scale(1);
}

.timetable-lesson-edit-button:hover,
.timetable-lesson-edit-button:focus-visible {
  border-color:
    var(--board-accent-2);

  background:
    color-mix(
      in srgb,
      var(--board-accent) 18%,
      #ffffff
    );

  color:
    var(--board-ink);

  box-shadow:
    0 6px 14px
    rgba(15, 23, 42, 0.10);

  outline: none;

  transform:
    translateY(-50%)
    scale(1.06);
}

.timetable-lesson-edit-button:active {
  transform:
    translateY(-50%)
    scale(0.94);
}

/*
  Touch devices have no reliable hover,
  so keep Edit lesson visible there.
*/
@media (hover: none) {
  .timetable-lesson-edit-button {
    opacity: 1;
    visibility: visible;
    transform:
      translateY(-50%)
      scale(1);
  }
}

.lesson-readiness-status {
  width:
    fit-content;

  flex:
    0
    0
    auto;

  margin-top:
    5px;

  display:
    inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.lesson-readiness-status.ready {
  color: #15803d;
}

.lesson-readiness-status.attention {
  color: #b45309;
}

.lesson-readiness-status.incomplete {
  color: #ca8a04;
}

.lesson-readiness-status.not-prepared {
  color: #64748b;
}

/*
  Passed lessons remain readable and clickable, but no longer
  compete visually with the current and upcoming lessons.
*/

.past-period {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  box-shadow: none !important;
}

.past-period .time {
  background: #475569 !important;
  color: #ffffff !important;
}

.past-period .period strong {
  color: #334155 !important;
}

.past-period .period > span {
  color: #64748b !important;
}

.past-period:hover {
  border-color: #64748b !important;
  background: #ffffff !important;
}

.past-period:hover .time {
  background: #334155 !important;
}

.past-period.selected-period-row {
  border-color: #2563eb !important;
  background: #ffffff !important;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.22) !important;
}

.past-period.selected-period-row .time {
  background: #64748b !important;
}

    /* Theme-adaptive border highlights for the schedule sidebar roster cards */
.time-row:hover {
  border-color: var(--board-accent-2) !important;
}

/* Selected row: teacher has clicked it, but it is not necessarily happening now */
.selected-period-row {
  border-color:
    var(--board-accent-2) !important;

  background:
    color-mix(
      in srgb,
      var(--board-accent) 6%,
      #ffffff
    ) !important;

  box-shadow:
    0 0 0 2px
    color-mix(
      in srgb,
      var(--board-accent) 24%,
      transparent
    ) !important;

  flex-shrink: 0;
}

/* Current row: this is the live period happening now */
/* Current row: subtle live state with green dot and NOW badge */
.current-period {
  position: relative;
  border-color: #86efac !important;
  background: #f8fafc !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16) !important;
  flex-shrink: 0;
}

/* Keep the time block consistent with the timetable theme */
.current-period .time {
  position: relative;
  background: var(--board-ink) !important;
  color: #ffffff !important;
  flex-direction: column;
  gap: 5px;
}

/* Green live dot under the time */
.current-period .time::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.22),
    0 0 10px rgba(34, 197, 94, 0.45);
}

/* Current lesson badge */
.current-period .period::after {
  content: "NOW";

  display:
    inline-flex;

  align-items:
    center;

  width:
    fit-content;

  min-height:
    22px;

  margin-top:
    7px;

  margin-bottom:
    2px;

  padding:
    4px
    10px;

  border-radius:
    999px;

  background:
    #dcfce7;

  color:
    #166534;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.7px;

  flex:
    0
    0
    auto;
}


/*
 * By order has a compact live card.
 *
 * Reserve a dedicated area for NOW so the badge
 * can never be pushed below the progress bar
 * or clipped by the rounded timetable row.
 */
.time-row.order-only-row.current-period
.period {
  position:
    relative;

  padding-bottom:
    42px !important;
}


.time-row.order-only-row.current-period
.period::after {
  position:
    absolute;

  left:
    11px;

  bottom:
    9px;

  margin:
    0;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  width:
    fit-content;

  min-height:
    22px;

  padding:
    4px
    10px;

  flex:
    none;
}

/* =========================================================
   TIMETABLE SIDEBAR — DAY FINISHED
   ========================================================= */

/* =========================================================
   TIMETABLE SIDEBAR — FINISHED DAY ON FINAL PERIOD
   ========================================================= */

.time-row.day-finished-period {
  border-color:
    #86efac !important;

  background:
    #f8fffb !important;

  box-shadow:
    0 0 0 2px
    rgba(
      34,
      197,
      94,
      0.10
    ) !important;
}


.time-row.day-finished-period
.time {
  background:
    #166534 !important;
}


.timetable-final-status {
  display:
    grid;

  gap:
    3px;

  margin-top:
    6px;

  padding-top:
    6px;

  border-top:
    1px solid
    #d1fae5;
}


.timetable-final-status-title {
  display:
    flex;

  align-items:
    center;

  gap:
    4px;

  color:
    #15803d;

  font-size:
    9.5px;

  line-height:
    1;

  font-weight:
    950;
}


.timetable-final-status-next {
  color:
    #64748b;

  font-size:
    8.5px;

  line-height:
    1.25;

  font-weight:
    850;

  overflow-wrap:
    anywhere;
}


.timetable-final-status-next
strong {
  color:
    #334155;

  font-weight:
    950;
}


/* Upcoming first lesson before the school day begins */
.next-period {
  position:
    relative;

  height:
    max-content !important;

  min-height:
    max-content !important;

  grid-auto-rows:
    max-content;

  align-items:
    stretch;

  overflow:
    hidden;

  border-color:
    #bfdbfe !important;

  background:
    #f8fbff !important;

  box-shadow:
    0
    0
    0
    2px
    rgba(
      59,
      130,
      246,
      0.12
    ) !important;
}

/*
 * NEXT rows may contain title, note,
 * readiness and the NEXT badge.
 * Let the card grow naturally so none
 * of those elements are clipped.
 */
.next-period
.period {
  height:
    auto !important;

  min-height:
    max-content !important;

  display:
    flex;

  flex-direction:
    column;

  align-items:
    stretch;

  justify-content:
    flex-start;

  padding:
    9px
    29px
    10px
    11px;

  overflow:
    visible;
}


.next-period
.period
> strong,

.next-period
.period
> span,

.next-period
.lesson-readiness-status {
  flex:
    0
    0
    auto;
}


/*
 * Brown time/order block stretches to
 * match the natural NEXT card height.
 */
.next-period
.time {
  height:
    100%;

  align-self:
    stretch;
}

.next-period .time {
  position: relative;
  background: var(--board-ink) !important;
  color: #ffffff !important;
  flex-direction: column;
  gap: 5px;
}

.next-period .time::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow:
    0 0 0 3px rgba(96, 165, 250, 0.20),
    0 0 10px rgba(96, 165, 250, 0.35);
}

.next-period .period::after {
  content:
    "NEXT";

  display:
    inline-flex;

  align-items:
    center;

  width:
    fit-content;

  min-height:
    22px;

  margin-top:
    7px;

  margin-bottom:
    2px;

  padding:
    4px
    10px;

  border-radius:
    999px;

  background:
    #dbeafe;

  color:
    #1d4ed8;
  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.7px;
}

/* If current is also selected, keep it clear but not overpowering */
.current-period.selected-period-row {
  border-color: #22c55e !important;
  background: #f8fafc !important;
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.22),
    0 8px 18px rgba(15, 23, 42, 0.06) !important;
}

    /* =========================================================
       5. CENTRE STAGE
       ========================================================= */

    .stage-card {
      min-height: 0;
      height: 100%;

      background:
        radial-gradient(
          circle at top left,
          color-mix(
            in srgb,
            var(--board-accent) 18%,
            transparent
          ),
          transparent 34%
        ),
        linear-gradient(
          135deg,
          var(--board-card),
          color-mix(
            in srgb,
            var(--board-surface-soft) 34%,
            #ffffff
          )
        );

      border:
        1px solid
        var(--board-border);

      border-radius: 24px;

      box-shadow:
        var(--board-shadow);

      padding: 16px;

      display: grid;

      grid-template-rows:
        auto
        1fr;

      gap: 10px;
      overflow: hidden;
    }

    .stage-top {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
    }

    .stage-label {
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 1.2px;
      text-transform: uppercase;

      color:
        var(--board-accent-2);

      margin-bottom: 4px;
    }

    .stage-title {
      margin: 0;

      color:
        var(--board-ink);

      font-size:
        clamp(24px, 2.4vw, 38px);

      line-height: 1;
      font-weight: 900;
      letter-spacing: -1.1px;

      display: flex;
      align-items: center;

      gap: 12px;
      flex-wrap: wrap;
    }

    .task-stage-heading-wrap {
      width: 100%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 9px;
    }

    .task-stage-heading-title {
      min-width: 0;
      color: var(--board-ink);
      font-size: inherit;
      line-height: 1;
      font-weight: 950;
      letter-spacing: inherit;
      overflow-wrap: anywhere;
    }

    .task-stage-heading-bottom {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

    .task-stage-heading-meta {
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  flex: 0 1 auto;
}

    .task-stage-heading-pill {
      min-height: 28px;

      display: inline-flex;
      align-items: center;
      justify-content: center;

      padding: 5px 10px;

      border:
        1px solid
        color-mix(
          in srgb,
          var(--board-accent) 42%,
          var(--board-border)
        );

      border-radius: 999px;

      background:
        color-mix(
          in srgb,
          var(--board-accent) 13%,
          #ffffff
        );

      color:
        var(--board-ink);

      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0;

      white-space: nowrap;
    }

    .task-stage-heading-actions {
  width: auto;
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: nowrap;
  overflow: visible;
}

    .task-stage-heading-actions .btn {
      flex: 0 0 auto;
    }

    .task-stage-heading-actions .btn {
      min-height: 32px;
      padding: 6px 11px;
      font-size: 11px;
      line-height: 1;
      letter-spacing: 0;
      box-shadow: none;
    }

    .task-stage-heading-actions .task-heading-primary {
  padding-left: 14px;
  padding-right: 14px;
}

.task-heading-qr-button {
  display: none;
}

.task-heading-expand-slides {
  display: inline-flex;
  min-height: 32px;
  padding: 6px 11px;
  font-size: 11px;
}

body.focus-mode[data-stage="task"]
.task-heading-qr-button {
  display: inline-flex;
  min-height: 32px;
  padding: 6px 11px;
  font-size: 11px;
}

body.focus-mode[data-stage="task"]
.task-heading-primary {
  display: none !important;
}


body.focus-mode[data-stage="task"]
.task-heading-qr-button {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

body.focus-mode[data-stage="task"]
.task-heading-qr-button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

body.focus-mode[data-stage="task"]
.task-heading-qr-button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}



/* Lesson resources dropdown */

.lesson-resources-menu {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  align-self: center;
  height: 32px;
  margin: 0;
  padding: 0;
}

.lesson-resources-menu > summary {
  list-style: none;
  height: 32px;
  min-height: 32px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lesson-resources-menu > summary::-webkit-details-marker {
  display: none;
}

.lesson-resources-menu > summary::after {
  content: "▾";
  margin-left: 3px;
  font-size: 9px;
  transition: transform 0.15s ease;
}

.lesson-resources-menu[open] > summary::after {
  transform: rotate(180deg);
}

.lesson-resources-menu-panel {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 150;
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.lesson-resources-menu-panel button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--board-ink);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.lesson-resources-menu-panel button:hover {
  background: #eefbf4;
}

.lesson-resources-menu-panel button.active {
  background: var(--board-ink);
  color: #ffffff;
}

/*
  Present to Class places the lesson QR control directly
  beside Student instructions instead of inside Resources.
*/
body.focus-mode[data-stage="task"]
.lesson-resource-qr-menu-item {
  display: none !important;
}

.lesson-resources-menu-panel button:disabled {
  color: #94a3b8;
  cursor: default;
  opacity: 1;
}

.lesson-resources-menu-panel button:disabled:hover {
  background: transparent;
}


/* =========================================================
   READ ALOUD — STUDENT-FRIENDLY CLASSROOM READER
   ========================================================= */


   /* Compact reader while the lesson is being read */

.lesson-read-aloud-panel.collapsed {
  width:
    fit-content;

  max-width:
    calc(
      100vw -
      24px
    );

  padding:
    7px 9px;

  gap:
    0;

  border-radius:
    999px;
}


.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-intro,

.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-choices,

.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-controls,

.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-speed {
  display:
    none;
}


.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-head {
  display:
    none;
}


.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-status {
  min-height:
    42px;

  margin:
    0;

  padding:
    3px
    5px;

  border:
    0;

  background:
    transparent;

  display:
    grid;

  grid-template-columns:
    26px
    auto
    auto
    auto;

  align-items:
    center;

  gap:
    7px;
}


.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-status-icon {
  font-size:
    20px;
}


.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-status-copy strong {
  font-size:
    11px;
}


.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-status-copy span {
  display:
    none;
}


.lesson-read-aloud-mini-progress {
  min-height:
    30px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  padding:
    6px
    10px;

  border:
    1px solid
    #bfdbfe;

  border-radius:
    999px;

  background:
    #ffffff;

  color:
    #1d4ed8;

  font-size:
    10px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;
}


.lesson-read-aloud-mini-progress[hidden] {
  display:
    none !important;
}


.lesson-read-aloud-mini-actions {
  display:
    none;

  align-items:
    center;

  justify-content:
    flex-end;

  gap:
    4px;

  flex-wrap:
    nowrap;

  white-space:
    nowrap;
}


.lesson-read-aloud-panel.collapsed
.lesson-read-aloud-mini-actions {
  display:
    flex;
}


.lesson-read-aloud-mini-button {
  width:
    30px;

  min-width:
    30px;

  height:
    30px;

  display:
    grid;

  place-items:
    center;

  padding:
    0;

  border:
    1px solid
    #bfdbfe;

  border-radius:
    999px;

  background:
    #ffffff;

  color:
    #1e3a5f;

  font-size:
    14px;

  cursor:
    pointer;
}


.lesson-read-aloud-mini-button:hover {
  background:
    #eff6ff;

  border-color:
    #60a5fa;
}

.lesson-read-aloud-panel {
  position:
    fixed;

  right:
    22px;

  bottom:
    22px;

  z-index:
    20000;

  width:
    min(
      430px,
      calc(
        100vw -
        28px
      )
    );

  display:
    grid;

  gap:
    14px;

  padding:
    17px;

  border:
    2px solid
    #bfdbfe;

  border-radius:
    24px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #eff6ff
    );

  box-shadow:
    0 24px 60px
    rgba(
      15,
      23,
      42,
      0.24
    );
}


.lesson-read-aloud-head {
  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    10px;
}


.lesson-read-aloud-title {
  display:
    flex;

  align-items:
    center;

  gap:
    10px;

  color:
    #1e3a5f;

  font-size:
    18px;

  font-weight:
    950;
}


.lesson-read-aloud-icon {
  width:
    42px;

  height:
    42px;

  display:
    grid;

  place-items:
    center;

  border-radius:
    15px;

  background:
    linear-gradient(
      135deg,
      #60a5fa,
      #6366f1
    );

  color:
    #ffffff;

  font-size:
    21px;

  box-shadow:
    0 8px 18px
    rgba(
      59,
      130,
      246,
      0.24
    );
}


.lesson-read-aloud-close {
  width:
    34px;

  height:
    34px;

  display:
    grid;

  place-items:
    center;

  border:
    1px solid
    #dbeafe;

  border-radius:
    999px;

  background:
    #ffffff;

  color:
    #64748b;

  cursor:
    pointer;
}


.lesson-read-aloud-intro {
  color:
    #64748b;

  font-size:
    12px;

  line-height:
    1.35;

  font-weight:
    800;
}


.lesson-read-aloud-choices {
  display:
    grid;

  grid-template-columns:
    repeat(
      3,
      minmax(
        0,
        1fr
      )
    );

  gap:
    8px;
}


.lesson-read-aloud-choice {
  min-width:
    0;

  min-height:
    88px;

  display:
    flex;

  flex-direction:
    column;

  align-items:
    center;

  justify-content:
    center;

  gap:
    6px;

  padding:
    10px;

  border:
    1px solid
    #bfdbfe;

  border-radius:
    17px;

  background:
    #ffffff;

  color:
    #1e3a5f;

  font-size:
    11px;

  line-height:
    1.15;

  font-weight:
    950;

  text-align:
    center;

  cursor:
    pointer;

  transition:
    transform
    0.15s ease,
    background
    0.15s ease,
    border-color
    0.15s ease,
    box-shadow
    0.15s ease;
}


.lesson-read-aloud-choice:hover,
.lesson-read-aloud-choice.active {
  border-color:
    #60a5fa;

  background:
    #eff6ff;

  box-shadow:
    0 7px 16px
    rgba(
      59,
      130,
      246,
      0.12
    );

  transform:
    translateY(-2px);
}


.lesson-read-aloud-choice-icon {
  font-size:
    27px;

  line-height:
    1;
}


.lesson-read-aloud-status {
  min-height:
    58px;

  display:
    flex;

  align-items:
    center;

  gap:
    11px;

  padding:
    11px
    13px;

  border:
    1px solid
    #bbf7d0;

  border-radius:
    16px;

  background:
    #f0fdf4;

  color:
    #166534;
}


.lesson-read-aloud-status-icon {
  flex:
    0 0 auto;

  font-size:
    24px;
}


.lesson-read-aloud-status-copy {
  min-width:
    0;

  display:
    grid;

  gap:
    2px;
}


.lesson-read-aloud-status-copy strong {
  font-size:
    12px;

  font-weight:
    950;
}


.lesson-read-aloud-status-copy span {
  overflow:
    hidden;

  color:
    #4b7b5a;

  font-size:
    10px;

  line-height:
    1.25;

  font-weight:
    800;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;
}


.lesson-read-aloud-controls {
  display:
    grid;

  grid-template-columns:
    repeat(
      4,
      minmax(
        0,
        1fr
      )
    );

  gap:
    7px;
}


.lesson-read-aloud-control {
  min-height:
    40px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    5px;

  padding:
    7px;

  border:
    1px solid
    #dbeafe;

  border-radius:
    13px;

  background:
    #ffffff;

  color:
    #1e3a5f;

  font-size:
    10px;

  font-weight:
    950;

  cursor:
    pointer;
}


.lesson-read-aloud-control:hover {
  background:
    #eff6ff;

  border-color:
    #93c5fd;
}


.lesson-read-aloud-speed {
  display:
    grid;

  grid-template-columns:
    repeat(
      3,
      minmax(
        0,
        1fr
      )
    );

  gap:
    6px;

  padding:
    5px;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    14px;

  background:
    #f8fafc;
}


.lesson-read-aloud-speed button {
  min-height:
    34px;

  border:
    0;

  border-radius:
    10px;

  background:
    transparent;

  color:
    #64748b;

  font-size:
    10px;

  font-weight:
    950;

  cursor:
    pointer;
}


.lesson-read-aloud-speed button.active {
  background:
    #ffffff;

  color:
    #1d4ed8;

  box-shadow:
    0 3px 8px
    rgba(
      15,
      23,
      42,
      0.08
    );
}


/*
  Make the instruction pupils are hearing
  unmistakably clear on the board.
*/
body.lesson-read-aloud-active
.student-instruction-focus-card {
  border-color:
    #60a5fa !important;

  box-shadow:
    0 0 0 5px
    rgba(
      96,
      165,
      250,
      0.17
    ),
    0 16px 34px
    rgba(
      15,
      23,
      42,
      0.10
    ) !important;

  transform:
    scale(1.01);

  transition:
    transform
    0.2s ease,
    box-shadow
    0.2s ease;
}


body.lesson-read-aloud-active
.student-instruction-step-number {
  animation:
    lessonReadAloudPulse
    1.3s ease-in-out
    infinite;
}


/* =========================================================
   READ ALOUD — SENTENCE TRACKING
   ========================================================= */

.lesson-read-aloud-sentence {
  display:
    inline;

  padding:
    2px
    3px;

  margin:
    0 -3px;

  border-radius:
    7px;

  transition:
    background
    0.2s ease,
    color
    0.2s ease,
    box-shadow
    0.2s ease,
    opacity
    0.2s ease;
}


body.lesson-read-aloud-active
.lesson-read-aloud-sentence {
  opacity:
    0.52;
}


body.lesson-read-aloud-active
.lesson-read-aloud-sentence.is-reading {
  opacity:
    1;

  background:
    #fef08a;

  color:
    #172554;

  box-shadow:
    0 0 0 4px
    rgba(
      250,
      204,
      21,
      0.16
    );
}


body.lesson-read-aloud-active
.lesson-read-aloud-sentence.is-read {
  opacity:
    0.72;
}


@keyframes lessonReadAloudPulse {
  0%,
  100% {
    transform:
      scale(1);
  }

  50% {
    transform:
      scale(1.12);
  }
}


@media (
  max-width:
  700px
) {
  .lesson-read-aloud-panel {
    right:
      10px;

    bottom:
      10px;

    width:
      calc(
        100vw -
        20px
      );
  }


  .lesson-read-aloud-choices {
    grid-template-columns:
      1fr;
  }
}


/* =========================================================
   LESSON — APPLY TO OTHER CLASSES
   ========================================================= */

.lesson-apply-panel {
  margin:
    0
    20px
    10px;

  border:
    1px solid
    #d9fbe8;

  border-radius:
    14px;

  background:
    #f6fdf9;

  overflow:
    hidden;
}


.lesson-apply-summary {
  min-height:
    46px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    12px;

  padding:
    10px
    13px;

  color:
    #143f3a;

  font-size:
    12px;

  line-height:
    1;

  font-weight:
    950;

  cursor:
    pointer;

  list-style:
    none;
}


.lesson-apply-summary::-webkit-details-marker {
  display:
    none;
}


.lesson-apply-summary::before {
  content:
    "▸";

  flex:
    0 0
    auto;

  color:
    #159957;

  font-size:
    13px;
}


.lesson-apply-panel[open]
.lesson-apply-summary::before {
  content:
    "▾";
}


.lesson-apply-summary
> span:first-of-type {
  flex:
    1 1
    auto;
}


.lesson-apply-selected-count {
  flex:
    0 0
    auto;

  min-height:
    25px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  padding:
    5px
    9px;

  border:
    1px solid
    #bbf7d0;

  border-radius:
    999px;

  background:
    #ffffff;

  color:
    #166534;

  font-size:
    9.5px;

  font-weight:
    950;

  white-space:
    nowrap;
}


.lesson-apply-body {
  padding:
    0
    13px
    13px;
}


.lesson-apply-intro {
  margin-bottom:
    10px;

  color:
    #64748b;

  font-size:
    11px;

  line-height:
    1.35;

  font-weight:
    800;
}


.lesson-apply-target-list {
  max-height:
    260px;

  display:
    grid;

  gap:
    7px;

  overflow-y:
    auto;

  padding-right:
    3px;

  scrollbar-gutter:
    stable;
}


.lesson-apply-class-group {
  border:
    1px solid
    #dbe3e8;

  border-radius:
    12px;

  background:
    #ffffff;

  overflow:
    hidden;
}


.lesson-apply-class-summary {
  min-height:
    42px;

  display:
    flex;

  align-items:
    center;

  gap:
    9px;

  padding:
    8px
    11px;

  list-style:
    none;

  color:
    #143f3a;

  cursor:
    pointer;
}


.lesson-apply-class-summary::-webkit-details-marker {
  display:
    none;
}


.lesson-apply-class-chevron {
  width:
    18px;

  flex:
    0 0
    18px;

  color:
    #159957;

  font-size:
    11px;

  font-weight:
    950;
}


.lesson-apply-class-group[open]
.lesson-apply-class-chevron {
  transform:
    rotate(
      90deg
    );
}


.lesson-apply-class-name {
  min-width:
    0;

  flex:
    1 1
    auto;

  color:
    #143f3a;

  font-size:
    12px;

  font-weight:
    950;

  white-space:
    nowrap;

  overflow:
    hidden;

  text-overflow:
    ellipsis;
}


.lesson-apply-class-count {
  flex:
    0 0
    auto;

  color:
    #64748b;

  font-size:
    9.5px;

  font-weight:
    900;

  white-space:
    nowrap;
}


.lesson-apply-periods {
  display:
    grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(
        205px,
        1fr
      )
    );

  gap:
    6px;

  padding:
    8px;

  border-top:
    1px solid
    #edf2f7;

  background:
    #f8fafc;
}


.lesson-apply-period {
  min-width:
    0;

  min-height:
    48px;

  display:
    grid;

  grid-template-columns:
    18px
    50px
    minmax(
      0,
      1fr
    );

  align-items:
    center;

  gap:
    7px;

  padding:
    7px
    9px;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    10px;

  background:
    #ffffff;

  cursor:
    pointer;

  transition:
    border-color
    0.15s ease,
    background
    0.15s ease,
    transform
    0.15s ease;
}


.lesson-apply-period:hover {
  border-color:
    #86efac;

  background:
    #f0fdf4;

  transform:
    translateY(
      -1px
    );
}


.lesson-apply-period:has(
  input:checked
) {
  border-color:
    #22c55e;

  background:
    #ecfdf5;

  box-shadow:
    0
    0
    0
    2px
    rgba(
      34,
      197,
      94,
      0.10
    );
}


.lesson-apply-period
input {
  width:
    16px;

  height:
    16px;

  margin:
    0;
}


.lesson-apply-period-time {
  color:
    #143f3a;

  font-size:
    10.5px;

  line-height:
    1;

  font-weight:
    950;
}


.lesson-apply-period-title {
  min-width:
    0;

  color:
    #475569;

  font-size:
    10.5px;

  line-height:
    1.2;

  font-weight:
    850;

  white-space:
    nowrap;

  overflow:
    hidden;

  text-overflow:
    ellipsis;
}


@media (
  max-width:
  700px
) {
  .lesson-apply-periods {
    grid-template-columns:
      1fr;
  }

  .lesson-apply-panel {
    margin:
      0
      10px
      10px;
  }
}


/* =========================================================
   LESSON + STEP TOOLS AND LINKS
   ========================================================= */

.lesson-attachment-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lesson-attachment-chip {
  min-height: 29px;

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

  padding: 5px 9px;

  border: 1px solid #bbf7d0;
  border-radius: 999px;

  background: #f0fdf4;
  color: #166534;

  font-size: 10px;
  line-height: 1;
  font-weight: 950;

  white-space: nowrap;
  cursor: pointer;
}

.lesson-attachment-chip:hover,
.lesson-attachment-chip:focus-visible {
  border-color: #5fdc9a;
  background: #dcfce7;
  outline: none;
  transform: translateY(-1px);
}

.lesson-attachment-chip.link {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.lesson-attachment-chip.link:hover,
.lesson-attachment-chip.link:focus-visible {
  border-color: #60a5fa;
  background: #dbeafe;
}

.instruction-step-attachments-editor {
  grid-column: 1 / -1;

  display: grid;

  grid-template-columns:
    105px
    minmax(150px, 0.55fr)
    minmax(0, 1fr);

  gap: 8px;

  margin-top: 2px;
  padding: 10px;

  border: 1px solid #dbeafe;
  border-radius: 12px;

  background: #f8fbff;
}

.instruction-step-time-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.instruction-step-time-field > label {
  display: flex;
  align-items: center;
  gap: 5px;

  color: #64748b;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;

  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.instruction-step-time-field > label span {
  color: #94a3b8;
  font-size: 8px;
}

/* =========================================================
   STEP TIME — CLEAN SIMPLE FIELD
   ========================================================= */

#periodModal
.instruction-step-attachments-editor {
  grid-template-columns:
    150px
    minmax(180px, 0.75fr)
    minmax(0, 1.25fr) !important;

  gap: 10px !important;

  width: 100%;
  min-width: 0;
}

#periodModal
.instruction-step-attachments-editor
> * {
  min-width: 0;
}

#periodModal
.instruction-step-attachments-editor
select,
#periodModal
.instruction-step-attachments-editor
textarea,
#periodModal
.instruction-step-time-field {
  max-width: 100%;
  min-width: 0 !important;
}


#periodModal
.instruction-step-time-field {
  width: 100%;
  min-width: 0;

  display: grid;
  gap: 5px;
}


#periodModal
.instruction-step-time-simple {
  width: 100%;
  min-width: 0;
  min-height: 42px;

  display: flex;
  align-items: center;

  gap: 8px;

  padding:
    0
    11px;

  border:
    1px solid
    #cbd5e1;

  border-radius:
    10px;

  background:
    #ffffff;
}


#periodModal
.instruction-step-time-simple
input[type="number"] {
  flex:
    1 1
    auto !important;

  width:
    82px !important;

  min-width:
    82px !important;

  max-width:
    none !important;

  height:
    38px !important;

  min-height:
    38px !important;

  margin:
    0 !important;

  padding:
    0
    4px !important;

  border:
    0 !important;

  border-radius:
    0 !important;

  outline:
    none !important;

  background:
    transparent !important;

  box-shadow:
    none !important;

  color:
    #111827 !important;

  font-size:
    15px !important;

  line-height:
    38px !important;

  font-weight:
    950 !important;

  text-align:
    left !important;
}


#periodModal
.instruction-step-time-simple
> span {
  flex:
    0 0
    auto;

  color:
    #64748b;

  font-size:
    10px;

  line-height:
    1;

  font-weight:
    900;

  white-space:
    nowrap;
}


#periodModal
.instruction-step-time-simple
input[type="number"]::-webkit-inner-spin-button,
#periodModal
.instruction-step-time-simple
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance:
    none;

  margin:
    0;
}


@media (max-width: 900px) {
  #periodModal
  .instruction-step-attachments-editor {
    grid-template-columns:
      140px
      minmax(160px, 0.8fr)
      minmax(0, 1.2fr) !important;
  }
}


@media (max-width: 700px) {
  #periodModal
  .instruction-step-attachments-editor {
    grid-template-columns:
      1fr !important;
  }
}

@media (max-width: 760px) {
  .instruction-step-attachments-editor {
    grid-template-columns: 1fr;
  }
}

.instruction-step-attachments-editor select,
.instruction-step-attachments-editor textarea {
  width: 100%;
  margin: 0 !important;

  border: 1px solid #cbd5e1;
  border-radius: 9px;

  background: #ffffff;
  color: #111827;

  font-size: 10.5px;
  font-weight: 800;
}

.instruction-step-attachments-editor select {
  min-height: 34px;
  padding: 6px 8px;
}

.instruction-step-attachments-editor textarea {
  min-height: 52px !important;
  height: 52px;

  padding: 7px 9px;

  line-height: 1.3;

  resize: vertical;
}

.instruction-step-attachments-label {
  grid-column: 1 / -1;

  color: #64748b;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;

  letter-spacing: 0.5px;
  text-transform: uppercase;

  margin-bottom: 1px;
}

.student-instruction-step-copy
.lesson-attachment-chips {
  margin-top: 12px;
}

@media (max-width: 650px) {
  .instruction-step-attachments-editor {
    grid-column: 2;
    grid-template-columns: 1fr;
  }

  .instruction-step-attachments-label {
    grid-column: 1;
  }
}

    @media (max-width: 1050px) {
      .task-stage-heading-bottom {
        grid-template-columns: 1fr;
        align-items: start;
      }

      .task-stage-heading-meta {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
      }

      .task-stage-heading-meta::-webkit-scrollbar {
        display: none;
      }

      .task-stage-heading-actions {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: visible;
}
    }

    body[data-stage="task"] .stage-label:empty {
      display: none;
    }

    .stage-top > div:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.stage-dashboard-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: #ffffff;
  color: #143f3a;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 4px 10px
    rgba(15, 23, 42, 0.05);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.stage-dashboard-button:hover,
.stage-dashboard-button:focus-visible {
  border-color: #86efac;
  background: #eefbf4;
  box-shadow:
    0 6px 14px
    rgba(15, 23, 42, 0.09);
  outline: none;
  transform: translateY(-1px);
}

.stage-dashboard-button:active {
  transform: scale(0.97);
}

.stage-dashboard-button {
  display: none !important;
}

body.focus-mode
.stage-dashboard-button {
  display: inline-flex !important;
}

.date-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;
  min-width: 170px;

  padding: 10px 14px;

  border-radius: 16px;

  background:
    var(--board-ink);

  color:
    #ffffff;

  border:
    1px solid
    color-mix(
      in srgb,
      var(--board-accent) 20%,
      transparent
    );

  text-align: center;
  font-weight: 900;
  line-height: 1.25;
  font-size: 14px;
  white-space: nowrap;
}


/*
 * Timetable already shows the selected weekday
 * and date in its own navigation.
 * Do not repeat the date in the stage header.
 */
body[data-stage="timetable"]
.date-card {
  display:
    none !important;
}

.header-birthday {
  position: relative;
  flex: 0 0 auto;
}

.header-birthday[hidden] {
  display: none !important;
}

.header-birthday > summary {
  list-style: none;
}

.header-birthday > summary::-webkit-details-marker {
  display: none;
}

.header-birthday-trigger {
  min-width: 48px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 15px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.header-birthday-trigger:hover,
.header-birthday-trigger:focus-visible,
.header-birthday[open]
.header-birthday-trigger {
  border-color: #fbbf24;
  background: #fef3c7;
  box-shadow:
    0 5px 12px
    rgba(146, 64, 14, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.header-birthday-trigger:active {
  transform: scale(0.96);
}

.header-birthday-count {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
}

.header-birthday-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 260;
  width: max-content;
  min-width: 190px;
  max-width: 280px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 15px;
  background: #ffffff;
  color: #374151;
  box-shadow:
    0 16px 36px
    rgba(15, 23, 42, 0.18);
}

.header-birthday-popover strong {
  color: #92400e;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
}

.header-birthday-names {
  display: grid;
  gap: 6px;
}

.header-birthday-name {
  width: 100%;
  min-height: 40px;

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

  padding:
    7px
    9px;

  border:
    1px solid
    transparent;

  border-radius:
    11px;

  background:
    #fffbeb;

  color:
    #78350f;

  font:
    inherit;

  font-size:
    11px;

  line-height:
    1.2;

  font-weight:
    900;

  text-align:
    left;

  cursor:
    pointer;

  transition:
    transform
    0.14s ease,
    border-color
    0.14s ease,
    background
    0.14s ease,
    box-shadow
    0.14s ease;
}


.header-birthday-name::before {
  content:
    "🎂";

  flex:
    0 0
    auto;

  font-size:
    14px;
}


.header-birthday-name-text {
  min-width:
    0;

  flex:
    1
    1
    auto;

  overflow:
    hidden;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;
}


.header-birthday-celebrate {
  flex:
    0 0
    auto;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  min-height:
    25px;

  padding:
    4px
    8px;

  border-radius:
    999px;

  background:
    #f59e0b;

  color:
    #ffffff;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;
}


.header-birthday-name:hover,
.header-birthday-name:focus-visible {
  border-color:
    #fbbf24;

  background:
    #fef3c7;

  box-shadow:
    0
    4px
    10px
    rgba(
      146,
      64,
      14,
      0.10
    );

  outline:
    none;

  transform:
    translateY(
      -1px
    );
}


.header-birthday-name:active {
  transform:
    scale(
      0.98
    );
}


.header-birthday-name.is-celebrated {
  border-color:
    #bbf7d0;

  background:
    #f0fdf4;

  color:
    #166534;

  cursor:
    pointer;

  box-shadow:
    0
    2px
    6px
    rgba(
      22,
      101,
      52,
      0.06
    );
}


.header-birthday-name.is-celebrated
.header-birthday-celebrate {
  background:
    #dcfce7;

  color:
    #166534;
}


.header-birthday-name.is-celebrated:hover,
.header-birthday-name.is-celebrated:focus-visible {
  border-color:
    #86efac;

  background:
    #dcfce7;

  box-shadow:
    0
    4px
    10px
    rgba(
      22,
      101,
      52,
      0.10
    );

  outline:
    none;

  transform:
    translateY(
      -1px
    );
}


.header-birthday-name.is-celebrated:active {
  transform:
    scale(
      0.96
    );

  background:
    #bbf7d0;
}

    .stage-body {
      min-height: 0;
      border: none;
      background: transparent;
      padding: 0;
      overflow: auto;
      display: flex;
      flex-direction: column;
    }

    .activity-card {
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      padding: 26px;
      width: 100%;
      height: 100%;
      min-height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
    }

    .activity-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
    }

    .task-top-toolbar {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      margin-bottom: 18px;
      flex: 0 0 auto;
    }

    .task-top-meta {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .task-top-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 7px;
      flex-wrap: nowrap;
      flex-shrink: 0;
    }

    .task-top-actions .btn {
      min-height: 34px;
      padding: 7px 11px;
      font-size: 11.5px;
      box-shadow: none;
    }

    .task-top-actions .task-toolbar-primary {
      padding-left: 14px;
      padding-right: 14px;
      background: var(--board-accent) !important;
      color: var(--board-ink) !important;
    }

    @media (max-width: 1050px) {
      .task-top-toolbar {
        align-items: flex-start;
        flex-direction: column;
      }

      .task-top-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
      }
    }

    .meta-pill {
      background:
        color-mix(
          in srgb,
          var(--board-accent) 12%,
          #ffffff
        );

      border:
        1px solid
        color-mix(
          in srgb,
          var(--board-accent) 38%,
          var(--board-border)
        );

      color:
        var(--board-ink);

      border-radius: 999px;
      padding: 7px 11px;
      font-weight: 900;
      font-size: 13px;
    }

    .big-heading {
      font-size: clamp(30px, 3.2vw, 48px);
      line-height: 1.06;
      font-weight: 900;
      color: #111827;
      margin-bottom: 12px;
      letter-spacing: -1px;
    }

    .big-text {
      font-size: clamp(24px, 2.4vw, 36px);
      line-height: 1.28;
      color: #374151;
    }

    .instruction-formatted {
      display: block;
      font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
      font-weight: 520;
      letter-spacing: -0.01em;
      text-rendering: optimizeLegibility;
    }

    .instruction-formatted p {
      margin: 0 0 0.7em;
    }

    .instruction-formatted p:last-child {
      margin-bottom: 0;
    }

    .instruction-formatted strong {
      color: #0f172a;
      font-weight: 850;
      letter-spacing: -0.015em;
    }

    .instruction-formatted ul,
.instruction-formatted ol {
  margin: 0 0 0.8em;
  padding-left: 1.25em;
}

    .instruction-formatted li {
      margin-bottom: 0.32em;
      padding-left: 0.12em;
    }

    .instruction-formatted li:last-child {
      margin-bottom: 0;
    }

    .instruction-spacer {
      height: 0.45em;
    }

    .info-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 9px;
      margin-top: 16px;
    }

    .info-tile {
      background:
        color-mix(
          in srgb,
          var(--board-surface-soft) 42%,
          #ffffff
        );

      border:
        1px solid
        var(--board-border);

      border-radius: 16px;
      padding: 11px;
    }

    .info-tile strong {
      display: block;

      color:
        var(--board-accent-2);

      font-size: 12px;
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .info-tile span {
      color: #111827;
      font-size: 16px;
      font-weight: 900;
      line-height: 1.25;
    }

    .large-tool {
      display: flex;
      min-height: 320px;
      height: 100%;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      text-align: center;
      gap: 16px;
    }

    .large-display {
      font-size: clamp(70px, 10vw, 170px);
      line-height: 0.95;
      font-weight: 900;
      color: #143f3a;
      letter-spacing: -5px;
      text-align: center;
    }

    .large-display.shuffling,
.spinner-wheel.spinning {
  animation: livelyPulse 0.18s linear infinite;
}

.cube-3d-die.rolling,
.dice-face.rolling {
  animation: diceBounceRoll 0.16s linear infinite;
}


@keyframes diceBounceRoll {
  0% {
    transform: rotateX(0deg) rotateY(0deg) scale(0.97);
    filter: drop-shadow(0 16px 18px rgba(15, 23, 42, 0.18));
  }

  50% {
    transform: rotateX(8deg) rotateY(-8deg) scale(1.04);
    filter: drop-shadow(0 24px 24px rgba(15, 23, 42, 0.24));
  }

  100% {
    transform: rotateX(-8deg) rotateY(8deg) scale(0.98);
    filter: drop-shadow(0 16px 18px rgba(15, 23, 42, 0.18));
  }
}


body.theme-chalk .face-3d-die {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #334155, #1e293b);

  color: #fef08a;
  border-color: #fef08a;

  text-shadow:
    0 0 14px rgba(254, 240, 138, 0.34),
    0 3px 0 rgba(15, 23, 42, 0.45);

  box-shadow:
    inset 0 12px 20px rgba(255,255,255,0.06),
    inset 0 -18px 28px rgba(0,0,0,0.28),
    0 18px 34px rgba(15, 23, 42, 0.18),
    0 0 0 8px rgba(254, 240, 138, 0.13);
}

    @keyframes livelyPulse {
      0% { transform: scale(1) rotate(-1deg); }
      50% { transform: scale(1.035) rotate(1deg); }
      100% { transform: scale(1) rotate(-1deg); }
    }

    .large-sub {
      font-size: clamp(18px, 2vw, 28px);
      color: #4b5563;
      font-weight: 900;
      text-align: center;
      line-height: 1.25;
    }

    .large-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .large-actions .btn {
      font-size: 16px;
      padding: 13px 20px;
    }

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

    .stage-tile {
      background:
        color-mix(
          in srgb,
          var(--board-card) 92%,
          var(--board-surface-soft)
        );

      border:
        1px solid
        var(--board-border);

      border-radius: 17px;
      padding: 14px;

      box-shadow:
        0 8px 18px
        rgba(
          15,
          23,
          42,
          0.05
        );
    }

    .stage-tile h3 {
      margin: 0 0 7px;

      font-size:
        clamp(
          18px,
          1.7vw,
          24px
        );

      color:
        var(--board-ink);
    }

    .stage-tile p {
      margin: 0;

      font-size:
        clamp(
          15px,
          1.35vw,
          19px
        );

      color:
        #4b5563;

      line-height: 1.35;
    }

    body[data-stage="timetable"] .stage-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scroll-padding-bottom: 18px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;

  position: relative;
}

.timetable-stage-sticky-nav {
  position: sticky;
  top: 0;

  z-index: 40;

  padding:
    4px
    0
    10px;

  margin-bottom:
    2px;

  background:
    linear-gradient(
      180deg,
      var(--board-card) 0%,
      var(--board-card) 88%,
      rgba(255,255,255,0) 100%
    );
}

    .timetable-stage-grid {
      align-content: start;
      grid-auto-rows: 154px;
      padding-bottom: 18px;
    }

    .timetable-lesson-card {
      min-width: 0;
      height: 154px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      cursor: pointer;
      transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
    }

    .timetable-lesson-card:hover,
    .timetable-lesson-card:focus-visible {
      border-color: var(--board-accent);
      background: color-mix(
        in srgb,
        var(--board-accent) 6%,
        #ffffff
      );
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
      transform: translateY(-2px);
      outline: none;
    }

    .timetable-stage-title-row {
  width: 100%;

  display: flex;
  align-items: center;

  gap: 8px;

  min-width: 0;

  margin-bottom: 7px;
}


.timetable-stage-title-row
h3 {
  flex:
    1 1 auto;

  min-width: 0;

  margin:
    0;

  white-space:
    nowrap;

  overflow:
    hidden;

  text-overflow:
    ellipsis;
}


.timetable-stage-status-badge {
  flex:
    0 0 auto;

  min-height:
    22px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  padding:
    4px
    8px;

  border-radius:
    999px;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.35px;

  white-space:
    nowrap;
}


.timetable-stage-status-badge.current {
  border:
    1px solid
    #86efac;

  background:
    #dcfce7;

  color:
    #166534;
}


.timetable-stage-status-badge.next {
  border:
    1px solid
    #bfdbfe;

  background:
    #dbeafe;

  color:
    #1d4ed8;
}


.timetable-stage-current {
  border-color:
    #22c55e !important;

  background:
    #f8fffb !important;

  box-shadow:
    0
    0
    0
    2px
    rgba(
      34,
      197,
      94,
      0.12
    ) !important;
}


.timetable-stage-next {
  border-color:
    #93c5fd !important;

  background:
    #f8fbff !important;
}

    .timetable-lesson-preview {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      /* Standard property for compatibility */
      line-clamp: 3;
      overflow: hidden;
      text-overflow: ellipsis;

      font-size: clamp(14px, 1.15vw, 17px) !important;
      line-height: 1.35 !important;
    }

    .timetable-lesson-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timetable-view-lesson {
  color: var(--board-accent-2);
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.timetable-lesson-footer .lesson-readiness-status {
  margin-top: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
}

    @media (max-width: 760px) {
      .timetable-stage-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 9px;
        padding-bottom:
          calc(
            78px +
            env(
              safe-area-inset-bottom
            )
          );
      }

      .timetable-lesson-card {
        height: auto;
        min-height: 132px;
        padding: 14px;
      }

      .timetable-lesson-preview {
        -webkit-line-clamp: 4;
        line-clamp: 4;
        font-size: 14px !important;
      }

      .timetable-lesson-footer {
        flex-wrap: wrap;
        align-items: flex-end;
      }
    }

    /* =========================================================
       MYSTERY BOXES
       ========================================================= */

    body[data-stage="mysteryBoxes"] .stage-card {
      padding: 12px;
      gap: 8px;
      background:
        radial-gradient(
          circle at top,
          rgba(95, 220, 154, 0.14),
          transparent 38%
        ),
        linear-gradient(135deg, #ffffff, #f8fafc);
    }

    body[data-stage="mysteryBoxes"] .stage-body {
      overflow: hidden;
    }

    .mystery-boxes-shell {
      width: 100%;
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      gap: 9px;
      overflow: hidden;
    }

    .mystery-boxes-topbar {
      min-height: 48px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      padding: 7px 9px;
      border: 1px solid #d9fbe8;
      border-radius: 16px;
      background: #ffffff;
    }

    .mystery-boxes-status {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
    }

    .mystery-boxes-pill {
      min-height: 31px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 6px 10px;
      border: 1px solid #d9fbe8;
      border-radius: 999px;
      background: #eefbf4;
      color: #143f3a;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
    }

    .mystery-boxes-pill.reward {
      border-color: #fde68a;
      background: #fffbeb;
      color: #92400e;
    }

    .mystery-boxes-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex-wrap: wrap;
    }

    .mystery-boxes-actions .btn {
      min-height: 32px;
      padding: 6px 11px;
      font-size: 11px;
    }

    .mystery-boxes-board {
      position: relative;
      min-height: 0;
      height: 100%;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr) auto;
      gap: 8px;
      padding: 11px;
      border-radius: 20px;
      overflow: hidden;
      background:
        radial-gradient(
          circle at center,
          #1e293b 0%,
          #0f172a 100%
        );
      box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 12px 28px rgba(15, 23, 42, 0.16);
    }

    .mystery-boxes-board::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background-image:
        linear-gradient(
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        ),
        linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        );
      background-size: 36px 36px;
    }

    .mystery-boxes-title {
      position: relative;
      z-index: 1;
      margin: 0;
      text-align: center;
      color: #fbbf24;
      font-size: clamp(20px, 2.5vw, 34px);
      line-height: 1;
      font-weight: 950;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      text-shadow: 0 3px 0 rgba(0, 0, 0, 0.32);
    }

    .mystery-boxes-grid {
      --mystery-columns: 5;
      --mystery-rows: 4;

      position: relative;
      z-index: 1;
      min-height: 0;
      height: 100%;
      display: grid;
      grid-template-columns:
        repeat(
          var(--mystery-columns),
          minmax(0, 1fr)
        );
      grid-template-rows:
        repeat(
          var(--mystery-rows),
          minmax(0, 1fr)
        );
      gap: 7px;
      align-content: stretch;
    }

    .mystery-box-tile {
      min-width: 0;
      min-height: 0;
      height: 100%;
      border: 0;
      border-radius: 11px;
      background:
        linear-gradient(145deg, #334155, #1e293b);
      color: rgba(255, 255, 255, 0.76);
      font-size: clamp(14px, 1.8vw, 22px);
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
      box-shadow:
        0 4px 0 #020617,
        0 6px 10px rgba(0, 0, 0, 0.3);
      transition:
        transform 0.16s ease,
        filter 0.16s ease,
        box-shadow 0.16s ease;
    }

    .mystery-box-tile:hover {
      transform: translateY(-3px);
      filter: brightness(1.16);
      box-shadow:
        0 7px 0 #020617,
        0 11px 17px rgba(0, 0, 0, 0.38);
    }

    .mystery-box-tile:active {
      transform: translateY(2px) scale(0.98);
      box-shadow: 0 2px 0 #020617;
    }

    .mystery-box-tile.revealed {
      cursor: default;
      pointer-events: none;
      transform: none;
      box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.22);
      color: #ffffff;
    }

    .mystery-box-tile.reward-1 {
      background:
        linear-gradient(135deg, #047857, #34d399);
    }

    .mystery-box-tile.reward-2 {
      background:
        linear-gradient(135deg, #1d4ed8, #38bdf8);
    }

    .mystery-box-tile.reward-3 {
      background:
        linear-gradient(135deg, #a855f7, #ec4899);
    }

    .mystery-box-tile.reward-4 {
      background:
        linear-gradient(
          45deg,
          #dc2626,
          #f97316,
          #eab308,
          #22c55e,
          #3b82f6,
          #a855f7
        );
      background-size: 300% 300%;
      animation: mysteryRainbow 5s linear infinite;
    }

    .mystery-box-tile.challenge {
      background:
        linear-gradient(135deg, #b91c1c, #fb7185);
    }

    .mystery-box-tile-icon {
      display: block;
      font-size: clamp(22px, 3vw, 40px);
      line-height: 1;
    }

    .mystery-boxes-legend {
      position: relative;
      z-index: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px 13px;
      flex-wrap: wrap;
      color: #cbd5e1;
      font-size: 9px;
      line-height: 1;
      font-weight: 950;
      text-transform: uppercase;
    }

    .mystery-reveal-overlay {
      position: absolute;
      inset: 0;
      z-index: 30;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      border-radius: inherit;
      background: rgba(2, 6, 23, 0.82);
      backdrop-filter: blur(7px);
    }

    .mystery-reveal-overlay.show {
      display: flex;
    }

    .mystery-reveal-card {
      width: min(500px, 96%);
      max-height: 94%;
      overflow-y: auto;
      padding: 20px;
      border: 4px solid #e2e8f0;
      border-radius: 24px;
      background: #ffffff;
      text-align: center;
      box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
      animation:
        mysteryCardEntry 0.3s
        cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .mystery-reveal-icon {
      margin-bottom: 5px;
      font-size: clamp(54px, 8vw, 82px);
      line-height: 1;
    }

    .mystery-reveal-title {
      margin: 0 0 8px;
      color: #0f172a;
      font-size: clamp(23px, 3vw, 32px);
      line-height: 1.05;
      font-weight: 950;
      letter-spacing: -0.8px;
    }

    .mystery-reveal-description {
      margin: 0;
      color: #475569;
      font-size: clamp(15px, 1.65vw, 19px);
      line-height: 1.42;
      font-weight: 750;
    }

    .mystery-reveal-points {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin: 13px 0 4px;
      padding: 8px 14px;
      border-radius: 999px;
      background: #fffbeb;
      border: 1px solid #fde68a;
      color: #92400e;
      font-size: 15px;
      font-weight: 950;
    }

    .mystery-countdown {
      display: none;
      margin: 10px 0 0;
      color: #dc2626;
      font-family: monospace;
      font-size: clamp(48px, 7vw, 72px);
      line-height: 1;
      font-weight: 950;
    }

    .mystery-countdown.show {
      display: block;
    }

    .mystery-answer-panel {
      display: none;
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 13px;
      background: #0f172a;
      color: #ffffff;
      text-align: left;
      font-size: 14px;
      line-height: 1.4;
      font-weight: 850;
    }

    .mystery-answer-panel.show {
      display: block;
    }

    .mystery-reveal-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 16px;
    }

    .mystery-reveal-actions .btn {
      width: 100%;
      min-width: 0;
    }

    .mystery-settings-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    @keyframes mysteryRainbow {
      0% {
        background-position: 0% 50%;
      }

      50% {
        background-position: 100% 50%;
      }

      100% {
        background-position: 0% 50%;
      }
    }

    @keyframes mysteryCardEntry {
      from {
        opacity: 0;
        transform: scale(0.84);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    body.focus-mode[data-stage="mysteryBoxes"] .stage-card,
    body.fullscreen-active[data-stage="mysteryBoxes"] .stage-card {
      padding: 9px;
      border-radius: 0;
    }

    body.focus-mode[data-stage="mysteryBoxes"] .mystery-boxes-shell,
    body.fullscreen-active[data-stage="mysteryBoxes"] .mystery-boxes-shell {
      gap: 7px;
    }

    body.focus-mode[data-stage="mysteryBoxes"] .mystery-boxes-topbar,
    body.fullscreen-active[data-stage="mysteryBoxes"] .mystery-boxes-topbar {
      min-height: 42px;
      padding: 5px 8px;
      border-radius: 13px;
    }

    body.focus-mode[data-stage="mysteryBoxes"] .mystery-boxes-board,
    body.fullscreen-active[data-stage="mysteryBoxes"] .mystery-boxes-board {
      padding: 9px 12px;
      border-radius: 16px;
    }

    body.focus-mode[data-stage="mysteryBoxes"] .mystery-boxes-grid,
    body.fullscreen-active[data-stage="mysteryBoxes"] .mystery-boxes-grid {
      gap: clamp(5px, 0.7vh, 8px);
    }

    body.fullscreen-active[data-stage="mysteryBoxes"] .mystery-boxes-title {
      font-size: clamp(24px, 3.3vh, 40px);
    }

    body.fullscreen-active[data-stage="mysteryBoxes"] .mystery-box-tile {
      font-size: clamp(16px, 2.4vh, 28px);
    }

    body.fullscreen-active[data-stage="mysteryBoxes"] .mystery-box-tile-icon {
      font-size: clamp(25px, 4.2vh, 46px);
    }

    @media (max-width: 920px) {
      .mystery-boxes-grid {
        --mystery-columns: 5;
      }

      .mystery-boxes-actions {
        width: 100%;
        justify-content: flex-start;
      }
    }

    @media (max-width: 700px) {
      .mystery-boxes-topbar {
        align-items: flex-start;
        flex-direction: column;
      }

      .mystery-settings-grid,
      .mystery-reveal-actions {
        grid-template-columns: 1fr;
      }

      .mystery-boxes-grid {
        gap: 5px;
      }

      .mystery-boxes-legend {
        display: none;
      }
    }

    /* =========================================================
   SNAKES AND LADDERS CLASSBOARD STAGE
   ========================================================= */

body[data-stage="snakesLadders"] .stage-card {
  padding: 10px;
  gap: 8px;
}

body[data-stage="snakesLadders"] .stage-body {
  overflow: hidden;
}

.snakes-classboard-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #334155;
  border-radius: 18px;
  background: #090d16;
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.18);
}

.snakes-classboard-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #090d16;
}

/* Snakes & Ladders Clean Focus */

body.focus-mode[data-stage="snakesLadders"] header,
body.focus-mode[data-stage="mysteryBoxes"] header {
  display: none !important;
}

body.focus-mode[data-stage="snakesLadders"] main,
body.focus-mode[data-stage="mysteryBoxes"] main {
  height: 100vh !important;
  padding: 6px !important;
}

body.focus-mode[data-stage="snakesLadders"]
.board-shell {
  height: 100%;
}

body.focus-mode[data-stage="snakesLadders"]
.stage-top,
body.focus-mode[data-stage="mysteryBoxes"]
.stage-top {
  display: none !important;
}

body.focus-mode[data-stage="snakesLadders"]
.stage-card,
body.focus-mode[data-stage="mysteryBoxes"]
.stage-card {
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 0 !important;
  border-radius: 0;
}

body.focus-mode[data-stage="snakesLadders"]
.stage-body,
body.focus-mode[data-stage="mysteryBoxes"]
.stage-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.focus-mode[data-stage="snakesLadders"]
.snakes-classboard-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

body.focus-mode[data-stage="snakesLadders"]
.snakes-classboard-frame {
  width: 100%;
  height: 100%;
}

/* Existing Classboard Projector Mode */

body.projector-mode[data-stage="snakesLadders"]
.stage-card {
  padding: 0;
  border-radius: 0;
}

body.projector-mode[data-stage="snakesLadders"]
.snakes-classboard-shell {
  border: 0;
  border-radius: 0;
}

    .quick-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 7px;
  min-height: 0;
  overflow: hidden;
}

.quick-strip-tools {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.quick-strip-tools::-webkit-scrollbar {
  display: none;
}

.quick-strip-tools .quick-launch {
  flex: 0 0 auto;
  width: auto;
  min-width: 94px;
  padding-left: 12px;
  padding-right: 12px;
}

.quick-strip-more {
  min-width: 82px;
  position: relative;
  z-index: 5;

  background:
    linear-gradient(
      145deg,
      var(--board-bg-a),
      var(--board-bg-b)
    );
}

.quick-strip-more .toolbar-more-button {
  width: 100%;
  height: 100%;
  min-width: 82px;
}

/* =========================================================
   CLEAN FOCUS TOOL NAVIGATION
   Uses the teacher's saved toolbar order.
   ========================================================= */

.clean-focus-tool-nav {
  position: fixed;
  inset: auto 0 8px 0;
  z-index: 115;

  display: none;
  align-items: flex-end;
  justify-content: space-between;

  padding: 0 12px;

  pointer-events: none;
}

body.focus-mode .clean-focus-tool-nav.show {
  display: flex;
}

body.video-only .clean-focus-tool-nav {
  display: none !important;
}

.clean-focus-tool-nav-button {
  min-width: 0;
  max-width: min(280px, 42vw);
  min-height: 34px;

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

  padding: 6px 13px;
  border: 1px solid color-mix(
    in srgb,
    var(--board-accent) 58%,
    rgba(20, 63, 58, 0.16)
  );
  border-radius: 999px;

  background: color-mix(
    in srgb,
    var(--board-accent) 12%,
    rgba(255, 255, 255, 0.82)
  );

  color: var(--board-ink);

  box-shadow:
    0 6px 16px rgba(15, 23, 42, 0.10),
    0 0 0 3px color-mix(
      in srgb,
      var(--board-accent) 10%,
      transparent
    );

  backdrop-filter: blur(10px);

  font-size: 11px;
  line-height: 1;
  font-weight: 950;

  cursor: pointer;
  pointer-events: auto;

  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;

  animation:
    cleanFocusNavEnter 0.42s ease-out both,
    cleanFocusNavHint 0.8s ease-in-out 0.55s 2;
}

.clean-focus-tool-nav-button.previous {
  transform-origin: left center;
}

.clean-focus-tool-nav-button.next {
  transform-origin: right center;
}

.clean-focus-tool-nav-button:hover,
.clean-focus-tool-nav-button:focus-visible {
  background: color-mix(
    in srgb,
    var(--board-accent) 22%,
    #ffffff
  );

  border-color: var(--board-accent-2);

  box-shadow:
    0 9px 22px rgba(15, 23, 42, 0.15),
    0 0 0 4px color-mix(
      in srgb,
      var(--board-accent) 16%,
      transparent
    );

  transform: translateY(-2px);
}

.clean-focus-tool-nav-button:active {
  transform: scale(0.96);
}

.clean-focus-tool-nav-arrow {
  color: var(--board-accent-2);
}

@keyframes cleanFocusNavEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cleanFocusNavHint {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(
      var(--clean-focus-nav-nudge, 0)
    );
  }
}

.clean-focus-tool-nav-button.previous {
  --clean-focus-nav-nudge: -4px;
}

.clean-focus-tool-nav-button.next {
  --clean-focus-nav-nudge: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .clean-focus-tool-nav-button {
    animation: none;
  }
}

.clean-focus-tool-nav-button.previous {
  justify-content: flex-start;
  text-align: left;
}

.clean-focus-tool-nav-button.next {
  justify-content: flex-end;
  text-align: right;
}

.clean-focus-tool-nav-button:disabled {
  visibility: hidden;
  pointer-events: none;
}

/*
  Universal quick tool picker.

  Allows a teacher to jump directly from
  Routine to Attendance, Exit Ticket to Timer,
  Picker to Whiteboard, etc.
*/

.clean-focus-tool-picker {
  position: absolute;

  left: 50%;
  bottom: 0;

  transform:
    translateX(-50%);

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: auto;
}

.clean-focus-tool-picker-button {
  min-height: 36px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  padding:
    7px
    15px;

  border:
    1px solid
    color-mix(
      in srgb,
      var(--board-accent) 65%,
      #cbd5e1
    );

  border-radius:
    999px;

  background:
    rgba(
      255,
      255,
      255,
      0.94
    );

  color:
    var(--board-ink);

  box-shadow:
    0 7px 18px
    rgba(
      15,
      23,
      42,
      0.12
    );

  backdrop-filter:
    blur(12px);

  font-size:
    11px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;
}

.clean-focus-tool-picker-button:hover,
.clean-focus-tool-picker-button:focus-visible {
  border-color:
    var(--board-accent-2);

  background:
    #ffffff;

  outline:
    none;

  transform:
    translateY(-2px);
}

.clean-focus-tool-picker-menu {
  position:
    absolute;

  left:
    50%;

  bottom:
    calc(
      100% +
      9px
    );

  z-index:
    500;

  width:
    min(
      520px,
      calc(
        100vw -
        24px
      )
    );

  max-height:
    min(
      430px,
      68vh
    );

  display:
    none;

  grid-template-columns:
    repeat(
      2,
      minmax(
        0,
        1fr
      )
    );

  gap:
    6px;

  overflow-y:
    auto;

  padding:
    9px;

  border:
    1px solid
    #dbe4df;

  border-radius:
    17px;

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

  box-shadow:
    0 22px 50px
    rgba(
      15,
      23,
      42,
      0.22
    );

  backdrop-filter:
    blur(18px);

  transform:
    translateX(-50%);
}

.clean-focus-tool-picker.open
.clean-focus-tool-picker-menu {
  display:
    grid;
}

.clean-focus-tool-picker-item {
  min-width:
    0;

  min-height:
    42px;

  display:
    grid;

  grid-template-columns:
    28px
    minmax(
      0,
      1fr
    );

  align-items:
    center;

  gap:
    8px;

  padding:
    7px
    10px;

  border:
    1px solid
    #e5e7eb;

  border-radius:
    11px;

  background:
    #ffffff;

  color:
    #143f3a;

  text-align:
    left;

  cursor:
    pointer;
}

.clean-focus-tool-picker-item:hover,
.clean-focus-tool-picker-item:focus-visible {
  border-color:
    #86efac;

  background:
    #eefbf4;

  outline:
    none;
}

.clean-focus-tool-picker-item.active {
  border-color:
    var(--board-accent-2);

  background:
    color-mix(
      in srgb,
      var(--board-accent) 18%,
      #ffffff
    );
}

.clean-focus-tool-picker-item-icon {
  display:
    grid;

  place-items:
    center;

  font-size:
    18px;

  line-height:
    1;
}

.clean-focus-tool-picker-item-label {
  min-width:
    0;

  overflow:
    hidden;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;

  font-size:
    11px;

  font-weight:
    950;
}

@media (
  max-width: 650px
) {
  .clean-focus-tool-picker-button {
    min-height:
      32px;

    padding:
      6px
      10px;

    font-size:
      10px;
  }

  .clean-focus-tool-picker-menu {
    grid-template-columns:
      1fr;

    width:
      min(
        320px,
        calc(
          100vw -
          20px
        )
      );
  }
}

/*
  The floating presentation timer must never appear
  outside an active Present to Class session.
*/
body:not(.present-to-class-active)
#presentTimerControl {
  display: none !important;
}

/*
  Present to Class return menu

  Main action returns to Timetable.
  Dropdown provides Next period and Dashboard.
*/

.present-return-menu {
  position: relative;
  flex: 0 0 auto;
}

.present-return-menu > summary {
  list-style: none;
}

.present-return-menu
> summary::-webkit-details-marker {
  display: none;
}

.present-return-trigger {
  min-height: 28px;

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

  padding:
    5px
    10px;

  border:
    1px solid
    #bbf7d0;

  border-radius:
    999px;

  background:
    #f0fdf4;

  color:
    #166534;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;
}

.present-return-trigger:hover,
.present-return-trigger:focus-visible,
.present-return-menu[open]
.present-return-trigger {
  border-color:
    #5fdc9a;

  background:
    #dcfce7;

  outline:
    none;
}

.present-return-chevron {
  font-size: 8px;

  transition:
    transform
    0.15s ease;
}

.present-return-menu[open]
.present-return-chevron {
  transform:
    rotate(180deg);
}


.present-return-panel {
  position:
    absolute;

  right:
    0;

  bottom:
    calc(
      100% +
      9px
    );

  z-index:
    1200;

  width:
    220px;

  display:
    grid;

  gap:
    4px;

  padding:
    7px;

  border:
    1px solid
    #dbe3e8;

  border-radius:
    14px;

  background:
    #ffffff;

  box-shadow:
    0
    18px
    42px
    rgba(
      15,
      23,
      42,
      0.24
    );
}


.present-return-panel
button {
  width:
    100%;

  min-height:
    46px;

  display:
    grid;

  grid-template-columns:
    26px
    minmax(
      0,
      1fr
    );

  align-items:
    center;

  gap:
    8px;

  padding:
    8px
    10px;

  border:
    0;

  border-radius:
    10px;

  background:
    transparent;

  color:
    #143f3a;

  text-align:
    left;

  cursor:
    pointer;
}


.present-return-panel
button:hover,
.present-return-panel
button:focus-visible {
  background:
    #eefbf4;

  outline:
    none;
}


.present-return-panel
button.primary {
  background:
    #f0fdf4;
}


.present-return-panel
button
> span:first-child {
  display:
    grid;

  place-items:
    center;

  font-size:
    16px;
}


.present-return-panel
button
> span:last-child {
  min-width:
    0;

  display:
    grid;

  gap:
    2px;
}


.present-return-panel
strong {
  color:
    #143f3a;

  font-size:
    11px;

  line-height:
    1;

  font-weight:
    950;
}


.present-return-panel
small {
  color:
    #64748b;

  font-size:
    9px;

  line-height:
    1.2;

  font-weight:
    800;
}

.present-to-class-exit-button {
  min-height: 26px;
  padding: 5px 9px;

  border: 1px solid #fecaca;
  border-radius: 999px;

  background: #fef2f2;
  color: #991b1b;

  box-shadow: none;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;

  cursor: pointer;
  pointer-events: auto;
}

.present-to-class-exit-button:hover,
.present-to-class-exit-button:focus-visible {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #7f1d1d;
  outline: none;
}

.present-to-class-exit-button:active {
  transform: scale(0.96);
}

.clean-focus-tool-nav-arrow {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 0.8;
  font-weight: 950;
}

.clean-focus-tool-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
  Temporary toolbar-position badge.

  It appears whenever the navigator is rendered,
  remains visible briefly, then fades away.
*/
.clean-focus-tool-nav-position {
  flex: 0 0 auto;
  min-width: 28px;
  height: 19px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 6px;
  border-radius: 999px;

  background: color-mix(
    in srgb,
    var(--board-accent) 22%,
    #ffffff
  );

  border: 1px solid color-mix(
    in srgb,
    var(--board-accent) 48%,
    transparent
  );

  color: var(--board-ink);

  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;

  animation:
    cleanFocusPositionBadge
    2.6s
    ease
    forwards;
}

@keyframes cleanFocusPositionBadge {
  0%,
  68% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.88);
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clean-focus-tool-nav-position {
    animation:
      cleanFocusPositionBadgeReduced
      2.6s
      linear
      forwards;
  }

  @keyframes cleanFocusPositionBadgeReduced {
    0%,
    75% {
      opacity: 1;
    }

    100% {
      opacity: 0;
      visibility: hidden;
    }
  }
}

@media (max-width: 650px) {
  .clean-focus-tool-nav {
    bottom: 6px;
    padding: 0 8px;
  }

  .clean-focus-tool-nav-button {
    max-width: 44vw;
    min-height: 30px;
    padding: 5px 9px;
    font-size: 10px;
    gap: 5px;
  }

  .clean-focus-tool-nav-arrow {
    font-size: 16px;
  }
}

    .quick-launch {
      background:
        color-mix(
          in srgb,
          var(--board-card) 94%,
          var(--board-surface-soft)
        );

      border:
        1px solid
        var(--board-border);

      border-radius: 15px;
      padding: 6px;

      text-align: center;
      font-weight: 900;

      color:
        var(--board-ink);

      display: flex;
      flex-direction: column;
      justify-content: center;

      gap: 3px;

      box-shadow:
        0 8px 18px
        rgba(
          15,
          23,
          42,
          0.05
        );

      cursor: pointer;
      min-width: 0;

      transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
    }

    .quick-launch:hover {
      border-color:
        color-mix(
          in srgb,
          var(--board-accent) 55%,
          var(--board-border)
        );

      background:
        color-mix(
          in srgb,
          var(--board-accent) 9%,
          #ffffff
        );

      box-shadow:
        0 12px 26px
        rgba(
          15,
          23,
          42,
          0.09
        );

      transform:
        translateY(-2px);
    }

    .quick-launch span {
  font-size: 21px;
  line-height: 1;
}

.video-tool-icon {
  width: 30px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border-radius: 7px;
  background: #ff0000;
  color: #ffffff;
  font-size: 14px !important;
  line-height: 1;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(255, 0, 0, 0.24);
}

    .quick-launch small {
      font-size: 11px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* =========================================================
       7. RIGHT WIDGETS
       ========================================================= */

    .right-rail {
      overflow: hidden;
    }

    .widget-slot {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Compact right-side widget headers */

.widget-slot .panel-head {
  min-height: 32px;
  padding: 5px 8px;
  gap: 5px;
}

.widget-slot .panel-head h2 {
  font-size: 13px;
  line-height: 1;
}

.widget-slot .panel-actions {
  gap: 3px;
}

.widget-slot .panel-head .icon-btn {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

    .widget-slot .panel-body {
      overflow-y: auto;
      overflow-x: hidden;
      height: calc(100% - 40px);
    }

    .mini-row {
      display: grid;
      grid-template-columns: 38px 1fr auto;
      gap: 9px;
      align-items: center;

      background:
        color-mix(
          in srgb,
          var(--board-surface-soft) 38%,
          #ffffff
        );

      border:
        1px solid
        var(--board-border);

      border-radius: 14px;
      padding: 9px;
      margin-bottom: 8px;
      min-width: 0;
    }

    .mini-icon {
      width: 38px;
      height: 38px;
      border-radius: 12px;

      background:
        color-mix(
          in srgb,
          var(--board-accent) 15%,
          #ffffff
        );

      display: flex;
      align-items: center;
      justify-content: center;

      font-size: 19px;
    }

    .mini-title {
      font-weight: 900;
      color: #111827;
      font-size: 14px;
      margin-bottom: 2px;

      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .mini-sub {
      color: #6b7280;
      font-size: 12px;
      line-height: 1.3;
    }

    .show-btn {
      border: none;
      background: transparent;

      color:
        var(--board-accent-2);

      font-weight: 900;
      font-size: 12px;
      cursor: pointer;
    }

    .timer-display {
      font-size:
        clamp(
          42px,
          4.2vw,
          66px
        );

      line-height: 1;
      font-weight: 900;

      color:
        var(--board-ink);

      text-align: center;
      letter-spacing: -2px;

      margin:
        2px
        0
        10px;

      cursor: pointer;
    }

    .timer-buttons {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      margin-bottom: 8px;
    }

    .timer-buttons button,
    .small-btn {
      border:
        1px solid
        var(--board-border);

      background:
        color-mix(
          in srgb,
          var(--board-surface-soft) 38%,
          #ffffff
        );

      color:
        var(--board-ink);

      border-radius: 999px;

      padding:
        8px
        6px;

      font-weight: 900;
      cursor: pointer;
      font-size: 12px;
    }

    .timer-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .sticky-stack {
      display: grid;
      gap: 8px;
    }

    .sticky {
      background: #fff7cc;
      border: 1px solid #fde68a;
      border-radius: 14px;
      padding: 10px;
      min-height: 58px;
      font-weight: 800;
      color: #374151;
      line-height: 1.35;
      cursor: pointer;
    }

    .daily-links-list {
  display: grid;
  gap: 8px;
}

/* Compact cards only inside the right-side Daily Links widget */
.daily-links-widget-list {
  gap: 5px;
}

.daily-links-widget-list .daily-link-card {
  min-height: 42px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 9px;
  border-radius: 12px;
  box-shadow: none;
}

.daily-links-widget-list .daily-link-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 14px;
}

.daily-links-widget-list .daily-link-title {
  font-size: 12px;
  line-height: 1.1;
}

.daily-links-widget-list .daily-link-content {
  padding-right: 0;
}

    .daily-link-card {
      position: relative;
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr);
      gap: 12px;
      align-items: center;
      width: 100%;
      min-height: 68px;
      border: 1px solid #e5e7eb;
      background: #ffffff;
      color: #143f3a;
      border-radius: 18px;
      padding: 13px 54px 13px 15px;
      cursor: pointer;
      text-align: left;
      transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
      box-shadow: 0 8px 18px rgba(15,23,42,0.05);
    }

    .daily-link-card:hover {
      transform: translateY(-2px);

      border-color:
        var(--board-accent);

      background:
        color-mix(
          in srgb,
          var(--board-accent) 9%,
          #ffffff
        );

      box-shadow:
        0 10px 20px
        rgba(15, 23, 42, 0.08);
    }

    .daily-link-icon {
      width: 42px;
      height: 42px;
      border-radius: 14px;

      background:
        color-mix(
          in srgb,
          var(--board-accent) 15%,
          #ffffff
        );

      display: grid;
      place-items: center;
      font-size: 19px;
      flex-shrink: 0;
    }

    .daily-link-content {
      min-width: 0;
      display: grid;
      gap: 0;
      align-self: center;
      padding-right: 4px;
    }

    .daily-link-title {
      display: block;
      color: #111827;
      font-size: 16px;
      font-weight: 950;
      line-height: 1.18;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .daily-link-url {
      display: none !important;
    }

    .daily-link-title-pin {
      position: absolute;
      top: 12px;
      right: 12px;

      width: 31px;
      height: 31px;
      min-width: 31px;

      display: inline-grid;
      place-items: center;

      border-radius: 999px;

      border:
        1px solid
        color-mix(
          in srgb,
          var(--board-accent) 34%,
          var(--board-border)
        );

      background:
        #ffffff;

      color:
        var(--board-accent-2);

      font-size: 15px;
      font-weight: 950;

      cursor: pointer;
      line-height: 1;
      padding: 0;

      box-shadow:
        0 4px 10px
        rgba(15, 23, 42, 0.05);
    }

    .daily-link-title-pin:hover {
      background:
        color-mix(
          in srgb,
          var(--board-accent) 18%,
          #ffffff
        );

      border-color:
        var(--board-accent);
    }

    .daily-links-empty {
      padding: 14px;
      border: 1px dashed #cbd5e1;
      border-radius: 14px;
      background: #f8fafc;
      color: #64748b;
      font-size: 13px;
      font-weight: 850;
      line-height: 1.35;
      text-align: center;
    }

    .daily-links-editor {
      display: grid;
      gap: 10px;
    }

    .daily-link-edit-row {
      display: grid;
      gap: 10px;
      padding: 12px;

      border:
        1px solid
        var(--board-border);

      border-radius: 18px;

      background:
        color-mix(
          in srgb,
          var(--board-surface-soft) 58%,
          #ffffff
        );
    }

    .daily-link-edit-row input,
    .daily-link-edit-row select {
      width: 100%;
      margin: 0;
      border: 1px solid #d1d5db;
      border-radius: 12px;
      padding: 10px;
      font-size: 14px;
      background: #ffffff;
    }

    .daily-link-edit-fields {
      display: grid;
      grid-template-columns: 74px 1fr 1.2fr 150px;
      gap: 8px;
      align-items: center;
    }

    .daily-link-manager-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .daily-link-manager-note {
      margin-bottom: 14px;
      padding: 12px 14px;
      border-radius: 18px;
      background: #f1fdf6;
      border: 1px solid #d9fbe8;
      color: #143f3a;
      font-size: 13px;
      font-weight: 850;
      line-height: 1.4;
    }

    .daily-link-manager-list {
      display: grid;
      gap: 10px;
    }

    .daily-link-manager-section {
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      overflow: hidden;
      background: #ffffff;
    }

    .daily-link-manager-summary {
      list-style: none;
      cursor: pointer;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto 20px;
      align-items: center;
      gap: 12px;
      padding: 13px 15px;
      background: #f8fafc;
      color: #143f3a;
      font-size: 15px;
      font-weight: 950;
    }

    .daily-link-manager-summary::-webkit-details-marker {
      display: none;
    }

    .daily-link-manager-summary::after {
      content: "▸";
      color: #159957;
      font-size: 15px;
      font-weight: 950;
      text-align: right;
    }

    .daily-link-manager-section[open] .daily-link-manager-summary::after {
      content: "▾";
    }

    .daily-link-manager-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 28px;
      height: 28px;
      padding: 0 9px;
      border-radius: 999px;
      background: #eefbf4;
      color: #159957;
      font-size: 11px;
      font-weight: 950;
    }

    .daily-link-manager-body {
      display: grid;
      gap: 8px;
      padding: 10px;
    }

    .daily-link-manager-card {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) auto;
      gap: 9px;
      align-items: center;
      padding: 10px;
      border: 1px solid #e5e7eb;
      border-radius: 15px;
      background: #ffffff;
    }

    .daily-link-manager-actions-inline {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: nowrap;
    }

    .daily-link-manager-icon {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 12px;
      background: #eefbf4;
      font-size: 18px;
    }

    .daily-link-manager-title {
      color: #111827;
      font-size: 14px;
      font-weight: 950;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .daily-link-manager-url {
      display: none !important;
    }

    .daily-link-manager-mini {
      min-height: 34px;
      min-width: 62px;
      padding: 7px 13px;
      border-radius: 999px;
      border: 1px solid #d1d5db;
      background: #ffffff;
      color: #143f3a;
      font-size: 11px;
      font-weight: 950;
      cursor: pointer;
      white-space: nowrap;
      text-align: center;
      line-height: 1;
    }

    .daily-link-manager-mini.danger {
      background: #fff7f7;
      border-color: #fecaca;
      color: #991b1b;
    }

    @media (max-width: 900px) {
      .daily-link-edit-fields {
        grid-template-columns: 1fr;
      }

      .daily-link-manager-card {
        grid-template-columns: 42px minmax(0, 1fr);
      }

      .daily-link-manager-actions-inline {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
      }
    }

    .daily-links-top-section {
      margin-top: 18px;
      margin-bottom: 16px;
      padding: 14px;
      border: 1px solid #d9fbe8;
      border-radius: 22px;
      background: #f1fdf6;
    }

    .daily-links-section-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
      color: #143f3a;
      font-size: 14px;
      font-weight: 950;
      letter-spacing: -0.2px;
    }

    .daily-links-section-title span:last-child {
      color: #64748b;
      font-size: 11px;
      font-weight: 900;
    }

    .daily-links-top-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 10px;
    }

    .daily-links-category-label {
      margin: 8px 0 10px;
      color: #143f3a;
      font-size: 13px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: 0.6px;
    }

    .daily-link-category-section {
      border: 1px solid #e5e7eb;
      border-radius: 20px;
      overflow: hidden;
      background: #ffffff;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    }

    .daily-link-category-section + .daily-link-category-section {
      margin-top: 12px;
    }

    .daily-link-category-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  color: #143f3a;
  font-size: 16px;
  font-weight: 950;
}

    .daily-link-category-summary::-webkit-details-marker {
      display: none;
    }

    .daily-link-category-summary::after {
      content: "▾";
      font-size: 16px;
      color: #159957;
      transition: transform 0.15s ease;
    }

    .daily-link-category-section:not([open]) .daily-link-category-summary::after {
      transform: rotate(-90deg);
    }

    .daily-link-category-count {
      margin-left: auto;
      padding: 4px 9px;
      border-radius: 999px;
      background: #eefbf4;
      color: #159957;
      font-size: 11px;
      font-weight: 950;
    }

    .daily-link-category-body {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
      gap: 12px;
      padding: 14px;
    }

    .daily-links-stage-card {
      height: 100% !important;
      justify-content: flex-start !important;
      overflow-y: auto !important;
    }

    .daily-links-stage-card .big-heading {
      font-size: clamp(28px, 3vw, 42px);
      line-height: 1.05;
      margin-bottom: 10px;
    }

    .daily-links-stage-card .big-text {
      font-size: clamp(17px, 1.5vw, 22px) !important;
      line-height: 1.35;
    }

    @media (max-width: 760px) {
      .daily-link-edit-row {
        grid-template-columns: 1fr;
      }
    }

    /* =========================================================
       CONTEXTUAL LESSON HELP
       ========================================================= */

    .today-context-ai {
      margin-top:
        12px;

      display:
        flex;

      align-items:
        center;

      justify-content:
        space-between;

      gap:
        12px;

      padding:
        10px
        12px;

      border:
        1px solid
        #ddd6fe;

      border-radius:
        14px;

      background:
        linear-gradient(
          135deg,
          #faf9ff,
          #f5f3ff
        );

      color:
        #334155;
    }


    .today-context-ai-copy {
      min-width:
        0;

      display:
        flex;

      align-items:
        center;

      gap:
        9px;
    }


    .today-context-ai-icon {
      width:
        28px;

      height:
        28px;

      flex:
        0
        0
        28px;

      display:
        grid;

      place-items:
        center;

      border-radius:
        10px;

      background:
        #ede9fe;

      color:
        #6d28d9;

      font-size:
        13px;

      font-weight:
        950;
    }


    .today-context-ai-text {
      min-width:
        0;

      display:
        grid;

      gap:
        2px;
    }


    .today-context-ai-text strong {
      color:
        #312e81;

      font-size:
        11px;

      line-height:
        1.15;

      font-weight:
        950;
    }


    .today-context-ai-text span {
      color:
        #64748b;

      font-size:
        10px;

      line-height:
        1.25;

      font-weight:
        800;
    }


    .today-context-ai-action {
      flex:
        0
        0
        auto;

      min-height:
        30px;

      display:
        inline-flex;

      align-items:
        center;

      justify-content:
        center;

      padding:
        6px
        11px;

      border:
        1px solid
        #c4b5fd;

      border-radius:
        999px;

      background:
        #ffffff;

      color:
        #6d28d9;

      font-size:
        10px;

      line-height:
        1;

      font-weight:
        950;

      white-space:
        nowrap;

      cursor:
        pointer;
    }


    .today-context-ai-action:hover,
    .today-context-ai-action:focus-visible {
      border-color:
        #8b5cf6;

      background:
        #f5f3ff;

      outline:
        none;
    }


    @media (
      max-width:
      700px
    ) {
      .today-context-ai {
        align-items:
          flex-start;

        flex-direction:
          column;
      }

      .today-context-ai-action {
        align-self:
          flex-end;
      }
    }


    /* =========================================================
       TODAY VIEW + REMINDERS
       ========================================================= */



    .today-view-shell {
      height: 100%;
      display: grid;
      grid-template-rows: auto 1fr auto;
      gap: 14px;
      overflow: hidden;
    }

    .today-view-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 14px;
      padding: 16px 20px;
      border: 1px solid #e5e7eb;
      border-radius: 22px;
      background: #ffffff;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    }

    .today-greeting-row {
      display: flex;
      align-items: center;
      gap: 14px;
      min-width: 0;
    }

    .today-sun {
      width: 56px;
      height: 56px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      border-radius: 18px;
      background: #f1fdf6;
      font-size: 32px;
    }

    .today-greeting {
      margin: 0;
      color: #143f3a;
      font-size: clamp(26px, 3vw, 42px);
      line-height: 1.05;
      letter-spacing: -1px;
      font-weight: 950;
    }

    .today-date-line {
      margin-top: 4px;
      color: #64748b;
      font-size: 15px;
      font-weight: 850;
    }

    .today-view-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
      gap: 14px;
      min-height: 0;
    }

    .today-card {
      min-height: 0;
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 22px;
      padding: 18px;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
      overflow: hidden;
    }

    .today-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }



    .today-card-title {
      margin: 0;
      color: #143f3a;
      font-size: 20px;
      line-height: 1.1;
      font-weight: 950;
      letter-spacing: -0.35px;
    }

        .today-card-title-wrap {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .today-card-help {
      display: none;
    }

    .today-card-count {
      color: #64748b;
      font-size: 12px;
      font-weight: 950;
      white-space: nowrap;
    }

    .today-next-time {
      color: #64748b;
      font-size: 13px;
      font-weight: 950;
    }

    .today-next-title {
      margin: 8px 0 10px;
      color: #111827;
      font-size: clamp(30px, 3.5vw, 52px);
      line-height: 1.02;
      font-weight: 950;
      letter-spacing: -1.3px;
    }

    .today-next-text {
      color: #374151;
      font-size: clamp(18px, 1.8vw, 26px);
      line-height: 1.32;
      font-weight: 750;
      max-height: 140px;
      overflow: hidden;
    }

    .today-card-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 18px;
    }

    .today-open-lesson-desktop {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .today-open-lesson-mobile {
      display: none;
    }

    .today-reminders-list {
      display: grid;
      gap: 10px;
      overflow: auto;
      max-height: 100%;
      padding-right: 2px;
    }

    .today-reminder-row {
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      min-height: 58px;
      padding: 10px 12px;
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      background: #ffffff;
      transition: background 0.2s ease, border-color 0.2s ease;
    }

    /* Attention Shake Effect for Overdue Reminders */
    .today-reminder-row.overdue,
    .today-reminder-row.is-overdue,
    .today-reminder-row.urgent,
    .today-reminder-row[data-overdue="true"],
    body[data-stage="today"] .today-reminder-row.overdue,
    body[data-stage="today"] .today-reminder-row.is-overdue {
      border-color: #fca5a5 !important;
      background: #fef2f2 !important;
      animation: reminderShake 2.2s ease-in-out infinite !important;
      will-change: transform;
    }

    .today-reminder-row.overdue .today-reminder-title,
    .today-reminder-row.is-overdue .today-reminder-title,
    body[data-stage="today"] .today-reminder-row.overdue .today-reminder-title {
      color: #991b1b !important;
    }

    .today-reminder-row.done,
    .today-reminder-row.is-done,
    .today-reminder-row.completed,
    body[data-stage="today"] .today-reminder-row.done {
      background: #f8fafc !important;
      color: #64748b !important;
      animation: none !important;
    }

    .today-reminder-check {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border-radius: 999px;

      border:
        2px solid
        color-mix(
          in srgb,
          var(--board-accent) 48%,
          var(--board-border)
        );

      background:
        color-mix(
          in srgb,
          var(--board-accent) 10%,
          #ffffff
        );

      color:
        var(--board-ink);

      font-size: 17px;
      font-weight: 950;
      cursor: pointer;

      transition:
        transform 0.15s ease,
        background 0.2s ease,
        border-color 0.2s ease;

      will-change: transform;
    }

    .today-reminder-check:hover {
      transform: scale(1.12);
    }

    .today-reminder-check:active {
      transform: scale(0.85);
      animation: reminderDonePop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    }

    /* Satisfying Done Checkmark Pop Effect */
    .today-reminder-row.done .today-reminder-check,
    .today-reminder-row.is-done .today-reminder-check,
    .today-reminder-check.done,
    .today-reminder-check.checked,
    body[data-stage="today"] .today-reminder-row.done .today-reminder-check {
      background:
        var(--board-accent) !important;

      border-color:
        var(--board-accent) !important;

      color:
        var(--board-ink) !important;

      animation:
        reminderDonePop
        0.4s
        cubic-bezier(
          0.175,
          0.885,
          0.32,
          1.275
        )
        forwards !important;
    }

    @keyframes reminderShake {
      0%, 100% { transform: translateX(0) rotate(0deg); }
      10%, 30%, 50%, 70% { transform: translateX(-4px) rotate(-1.5deg); }
      20%, 40%, 60%, 80% { transform: translateX(4px) rotate(1.5deg); }
      90% { transform: translateX(-1px) rotate(0deg); }
    }

    @keyframes reminderDonePop {
      0% { transform: scale(0.6); }
      50% { transform: scale(1.35); }
      100% { transform: scale(1); }
    }

    .today-reminder-title {
      color: #111827;
      font-size: 15px;
      line-height: 1.22;
      font-weight: 950;
      overflow-wrap: anywhere;
    }

    .today-reminder-row.done .today-reminder-title {
      color: #64748b;
      text-decoration: line-through;
    }

    .today-reminder-meta {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 5px;
    }

    .today-reminder-snoozed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 3px 8px;
  border: 1px solid #c4b5fd;
  border-radius: 999px;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

    .today-reminder-pill {
      display: inline-flex;
      align-items: center;
      min-height: 20px;
      padding: 3px 8px;
      border-radius: 999px;
      background: #f1f5f9;
      color: #475569;
      font-size: 11px;
      font-weight: 900;
    }

    .today-reminder-link {
  border: none;
  background: #eefbf4;
  color: #159957;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}

.today-reminder-content {
  min-width: 0;
}

.today-reminder-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
}

.today-reminder-meta span + span::before {
  content: "·";
  margin-right: 6px;
  color: #cbd5e1;
}

.today-reminder-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  position: relative;
}

.today-reminder-icon-action,
.today-reminder-menu summary {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #159957;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.today-reminder-icon-action:hover,
.today-reminder-menu summary:hover {
  background: #eefbf4;
  border-color: #bbf7d0;
}

/* =========================================================
   REMINDER OPTIONS FLOATING POPOVER
   Lives at body level so reminder/list overflow
   can never clip Edit / Delete.
   ========================================================= */

.today-reminder-menu-button {
  width: 30px;
  height: 30px;

  display: inline-grid;
  place-items: center;

  flex-shrink: 0;

  padding: 0;

  border: 1px solid #e5e7eb;
  border-radius: 999px;

  background: #ffffff;
  color: #159957;

  font-size: 17px;
  line-height: 1;
  font-weight: 950;

  cursor: pointer;
}

.today-reminder-menu-button:hover,
.today-reminder-menu-button:focus-visible,
.today-reminder-menu-button.active {
  border-color: #bbf7d0;
  background: #eefbf4;
  outline: none;
}


/*
  This element is appended directly to document.body.

  position: fixed means it floats over the Class Board
  instead of taking part in the reminder list layout.
*/
.reminder-options-popover {
  position: fixed;

  z-index: 10000;

  width: 156px;

  display: none;
  gap: 4px;

  padding: 6px;

  border: 1px solid #dbe3e8;
  border-radius: 13px;

  background: #ffffff;

  box-shadow:
    0 18px 42px
    rgba(15, 23, 42, 0.22);

  box-sizing: border-box;
}

.reminder-options-popover.show {
  display: grid;
}

.reminder-options-popover button {
  width: 100%;
  min-height: 36px;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;

  padding: 8px 10px;

  border: 0;
  border-radius: 9px;

  background: transparent;
  color: #143f3a;

  font-size: 11px;
  line-height: 1;
  font-weight: 900;

  text-align: left;

  cursor: pointer;
}

.reminder-options-popover button:hover,
.reminder-options-popover button:focus-visible {
  background: #eefbf4;
  outline: none;
}

.reminder-options-popover button.danger {
  color: #b91c1c;
}

.reminder-options-popover button.danger:hover,
.reminder-options-popover button.danger:focus-visible {
  background: #fef2f2;
}

.today-reminder-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}


/* =========================================================
   TODAY VIEW — COMPACT ACTION CENTRE
   ========================================================= */

.today-action-centre {
  display: grid !important;

  grid-template-rows:
    auto
    40px
    auto !important;

  gap: 10px !important;

  min-height: 0;
}

.today-action-centre.no-tabs {
  grid-template-rows:
    auto
    auto !important;
}

.today-action-centre .today-card-head {
  margin-bottom: 0 !important;
}

.today-action-tabs.single-tab {
  grid-template-columns:
    minmax(0, 1fr);
}

.today-action-tabs {
  width: 100%;
  height: 40px;
  min-height: 40px;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 4px;
  align-items: center;

  margin: 0;
  padding: 4px;

  border:
    1px solid
    var(--board-border);

  border-radius: 13px;

  background:
    color-mix(
      in srgb,
      var(--board-surface-soft) 72%,
      #f8fafc
    );

  flex: 0 0 40px;
  overflow: hidden;
}

.today-action-tab {
  width: 100%;
  height: 32px;

  min-width: 0;
  min-height: 32px;
  max-height: 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  margin: 0;
  padding: 0 10px;

  border:
    1px solid
    transparent;

  border-radius: 9px;

  background:
    transparent;

  color:
    #64748b;

  font-size: 11px;
  line-height: 1;
  font-weight: 950;

  white-space: nowrap;
  cursor: pointer;

  box-shadow: none;
}

.today-action-tab:hover {
  background:
    rgba(
      255,
      255,
      255,
      0.72
    );

  color:
    var(--board-ink);
}

.today-action-tab.active {
  border-color:
    color-mix(
      in srgb,
      var(--board-accent) 48%,
      var(--board-border)
    );

  background:
    #ffffff;

  color:
    var(--board-ink);

  box-shadow:
    0 2px 6px
    rgba(
      15,
      23,
      42,
      0.05
    );
}

.today-action-tab.active.needs {
  border-color:
    color-mix(
      in srgb,
      var(--board-accent) 38%,
      #ead7b8
    );

  background:
    color-mix(
      in srgb,
      var(--board-accent) 5%,
      #fffdf8
    );

  color:
    var(--board-ink);
}

.today-action-tab-count {
  min-width: 20px;
  height: 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 6px;

  border-radius: 999px;

  background:
    #e2e8f0;

  color:
    #475569;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;
}

.today-action-tab.active
.today-action-tab-count {
  background:
    color-mix(
      in srgb,
      var(--board-accent) 22%,
      #ffffff
    );

  color:
    var(--board-ink);
}

.today-action-tab.active.needs
.today-action-tab-count {
  background:
    color-mix(
      in srgb,
      var(--board-accent) 18%,
      #fff8e8
    );

  color:
    var(--board-ink);
}

.today-action-content {
  min-height: 0;

  overflow: visible;

  padding: 0 4px 4px 0;
}

.today-priority-action-list {
  display: grid;
  gap: 9px;
}

.today-priority-action {
  position: relative;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 10px;
  align-items: center;
  padding: 13px 13px 13px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.today-priority-action::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #fbbf24;
}

.today-priority-action-top {
  min-width: 0;
  display: grid;
  grid-template-columns:
    38px
    minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.today-priority-action-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff7dd;
  color: #b7791f;
  font-size: 18px;
  font-weight: 950;
}

.today-priority-action-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.today-priority-action-copy strong {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-priority-action-copy span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 850;
}

.today-priority-action-button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #7c5a16;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

.today-priority-action-button:hover {
  border-color: #f3d98a;
  background: #fffdf7;
}

.today-action-more {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #b45309;
  padding: 4px 2px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 950;
  cursor: pointer;
}

.today-action-more:hover {
  text-decoration: underline;
}

.today-action-reminder-list {
  min-height: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: visible;
}

.today-action-reminder-list
.today-reminder-row {
  min-height: 54px !important;
}

.today-completed-reminders-link {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #64748b;
  padding: 4px 2px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.today-completed-reminders-link:hover {
  color: #143f3a;
  text-decoration: underline;
}

.today-action-clear {
  min-height: 76px;
  display: grid;
  grid-template-columns:
    38px
    minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  background: #f0fdf4;
}

.today-action-clear-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 20px;
  font-weight: 950;
}

.today-action-clear strong {
  display: block;
  color: #166534;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 950;
}

.today-action-clear span {
  display: block;
  margin-top: 3px;
  color: #4b7b5a;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 850;
}

@media (max-width: 900px) {
  .today-priority-action {
    grid-template-columns: 1fr;
  }

  .today-priority-action-button {
    justify-self: start;
  }
}

.today-reminder-view-all {
  border: 0;
  background: transparent;

  color:
    var(--board-accent-2);

  padding: 4px 2px;

  font-size: 11px;
  font-weight: 950;

  cursor: pointer;
  white-space: nowrap;
}

.today-reminder-view-all:hover {
  text-decoration: underline;
}

.today-reminder-add {
  min-height: 30px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 5px 10px;

  border:
    1px solid
    color-mix(
      in srgb,
      var(--board-accent) 48%,
      var(--board-border)
    );

  border-radius: 999px;

  background:
    color-mix(
      in srgb,
      var(--board-accent) 13%,
      #ffffff
    );

  color:
    var(--board-ink);

  font-size: 11px;
  line-height: 1;
  font-weight: 950;

  white-space: nowrap;
  cursor: pointer;
}

.today-reminder-add:hover {
  background:
    color-mix(
      in srgb,
      var(--board-accent) 22%,
      #ffffff
    );

  border-color:
    var(--board-accent-2);
}

    .today-bottom-grid {
      min-height: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
      gap: 10px;
      overflow: hidden;
      align-items: stretch;
    }

    .today-links-section,
    .today-absent-section {
      min-height: 0;
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 20px;
      padding: 14px;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
      overflow: hidden;
    }

    .today-links-section {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .today-absent-section {
      display: flex;
      flex-direction: column;
    }

    .today-absent-summary {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr);
      gap: 11px;
      align-items: center;
      min-height: 70px;
      padding: 11px 12px;
      border-radius: 17px;
      background: #f8fafc;
      border: 1px solid #e5e7eb;
    }

    .today-absent-icon {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border-radius: 15px;
      background: #eefbf4;
      font-size: 21px;
    }

    .today-absent-count {
      color: #111827;
      font-size: clamp(24px, 2.2vw, 34px);
      line-height: 0.95;
      font-weight: 950;
      letter-spacing: -0.8px;
    }

    .today-absent-text {
      margin-top: 3px;
      color: #64748b;
      font-size: 12.5px;
      line-height: 1.2;
      font-weight: 850;
    }

    .today-absent-names {
      margin-top: 8px;
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      max-height: none;
      overflow: visible;
    }

    .today-absent-name {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 4px 8px;
      border-radius: 999px;
      background: #f1f5f9;
      color: #475569;
      font-size: 10.5px;
      font-weight: 900;
    }

    .today-absent-note {
      margin-top: 9px;
      color: #159957;
      font-size: 10.5px;
      font-weight: 900;
      line-height: 1.25;
    }

    .today-absent-section .btn {
  align-self: flex-start;
  margin-top: 8px;
}

.today-absent-header {
  align-items: center;
}

.today-absent-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: nowrap;
}

.today-absent-update {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #159957;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

.today-absent-update:hover {
  background: transparent;
  color: #166534;
  text-decoration: underline;
}

.today-birthday-panel {
  width: 100%;
  min-height: 48px;
  margin-top: auto;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #f9a8d4;
  border-radius: 14px;
  background: #fdf2f8;
  color: #9d174d;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.today-birthday-panel:hover {
  border-color: #f472b6;
  background: #fce7f3;
}

.today-birthday-panel.is-today {
  border-color: #ec4899;
  background: #fce7f3;
  color: #831843;
}

.today-management-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  width: 100%;
}

.today-seating-shortcut-panel {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1e40af;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.today-seating-shortcut-panel:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.today-routine-shortcut-panel {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #bbf4d7;
  border-radius: 14px;
  background: #eefbf4;
  color: #143f3a;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.today-routine-shortcut-panel:hover {
  border-color: #5fdc9a;
  background: #e1faf0;
}

.today-birthday-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 17px;
}

.today-birthday-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.today-birthday-copy strong {
  font-size: 12px;
  line-height: 1.1;
  font-weight: 950;
}

.today-birthday-copy span {
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-birthday-arrow {
  color: #b45309;
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
}

    .today-pinned-links-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      min-height: 0;
    }

    .today-pinned-link {
      min-height: 58px;
      display: grid;
      grid-template-columns: 36px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      justify-items: stretch;
      border: 1px solid #e5e7eb;
      border-radius: 15px;
      background: #ffffff;
      padding: 9px 11px;
      cursor: pointer;
      text-align: left;
    }

    .today-pinned-link:hover {
      border-color: #5fdc9a;
      background: #f1fdf6;
      transform: translateY(-1px);
    }

    .today-pinned-icon {
      width: 36px;
      height: 36px;
      display: grid;
      place-items: center;
      border-radius: 13px;
      background: #eefbf4;
      font-size: 18px;
    }

    .today-pinned-title {
      color: #111827;
      font-size: 13px;
      font-weight: 950;
      line-height: 1.15;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .today-pinned-url {
      display: none;
    }

    .today-pinned-link.today-add-link-btn {
      background: #f1fdf6 !important;
      border: 1px dashed #5fdc9a !important;
      color: #143f3a !important;
    }

    .today-pinned-link.today-add-link-btn:hover {
      background: #eefbf4 !important;
      border-color: #22c55e !important;
    }

    .today-pinned-link.today-add-link-btn .today-pinned-icon {
      background: #5fdc9a !important;
      color: #143f3a !important;
    }

    .today-empty {
      padding: 16px;
      border: 1px dashed #cbd5e1;
      border-radius: 16px;
      background: #f8fafc;
      color: #64748b;
      font-size: 13px;
      font-weight: 850;
      line-height: 1.4;
      text-align: center;
    }

    .reminder-form-grid {
      display: grid;
      grid-template-columns:
        minmax(0, 1fr)
        220px
        220px;
      gap: 12px;
      align-items: end;
    }

    .reminder-form-grid-full {
      grid-column: 1 / -1;
    }

    #reminderWeeklyDayField[hidden] {
      display: none !important;
    }

    @media (max-width: 760px) {
      .reminder-form-grid {
        grid-template-columns:
          1fr;
      }

      .reminder-form-grid-full {
        grid-column: 1;
      }
    }

    .today-duty-card {
      display: grid;
      /* Adjusted row tracks for a tightly fitted horizontal layout */
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 6px 14px;
      margin-top: 12px;
      border: 1px solid #d9fbe8;
      border-radius: 14px;
      background: #f1fdf6;
      min-height: 42px;
    }

    .today-duty-icon {
      width: 28px;
      height: 28px;
      display: grid;
      place-items: center;
      border-radius: 8px;
      background: #ffffff;
      font-size: 15px;
    }

    /* Fix: Turn the text column into an inline flex row to fit everything on one clean line */
    .today-duty-card > div:not(.today-duty-icon) {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .today-duty-label {
      color: #166534;
      background: #dcfce7;
      padding: 2px 7px;
      border-radius: 6px;
      font-size: 10px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 0 !important;
      white-space: nowrap;
    }

    .today-duty-title {
      color: #111827;
      font-size: 13px;
      font-weight: 950;
      line-height: 1;
      white-space: nowrap;
    }

    .today-duty-meta {
      color: #64748b;
      font-size: 12px;
      font-weight: 850;
      line-height: 1;
      margin-top: 0 !important;
      position: relative;
      padding-left: 8px;
    }

    /* Clean dot separator preceding the time context */
    .today-duty-meta::before {
      content: "•";
      position: absolute;
      left: -2px;
      color: #cbd5e1;
      font-weight: 900;
    }

    .today-duty-item + .today-duty-item {
      margin-top: 5px;
      padding-top: 5px;
      border-top: 1px solid #d9fbe8;
    }

    .weekly-duty-day-group {
      display: grid;
      gap: 7px;
      padding: 10px;
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      background: #ffffff;
    }

    .weekly-duty-grid {
      display: grid;
      gap: 10px;
    }

    .weekly-duty-row {
  display: grid;
  grid-template-columns:
    92px
    minmax(180px, 1.4fr)
    118px
    118px
    minmax(170px, 1fr)
    36px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.weekly-duty-remove-button {
  width: 36px;
  height: 40px;
  min-width: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 11px;
  background: #fff7f7;
  color: #b91c1c;
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

.weekly-duty-remove-button:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.weekly-duty-remove-button:active {
  transform: scale(0.94);
}

.weekly-duty-add-button {
  width: fit-content;
  min-height: 34px;
  margin-left: 100px;
  padding: 7px 12px;
  border: 1px dashed #86efac;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

.weekly-duty-add-button:hover {
  border-style: solid;
  background: #dcfce7;
}

.weekly-duty-remove-button {
  width: 34px;
  height: 40px;
  min-width: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 11px;
  background: #fff7f7;
  color: #b91c1c;
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

.weekly-duty-remove-button:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.weekly-duty-remove-button:active {
  transform: scale(0.94);
}

.weekly-duty-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.weekly-duty-field-label {
  color: #64748b;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.weekly-duty-field input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.weekly-duty-field input:focus {
  border-color: #5fdc9a;
  outline: none;
  box-shadow:
    0 0 0 3px
    rgba(95, 220, 154, 0.16);
}

.weekly-duty-time-note {
  grid-column: 2 / -1;
  margin-top: -1px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 800;
}

@media (max-width: 1050px) {
  .weekly-duty-row {
    grid-template-columns:
      82px
      minmax(160px, 1fr)
      110px
      110px
      36px;
  }

  .weekly-duty-field.location {
    grid-column: 2 / 5;
  }

  .weekly-duty-add-button {
    margin-left: 90px;
  }
}

@media (max-width: 700px) {
  .weekly-duty-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .weekly-duty-day,
  .weekly-duty-field.location,
  .weekly-duty-time-note {
    grid-column: 1;
  }
}

    .weekly-duty-day {
      color: #143f3a;
      font-size: 13px;
      font-weight: 950;
    }

    .weekly-duty-row input {
      width: 100%;
      border: 1px solid #d1d5db;
      border-radius: 12px;
      padding: 9px 10px;
      background: #ffffff;
      font-size: 13px;
      font-weight: 800;
    }

    @media (max-width: 900px) {
      .weekly-duty-row {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 1100px) {
      .today-view-grid {
        grid-template-columns: 1fr;
      }

      .today-next-title {
        font-size: 34px;
      }
    }

    @media (max-width: 760px) {
      .today-view-top {
        align-items: flex-start;
        flex-direction: column;
      }

      .reminder-form-grid {
        grid-template-columns: 1fr;
      }
    }


    /* =========================================================
       MOBILE TEACHER VIEW NAVIGATION
       ========================================================= */

    .mobile-teacher-nav {
      display: none;
    }

    @media (max-width: 760px) {
      body[data-stage="today"],
      body[data-stage="timetable"] {
        --mobile-teacher-nav-height:
          62px;
      }

      body[data-stage="timetable"]
      .stage-card {
        padding-bottom:
          calc(
            var(
              --mobile-teacher-nav-height
            ) +
            env(
              safe-area-inset-bottom
            ) +
            10px
          ) !important;
      }

      /*
        The bottom mobile navigation replaces the desktop
        Class Board toolbar on the Timetable screen.
      */

      body[data-stage="timetable"]
      .quick-strip {
        display: none !important;
      }

      body[data-stage="timetable"]
      .centre-board {
        grid-template-rows:
          minmax(0, 1fr) !important;
        gap: 0 !important;
      }

            body[data-stage="timetable"]
      .left-rail,
      body[data-stage="timetable"]
      .right-rail {
        display: none !important;
      }

      body[data-stage="timetable"]
      .board-shell {
        grid-template-columns:
          minmax(0, 1fr) !important;
        gap: 0 !important;
      }

      body[data-stage="timetable"]
      main {
        padding: 6px !important;
      }

            body[data-stage="timetable"]
      .stage-card {
        grid-template-rows:
          auto
          minmax(0, 1fr) !important;
        gap: 8px !important;
        padding:
          10px
          10px
          calc(
            var(
              --mobile-teacher-nav-height
            ) +
            env(
              safe-area-inset-bottom
            ) +
            10px
          ) !important;
        border-radius: 18px;
      }

      body[data-stage="timetable"]
      .stage-top {
        grid-template-columns:
          minmax(0, 1fr)
          auto !important;
        gap: 8px !important;
        align-items: center !important;
      }

      body[data-stage="timetable"]
      .stage-title {
        font-size: 25px !important;
        line-height: 1.05 !important;
        letter-spacing: -0.7px !important;
      }

      body[data-stage="timetable"]
      .date-card {
        min-width: 0;
        min-height: 36px;
        padding: 7px 10px;
        border-radius: 12px;
        font-size: 11px;
      }

      body[data-stage="today"]
      .stage-card {
        padding-bottom:
          calc(
            var(
              --mobile-teacher-nav-height
            ) +
            env(
              safe-area-inset-bottom
            ) +
            10px
          ) !important;
      }

      body[data-stage="today"]
      .today-view-shell {
        padding-bottom:
          calc(
            var(
              --mobile-teacher-nav-height
            ) +
            env(
              safe-area-inset-bottom
            ) +
            12px
          ) !important;
      }

      .mobile-teacher-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 400;
        min-height:
          calc(
            62px +
            env(
              safe-area-inset-bottom
            )
          );
        display: grid;
        grid-template-columns:
          repeat(
            4,
            minmax(0, 1fr)
          );
        align-items: start;
        padding:
          6px
          8px
          calc(
            6px +
            env(
              safe-area-inset-bottom
            )
          );
        border-top:
          1px solid #dbe2ea;
        background:
          rgba(
            255,
            255,
            255,
            0.97
          );
        box-shadow:
          0 -8px 28px
          rgba(
            15,
            23,
            42,
            0.12
          );
        backdrop-filter:
          blur(14px);
      }

      .mobile-teacher-nav-button {
        position: relative;
        min-width: 0;
        min-height: 48px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 5px 3px;
        border: 0;
        border-radius: 13px;
        background: transparent;
        color: #64748b;
        font-size: 10px;
        line-height: 1;
        font-weight: 900;
        cursor: pointer;
      }

      .mobile-teacher-nav-button:active {
        transform: scale(0.96);
      }

      .mobile-teacher-nav-button.active {
        background: #eefbf4;
        color: #143f3a;
      }

      .mobile-teacher-nav-button.active::before {
        content: "";
        position: absolute;
        top: 1px;
        width: 24px;
        height: 3px;
        border-radius: 999px;
        background:
          var(
            --board-accent-2,
            #22c55e
          );
      }

      .mobile-teacher-nav-icon {
        height: 24px;
        display: grid;
        place-items: center;
        color: currentColor;
        font-size: 22px;
        line-height: 1;
        font-weight: 950;
      }


      /*
       * Hide all mobile dashboard areas first.
       */

      body[data-stage="today"]
      .teacher-hero,
      body[data-stage="today"]
      .today-ready-section,
      body[data-stage="today"]
      .today-view-grid,
      body[data-stage="today"]
      .today-bottom-grid {
        display: none !important;
      }


      /*
       * TODAY
       *
       * Hero, timer, reward, date, duty,
       * Daily Content and Display Screens.
       */

      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="today"
      ]
      .teacher-hero {
        display: grid !important;
      }

      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="today"
      ]
      .today-ready-section {
        display: grid !important;
      }


      /*
       * LESSONS
       *
       * Current lesson and Needs Attention.
       */

      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="lessons"
      ]
      .today-view-grid {
        display: grid !important;
        grid-template-columns:
          1fr !important;
      }

      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="lessons"
      ]
      .today-view-grid
      > :nth-child(3) {
        display: none !important;
      }


      /*
       * CLASS
       *
       * Attendance and the class-management
       * shortcuts contained in that card.
       */

      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="class"
      ]
      .today-view-grid {
        display: grid !important;
        grid-template-columns:
          1fr !important;
      }

      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="class"
      ]
      .today-view-grid
      > :not(:nth-child(3)) {
        display: none !important;
      }





      /*
       * Give each selected section a clean
       * mobile page rather than retaining the
       * desktop dashboard grid proportions.
       */

      body[data-stage="today"]
      .today-view-grid {
        min-height: auto !important;
        height: auto !important;
        align-content: start !important;
      }

      body[data-stage="today"]
      .today-view-grid
      > * {
        min-height: auto !important;
        height: auto !important;
      }

      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="today"
      ]
      .today-view-shell,
      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="lessons"
      ]
      .today-view-shell,
      body[
        data-stage="today"
      ][
        data-mobile-teacher-tab="class"
      ]
      .today-view-shell {
        display: flex !important;
        flex-direction: column;
        gap: 12px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
      }


      /*
       * Never show the mobile bar on
       * student-facing or fullscreen modes.
       */

      body.focus-mode
      .mobile-teacher-nav,
      body.fullscreen-active
      .mobile-teacher-nav,
      body.daily-content-direct-mode
      .mobile-teacher-nav,
      body.video-only
      .mobile-teacher-nav {
        display: none !important;
      }
    }

    /* Cleaner Today View override.
       Hides the old stage header only on Today View and makes the cards fit. */

    body[data-stage="today"] .stage-card {
  grid-template-rows:
    1fr !important;

  padding:
    12px !important;
}


/* =========================================================
   TEACHER DASHBOARD AMBIENCE
   Works automatically with every Board Style
   ========================================================= */

body[data-stage="today"]
.stage-card {
  position:
    relative;

  isolation:
    isolate;

  overflow:
    hidden;

  background:
    radial-gradient(
      circle at 15% 8%,
      color-mix(
        in srgb,
        var(--board-accent) 13%,
        transparent
      ),
      transparent 32%
    ),

    radial-gradient(
      circle at 82% 74%,
      color-mix(
        in srgb,
        var(--board-accent) 10%,
        transparent
      ),
      transparent 34%
    ),

    linear-gradient(
      135deg,
      var(--board-bg-b),
      var(--board-bg-a),
      var(--board-bg-b)
    ) !important;

  background-size:
    150% 150%,
    165% 165%,
    220% 220% !important;

  animation:
    teacherDashboardAtmosphere
    18s
    ease-in-out
    infinite
    alternate !important;
}


/*
  Soft moving daylight band.
*/

body[data-stage="today"]
.stage-card::before {
  content:
    "";

  position:
    absolute;

  top:
    -35%;

  left:
    -30%;

  width:
    92%;

  height:
    130%;

  pointer-events:
    none;

  border-radius:
    50%;

  background:
    radial-gradient(
      ellipse at center,
      rgba(
        255,
        255,
        255,
        0.38
      )
      0%,

      rgba(
        255,
        255,
        255,
        0.15
      )
      30%,

      transparent
      68%
    );

  filter:
    blur(30px);

  opacity:
    0.62;

  transform:
    translate3d(
      0,
      0,
      0
    );

  animation:
    teacherDashboardLight
    22s
    ease-in-out
    infinite
    alternate;

  z-index:
    0;
}


/*
  Theme-coloured atmospheric glow.
*/

body[data-stage="today"]
.stage-card::after {
  content:
    "";

  position:
    absolute;

  right:
    -22%;

  bottom:
    -38%;

  width:
    82%;

  height:
    92%;

  pointer-events:
    none;

  border-radius:
    50%;

  background:
    radial-gradient(
      ellipse at center,
      color-mix(
        in srgb,
        var(--board-accent) 24%,
        transparent
      )
      0%,

      color-mix(
        in srgb,
        var(--board-accent) 9%,
        transparent
      )
      42%,

      transparent
      72%
    );

  filter:
    blur(34px);

  opacity:
    0.68;

  animation:
    teacherDashboardColourGlow
    26s
    ease-in-out
    infinite
    alternate;

  z-index:
    0;
}


/*
  Keep the real teacher dashboard above
  the moving atmosphere.
*/

body[data-stage="today"]
.stage-body {
  position:
    relative;

  z-index:
    2;
}


/* Slow background colour travel */

@keyframes teacherDashboardAtmosphere {
  0% {
    background-position:
      0% 10%,
      100% 90%,
      0% 50%;
  }

  50% {
    background-position:
      35% 25%,
      65% 70%,
      50% 50%;
  }

  100% {
    background-position:
      75% 40%,
      30% 55%,
      100% 50%;
  }
}


/* Daylight gently crosses the workspace */

@keyframes teacherDashboardLight {
  0% {
    transform:
      translate3d(
        -8%,
        -3%,
        0
      )
      scale(1);
  }

  100% {
    transform:
      translate3d(
        52%,
        16%,
        0
      )
      scale(1.12);
  }
}


/* Theme glow moves in the opposite direction */

@keyframes teacherDashboardColourGlow {
  0% {
    transform:
      translate3d(
        8%,
        7%,
        0
      )
      scale(1);
  }

  100% {
    transform:
      translate3d(
        -38%,
        -22%,
        0
      )
      scale(1.14);
  }
}


/*
  Accessibility:
  keep the atmosphere but stop movement.
*/

@media (
  prefers-reduced-motion:
  reduce
) {
  body[data-stage="today"]
  .stage-card,

  body[data-stage="today"]
  .stage-card::before,

  body[data-stage="today"]
  .stage-card::after {
    animation:
      none !important;
  }
}

/*
  Full view is the dashboard overview.
  Hide the classroom tools toolbar and give
  that space back to the dashboard.
*/

body[data-stage="today"]:not(.teacher-essentials-mode)
.quick-strip {
  display: none !important;
}

body[data-stage="today"]:not(.teacher-essentials-mode)
.centre-board {
  grid-template-rows:
    minmax(0, 1fr) !important;

  gap: 0 !important;
}

    /* Attendance belongs only inside My Dashboard */
.attendance-header-btn {
  display: none !important;
}

body[data-stage="today"]
.attendance-header-btn {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  display: inline-flex !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

body[data-stage="today"]
.attendance-header-btn
.compact-header-action-label {
  display: inline-block !important;
  width: auto !important;
  max-width: 78px !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

/* Dashboard-only controls */
body[data-stage="today"]
.teacher-view-home-btn {
  display: none !important;
}

/* Keep Present to Class available on My Dashboard */
body[data-stage="today"]
.present-lesson-launch-group {
  display: inline-flex !important;
}

/* Clearly label the return route on all other screens */
body:not([data-stage="today"])
.teacher-view-home-btn {
  width: auto !important;
  min-width: 180px !important;
  max-width: none !important;
  flex-shrink: 0 !important;
  justify-content: center !important;
  gap: 7px !important;
  padding-left: 14px !important;
  padding-right: 14px !important;

  background:
    var(--board-accent-2) !important;

  border:
    1px solid
    var(--board-accent-2) !important;

  color:
    #ffffff !important;

  box-shadow:
    0 5px 12px
    color-mix(
      in srgb,
      var(--board-accent-2) 28%,
      transparent
    ) !important;
}

body:not([data-stage="today"])
.teacher-view-home-btn:hover,
body:not([data-stage="today"])
.teacher-view-home-btn:focus-visible {
  background:
    var(--board-ink) !important;

  border-color:
    var(--board-ink) !important;

  color:
    #ffffff !important;

  box-shadow:
    0 7px 16px
    color-mix(
      in srgb,
      var(--board-ink) 30%,
      transparent
    ) !important;

  outline: none;
  transform:
    translateY(-1px);
}

body:not([data-stage="today"])
.teacher-view-home-btn,
body:not([data-stage="today"])
.teacher-view-home-btn
.compact-header-action-label,
body:not([data-stage="today"])
.teacher-view-home-btn
.compact-header-action-icon {
  color: #ffffff !important;
}

body:not([data-stage="today"])
.teacher-view-home-btn
.compact-header-action-label {
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
  white-space: nowrap !important;
  font-weight: 950 !important;
}

    body[data-stage="today"] .stage-top {
      display: none !important;
    }

    body[data-stage="today"] .stage-body {
      height: 100% !important;
      overflow: hidden !important;
    }
body[data-stage="today"] .today-view-shell {
      position: relative;

      height: 100% !important;

      grid-template-rows:
        auto
        1fr
        auto !important;

      gap:
        12px !important;

      overflow-y:
        auto !important;

      overflow-x:
        hidden !important;
    }

    /* =========================================================
   TEACHER THEME AMBIENCE
   Real DOM element so it always renders
   ========================================================= */

.teacher-theme-ambience {
  position:
    fixed;

  /*
    Anchor ambience to the actual screen,
    not to the variable-height dashboard shell.
  */

  left:
    50%;

  top:
    58vh;

  right:
    auto;

  bottom:
    auto;

  width:
    min(
      760px,
      62vw
    );

  min-height:
    170px;

  display:
    flex;

  flex-direction:
    column;

  align-items:
    center;

  justify-content:
    center;

  gap:
    12px;

  pointer-events:
    none;

  color:
    var(--board-accent-2);

  opacity:
    0.17;

  z-index:
    1;

  transform:
    translateX(-50%);

  animation:
    teacherThemeAmbienceFloat
    16s
    ease-in-out
    infinite
    alternate;
}


.teacher-theme-ambience-icons {
  font-size:
    clamp(
      36px,
      4vw,
      68px
    );

  line-height:
    1;

  letter-spacing:
    clamp(
      18px,
      2vw,
      34px
    );

  white-space:
    nowrap;

  text-shadow:
    0
    0
    24px
    color-mix(
      in srgb,
      var(--board-accent) 35%,
      transparent
    );
}


.teacher-theme-ambience-label {
  font-size:
    11px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    2px;

  text-transform:
    uppercase;

  opacity:
    0.5;
}


/* Keep dashboard cards above ambience */

body[data-stage="today"]
.teacher-hero,

body[data-stage="today"]
.today-view-grid,

body[data-stage="today"]
.today-bottom-grid,

body[data-stage="today"]
.today-ready-section {
  position:
    relative;

  z-index:
    2;
}


/* Individual theme personalities */

.teacher-theme-ambience[
  data-theme="calm"
] {
  opacity:
    0.13;
}


.teacher-theme-ambience[
  data-theme="focus"
] {
  opacity:
    0.11;

  animation-duration:
    20s;
}


.teacher-theme-ambience[
  data-theme="warm"
] {
  opacity:
    0.15;
}


.teacher-theme-ambience[
  data-theme="ocean"
] {
  opacity:
    0.15;

  animation:
    teacherThemeOceanFloat
    13s
    ease-in-out
    infinite;
}


.teacher-theme-ambience[
  data-theme="bright"
] {
  opacity:
    0.16;

  animation-duration:
    12s;
}


.teacher-theme-ambience[
  data-theme="galaxy"
] {
  opacity:
    0.22;

  animation:
    teacherThemeGalaxyFloat
    20s
    linear
    infinite;
}


.teacher-theme-ambience[
  data-theme="chalk"
] {
  opacity:
    0.13;

  transform:
    rotate(
      -3deg
    );
}


.teacher-theme-ambience[
  data-theme="candy"
] {
  opacity:
    0.17;

  animation-duration:
    11s;
}


/* Generic gentle float */

@keyframes teacherThemeAmbienceFloat {
  from {
    transform:
      translateX(-50%)
      translate3d(
        -28px,
        3px,
        0
      );
  }

  to {
    transform:
      translateX(-50%)
      translate3d(
        28px,
        -3px,
        0
      );
  }
}


/* Ocean has a more wave-like motion */

@keyframes teacherThemeOceanFloat {
  0%,
  100% {
    transform:
      translateX(-50%)
      translate3d(
        -40px,
        2px,
        0
      );
  }

  50% {
    transform:
      translateX(-50%)
      translate3d(
        40px,
        -2px,
        0
      );
  }
}


/* Galaxy slowly travels instead of bobbing */

@keyframes teacherThemeGalaxyFloat {
  from {
    transform:
      translateX(-50%)
      translate3d(
        -72px,
        2px,
        0
      );
  }

  to {
    transform:
      translateX(-50%)
      translate3d(
        72px,
        -2px,
        0
      );
  }
}

body:not([data-stage="today"])
.teacher-theme-ambience {
  display:
    none !important;
}


@media (
  prefers-reduced-motion:
  reduce
) {
  .teacher-theme-ambience {
    animation:
      none !important;
  }
}


    body[data-stage="today"] .today-view-shell {
      position: relative;
      isolation: isolate;

      height: 100% !important;

      grid-template-rows:
        auto
        1fr
        auto !important;

      gap: 12px !important;

      overflow-y:
        auto !important;

      overflow-x:
        hidden !important;
    }


/* Keep real dashboard content above theme ambience,
   but do NOT override the ambience layer itself. */

body[data-stage="today"]
.today-view-shell > *:not(.teacher-theme-ambience) {
  position: relative;
  z-index: 2;
}




    /* Force side rails to hide natively on the Today View without breaking global focus controls */
    body[data-stage="today"] .left-rail,
    body[data-stage="today"] .right-rail {
      display: none !important;
    }
    body[data-stage="today"] .board-shell {
      grid-template-columns: 1fr !important;
      gap: 0 !important;
    }

    body[data-stage="today"] .today-view-top {
      min-height: 72px !important;
      padding: 12px 16px !important;
      border-radius: 20px !important;
    }

    body[data-stage="today"] .today-sun {
      width: 46px !important;
      height: 46px !important;
      border-radius: 14px !important;
      font-size: 25px !important;
    }

    body[data-stage="today"] .today-greeting {
      font-size: clamp(22px, 2.2vw, 32px) !important;
      line-height: 1.05 !important;
    }

    body[data-stage="today"] .today-date-line {
      font-size: 13px !important;
    }

    body[data-stage="today"] .today-view-grid {
      min-height: 0 !important;
      grid-template-columns:
        minmax(0, 1.48fr)
        minmax(300px, 0.86fr)
        minmax(280px, 0.78fr) !important;
      gap: 12px !important;
    }

    /* Full-width tabbed resources panel below the three main dashboard cards */
    body[data-stage="today"] .today-bottom-grid {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) !important;
      gap: 12px !important;
      align-items: start !important;
    }


        body[data-stage="today"] .today-resource-panel {
      width: 100%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;

      background:
        linear-gradient(
          145deg,
          var(--board-card),
          color-mix(
            in srgb,
            var(--board-surface-soft) 30%,
            #ffffff
          )
        );

      border:
        1px solid
        var(--board-border);

      border-radius: 18px;

      box-shadow:
        var(--board-shadow);
    }

    body[data-stage="today"] .today-resource-tabs {
  min-height: 36px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 0 14px;

  border-bottom:
    1px solid
    var(--board-border);

  background:
    color-mix(
      in srgb,
      var(--board-surface-soft) 28%,
      transparent
    );
}

body[data-stage="today"] .today-resource-tab {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

    body[data-stage="today"] .today-resource-tab:hover {
      color: var(--board-ink);
    }

    body[data-stage="today"] .today-resource-tab.active {
      color: var(--board-ink);
    }

    body[data-stage="today"] .today-resource-tab.active::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 3px;
      border-radius: 999px 999px 0 0;
      background: var(--board-accent-2);
    }

    body[data-stage="today"] .today-resource-tab-count {
      min-width: 21px;
      height: 21px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 7px;
      border-radius: 999px;
      background: #f1f5f9;
      color: #64748b;
      font-size: 10px;
      font-weight: 950;
    }

    body[data-stage="today"] .today-resource-tab.active .today-resource-tab-count {
      background:
        color-mix(
          in srgb,
          var(--board-accent) 22%,
          #ffffff
        );

      color:
        var(--board-ink);
    }

    body[data-stage="today"] .today-resource-content {
  min-height: 0;
  padding: 7px 12px 9px;
}

    body[data-stage="today"] .today-resource-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 8px;
    }

    body[data-stage="today"] .today-resource-grid .today-pinned-link {
      width: 100%;
      min-width: 0;
    }

    @media (max-width: 1250px) {
      body[data-stage="today"] .today-view-grid {
        grid-template-columns:
          minmax(0, 1.35fr)
          minmax(280px, 0.9fr)
          minmax(260px, 0.8fr) !important;
      }

      body[data-stage="today"] .today-resource-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (max-width: 980px) {
      body[data-stage="today"] .today-view-grid {
        grid-template-columns: 1fr !important;
      }

      body[data-stage="today"] .today-resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 560px) {
      body[data-stage="today"] .today-resource-tabs {
        gap: 14px;
        overflow-x: auto;
      }

      body[data-stage="today"] .today-resource-grid {
        grid-template-columns: 1fr;
      }
    }

    /* Fix: Establish a strict 4-row layout chain to prioritize the lesson content window's height */
    body[data-stage="today"] .today-view-shell {
      grid-template-rows: auto auto 1fr auto !important;
    }

    body[data-stage="today"] .today-card {
  min-height: 0 !important;

  padding:
    14px
    16px !important;

  border-radius:
    20px !important;

  display:
    flex !important;

  flex-direction:
    column !important;

  overflow:
    hidden !important;

  background:
    linear-gradient(
      145deg,
      var(--board-card),
      color-mix(
        in srgb,
        var(--board-surface-soft) 42%,
        #ffffff
      )
    ) !important;

  border:
    1px solid
    var(--board-border) !important;

  box-shadow:
    var(--board-shadow) !important;
}

body[data-stage="today"] .today-card:first-child {
  min-height: 0 !important;
}

body[data-stage="today"] .today-card:first-child .today-start-lesson-row {
  position:
    relative;

  z-index:
    2;

  background:
    transparent;
}

    body[data-stage="today"] .today-card-head {
      margin-bottom: 8px !important;
      flex: 0 0 auto !important;
    }

    body[data-stage="today"] .today-card-title {
      font-size: 18px !important;
    }

    body[data-stage="today"] .today-next-title {
      font-size: clamp(26px, 2.6vw, 38px) !important;
      line-height: 1.02 !important;
      margin: 4px 0 8px !important;
    }

    body[data-stage="today"] .today-next-text-wrap {
  min-height: 0 !important;
  height: auto !important;

  /*
    Around 7–8 lines of lesson summary.
    Roughly 70 words on a typical desktop dashboard.
  */
  max-height: 165px !important;

  flex: 0 0 auto !important;

  overflow: hidden !important;
  position: relative;
}

body[data-stage="today"] .today-next-text {
  height: auto !important;
  max-height: 165px !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  padding-right: 8px !important;
  padding-bottom: 2px !important;
  margin-bottom: 0 !important;

  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif !important;

  font-size: clamp(15px, 1.12vw, 17px) !important;
line-height: 1.5 !important;
font-weight: 620 !important;
letter-spacing: -0.005em !important;

  color: #334155 !important;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  overscroll-behavior: contain;
  scrollbar-gutter: stable;

  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar {
  width: 6px;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar-track {
  background: transparent;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

body[data-stage="today"] .today-start-lesson-row {
  flex: 0 0 auto !important;
  margin-top: auto !important;
}

    body[data-stage="today"] .today-card-actions {
      margin-top: auto !important;
      padding-top: 8px !important;
      flex: 0 0 auto !important;
    }

    body[data-stage="today"]
.today-reminders-card:not(.today-action-centre) {
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows:
    auto
    minmax(0, 1fr) !important;
  overflow: hidden !important;
}

body[data-stage="today"]
.today-reminders-card.today-action-centre {
  min-height: 0 !important;

  display: grid !important;

  grid-template-rows:
    auto
    40px
    minmax(0, 1fr) !important;

  align-content: start !important;

  gap: 10px !important;

  overflow: hidden !important;
}

body[data-stage="today"]
.today-reminders-card.today-action-centre.no-tabs {
  grid-template-rows:
    auto
    minmax(0, 1fr) !important;
}

body[data-stage="today"]
.today-reminders-card.today-action-centre
.today-card-head {
  align-self: start !important;
  margin-bottom: 0 !important;
}

body[data-stage="today"]
.today-reminders-card.today-action-centre
.today-action-tabs {
  align-self: start !important;
  margin: 0 !important;
}

body[data-stage="today"]
.today-reminders-card.today-action-centre
.today-action-content {
  align-self: stretch !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/*
  In Essentials, the main dashboard row must never grow
  far enough to push the resource panel behind the toolbar.
  Extra reminders scroll inside the Action Centre instead.
*/

body.teacher-essentials-mode.essentials-main-count-2
.today-action-content {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.teacher-essentials-mode.essentials-main-count-2
.today-action-reminder-list,
body.teacher-essentials-mode.essentials-main-count-2
.today-priority-action-list {
  min-height: 0 !important;
  overflow: visible !important;
}

body.teacher-essentials-mode.essentials-main-count-2
.today-reminders-card {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

body[data-stage="today"] .today-reminders-list {
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  gap: 8px !important;
  padding: 0 6px 16px 0 !important;
  scroll-padding-bottom: 16px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  box-shadow:
    inset 0 -14px 12px -16px rgba(15, 23, 42, 0.35);
}



    body[data-stage="today"] .today-reminder-row {
      min-height: 52px !important;
      padding: 8px 10px !important;
      border-radius: 15px !important;
      grid-template-columns: 34px minmax(0, 1fr) auto !important;
    }

    body[data-stage="today"] .today-reminder-check {
      width: 30px !important;
      height: 30px !important;
    }

    body[data-stage="today"] .today-reminder-title {
      font-size: 14px !important;
    }

    body[data-stage="today"] .today-reminder-pill {
      min-height: 18px !important;
      padding: 2px 7px !important;
      font-size: 10px !important;
    }

    body[data-stage="today"] .today-links-section {
      /* Fix: Reduce vertical padding and strip strict min-height to lift the box upward */
      min-height: 0 !important;
      padding: 6px 12px 10px !important;
      border-radius: 18px !important;
      overflow: hidden !important;
      gap: 4px !important;
    }

    body[data-stage="today"] .today-pinned-links-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      /* Reduced from 6px to compress vertical height stack */
      gap: 4px !important; 
    }

    body[data-stage="today"] .today-pinned-link {
      min-height: 36px !important;
      display: grid !important;

      grid-template-columns:
        28px
        minmax(0, 1fr) !important;

      grid-template-areas:
        "icon title" !important;

      column-gap:
        8px !important;

      row-gap:
        0 !important;

      align-items:
        center !important;

      text-align:
        left !important;

      padding:
        3px
        8px !important;

      border-radius:
        10px !important;

      background:
        color-mix(
          in srgb,
          var(--board-card) 92%,
          var(--board-surface-soft)
        ) !important;

      border:
        1px solid
        var(--board-border) !important;
    }

    body[data-stage="today"] .today-pinned-icon {
      grid-area: icon !important;
      width: 28px !important;
      height: 28px !important;
      font-size: 14px !important;
      border-radius: 8px !important;

      display:
        inline-flex !important;

      align-items:
        center !important;

      justify-content:
        center !important;

      background:
        color-mix(
          in srgb,
          var(--board-accent) 16%,
          #ffffff
        ) !important;
    }

    body[data-stage="today"] .today-pinned-title {
      grid-area: title !important;
      font-size: 12px !important;
      font-weight: 900 !important;
      color: #111827 !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      line-height: 1.1 !important;
    }

    body[data-stage="today"] .today-pinned-url {
      display: none !important;
    }

    body[data-stage="today"] .today-absent-section {
      min-height: 118px !important;
      padding: 10px !important;
      border-radius: 18px !important;
    }

    body[data-stage="today"] .today-absent-summary {
      min-height: 48px !important;
      padding: 8px 9px !important;
      border-radius: 14px !important;
      grid-template-columns: 32px minmax(0, 1fr) !important;
      gap: 8px !important;
    }

    body[data-stage="today"] .today-absent-icon {
      width: 32px !important;
      height: 32px !important;
      border-radius: 11px !important;
      font-size: 16px !important;
    }

    body[data-stage="today"] .today-absent-count {
      font-size: clamp(20px, 1.8vw, 28px) !important;
    }

    body[data-stage="today"] .today-absent-text {
      font-size: 11.5px !important;
      line-height: 1.15 !important;
    }

    body[data-stage="today"] .today-absent-note {
      margin-top: 6px !important;
      font-size: 10px !important;
    }

    body[data-stage="today"] .today-absent-section .btn {
      margin-top: 6px !important;
      min-height: 32px !important;
      padding: 6px 11px !important;
      font-size: 11.5px !important;
    }


    /* =========================================================
       TEACHER DESK VIEW
       ========================================================= */

    .teacher-duty-stat {
      display: flex;
      position: relative;
      min-width: 180px;
      min-height: 88px;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
      gap: 4px;
      padding: 11px 13px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 15px;
      background: rgba(0, 0, 0, 0.08);
      color: #ffffff;
      font: inherit;
      text-align: left;
      cursor: pointer;
      overflow: hidden;
    }



    /*
      Essentials and Full view use the same saved
      Today bar selections. No view-specific card
      visibility rules should be added here.
    */

    .teacher-duty-stat:hover {
      border-color: rgba(255, 255, 255, 0.28);
      background: rgba(255, 255, 255, 0.09);
      transform: translateY(-1px);
    }

    .teacher-duty-stat-label {
      color: rgba(255, 255, 255, 0.72);
      font-size: 10px;
      line-height: 1;
      font-weight: 950;
    }

    .teacher-duty-stat-main {
      width: 100%;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .teacher-duty-stat-main strong {
      min-width: 0;
      overflow: hidden;
      color: #ffffff;
      font-size: 14px;
      line-height: 1.1;
      font-weight: 950;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .teacher-duty-stat-details {
      width: 100%;
      overflow: hidden;
      color: rgba(255, 255, 255, 0.78);
      font-size: 11px;
      line-height: 1.1;
      font-weight: 850;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .teacher-duty-stat-edit {
      margin-top: 2px;
      color: #bbf7d0;
      font-size: 10px;
      line-height: 1;
      font-weight: 950;
    }

    

    .teacher-desk-control {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns:
    auto
    minmax(0, 1fr)
    auto;
      align-items: center;
      gap: 14px;
      padding: 5px 12px;
      border: 1px solid #dbe3e8;
      border-radius: 16px;
      background: #ffffff;
      box-shadow:
        0 5px 14px
        rgba(15, 23, 42, 0.04);
    }

    .teacher-desk-control-copy {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: nowrap;
    }


    /* =========================================================
       CLASS BOARD TRIAL JOURNEY
       ========================================================= */

    .classboard-trial-journey {
      width:
        100%;

      min-width:
        0;

      display:
        grid;

      grid-template-columns:
        minmax(
          0,
          1fr
        )
        auto;

      align-items:
        center;

      gap:
        14px;

      padding:
        12px
        14px;

      border:
        1px solid
        #c7ead5;

      border-radius:
        17px;

      background:
        linear-gradient(
          135deg,
          #f7fffa,
          #eefbf4
        );

      box-shadow:
        0
        5px
        14px
        rgba(
          15,
          23,
          42,
          0.04
        );
    }


    .classboard-trial-journey.conversion {
      border-color:
        #fde68a;

      background:
        linear-gradient(
          135deg,
          #fffdf5,
          #fffbeb
        );
    }


    .classboard-trial-copy {
      min-width:
        0;

      display:
        grid;

      gap:
        5px;
    }


    .classboard-trial-topline {
      display:
        flex;

      align-items:
        center;

      gap:
        8px;

      flex-wrap:
        wrap;
    }


    .classboard-trial-day {
      min-height:
        23px;

      display:
        inline-flex;

      align-items:
        center;

      justify-content:
        center;

      padding:
        4px
        8px;

      border-radius:
        999px;

      background:
        #dcfce7;

      color:
        #166534;

      font-size:
        9px;

      line-height:
        1;

      font-weight:
        950;

      white-space:
        nowrap;
    }


    .classboard-trial-journey.conversion
    .classboard-trial-day {
      background:
        #fef3c7;

      color:
        #92400e;
    }


    .classboard-trial-time {
      color:
        #64748b;

      font-size:
        10px;

      font-weight:
        900;
    }


    .classboard-trial-title {
      margin:
        0;

      color:
        #143f3a;

      font-size:
        15px;

      line-height:
        1.1;

      font-weight:
        950;
    }


    .classboard-trial-text {
      margin:
        0;

      max-width:
        820px;

      color:
        #52635f;

      font-size:
        11px;

      line-height:
        1.35;

      font-weight:
        800;
    }


    .classboard-trial-progress {
      width:
        min(
          360px,
          100%
        );

      height:
        5px;

      overflow:
        hidden;

      border-radius:
        999px;

      background:
        #dbe9e1;
    }


    .classboard-trial-progress-fill {
      height:
        100%;

      border-radius:
        inherit;

      background:
        #22c55e;

      transition:
        width
        0.25s
        ease;
    }


    .classboard-trial-journey.conversion
    .classboard-trial-progress-fill {
      background:
        #f59e0b;
    }


    .classboard-trial-action {
      min-height:
        38px;

      display:
        inline-flex;

      align-items:
        center;

      justify-content:
        center;

      gap:
        6px;

      padding:
        8px
        14px;

      border:
        0;

      border-radius:
        999px;

      background:
        #143f3a;

      color:
        #ffffff;

      font-size:
        11px;

      line-height:
        1;

      font-weight:
        950;

      white-space:
        nowrap;

      cursor:
        pointer;

      text-decoration:
        none;

      box-shadow:
        0
        5px
        12px
        rgba(
          20,
          63,
          58,
          0.15
        );
    }


    .classboard-trial-action:hover,
    .classboard-trial-action:focus-visible {
      background:
        #0f332f;

      outline:
        none;

      transform:
        translateY(
          -1px
        );
    }


    .classboard-trial-journey.conversion
    .classboard-trial-action {
      background:
        #b45309;
    }


    @media (
      max-width:
      760px
    ) {
      .classboard-trial-journey {
        grid-template-columns:
          1fr;

        gap:
          10px;
      }

      .classboard-trial-action {
        width:
          100%;
      }
    }

    .classboard-updates-kicker {
  flex:
    0
    0
    auto;

  display:
    inline-flex;

  align-items:
    center;

  gap:
    6px;

  min-height:
    24px;

  padding:
    0;

  border:
    0;

  border-radius:
    0;

  background:
    transparent;

  font-size:
    9px !important;

  line-height:
    1 !important;

  font-weight:
    950 !important;

  letter-spacing:
    0.4px;

  text-transform:
    uppercase;

  white-space:
    nowrap;
}


.classboard-trial-day-status {
  display:
    inline-flex;

  align-items:
    center;

  min-height:
    24px;

  padding:
    4px
    8px;

  border:
    1px solid
    #d1fae5;

  border-radius:
    999px;

  background:
    #f0fdf4;

  color:
    #166534;
}


.classboard-trial-remaining {
  display:
    inline-flex;

  align-items:
    center;

  padding-left:
    6px;

  border-left:
    1px solid
    #bbf7d0;

  font-weight:
    950;
}


.classboard-trial-remaining.normal {
  color:
    #15803d;
}


.classboard-trial-remaining.warning {
  color:
    #b45309;
}


.classboard-trial-remaining.urgent {
  color:
    #dc2626;
}

    .teacher-desk-control-copy strong {
      color: #143f3a;
      font-size: 16px;
      line-height: 1;
      font-weight: 950;
    }

    .teacher-desk-control-copy span {
      color: #64748b;
      font-size: 10.5px;
      line-height: 1.15;
      font-weight: 850;
    }

    .classboard-dashboard-updates {
      position: relative;
      width: min(100%, 520px);
      height: 28px;
      min-width: 280px;
      overflow: hidden;
      margin: 0;
    }

    .classboard-dashboard-update {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      gap: 7px;
      min-width: 0;
      padding: 5px 10px;
      border: 1px solid #d9fbe8;
      border-radius: 999px;
      background: #f1fdf6;
      color: #64748b;
      text-decoration: none;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(4px);
      animation: classboardDashboardUpdateRotation 32s infinite ease;
    }

    .classboard-dashboard-update:nth-child(1) {
      animation-delay: 0s;
    }

    .classboard-dashboard-update:nth-child(2) {
      animation-delay: 8s;
    }

    .classboard-dashboard-update:nth-child(3) {
      animation-delay: 16s;
    }

    .classboard-dashboard-update:nth-child(4) {
      animation-delay: 24s;
    }

    .classboard-dashboard-updates:hover
    .classboard-dashboard-update {
      animation-play-state: paused;
    }

    @keyframes classboardDashboardUpdateRotation {
      0% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(5px);
      }

      4%,
      21% {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
      }

      25%,
      100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-5px);
      }
    }

    .classboard-update-dot {
      flex: 0 0 auto;
      color: #22c55e;
      font-size: 8px;
      line-height: 1;
    }

    .classboard-update-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}


/*
 * Trial guidance should show the full message.
 * Normal rotating TrackEDU updates can still use ellipsis.
 */

/* =========================================================
   COMPACT TRIAL GUIDANCE
   ========================================================= */

.classboard-trial-inline {
  min-width: 0;
  flex: 1 1 auto;

  display: flex;
  align-items: center;

  gap: 10px;

  overflow: hidden;
}


.classboard-trial-inline-dot {
  width: 7px;
  height: 7px;

  flex: 0 0 7px;

  border-radius: 999px;

  background: #22c55e;

  color: transparent !important;

  box-shadow:
    0 0 0 3px
    rgba(
      34,
      197,
      94,
      0.10
    );
}


.classboard-trial-inline-text {
  min-width: 0;
  flex: 0 1 auto;

  color: #475569 !important;

  font-size: 11px !important;
  line-height: 1.15;

  font-weight: 800 !important;

  letter-spacing: -0.08px;

  white-space: nowrap;
}


.classboard-trial-inline-text::first-line {
  color: #334155;
}


.classboard-trial-inline-action {
  flex: 0 0 auto;

  min-height: 28px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 5px;

  margin-left: 2px;

  padding:
    5px
    11px;

  border:
    1px solid
    #bbf7d0;

  border-radius:
    999px;

  background:
    linear-gradient(
      180deg,
      #f8fff9,
      #eefbf4
    );

  color:
    #15803d;

  font:
    inherit;

  font-size:
    9.5px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;

  box-shadow:
    0
    2px
    5px
    rgba(
      22,
      163,
      74,
      0.06
    );

  transition:
    transform
    0.15s ease,
    border-color
    0.15s ease,
    background
    0.15s ease,
    box-shadow
    0.15s ease;
}


.classboard-trial-inline-action:hover,
.classboard-trial-inline-action:focus-visible {
  border-color:
    #86efac;

  background:
    #ecfdf5;

  box-shadow:
    0
    4px
    9px
    rgba(
      22,
      163,
      74,
      0.10
    );

  outline:
    none;

  transform:
    translateY(-1px);
}


.classboard-trial-inline-action:active {
  transform:
    scale(0.97);
}

    .classboard-update-cta {
      flex: 0 0 auto;
      color: #159957 !important;
      font-size: 9px !important;
      font-weight: 950 !important;
      white-space: nowrap;
    }

    .classboard-dashboard-update:hover
    .classboard-update-text strong,
    .classboard-dashboard-update:hover
    .classboard-update-cta {
      color: #166534 !important;
    }

    .teacher-desk-header-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 9px;
      flex-wrap: nowrap;
    }

    .teacher-dashboard-feedback-button {
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 7px 13px;
      border: 1px solid #fde68a;
      border-radius: 999px;
      background: #fffbeb;
      color: #92400e;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
      cursor: pointer;
      box-shadow:
        0 3px 9px
        rgba(
          146,
          64,
          14,
          0.08
        );
      transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
    }

    @media (
      min-width: 701px
    ) and (
      max-width: 1220px
    ) {
      .teacher-dashboard-feedback-button {
        display: none !important;
      }
    }

    .teacher-dashboard-feedback-button:hover {
      border-color: #fbbf24;
      background: #fef3c7;
      box-shadow:
        0 6px 14px
        rgba(
          146,
          64,
          14,
          0.13
        );
      transform: translateY(-1px);
    }

    .teacher-dashboard-feedback-button:active {
      transform: scale(0.97);
    }

    .teacher-desk-attendance-button {
      display: none;
      min-height: 38px;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 7px 13px;
      border: 1px solid #bbf7d0;
      border-radius: 999px;
      background: #eefbf4;
      color: #166534;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
      cursor: pointer;
    }

    body.teacher-essentials-mode[data-stage="today"]
    .teacher-desk-attendance-button {
      display: inline-flex;
    }

    .teacher-desk-attendance-button:hover {
      border-color: #86efac;
      background: #dcfce7;
      transform: translateY(-1px);
    }

    .teacher-desk-attendance-button:active {
      transform: scale(0.97);
    }

    .teacher-desk-timetable-button {
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 7px 13px;
      border: 1px solid #bfdbfe;
      border-radius: 999px;
      background: #eff6ff;
      color: #1e40af;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
      cursor: pointer;
    }

    .teacher-desk-timetable-button:hover {
      border-color: #93c5fd;
      background: #dbeafe;
      transform: translateY(-1px);
    }

    .teacher-desk-timetable-button:active {
      transform: scale(0.97);
    }

    .teacher-desk-control-actions {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 4px;
      border: 1px solid #e2e8f0;
      border-radius: 999px;
      background: #f1f5f9;
    }

    .teacher-desk-mode-button {
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 7px 14px;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: #64748b;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
      cursor: pointer;
      box-shadow: none;
      transition:
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
    }

    .teacher-desk-mode-button:not(.active):hover {
      background: #ffffff;
      color: #143f3a;
    }

    .teacher-desk-mode-button.active {
      background: #166534;
      color: #ffffff;
      box-shadow:
        0 3px 8px
        rgba(22, 101, 52, 0.18);
    }

    .teacher-desk-mode-button:active {
      transform: scale(0.97);
    }

    /* =========================================================
       CUSTOMISABLE ESSENTIALS DASHBOARD
       Full view always shows everything.
       Essentials follows the teacher's saved choices.
       ========================================================= */

    body.teacher-essentials-mode.essentials-hide-daily-content
    .today-daily-content-card {
      display: none !important;
    }

    body.teacher-essentials-mode.essentials-hide-class-screens
    .today-ready-screens-group {
      display: none !important;
    }

    body.teacher-essentials-mode.essentials-hide-ready-section
    .today-ready-section {
      display: none !important;
    }

    body.teacher-essentials-mode.essentials-hide-current-lesson
    .today-view-grid > :nth-child(1) {
      display: none !important;
    }

    body.teacher-essentials-mode.essentials-hide-lessons-to-prepare
    .today-view-grid > :nth-child(2) {
      display: none !important;
    }

    body.teacher-essentials-mode.essentials-hide-attendance
    .today-view-grid > :nth-child(3) {
      display: none !important;
    }

    body.teacher-essentials-mode.essentials-hide-school-links
    .today-bottom-grid {
      display: none !important;
    }

    body.teacher-essentials-mode.essentials-main-count-1
    .today-view-grid {
      grid-template-columns:
        minmax(0, 1fr) !important;
    }

    /* =========================================================
   ESSENTIALS — TWO MAIN CARDS

   When a teacher selects only two dashboard cards,
   keep them compact rather than stretching them to
   fill the entire available dashboard height.
   ========================================================= */

body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid {
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(360px, 0.95fr) !important;

  gap: 14px !important;

  /*
    The grid itself can occupy the dashboard area,
    but its cards should remain content-height.
  */
  align-items: start !important;
  align-content: start !important;

  min-height: 0 !important;
  height: 100% !important;
}


/*
  Do not stretch either card to the grid row height.
*/
body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid > .today-card {
  align-self: start !important;

  height: auto !important;
  min-height: 0 !important;

  overflow: hidden !important;
}


/*
  Current lesson.
*/
body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid > :nth-child(1) {
  padding:
    18px
    20px !important;
}


/*
  Lessons to prepare / reminders.
*/
body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid > :nth-child(2) {
  padding:
    18px !important;
}


/*
  In the compact two-card layout, the Current lesson
  buttons should follow the lesson preview naturally
  rather than being pushed towards the bottom of a
  large empty card.
*/
body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid > :nth-child(1)
.today-start-lesson-row {
  margin-top:
    18px !important;
}


/*
  Same principle for any general Current lesson
  action container.
*/
body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid > :nth-child(1)
.today-card-actions {
  margin-top:
    18px !important;
}

    body.teacher-essentials-mode.essentials-main-count-3
    .today-view-grid {
      grid-template-columns:
        minmax(0, 1.48fr)
        minmax(300px, 0.86fr)
        minmax(280px, 0.78fr) !important;
    }

    /* Customisable Today bar shared by Essentials and Full view */
body[data-stage="today"] .teacher-hero-stats {
  display: flex !important;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
}

body[data-stage="today"] .teacher-task-timer {
  width: 150px;
  min-width: 150px;
  order: 1;
}

body[data-stage="today"] .teacher-reward-stat {
  width: 190px;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  order: 2;
}

body[data-stage="today"] .teacher-duty-stat {
  width: 210px;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  order: 3;
}

body[data-stage="today"] .teacher-date-stat {
  width: 190px;
  min-width: 190px;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  align-items: center;
  order: 4;
}

body[data-stage="today"] .teacher-stat-hidden,
body.teacher-essentials-mode[data-stage="today"]
.teacher-stat-hidden,
body:not(.teacher-essentials-mode)[data-stage="today"]
.teacher-stat-hidden {
  display: none !important;
}

.teacher-hero-customise-button {
  width: fit-content;
  min-height: 34px;
  margin-top: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #143f3a;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

body.teacher-essentials-mode[data-stage="today"]
.teacher-hero-customise-button {
  display: inline-flex;
}

.teacher-hero-customise-button:hover,
.teacher-hero-customise-button:focus-visible {
  background: #ffffff;
  color: #143f3a;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.teacher-hero-customise-button:active {
  transform: scale(0.97);
}

    @media (max-width: 900px) {
      .teacher-desk-control {
        grid-template-columns: 1fr;
      }

      .teacher-desk-control-actions {
        justify-self: start;
      }

      body.teacher-essentials-mode[data-stage="today"]
      .today-view-grid {
        grid-template-columns: 1fr !important;
      }
    }


    /* =========================================================
       DAILY CONTENT
       Fast, teacher-friendly daily prompts and classroom extras.
       ========================================================= */

    .today-daily-content-card {
      min-width: 250px;
      min-height: 34px;
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      padding: 4px 5px 4px 7px;
      border: 1px solid #c4b5fd;
      border-radius: 12px;
      background: #f5f3ff;
      color: #4c1d95;
    }

    .today-daily-content-icon {
      width: 26px;
      height: 26px;
      display: grid;
      place-items: center;
      border-radius: 9px;
      background: #ede9fe;
      font-size: 13px;
    }

    .today-daily-content-copy {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 7px;
      white-space: nowrap;
    }

    .today-daily-content-copy strong {
      flex: 0 0 auto;
      font-size: 11.5px;
      line-height: 1.05;
      font-weight: 950;
    }

    .today-daily-content-copy span {
      min-width: 0;
      color: #6d28d9;
      font-size: 10.5px;
      line-height: 1.1;
      font-weight: 850;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .today-daily-content-actions {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .today-daily-content-action {
      min-height: 27px;
      padding: 4px 8px;
      border: 0;
      border-radius: 999px;
      background: #ede9fe;
      color: #6d28d9;
      font-size: 10.5px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
    }

    .today-daily-content-action:hover {
      background: #ddd6fe;
    }

    .daily-content-manager {
      display: grid;
      gap: 14px;
    }

    .daily-content-simple-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ddd6fe;
  border-radius: 16px;
  background: #f5f3ff;
}


/* =========================================================
   DAILY CONTENT — PLAN AHEAD
   ========================================================= */

.daily-content-plan-ahead {
  border:
    1px solid
    #c7d2fe;

  border-radius:
    17px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f8faff
    );

  overflow:
    hidden;

  box-shadow:
    0 5px 14px
    rgba(
      79,
      70,
      229,
      0.05
    );
}


.daily-content-plan-ahead
> summary {
  min-height:
    58px;

  display:
    flex;

  align-items:
    center;

  gap:
    11px;

  padding:
    11px
    14px;

  list-style:
    none;

  cursor:
    pointer;

  user-select:
    none;
}


.daily-content-plan-ahead
> summary::-webkit-details-marker {
  display:
    none;
}


.daily-content-plan-ahead
> summary::after {
  content:
    "▾";

  margin-left:
    auto;

  color:
    #6366f1;

  font-size:
    13px;

  font-weight:
    950;

  transition:
    transform
    0.16s ease;
}


.daily-content-plan-ahead:not([open])
> summary::after {
  transform:
    rotate(-90deg);
}


.daily-content-plan-ahead-icon {
  width:
    36px;

  height:
    36px;

  display:
    grid;

  place-items:
    center;

  flex:
    0 0
    36px;

  border-radius:
    12px;

  background:
    #eef2ff;

  font-size:
    18px;
}


.daily-content-plan-ahead-title {
  min-width:
    0;

  display:
    grid;

  gap:
    2px;
}


.daily-content-plan-ahead-title
strong {
  color:
    #1e3a5f;

  font-size:
    13px;

  line-height:
    1.1;

  font-weight:
    950;
}


.daily-content-plan-ahead-title
span {
  color:
    #64748b;

  font-size:
    10.5px;

  line-height:
    1.3;

  font-weight:
    850;
}


.daily-content-plan-ahead-body {
  display:
    grid;

  gap:
    11px;

  padding:
    3px
    14px
    14px;
}


.daily-content-plan-ahead-grid {
  display:
    grid;

  grid-template-columns:
    minmax(
      150px,
      0.7fr
    )
    minmax(
      190px,
      1fr
    );

  gap:
    10px;
}


.daily-content-plan-field {
  min-width:
    0;

  display:
    grid;

  gap:
    6px;
}


.daily-content-plan-field
> span {
  color:
    #64748b;

  font-size:
    9.5px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.5px;

  text-transform:
    uppercase;
}


.daily-content-plan-field
input,

.daily-content-plan-field
select,

.daily-content-plan-field
textarea {
  width:
    100%;

  margin:
    0;

  border:
    1px solid
    #d1d5db;

  border-radius:
    11px;

  background:
    #ffffff;

  color:
    #334155;

  font:
    inherit;

  font-size:
    12px;

  line-height:
    1.3;

  font-weight:
    800;

  outline:
    none;

  box-shadow:
    none;

  transition:
    border-color
    0.15s ease,
    box-shadow
    0.15s ease,
    background
    0.15s ease;
}


.daily-content-plan-field
input,

.daily-content-plan-field
select {
  min-height:
    40px;

  padding:
    8px
    10px;
}


.daily-content-plan-field
textarea {
  min-height:
    76px;

  padding:
    10px
    11px;

  resize:
    vertical;
}


.daily-content-plan-field
input:focus,

.daily-content-plan-field
select:focus,

.daily-content-plan-field
textarea:focus {
  border-color:
    #8b5cf6;

  background:
    #ffffff;

  box-shadow:
    0
    0
    0
    3px
    rgba(
      139,
      92,
      246,
      0.10
    );
}


.daily-content-plan-actions {
  display:
    flex;

  justify-content:
    flex-end;
}


.daily-content-plan-save {
  min-height:
    38px;

  padding:
    8px
    15px;

  border:
    1px solid
    #c4b5fd;

  border-radius:
    999px;

  background:
    #ede9fe;

  color:
    #5b21b6;

  font-size:
    11.5px;

  line-height:
    1;

  font-weight:
    950;

  cursor:
    pointer;

  box-shadow:
    0 4px 10px
    rgba(
      91,
      33,
      182,
      0.08
    );
}


.daily-content-plan-save:hover,
.daily-content-plan-save:focus-visible {
  border-color:
    #8b5cf6;

  background:
    #ddd6fe;

  outline:
    none;

  transform:
    translateY(-1px);
}


.daily-content-plan-save:active {
  transform:
    scale(0.97);
}


@media (
  max-width:
  700px
) {
  .daily-content-plan-ahead-grid {
    grid-template-columns:
      1fr;
  }

  .daily-content-plan-actions {
    justify-content:
      stretch;
  }

  .daily-content-plan-save {
    width:
      100%;
  }
}

    .daily-content-type-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .daily-content-type-toggle {
      min-height: 42px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px 11px;
      border: 1px solid #e5e7eb;
      border-radius: 13px;
      background: #ffffff;
      color: #334155;
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
    }

    .daily-content-type-toggle.active {
      border-color: #8b5cf6;
      background: #f5f3ff;
      color: #5b21b6;
      box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.12);
    }

    .daily-content-editor-list {
      display: grid;
      gap: 9px;
    }

    .daily-content-editor-row {
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr) auto;
      gap: 9px;
      align-items: center;
      padding: 10px;
      border: 1px solid #e5e7eb;
      border-radius: 15px;
      background: #ffffff;
    }

    .daily-content-editor-icon {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 12px;
      background: #f5f3ff;
      font-size: 18px;
    }

    .daily-content-editor-copy {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .daily-content-editor-copy strong {
      color: #111827;
      font-size: 12px;
      font-weight: 950;
    }

    .daily-content-editor-copy textarea {
      width: 100%;
      min-height: 58px;
      resize: vertical;
      padding: 8px 10px;
      border: 1px solid #d1d5db;
      border-radius: 11px;
      background: #ffffff;
      color: #334155;
      font-size: 12px;
      line-height: 1.35;
      font-weight: 800;
    }

    .daily-content-editor-field {
      min-width: 0;
      display: grid;
      gap: 5px;
    }

    .daily-content-editor-field + 
    .daily-content-editor-field {
      margin-top: 8px;
    }

    .daily-content-editor-field > span {
      color: #64748b;
      font-size: 9.5px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0.55px;
      text-transform: uppercase;
    }

    .daily-content-editor-field.answer
    textarea {
      border-color: #c4b5fd;
      background: #faf9ff;
    }

    .daily-content-editor-field.answer
    textarea:focus {
      border-color: #8b5cf6;
      outline: none;
      box-shadow:
        0 0 0 3px
        rgba(139, 92, 246, 0.12);
    }

    .daily-content-editor-row.has-answer-field {
      align-items: start;
    }

    .daily-content-editor-row.has-answer-field
    .daily-content-editor-icon,
    .daily-content-editor-row.has-answer-field
    .daily-content-editor-actions {
      margin-top: 22px;
    }

    .daily-content-editor-actions {
      display: grid;
      gap: 6px;
    }

    .daily-content-display-settings {
      display: grid;
      grid-template-columns:
        repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .daily-content-setting-card {
      min-width: 0;
      min-height: 72px;
      display: grid;
      grid-template-columns:
        38px
        minmax(0, 1fr)
        minmax(145px, auto);
      gap: 10px;
      align-items: center;
      padding: 10px 12px;
      border: 1px solid #ddd6fe;
      border-radius: 16px;
      background:
        linear-gradient(
          135deg,
          #ffffff,
          #faf9ff
        );
      box-shadow:
        0 5px 14px
        rgba(76, 29, 149, 0.05);
    }

    .daily-content-setting-icon {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 12px;
      background: #ede9fe;
      color: #6d28d9;
      font-size: 18px;
      line-height: 1;
      font-weight: 950;
    }

    .daily-content-setting-copy {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .daily-content-setting-copy strong {
      color: #111827;
      font-size: 13px;
      line-height: 1.1;
      font-weight: 950;
    }

    .daily-content-setting-copy small {
      color: #64748b;
      font-size: 10.5px;
      line-height: 1.25;
      font-weight: 800;
    }

    .daily-content-setting-select {
      width: 100%;
      min-width: 145px;
      min-height: 38px;
      padding: 8px 32px 8px 11px;
      border: 1px solid #c4b5fd;
      border-radius: 12px;
      background: #ffffff;
      color: #4c1d95;
      font-size: 12px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
      outline: none;
    }

    .daily-content-setting-select:hover,
    .daily-content-setting-select:focus {
      border-color: #8b5cf6;
      box-shadow:
        0 0 0 3px
        rgba(139, 92, 246, 0.12);
    }

    @media (max-width: 760px) {
      .daily-content-display-settings {
        grid-template-columns: 1fr;
      }

      .daily-content-setting-card {
        grid-template-columns:
          38px
          minmax(0, 1fr);
      }

      .daily-content-setting-select {
        grid-column: 1 / -1;
        min-width: 0;
      }
    }

    .daily-content-preview {
      min-height: 280px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      padding: 14px;
      border-radius: 22px;
      background: linear-gradient(135deg, #143f3a, #1e5e54);
    }

    .daily-content-preview-card {
      min-width: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 8px;
      padding: 18px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.96);
      text-align: center;
    }

    .daily-content-preview-card strong {
      color: #6d28d9;
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .55px;
    }

    .daily-content-preview-card span {
      color: #111827;
      font-size: clamp(16px, 1.65vw, 24px);
      line-height: 1.25;
      font-weight: 900;
    }

    .daily-content-stage {
      width: 100%;
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-rows: minmax(0, 1fr);
      gap: 0;
    }

    /*
      Standalone Daily Content display.

      Hide the website header, timetable, widgets and
      bottom toolbar while keeping the lesson heading
      and date at the top of the stage.
    */

    body.daily-content-direct-mode
    .top-line,
    body.daily-content-direct-mode
    header {
      display: none !important;
    }

    body.daily-content-direct-mode
    main {
      width: 100vw !important;
      height: 100vh !important;
      padding: 0 !important;
    }

    body.daily-content-direct-mode
    .board-shell {
      width: 100%;
      height: 100%;
      display: grid !important;
      grid-template-columns:
        38px
        minmax(0, 1fr)
        38px !important;
      gap: 6px !important;
    }

    /*
      The rails remain present so their existing restore
      buttons can reopen them.
    */

    body.daily-content-direct-mode
    .left-rail,
    body.daily-content-direct-mode
    .right-rail {
      display: flex !important;
    }

    body.daily-content-direct-mode
    .quick-strip {
      display: none !important;
    }

    body.daily-content-direct-mode
    .centre-board {
      width: 100%;
      height: 100%;
      display: grid;
      grid-template-rows:
        minmax(0, 1fr) !important;
      gap: 0 !important;
    }

    body.daily-content-direct-mode:not(
      .left-rail-collapsed
    )
    .board-shell {
      grid-template-columns:
        224px
        minmax(0, 1fr)
        38px !important;
    }

    body.daily-content-direct-mode:not(
      .right-rail-collapsed
    )
    .board-shell {
      grid-template-columns:
        38px
        minmax(0, 1fr)
        270px !important;
    }

    body.daily-content-direct-mode:not(
      .left-rail-collapsed
    ):not(
      .right-rail-collapsed
    )
    .board-shell {
      grid-template-columns:
        224px
        minmax(0, 1fr)
        270px !important;
    }

    body.daily-content-direct-mode
    .stage-card {
      width: 100%;
      height: 100%;
      padding:
        14px
        20px
        20px !important;
      border: 0 !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      grid-template-rows:
        auto
        minmax(0, 1fr) !important;
      gap: 12px !important;
    }

    body.daily-content-direct-mode
    .stage-body {
      width: 100%;
      height: 100%;
      min-height: 0;
      overflow: hidden !important;
    }

    /*
      Standalone Daily Content does not need the Present Lesson
      controls. During Present Lesson, however, the normal Pen,
      Pointer, Erase, Quick actions and Exit strip must remain.
    */

    body.daily-content-direct-mode:not(
      .focus-mode
    )
    .clean-focus-tool-nav,
    body.daily-content-direct-mode:not(
      .focus-mode
    )
    .present-quick-actions {
      display: none !important;
    }

    body.daily-content-direct-mode.focus-mode
    .present-quick-actions {
      display: flex !important;
      z-index: 500 !important;
    }

        body.daily-content-direct-mode.focus-mode[
      data-stage="dailyContent"
    ]
    .daily-content-stage-grid.count-1
    .daily-content-stage-card {
      padding-bottom:
        clamp(
          88px,
          10vh,
          118px
        ) !important;
    }



    .daily-content-header-timer {
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 6px 12px;
      border: 1px solid #bbf7d0;
      border-radius: 999px;
      background: #143f3a;
      color: #ffffff;
      font-size: 15px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: -0.3px;
      white-space: nowrap;
      cursor: pointer;
    }

    .daily-content-quick-display-toggle {
      gap: 6px;
      border-color: #c4b5fd !important;
      background: #f5f3ff !important;
      color: #5b21b6 !important;
    }

    .daily-content-quick-display-toggle:hover {
      border-color: #8b5cf6 !important;
      background: #ede9fe !important;
    }

    .daily-content-quick-display-toggle.showing-one {
      border-color: #8b5cf6 !important;
      background: #6d28d9 !important;
      color: #ffffff !important;
    }

    .daily-content-quick-display-icon {
      display: inline-grid;
      place-items: center;
      font-size: 14px;
      line-height: 1;
      font-weight: 950;
    }

    body.focus-mode[data-stage="dailyContent"]
.clean-focus-tool-nav.show {
  display: flex !important;
}

    body.focus-mode[data-stage="dailyContent"]
    .stage-card,
    body.fullscreen-active[data-stage="dailyContent"]
    .stage-card {
      padding: 16px 20px 20px !important;
      grid-template-rows:
        auto
        minmax(0, 1fr) !important;
      gap: 12px !important;
    }

    body.focus-mode[data-stage="dailyContent"]
    .stage-body,
    body.fullscreen-active[data-stage="dailyContent"]
    .stage-body {
      min-height: 0 !important;
      height: 100% !important;
      overflow: hidden !important;
    }

    body.focus-mode[data-stage="dailyContent"]
    .daily-content-stage-grid,
    body.fullscreen-active[data-stage="dailyContent"]
    .daily-content-stage-grid {
      height: 100%;
      min-height: 0;
      overflow: hidden;
    }

    .daily-content-stage-grid {
      min-height: 0;
      display: grid;
      grid-template-columns:
        repeat(3, minmax(0, 1fr));
      gap: clamp(16px, 1.5vw, 22px);
      padding: clamp(18px, 2vw, 28px);
      border-radius: 32px;
      background:
        linear-gradient(
          180deg,
          #f8fbff 0%,
          #eef5ff 100%
        );
      border: 1px solid #dbe7f5;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
      overflow: auto;
    }

    .daily-content-stage-grid.count-1 {
      width: 100%;
      height: 100%;
      min-height: 0;
      grid-template-columns: 1fr;
      padding: 0;
      gap: 0;
      border-radius: 0;
      background: transparent;
      border: 0;
      box-shadow: none;
      overflow: hidden;
    }

    .daily-content-stage-grid.count-2 {
      grid-template-columns:
        repeat(2, minmax(0, 1fr));
    }

    .daily-content-stage-grid.count-4 {
      grid-template-columns:
        repeat(2, minmax(0, 1fr));
      grid-template-rows:
        repeat(2, minmax(0, 1fr));
    }

    .daily-content-stage-grid.count-5,
    .daily-content-stage-grid.count-6 {
      grid-template-columns:
        repeat(3, minmax(0, 1fr));
      grid-template-rows:
        repeat(2, minmax(0, 1fr));
    }

    .daily-content-stage-card {
      --daily-card-bg: #f5f3ff;
      --daily-card-accent: #7c3aed;
      --daily-card-soft: #ede9fe;
      --daily-card-ink: #3b1768;

      position: relative;
      isolation: isolate;
      min-width: 0;
      min-height: 0;
      height: 100%;
      display: grid;
      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto
        auto;
      align-items: start;
      gap: clamp(12px, 1.25vh, 18px);
      padding: clamp(18px, 1.8vw, 26px);
      border:
        2px solid
        color-mix(
          in srgb,
          var(--daily-card-accent) 28%,
          #ffffff
        );
      border-radius:
        clamp(24px, 2vw, 30px);
      background:
        radial-gradient(
          circle at 88% 10%,
          color-mix(
            in srgb,
            var(--daily-card-soft) 84%,
            #ffffff
          ),
          transparent 21%
        ),
        linear-gradient(
          180deg,
          #ffffff 0%,
          var(--daily-card-bg) 100%
        );
      color: var(--daily-card-ink);
      text-align: center;
      overflow: hidden;
      box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
      animation:
        dailyContentCardEnter
        0.42s
        cubic-bezier(0.2, 0.8, 0.2, 1)
        both;
    }

    .daily-content-stage-card:nth-child(2) {
      animation-delay: 55ms;
    }

    .daily-content-stage-card:nth-child(3) {
      animation-delay: 110ms;
    }

    .daily-content-stage-card:nth-child(4) {
      animation-delay: 165ms;
    }

    .daily-content-stage-card:nth-child(5) {
      animation-delay: 220ms;
    }

    .daily-content-stage-card:nth-child(6) {
      animation-delay: 275ms;
    }

    @keyframes dailyContentCardEnter {
      from {
        opacity: 0;
        transform:
          translateY(16px)
          scale(0.97);
      }

      to {
        opacity: 1;
        transform:
          translateY(0)
          scale(1);
      }
    }

    .daily-content-stage-card::before {
      content: "";
      position: absolute;
      top: -52px;
      right: -40px;
      z-index: -1;
      width: 138px;
      height: 138px;
      border-radius: 999px;
      background: var(--daily-card-soft);
      opacity: 0.82;
    }

    .daily-content-stage-card::after {
      content: "";
      position: absolute;
      right: 16px;
      bottom: 14px;
      z-index: -1;
      width: 54px;
      height: 9px;
      border-radius: 999px;
      background: var(--daily-card-accent);
      opacity: 0.12;
      transform: rotate(-8deg);
    }

    .daily-content-stage-card.type-word {
      --daily-card-bg: #f5f3ff;
      --daily-card-accent: #7c3aed;
      --daily-card-soft: #ddd6fe;
      --daily-card-ink: #3b1768;
    }

    .daily-content-stage-card.type-question {
      --daily-card-bg: #eff6ff;
      --daily-card-accent: #2563eb;
      --daily-card-soft: #bfdbfe;
      --daily-card-ink: #1e3a8a;
    }

    .daily-content-stage-card.type-joke {
      --daily-card-bg: #fffbeb;
      --daily-card-accent: #d97706;
      --daily-card-soft: #fde68a;
      --daily-card-ink: #78350f;
    }

    .daily-content-stage-card.type-fact {
      --daily-card-bg: #ecfdf5;
      --daily-card-accent: #059669;
      --daily-card-soft: #a7f3d0;
      --daily-card-ink: #064e3b;
    }

    .daily-content-stage-card.type-today {
      --daily-card-bg: #fff1f2;
      --daily-card-accent: #e11d48;
      --daily-card-soft: #fecdd3;
      --daily-card-ink: #881337;
    }

    .daily-content-stage-card.type-riddle {
      --daily-card-bg: #eef2ff;
      --daily-card-accent: #4f46e5;
      --daily-card-soft: #c7d2fe;
      --daily-card-ink: #312e81;
    }

    .daily-content-stage-card-header {
      width: 100%;
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    .daily-content-stage-icon {
      width: clamp(42px, 3vw, 56px);
      height: clamp(42px, 3vw, 56px);
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border-radius: 16px;
      background:
        color-mix(
          in srgb,
          var(--daily-card-soft) 72%,
          #ffffff
        );
      font-size:
        clamp(22px, 1.8vw, 32px);
      line-height: 1;
      box-shadow:
        0 8px 18px
        color-mix(
          in srgb,
          var(--daily-card-accent) 16%,
          transparent
        );
    }

    .daily-content-stage-card-title {
      min-width: 0;
      color: var(--daily-card-accent);
      font-size:
        clamp(16px, 1.05vw, 22px);
      line-height: 1.05;
      font-weight: 950;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      overflow-wrap: anywhere;
    }

    .daily-content-stage-card > div:nth-child(2) {
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
    }

    .daily-content-stage-card-text {
      min-width: 0;
      max-width: 100%;
      align-self: center;
      color: #0f172a;
      font-size:
        clamp(22px, 2vw, 34px);
      line-height: 1.08;
      font-weight: 950;
      letter-spacing: -0.9px;
      overflow-wrap: anywhere;
      hyphens: auto;
      text-wrap: balance;
    }

    .daily-content-stage-card.type-word
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child,
    .daily-content-stage-card.type-today
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child,
    .daily-content-stage-card.type-riddle
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child {
      font-size:
        clamp(26px, 2.4vw, 42px);
      line-height: 1.02;
    }

    .daily-content-stage-card-footer {
      width: 100%;
      min-height: 25px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .daily-content-stage-card-number {
      min-height: 23px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 10px;
      border:
        1px solid
        color-mix(
          in srgb,
          var(--daily-card-accent) 24%,
          transparent
        );
      border-radius: 999px;
      background:
        color-mix(
          in srgb,
          var(--daily-card-soft) 34%,
          #ffffff
        );
      color: var(--daily-card-accent);
      font-size: 9px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0.6px;
      text-transform: uppercase;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card {
      width: 100%;
      height: 100%;
      min-height: 0;
      margin: 0;
      padding:
        clamp(36px, 5vw, 76px);
      border-radius: 0;
      border: 0;
      box-shadow: none;
    }

        body[data-stage="dailyContent"]
    .daily-content-stage:has(
      .daily-content-stage-grid.count-1
    ) {
      width: 100%;
      height: 100%;
    }

    body[data-stage="dailyContent"]
    .stage-body:has(
      .daily-content-stage-grid.count-1
    ) {
      overflow: hidden !important;
    }

    body.daily-content-direct-mode
    .stage-card:has(
      .daily-content-stage-grid.count-1
    ),
    body.focus-mode[data-stage="dailyContent"]
    .stage-card:has(
      .daily-content-stage-grid.count-1
    ),
    body.fullscreen-active[data-stage="dailyContent"]
    .stage-card:has(
      .daily-content-stage-grid.count-1
    ) {
      padding-left: 0 !important;
      padding-right: 0 !important;
      padding-bottom: 0 !important;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-icon {
      width: clamp(70px, 7vw, 112px);
      height: clamp(70px, 7vw, 112px);
      border-radius: clamp(22px, 2.4vw, 34px);
      font-size: clamp(40px, 5vw, 76px);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card-title {
      font-size:
        clamp(22px, 2.8vw, 42px);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card-text {
      max-width: 1150px;
      margin: 0 auto;
      font-size:
        clamp(46px, 6.4vw, 100px);
      line-height: 1.03;
      letter-spacing: -2px;
    }

    /*
      QUESTION OF THE DAY — SHOW ONE

      Keep the question dominant, but render the revealed
      response guide as a smaller supporting panel rather
      than another full-size headline.
    */

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-question {
      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;
      gap:
        clamp(16px, 2.2vh, 28px);
      padding:
        clamp(30px, 4vh, 52px)
        clamp(44px, 6vw, 96px)
        clamp(88px, 10vh, 118px);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-question
    .daily-content-stage-card-header {
      align-self: start;
      position: relative;
      z-index: 2;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-question
    > div:nth-child(2) {
      width: min(100%, 1220px);
      min-height: 0;
      align-self: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap:
        clamp(22px, 3vh, 38px);
      margin: 0 auto;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-question
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child {
      width: 100%;
      max-width: 1220px;
      margin: 0 auto;
      color: #111827;
      font-size:
        clamp(44px, 5.5vw, 86px);
      line-height: 1.04;
      letter-spacing: -2px;
      text-wrap: balance;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-question
    .daily-content-hidden-answer.revealed {
      width: min(100%, 980px);
      max-width: 980px;
      margin: 0 auto !important;
      padding:
        clamp(16px, 2vh, 24px)
        clamp(22px, 2.8vw, 38px);
      border: 2px solid #93c5fd;
      border-radius:
        clamp(16px, 1.6vw, 24px);
      background:
        linear-gradient(
          135deg,
          #eff6ff,
          #dbeafe
        );
      color: #1d4ed8 !important;
      font-size:
        clamp(23px, 2.6vw, 42px) !important;
      line-height: 1.16 !important;
      letter-spacing: -0.7px !important;
      text-wrap: balance;
      box-shadow:
        0 10px 24px
        rgba(37, 99, 235, 0.10);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-question
    .daily-content-stage-actions {
      align-self: end;
      position: relative;
      z-index: 3;
      margin: 0;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-question
    .daily-content-stage-action {
      min-height: 40px;
      padding:
        9px
        16px;
      font-size:
        clamp(11px, 0.95vw, 14px);
    }


    /*
      =========================================================
      WORD OF THE DAY — SHOW ONE
      =========================================================

      The word remains dominant. Its revealed meaning becomes
      a smaller purple support panel beneath it.
    */

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word {
      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto
        auto;
      gap:
        clamp(13px, 1.8vh, 22px);
      padding:
        clamp(30px, 4vh, 52px)
        clamp(44px, 6vw, 96px)
        clamp(88px, 10vh, 118px);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-stage-card-header {
      align-self: start;
      position: relative;
      z-index: 2;
      margin: 0;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    > div:nth-child(2) {
      width: min(100%, 1120px);
      min-height: 0;
      align-self: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap:
        clamp(20px, 2.7vh, 34px);
      margin: 0 auto;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child {
      width: 100%;
      max-width: 1050px;
      margin: 0 auto;
      color: #111827;
      font-size:
        clamp(68px, 8vw, 128px);
      line-height: 0.94;
      letter-spacing: -3px;
      text-wrap: balance;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-hidden-answer.revealed {
      width: min(100%, 900px);
      max-width: 900px;
      margin: 0 auto !important;
      padding:
        clamp(15px, 1.8vh, 22px)
        clamp(22px, 2.7vw, 36px);
      border: 2px solid #c4b5fd;
      border-radius:
        clamp(16px, 1.6vw, 24px);
      background:
        linear-gradient(
          135deg,
          #f5f3ff,
          #ede9fe
        );
      color: #6d28d9 !important;
      font-size:
        clamp(23px, 2.5vw, 40px) !important;
      line-height: 1.16 !important;
      letter-spacing: -0.6px !important;
      text-wrap: balance;
      box-shadow:
        0 10px 24px
        rgba(109, 40, 217, 0.10);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-discussion-prompt {
      width: min(100%, 840px);
      align-self: end;
      margin: 0 auto;
      padding:
        11px
        18px;
      font-size:
        clamp(13px, 1.15vw, 18px);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-stage-actions {
      align-self: start;
      position: relative;
      z-index: 3;
      margin: 0;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-stage-action {
      min-height: 40px;
      padding:
        9px
        16px;
      font-size:
        clamp(11px, 0.95vw, 14px);
    }


    /*
      =========================================================
      JOKE OF THE DAY — SHOW ONE
      =========================================================

      The setup remains the main classroom prompt. The revealed
      punchline appears beneath it as a smaller amber panel.
    */

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-joke {
      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;
      gap:
        clamp(16px, 2.2vh, 28px);
      padding:
        clamp(30px, 4vh, 52px)
        clamp(44px, 6vw, 96px)
        clamp(88px, 10vh, 118px);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-joke
    .daily-content-stage-card-header {
      align-self: start;
      position: relative;
      z-index: 2;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-joke
    > div:nth-child(2) {
      width: min(100%, 1180px);
      min-height: 0;
      align-self: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap:
        clamp(22px, 3vh, 38px);
      margin: 0 auto;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-joke
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child {
      width: 100%;
      max-width: 1120px;
      margin: 0 auto;
      color: #111827;
      font-size:
        clamp(42px, 5.2vw, 82px);
      line-height: 1.05;
      letter-spacing: -1.8px;
      text-wrap: balance;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-joke
    .daily-content-hidden-answer.revealed {
      width: min(100%, 940px);
      max-width: 940px;
      margin: 0 auto !important;
      padding:
        clamp(16px, 2vh, 24px)
        clamp(22px, 2.8vw, 38px);
      border: 2px solid #fbbf24;
      border-radius:
        clamp(16px, 1.6vw, 24px);
      background:
        linear-gradient(
          135deg,
          #fffbeb,
          #fef3c7
        );
      color: #b45309 !important;
      font-size:
        clamp(24px, 2.7vw, 43px) !important;
      line-height: 1.15 !important;
      letter-spacing: -0.7px !important;
      text-wrap: balance;
      box-shadow:
        0 10px 24px
        rgba(217, 119, 6, 0.11);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-joke
    .daily-content-stage-actions {
      align-self: end;
      position: relative;
      z-index: 3;
      margin: 0;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-joke
    .daily-content-stage-action {
      min-height: 40px;
      padding:
        9px
        16px;
      font-size:
        clamp(11px, 0.95vw, 14px);
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card,
    .daily-content-stage-grid.count-6
    .daily-content-stage-card {
      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;
      gap: clamp(6px, 0.8vh, 9px);
      padding:
        clamp(12px, 1.2vw, 18px);
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-icon,
    .daily-content-stage-grid.count-6
    .daily-content-stage-icon {
      width: clamp(32px, 2.3vw, 42px);
      height: clamp(32px, 2.3vw, 42px);
      border-radius: 12px;
      font-size:
        clamp(18px, 1.65vw, 26px);
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card-header,
    .daily-content-stage-grid.count-6
    .daily-content-stage-card-header {
      gap: 7px;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card-title,
    .daily-content-stage-grid.count-6
    .daily-content-stage-card-title {
      font-size:
        clamp(10px, 0.9vw, 15px);
      line-height: 1;
      letter-spacing: 0.35px;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card
    > div:nth-child(2),
    .daily-content-stage-grid.count-6
    .daily-content-stage-card
    > div:nth-child(2) {
      min-height: 0;
      gap: 7px;
      justify-content: center;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card-text,
    .daily-content-stage-grid.count-6
    .daily-content-stage-card-text {
      font-size:
        clamp(18px, 1.75vw, 29px);
      line-height: 1.06;
      letter-spacing: -0.65px;
    }

    .daily-content-stage-grid.count-5
    .daily-content-hidden-answer.revealed,
    .daily-content-stage-grid.count-6
    .daily-content-hidden-answer.revealed {
      width: min(100%, 96%);
      padding:
        7px
        10px;
      border-radius: 12px;
      font-size:
        clamp(11px, 0.9vw, 15px) !important;
      line-height: 1.15 !important;
      letter-spacing: -0.1px !important;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-actions,
    .daily-content-stage-grid.count-6
    .daily-content-stage-actions {
      width: 100%;
      gap: 4px;
      flex-wrap: nowrap;
      margin: 0;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-action,
    .daily-content-stage-grid.count-6
    .daily-content-stage-action {
      min-width: 0;
      min-height: 27px;
      flex: 0 1 auto;
      gap: 3px;
      padding:
        5px
        clamp(5px, 0.5vw, 8px);
      font-size:
        clamp(8px, 0.62vw, 10px);
      white-space: nowrap;
    }

        /*
      Compact Question of the Day when five or six cards share
      the screen. The question stays dominant while the revealed
      guidance becomes a clearly secondary answer strip.
    */

    .daily-content-stage-grid.count-5
    .daily-content-stage-card.type-question,
    .daily-content-stage-grid.count-6
    .daily-content-stage-card.type-question {
      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card.type-question
    > div:nth-child(2),
    .daily-content-stage-grid.count-6
    .daily-content-stage-card.type-question
    > div:nth-child(2) {
      width: 100%;
      min-height: 0;
      display: grid;
      grid-template-rows:
        minmax(0, 1fr)
        auto;
      align-items: center;
      gap: 7px;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card.type-question
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child,
    .daily-content-stage-grid.count-6
    .daily-content-stage-card.type-question
    > div:nth-child(2)
    > .daily-content-stage-card-text:first-child {
      align-self: center;
      font-size:
        clamp(18px, 1.7vw, 28px);
      line-height: 1.05;
      letter-spacing: -0.7px;
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-card.type-question
    .daily-content-hidden-answer.revealed,
    .daily-content-stage-grid.count-6
    .daily-content-stage-card.type-question
    .daily-content-hidden-answer.revealed {
      align-self: end;
      max-height: 62px;
      overflow: hidden;
      display: -webkit-box;
      padding:
        7px
        10px;
      font-size:
        clamp(10px, 0.82vw, 14px) !important;
      line-height: 1.14 !important;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      line-clamp: 3;
    }

    @media (prefers-reduced-motion: reduce) {
      .daily-content-stage-card {
        animation: none;
      }
    }

    .present-lesson-with-daily-content {
      width: 100%;
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-rows:
        minmax(0, 1fr)
        auto;
      gap: 10px;
      overflow: hidden;
    }

    .present-lesson-main-content {
      min-height: 0;
      overflow: hidden;
    }

    .present-lesson-daily-content {
      display: none;
    }

    body.focus-mode[data-stage="task"]
    .present-lesson-daily-content {
      min-height: 102px;
      display: grid;
      grid-template-columns:
        repeat(
          var(--daily-present-count, 3),
          minmax(0, 1fr)
        );
      gap: 8px;
      padding: 8px;
      border: 1px solid #d9fbe8;
      border-radius: 17px;
      background:
        linear-gradient(
          135deg,
          #143f3a,
          #1e5e54
        );
      overflow: hidden;
    }

    .present-lesson-daily-card {
      min-width: 0;
      display: grid;
      align-content: center;
      gap: 5px;
      padding: 9px 11px;
      border-radius: 13px;
      background: rgba(255, 255, 255, 0.97);
      text-align: center;
      overflow: hidden;
    }

    .present-lesson-daily-card strong {
      color: #6d28d9;
      font-size: 9px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0.45px;
      text-transform: uppercase;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .present-lesson-daily-card span {
      display: -webkit-box;
      overflow: hidden;
      color: #111827;
      font-size: clamp(12px, 1.2vw, 17px);
      line-height: 1.18;
      font-weight: 950;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      line-clamp: 2;
    }

    @media (max-width: 820px) {
      .daily-content-type-grid,
      .daily-content-preview,
      .daily-content-stage-grid,
      .daily-content-stage-grid.count-5,
      .daily-content-stage-grid.count-6 {
        grid-template-columns: 1fr;
      }

      .today-daily-content-card {
        min-width: 0;
      }

      body.focus-mode[data-stage="task"]
      .present-lesson-daily-content {
        grid-template-columns:
          repeat(2, minmax(0, 1fr));
        max-height: 190px;
        overflow-y: auto;
      }
    }

    /* =========================================================
       DAILY CONTENT PARTICIPATION CONTROLS
       ========================================================= */

    .daily-content-setting-checks {
      min-width: 145px;
      display: grid;
      gap: 6px;
    }

    .daily-content-setting-checks label {
      min-height: 29px;
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 5px 9px;
      border: 1px solid #ddd6fe;
      border-radius: 10px;
      background: #ffffff;
      color: #4c1d95;
      font-size: 10.5px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
    }

    .daily-content-setting-checks input {
      accent-color: #7c3aed;
    }

    .daily-content-stage-actions {
      width: 100%;
      align-self: start;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .daily-content-stage-action {
      min-height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 7px 13px;
      border: 1px solid
        color-mix(
          in srgb,
          var(--daily-card-accent, #7c3aed)
          35%,
          #ffffff
        );
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.88);
      color:
        var(
          --daily-card-accent,
          #6d28d9
        );
      font-size: 10.5px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
      box-shadow:
        0 6px 14px
        rgba(15, 23, 42, 0.08);
    }

    .daily-content-stage-action:hover {
      transform: translateY(-1px);
      background: #ffffff;
    }

    .daily-content-stage-action.primary {
      border-color:
        var(
          --daily-card-accent,
          #7c3aed
        );
      background:
        var(
          --daily-card-accent,
          #7c3aed
        );
      color: #ffffff;
    }

    .daily-content-hidden-answer {
      display: none;
    }

    .daily-content-hidden-answer.revealed {
      display: block;
      animation:
        dailyContentReveal
        0.32s
        ease-out
        both;
    }

    @keyframes dailyContentReveal {
      from {
        opacity: 0;
        transform:
          translateY(8px)
          scale(0.98);
      }

      to {
        opacity: 1;
        transform:
          translateY(0)
          scale(1);
      }
    }

    .daily-content-stage-grid:not(.count-1)
    .daily-content-hidden-answer.revealed {
      width: min(100%, 92%);
      margin: 0 auto !important;
      padding:
        10px 14px;
      border:
        1.5px solid
        color-mix(
          in srgb,
          var(--daily-card-accent) 30%,
          #ffffff
        );
      border-radius: 16px;
      background:
        color-mix(
          in srgb,
          var(--daily-card-soft) 58%,
          #ffffff
        );
      color:
        var(--daily-card-accent) !important;
      font-size:
        clamp(15px, 1.1vw, 20px) !important;
      line-height: 1.2 !important;
      letter-spacing: -0.2px !important;
      text-wrap: balance;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    .daily-content-discussion-prompt {
      width: min(100%, 720px);
      align-self: end;
      margin: 0 auto;
      padding: 9px 13px;
      border: 1px dashed
        color-mix(
          in srgb,
          var(--daily-card-accent, #7c3aed)
          42%,
          #ffffff
        );
      border-radius: 13px;
      background: rgba(255, 255, 255, 0.66);
      color: #475569;
      font-size:
        clamp(11px, 1vw, 15px);
      line-height: 1.25;
      font-weight: 900;
      text-align: center;
    }

    .daily-content-stage-grid:not(.count-1)
    .daily-content-discussion-prompt {
      width: 100%;
      max-width: 100%;
      margin: 0;
      padding:
        10px 12px;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.76);
      font-size:
        clamp(12px, 0.95vw, 15px);
      line-height: 1.22;
    }

    .daily-content-stage-grid:not(.count-1)
    .daily-content-stage-actions {
      width: 100%;
      min-width: 0;
      align-self: end;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      flex-wrap: nowrap;
      margin-top: 2px;
    }

    .daily-content-stage-grid:not(.count-1)
    .daily-content-stage-action {
      min-width: 0;
      min-height: 30px;
      flex: 0 1 auto;
      padding:
        6px
        clamp(8px, 0.75vw, 11px);
      gap: 4px;
      border-radius: 999px;
      font-size:
        clamp(9.5px, 0.72vw, 11.5px);
      line-height: 1;
      white-space: nowrap;
      box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.06);
    }

    .daily-content-stage-grid:not(.count-1)
    .daily-content-stage-action.primary {
      box-shadow:
        0 6px 14px
        color-mix(
          in srgb,
          var(--daily-card-accent) 16%,
          transparent
        );
    }

        /*
      Keep all three Daily Content controls on one line inside
      the narrower Show all cards.
    */

    .daily-content-stage-grid.count-5
    .daily-content-stage-action,
    .daily-content-stage-grid.count-6
    .daily-content-stage-action {
      min-height: 28px;
      padding:
        5px
        clamp(6px, 0.55vw, 9px);
      gap: 3px;
      font-size:
        clamp(8.5px, 0.64vw, 10.5px);
    }

    .daily-content-stage-grid.count-5
    .daily-content-stage-actions,
    .daily-content-stage-grid.count-6
    .daily-content-stage-actions {
      gap: 5px;
    }
    .daily-content-think-overlay {
      position: fixed;
      inset: 0;
      z-index: 30000;
      display: none;
      place-items: center;
      padding: 20px;
      background:
        rgba(15, 23, 42, 0.78);
      backdrop-filter: blur(9px);
    }

    .daily-content-think-overlay.show {
      display: grid;
    }

    .daily-content-think-card {
      width: min(500px, 96vw);
      padding: 30px;
      border: 3px solid #a7f3d0;
      border-radius: 30px;
      background: #ffffff;
      text-align: center;
      box-shadow:
        0 28px 70px
        rgba(2, 6, 23, 0.38);
    }

    .daily-content-think-card strong {
      display: block;
      color: #166534;
      font-size: 17px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .daily-content-think-number {
      margin: 14px 0;
      color: #143f3a;
      font-size:
        clamp(84px, 14vw, 150px);
      line-height: 0.9;
      font-weight: 950;
      letter-spacing: -6px;
    }

    .daily-content-think-card span {
      color: #64748b;
      font-size: 15px;
      font-weight: 900;
    }

    .daily-content-picked-student {
      position: fixed;
      inset: 0;
      z-index: 30000;
      display: none;
      place-items: center;
      padding: 20px;
      background:
        rgba(15, 23, 42, 0.76);
      backdrop-filter: blur(9px);
    }

    .daily-content-picked-student.show {
      display: grid;
    }

    .daily-content-picked-student-card {
      width: min(620px, 95vw);
      padding: 34px;
      border: 4px solid #fde68a;
      border-radius: 32px;
      background:
        radial-gradient(
          circle at top,
          #fff7cc,
          #ffffff 58%
        );
      text-align: center;
      box-shadow:
        0 30px 80px
        rgba(2, 6, 23, 0.4);
      animation:
        dailyContentStudentPop
        0.38s
        cubic-bezier(
          0.18,
          0.89,
          0.32,
          1.28
        );
    }

    @keyframes dailyContentStudentPop {
      from {
        opacity: 0;
        transform:
          scale(0.8)
          rotate(-2deg);
      }

      to {
        opacity: 1;
        transform:
          scale(1)
          rotate(0);
      }
    }

    .daily-content-picked-student-card small {
      display: block;
      color: #b45309;
      font-size: 13px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: 0.9px;
    }

    .daily-content-picked-student-card strong {
      display: block;
      margin: 14px 0 20px;
      color: #143f3a;
      font-size:
        clamp(48px, 7vw, 94px);
      line-height: 1;
      font-weight: 950;
      overflow-wrap: anywhere;
    }

    @media (max-width: 760px) {
      .daily-content-setting-checks {
        grid-column: 1 / -1;
        width: 100%;
      }
    }

    /* =========================================================
       READY SCREENS
       Massive text-only classroom display screens.
       Integrated into Today View, not the toolbar.
       ========================================================= */

    .today-ready-section {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 17px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.025);
  display: grid;
  grid-template-columns:
    minmax(260px, auto)
    minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  overflow: hidden;
}

.today-ready-section > div:first-child {
  justify-self: start;
}

.today-ready-section .today-ready-screens-group {
  justify-self: end;
}

.today-ready-screens-group {
  min-width: 0;
  margin-left: auto;
  display: grid;
  grid-template-columns:
    auto
    minmax(0, auto)
    auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

    .today-ready-title {
      margin: 0;
      color: #143f3a;
      font-size: 14px;
      font-weight: 950;
      letter-spacing: -0.2px;
      white-space: nowrap;
    }

    .today-ready-grid {
  min-width: 0;
  display: grid;
  grid-template-columns:
    repeat(3, minmax(130px, 170px));
  align-items: center;
  justify-content: end;
  gap: 7px;
  overflow: hidden;
}

    .today-ready-screen-option {
      position: relative;
      min-width: 130px;
      max-width: 170px;
      min-height: 30px;
      display: grid;
      grid-template-columns:
        minmax(0, 1fr);
      align-items: center;
      border: 1px solid #e5e7eb;
      border-radius: 999px;
      background: #ffffff;
      overflow: hidden;
      transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
    }

    .today-ready-screen-option:hover {
      border-color: #86efac;
      background: #f7fff9;
      transform: translateY(-1px);
    }

    .today-ready-screen-option.selected {
      border-color: #22c55e;
      background: #f0fdf4;
      box-shadow:
        0 0 0 2px rgba(34, 197, 94, 0.14);
    }

    .today-ready-button {
      width: 100%;
      min-width: 0;
      min-height: 30px;
      display: grid;
      grid-template-columns:
        20px
        minmax(0, 1fr);
      gap: 5px;
      align-items: center;
      padding: 4px 3px 4px 5px;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: #143f3a;
      text-align: left;
      cursor: pointer;
      box-shadow: none;
    }

    .today-ready-button:hover {
      background: transparent;
    }

    .today-ready-screen-option.selected
    .today-ready-icon {
      background: #dcfce7;
    }

    .today-ready-select-button {
      width: 22px;
      height: 22px;
      min-width: 22px;
      display: inline-grid;
      place-items: center;
      margin-right: 3px;
      padding: 0;
      border: 1px solid #bbf7d0;
      border-radius: 999px;
      background: #f0fdf4;
      color: #15803d;
      font-size: 15px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
    }

    .today-ready-select-button:hover {
      border-color: #22c55e;
      background: #dcfce7;
    }

    .today-ready-select-button.selected {
      border-color: #22c55e;
      background: #22c55e;
      color: #ffffff;
      font-size: 10px;
      box-shadow:
        0 0 0 2px rgba(34, 197, 94, 0.16);
    }

    .today-ready-icon {
      width: 20px;
      height: 20px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: #eefbf4;
      font-size: 10px;
      flex-shrink: 0;
    }

    .today-ready-label {
      display: block;
      color: #111827;
      font-size: 11px;
      font-weight: 950;
      line-height: 1.05;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .today-ready-choose-button {
      width: 30px;
      min-width: 30px;
      max-width: 30px;
      min-height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: flex-start;
      gap: 0;
      padding: 0 7px;
      border: 1px solid #bfdbfe;
      border-radius: 999px;
      background: #eff6ff;
      color: #1d4ed8;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
      overflow: hidden;
      cursor: pointer;
      transition:
        width 0.2s ease,
        min-width 0.2s ease,
        max-width 0.2s ease,
        gap 0.2s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
    }

    .today-ready-choose-icon {
      width: 15px;
      min-width: 15px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      line-height: 1;
    }

    .today-ready-choose-label {
      max-width: 0;
      opacity: 0;
      overflow: hidden;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      transition:
        max-width 0.2s ease,
        opacity 0.14s ease;
    }

    .today-ready-choose-button:hover,
    .today-ready-choose-button:focus-visible {
      width: 126px;
      min-width: 126px;
      max-width: 126px;
      gap: 7px;
      border-color: #93c5fd;
      background: #dbeafe;
      outline: none;
      transform: translateY(-1px);
    }

    .today-ready-choose-button:hover
    .today-ready-choose-label,
    .today-ready-choose-button:focus-visible
    .today-ready-choose-label {
      max-width: 98px;
      opacity: 1;
    }

    .today-ready-choose-button:active {
      transform: scale(0.96);
    }

    .today-ready-duty-divider {
      align-self: stretch;
      width: 1px;
      min-height: 24px;
      background: #e5e7eb;
    }

    .today-ready-duty-group {
      min-width: 0;
      min-height: 34px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 7px;
      padding: 3px 5px 3px 7px;
      border: 1px solid #fde68a;
      border-radius: 12px;
      background: #fffbeb;
    }

    .today-ready-duty {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 7px;
      white-space: nowrap;
    }

    .today-ready-duty-icon {
      width: 26px;
      height: 26px;
      display: grid;
      place-items: center;
      flex: 0 0 26px;
      border-radius: 9px;
      background: #fef3c7;
      font-size: 13px;
    }

    .today-ready-duty-copy {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 6px;
      overflow: hidden;
    }

    .today-ready-duty-copy strong {
      color: #111827;
      font-size: 11.5px;
      font-weight: 950;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .today-ready-duty-copy span {
      color: #64748b;
      font-size: 10.5px;
      font-weight: 850;
      white-space: nowrap;
    }

    .today-ready-duty-copy span::before {
      content: "·";
      margin-right: 6px;
      color: #cbd5e1;
    }

    .today-ready-duty-edit {
      min-height: 27px;
      padding: 4px 9px;
      border: 0;
      border-radius: 999px;
      background: #fef3c7;
      color: #b45309;
      font-size: 11px;
      font-weight: 950;
      white-space: nowrap;
      cursor: pointer;
    }

    .today-ready-duty-edit:hover {
      background: #fde68a;
    }

    /*
      Mobile Today View duty widget.

      It sits beside the date in the hero and replaces the
      larger duty widget from the Display Screens row.
    */

    .mobile-today-duty-widget {
      display: none;
    }

    @media (max-width: 760px) {
      body[data-stage="today"]
      .teacher-date-stat {
        width: 100%;
        display: grid;
        grid-template-columns:
          minmax(0, 0.9fr)
          minmax(0, 1.1fr);
        gap: 8px;
        align-items: stretch;
      }

      body[data-stage="today"]
      .teacher-hero-date {
        min-width: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
      }

      body[data-stage="today"]
      .mobile-today-duty-widget {
        min-width: 0;
        min-height: 54px;
        display: grid;
        grid-template-columns:
          30px
          minmax(0, 1fr)
          auto;
        gap: 7px;
        align-items: center;
        padding: 7px 8px;
        border: 1px solid #fde68a;
        border-radius: 13px;
        background: #fffbeb;
        color: #111827;
        text-align: left;
        cursor: pointer;
      }

      body[data-stage="today"]
      .mobile-today-duty-widget:active {
        transform: scale(0.98);
      }

      body[data-stage="today"]
      .mobile-today-duty-icon {
        width: 30px;
        height: 30px;
        display: grid;
        place-items: center;
        border-radius: 9px;
        background: #fef3c7;
        font-size: 15px;
      }

      body[data-stage="today"]
      .mobile-today-duty-copy {
        min-width: 0;
        display: grid;
        gap: 2px;
      }

      body[data-stage="today"]
      .mobile-today-duty-copy strong {
        overflow: hidden;
        color: #111827;
        font-size: 11px;
        line-height: 1.1;
        font-weight: 950;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      body[data-stage="today"]
      .mobile-today-duty-copy small {
        overflow: hidden;
        color: #64748b;
        font-size: 9.5px;
        line-height: 1.1;
        font-weight: 850;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      body[data-stage="today"]
      .mobile-today-duty-edit {
        color: #b45309;
        font-size: 9.5px;
        line-height: 1;
        font-weight: 950;
        white-space: nowrap;
      }

      /*
        The mobile hero now contains the duty, so hide only
        the original duty widget in the Display Screens row.
      */

      body[data-stage="today"]
      .today-ready-section
      .today-ready-duty-group {
        display: none !important;
      }

      body[data-stage="today"]
      .today-ready-duty-divider {
        display: none !important;
      }

      body[data-stage="today"]
      .teacher-help-inline {
        position: absolute;
        top: 7px;
        right: 7px;
      }
    }

    @media (max-width: 1150px) {
      .today-ready-section {
        grid-template-columns: auto minmax(0, 1fr) auto;
      }

      .today-ready-duty-divider {
        display: none;
      }

      .today-ready-duty {
        grid-column: 2 / 3;
      }

      .today-ready-duty-edit {
        grid-column: 3 / 4;
      }
    }

    .ready-screen-stage {
      width: 100%;
      height: 100%;
      min-height: 100%;
      display: grid;
      grid-template-rows: auto 1fr;
      gap: 10px;
      overflow: hidden;
    }

    .ready-screen-toolbar {
      display: grid;
      grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      background: #ffffff;
    }

    .ready-screen-toolbar-title {
      min-width: 0;
    }

    .ready-screen-toolbar-title strong {
      display: block;
      color: #111827;
      font-size: 14px;
      font-weight: 950;
      line-height: 1.15;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .ready-screen-meta {
      color: #64748b;
      font-size: 11px;
      font-weight: 900;
      line-height: 1.2;
      white-space: nowrap;
    }

    .ready-screen-toolbar-pins {
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      overflow: hidden;
    }

    .ready-screen-toolbar-pin {
      min-width: 118px;
      max-width: 158px;
      min-height: 34px;
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      align-items: center;
      gap: 6px;
      padding: 5px 9px 5px 6px;
      border-radius: 999px;
      border: 1px solid #e5e7eb;
      background: #ffffff;
      color: #143f3a;
      cursor: pointer;
      text-align: left;
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.025);
    }

    .ready-screen-toolbar-pin:hover {
      border-color: #5fdc9a;
      background: #f1fdf6;
      transform: translateY(-1px);
    }

    .ready-screen-toolbar-pin span {
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: #eefbf4;
      font-size: 12px;
    }

    .ready-screen-toolbar-pin strong {
      min-width: 0;
      color: #111827;
      font-size: 11.5px;
      font-weight: 950;
      line-height: 1.05;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .ready-screen-actions {
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: nowrap;
      justify-content: flex-end;
    }

    .ready-screen-actions .btn {
      min-height: 34px;
      padding: 7px 12px;
      font-size: 12px;
    }



    
    .ready-screen-display {
      position: relative;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: clamp(28px, 5vw, 76px);
      border-radius: 34px;
      border: 1px solid rgba(255, 255, 255, 0.38);
      background:
        radial-gradient(circle at top left, rgba(95, 220, 154, 0.20), transparent 34%),
        linear-gradient(135deg, #ffffff, #f8fafc);
      box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
      overflow: hidden;
      isolation: isolate;
      color: #143f3a;
    }


    /*
     * IMAGE-ONLY READY SCREEN
     *
     * Remove the normal presentation padding so
     * the image can use almost the whole board.
     */
    .ready-screen-display:has(
      .ready-screen-image-only-wrap
    ) {
      padding:
        clamp(
          10px,
          1.2vw,
          18px
        );
    }

    .ready-screen-display::before,
    .ready-screen-display::after {
      content: "";
      position: absolute;
      inset: auto;
      z-index: 0;
      pointer-events: none;
    }

    .ready-screen-display::before {
      width: min(46vw, 560px);
      height: min(46vw, 560px);
      right: -120px;
      top: -150px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.30);
      filter: blur(1px);
    }

    .ready-screen-display::after {
      width: min(34vw, 420px);
      height: min(34vw, 420px);
      left: -110px;
      bottom: -120px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.22);
    }

    .ready-screen-text-wrap {
      position: relative;
      z-index: 2;
      width: min(100%, 1120px);
      display: grid;
      gap: clamp(16px, 2.3vw, 32px);
      padding: clamp(8px, 1vw, 14px);
    }

    .ready-screen-headline {
      color: inherit;
      font-size: clamp(62px, 8.5vw, 158px);
      line-height: 0.9;
      font-weight: 950;
      letter-spacing: -4.5px;
      text-transform: uppercase;
      overflow-wrap: anywhere;
      -webkit-text-stroke: clamp(1px, 0.13vw, 2.5px) rgba(15, 23, 42, 0.40);
      paint-order: stroke fill;
      text-shadow:
        0 3px 0 rgba(15, 23, 42, 0.20),
        0 8px 22px rgba(15, 23, 42, 0.30),
        0 0 34px rgba(255, 255, 255, 0.18);
    }


    /*
     * When a Ready Screen contains an image,
     * keep the headline compact so the visual
     * receives most of the presentation space.
     */
    /*
     * Ready Screens containing an image use the
     * full presentation height.
     *
     * Headline sits high on the board and the
     * image receives the remaining space.
     */
    .ready-screen-text-wrap:has(
      .ready-screen-image-grid
    ) {
      width:
        100%;

      max-width:
        none;

      height:
        100%;

      min-height:
        0;

      grid-template-rows:
        auto
        minmax(
          0,
          1fr
        );

      align-content:
        stretch;

      /*
       * Keep the headline clearly separate,
       * but don't waste valuable image space.
       */
      gap:
        clamp(
          4px,
          0.7vh,
          9px
        );

      padding-top:
        clamp(
          8px,
          1.2vh,
          16px
        );
    }


    .ready-screen-text-wrap:has(
      .ready-screen-image-grid
    )
    > .ready-screen-headline {
      font-size:
        clamp(
          32px,
          4vw,
          68px
        );

      line-height:
        0.95;

      letter-spacing:
        -1.8px;

      margin:
        0;

      transform:
        none;

      align-self:
        start;
    }

    .ready-screen-line {
      color: inherit;
      font-size: clamp(34px, 4.3vw, 82px);
      line-height: 1.05;
      font-weight: 900;
      overflow-wrap: anywhere;
      -webkit-text-stroke: clamp(0.7px, 0.08vw, 1.6px) rgba(15, 23, 42, 0.34);
      paint-order: stroke fill;
      text-shadow:
        0 2px 0 rgba(15, 23, 42, 0.18),
        0 6px 18px rgba(15, 23, 42, 0.26),
        0 0 24px rgba(255, 255, 255, 0.16);
    }


    /*
     * READY SCREEN VISUALS
     *
     * Images are remotely hosted.
     * TrackEDU stores only the URL strings.
     */

    .ready-screen-image-grid {
      width:
        min(
          100%,
          1120px
        );

      min-height:
        0;

      display:
        grid;

      gap:
        clamp(
          12px,
          1.4vw,
          20px
        );

      align-items:
        stretch;

      justify-self:
        center;
    }


    /*
     * One image becomes the hero visual rather
     * than sitting inside a huge empty panel.
     */
    .ready-screen-image-grid[data-count="1"] {
      width:
        min(
          94%,
          1380px
        );

      grid-template-columns:
        1fr;
    }


    /*
     * IMAGE ONLY
     *
     * When the teacher chooses Image only,
     * the visual becomes the main classroom
     * presentation rather than a small card.
     */
    .ready-screen-text-wrap.ready-screen-image-only-wrap {
      width:
        100% !important;

      max-width:
        none !important;

      height:
        100% !important;

      min-height:
        0;

      padding:
        14px
        18px
        0 !important;

      gap:
        0;

      /*
       * Row 1 = image.
       * Row 2 = protected space above the
       * Present to Class toolbar.
       *
       * Keep the image completely above
       * Annotate / Actions / Tools.
       */
      grid-template-rows:
        minmax(
          0,
          1fr
        )
        54px !important;

      align-content:
        stretch;

      align-items:
        stretch;

      justify-items:
        stretch;

      overflow:
        hidden;
    }


    /*
     * If Image only has no headline/footer,
     * the image owns the entire usable stage.
     */
    .ready-screen-image-only-wrap
    > .ready-screen-image-grid {
      min-height:
        0;

      height:
        100% !important;

      grid-row:
        1;

      align-self:
        stretch;
    }


    .ready-screen-image-only-wrap
    .ready-screen-image-grid {
      width:
        100% !important;

      height:
        100% !important;

      min-width:
        0;

      min-height:
        0;

      max-width:
        none !important;

      max-height:
        none !important;

      align-items:
        stretch;

      justify-items:
        stretch;
    }


    .ready-screen-image-only-wrap
    .ready-screen-image-grid[data-count="1"] {
      width:
        100% !important;

      height:
        100% !important;

      min-height:
        0;

      max-width:
        none !important;

      max-height:
        none !important;
    }


    .ready-screen-image-only-wrap
    .ready-screen-image-card {
      width:
        100%;

      height:
        100%;

      background:
        transparent;

      border-radius:
        0;

      overflow:
        visible;
    }


    .ready-screen-image-only-wrap
    .ready-screen-image-card
    img {
      width:
        100%;

      height:
        100%;

      max-width:
        100%;

      max-height:
        100% !important;

      object-fit:
        contain;

      border-radius:
        clamp(
          8px,
          1vw,
          16px
        );
    }


    .ready-screen-image-grid[data-count="2"] {
      grid-template-columns:
        repeat(
          2,
          minmax(
            0,
            1fr
          )
        );
    }


    .ready-screen-image-grid[data-count="3"] {
      grid-template-columns:
        repeat(
          3,
          minmax(
            0,
            1fr
          )
        );
    }


    .ready-screen-image-grid[data-count="4"] {
      width:
        min(
          82vw,
          920px
        );

      grid-template-columns:
        repeat(
          2,
          minmax(
            0,
            1fr
          )
        );
    }


    .ready-screen-image-grid[data-count="5"],
    .ready-screen-image-grid[data-count="6"] {
      grid-template-columns:
        repeat(
          3,
          minmax(
            0,
            1fr
          )
        );
    }


    .ready-screen-image-card {
      min-width:
        0;

      min-height:
        0;

      display:
        grid;

      place-items:
        center;

      overflow:
        hidden;

      border-radius:
        clamp(
          14px,
          1.5vw,
          22px
        );

      background:
        transparent;
    }


    .ready-screen-image-card img {
      display:
        block;

      width:
        100%;

      height:
        100%;

      max-height:
        min(
          43vh,
          430px
        );

      object-fit:
        contain;

      border-radius:
        inherit;
    }


    .ready-screen-image-grid[data-count="1"]
    .ready-screen-image-card img {
      max-height:
        min(
          64vh,
          650px
        );
    }


    /*
     * Image-only overrides the normal Ready Screen
     * image limit so it can fill the projector.
     */
    .ready-screen-image-only-wrap
    .ready-screen-image-grid[data-count="1"]
    .ready-screen-image-card
    img {
      max-height:
        100% !important;
    }


    .ready-screen-image-grid[data-count="4"]
    .ready-screen-image-card img,

    .ready-screen-image-grid[data-count="5"]
    .ready-screen-image-card img,

    .ready-screen-image-grid[data-count="6"]
    .ready-screen-image-card img {
      max-height:
        min(
          27vh,
          260px
        );
    }


    .ready-screen-image-card.is-broken {
      display:
        none;
    }


    /*
     * Image + text composition.
     */
    .ready-screen-visual-with-text {
      width:
        min(
          100%,
          1160px
        );

      display:
        grid;

      grid-template-columns:
        minmax(
          0,
          1.05fr
        )
        minmax(
          280px,
          0.95fr
        );

      align-items:
        center;

      gap:
        clamp(
          22px,
          3vw,
          50px
        );

      justify-self:
        center;
    }


    .ready-screen-visual-with-text
    .ready-screen-image-grid {
      width:
        100%;
    }


    .ready-screen-visual-copy {
      min-width:
        0;

      display:
        grid;

      gap:
        clamp(
          12px,
          1.5vw,
          22px
        );

      align-content:
        center;
    }


    .ready-screen-visual-copy
    .ready-screen-line {
      font-size:
        clamp(
          28px,
          3.4vw,
          60px
        );
    }


    .ready-screen-image-help {
      display:
        block;

      margin-top:
        5px;

      color:
        #64748b;

      font-size:
        11px;

      line-height:
        1.4;

      font-weight:
        800;
    }


    @media (
      max-width:
      850px
    ) {
      .ready-screen-visual-with-text {
        grid-template-columns:
          1fr;
      }


      .ready-screen-image-grid[data-count="3"],
      .ready-screen-image-grid[data-count="5"],
      .ready-screen-image-grid[data-count="6"] {
        grid-template-columns:
          repeat(
            2,
            minmax(
              0,
              1fr
            )
          );
      }
    }


    @media (
      max-width:
      560px
    ) {
      .ready-screen-image-grid[data-count] {
        width:
          100%;

        grid-template-columns:
          1fr;
      }
    }


    .ready-screen-footer {
      justify-self: center;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      max-width: min(100%, 960px);
      min-height: clamp(42px, 4vw, 66px);
      padding: clamp(10px, 1.2vw, 16px) clamp(18px, 2vw, 30px);
      border-radius: 999px;
      color: inherit;
      background: rgba(255, 255, 255, 0.54);
      border: 1px solid rgba(255, 255, 255, 0.50);
      backdrop-filter: blur(6px);
      font-size: clamp(20px, 2.1vw, 38px);
      line-height: 1.15;
      font-weight: 950;
      overflow-wrap: anywhere;
      -webkit-text-stroke: 0.8px rgba(15, 23, 42, 0.25);
      paint-order: stroke fill;
      text-shadow:
        0 2px 0 rgba(15, 23, 42, 0.12),
        0 6px 18px rgba(15, 23, 42, 0.22);
      box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    }

    /* =========================================================
       ALPHABET & NUMBERS LEARNING DISPLAY
       Compact classroom reference layout.
       ========================================================= */

    .ready-screen-display:has(.learning-reference-display) {
      padding: clamp(12px, 1.8vw, 26px);
    }

    /*
      Keep the chalk texture, but reduce the large decorative
      shapes so contrast stays consistent behind every character.
    */
    .ready-screen-display:has(.learning-reference-display)::before,
    .ready-screen-display:has(.learning-reference-display)::after {
      opacity: 0.09;
    }

    .learning-reference-display {
      width: min(100%, 1280px);
      height: 100%;
      min-height: 0;
      margin: 0 auto;

      display: grid;
      grid-template-rows:
        auto
        auto
        auto;

      align-content: center;
      gap: 0;
      padding: clamp(10px, 1.2vw, 18px);

      color: #f8fafc;
    }

    .learning-reference-section {
      min-width: 0;
      min-height: 0;
      display: grid;
      align-items: stretch;
    }

    /*
      Numbers remain at the top as one compact reference strip.
    */
    .learning-reference-number-section {
      padding: clamp(6px, 0.7vw, 10px);
      border: 1px solid rgba(255, 255, 255, 0.11);
      border-radius: 18px;
      background: rgba(15, 23, 42, 0.20);
    }

    .learning-reference-number-section +
    .learning-reference-alphabet-section {
      margin-top: clamp(22px, 3vh, 38px);
    }

    .learning-reference-number-grid {
      min-width: 0;
      display: grid;
      grid-template-columns:
        repeat(10, minmax(0, 1fr));
      gap: clamp(4px, 0.5vw, 8px);
    }

    /*
      Uppercase and lowercase remain paired in two rows of 13.
    */
    .learning-reference-alphabet-section {
      padding: clamp(7px, 0.8vw, 12px);
      border: 1px solid rgba(255, 255, 255, 0.11);
      border-radius: 18px;
      background: rgba(15, 23, 42, 0.20);
    }

    .learning-reference-alphabet-grid {
      min-width: 0;
      min-height: 0;

      display: grid;
      grid-template-columns:
        repeat(13, minmax(0, 1fr));
      grid-template-rows:
        repeat(2, auto);

      gap:
        clamp(8px, 1vh, 12px)
        clamp(4px, 0.48vw, 8px);

      align-content: center;
    }

    /*
      Items behave like a classroom reference strip rather than
      a collection of large app buttons.
    */
    .learning-reference-item {
      min-width: 0;
      min-height: 0;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: clamp(8px, 0.75vw, 12px);

      background:
        linear-gradient(
          145deg,
          rgba(255, 255, 255, 0.075),
          rgba(255, 255, 255, 0.025)
        );

      color: #ffffff;
      cursor: pointer;
      box-shadow: none;

      transition:
        transform 0.14s ease,
        border-color 0.14s ease,
        background 0.14s ease,
        box-shadow 0.14s ease;
    }

    .learning-reference-item:hover,
    .learning-reference-item:focus-visible {
      border-color: #86efac;
      background: rgba(95, 220, 154, 0.13);
      box-shadow:
        0 0 0 3px rgba(134, 239, 172, 0.10);
      transform: translateY(-1px);
      outline: none;
    }

    .learning-reference-item.selected {
      border-color: #86efac;
      background: #dcfce7;
      color: #14532d;

      box-shadow:
        0 0 0 4px rgba(134, 239, 172, 0.18),
        0 8px 18px rgba(2, 6, 23, 0.20);

      transform: translateY(-1px) scale(1.018);
    }

    .learning-reference-number {
      height: clamp(88px, 12vh, 126px);
      min-height: 0;

      display: grid;
      grid-template-rows:
        minmax(0, 1fr)
        auto;
      place-items: center;

      padding: clamp(5px, 0.55vw, 8px);
    }

    .learning-reference-number strong {
      font-size: clamp(25px, 2.75vw, 48px);
      line-height: 0.92;
      font-weight: 950;
    }

    .learning-reference-number span {
      margin-top: 3px;
      font-size: clamp(8px, 0.76vw, 12px);
      line-height: 1;
      font-weight: 900;
      text-transform: lowercase;
    }

    .learning-reference-letter {
      height: clamp(96px, 13.5vh, 132px);
      min-height: 0;

      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows:
        minmax(0, 1fr)
        auto;
      place-items: center;

      padding: clamp(4px, 0.45vw, 7px);
    }

    .learning-reference-letter strong {
      font-size: clamp(24px, 2.35vw, 41px);
      line-height: 0.92;
      font-weight: 950;
    }

    .learning-reference-letter span {
      margin-top: 3px;
      font-size: clamp(16px, 1.5vw, 26px);
      line-height: 0.9;
      font-weight: 850;
    }

    .learning-reference-display.show-vowels
    .learning-reference-letter.vowel:not(.selected) {
      border-color: #93c5fd;
      background: #dbeafe;
      color: #1e3a8a;

      box-shadow:
        0 0 0 3px rgba(147, 197, 253, 0.16);
    }

    /*
      Hidden items retain their position so the sequence remains
      visible. Clicking the blank tile reveals it again.
    */
    .learning-reference-item.hidden-item {
      position: relative;
      border-style: dashed;
      border-color: rgba(255, 255, 255, 0.34);
      background: rgba(15, 23, 42, 0.34);
      color: transparent;
      text-shadow: none;
    }

    .learning-reference-item.hidden-item strong,
    .learning-reference-item.hidden-item span {
      visibility: hidden;
    }

    .learning-reference-item.hidden-item::after {
      content: "?";
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      color: rgba(255, 255, 255, 0.56);
      font-size: clamp(22px, 2.6vw, 42px);
      line-height: 1;
      font-weight: 950;
    }

    /*
      Focus mode preserves the full sequence while making chosen
      items clearly dominant.
    */
    .learning-reference-display.focus-selected-mode
    .learning-reference-item.focus-muted {
      opacity: 0.13;
      filter: grayscale(1);
      transform: scale(0.96);
    }

    .learning-reference-display.focus-selected-mode
    .learning-reference-item.selected {
      opacity: 1;
      filter: none;
    }

    /*
      Show Range fades values outside the selected interval.
    */
    .learning-reference-item.range-muted {
      opacity: 0.12;
      filter: grayscale(1);
      pointer-events: none;
    }

    /*
      Number words can be hidden without changing tile height.
    */
    .learning-reference-display.hide-number-words
    .learning-reference-number span {
      visibility: hidden;
    }

    /*
      Match Case initially conceals lowercase letters. Clicking an
      uppercase tile reveals only its matching lowercase partner.
    */
    .learning-reference-display.match-case-mode
    .learning-reference-letter span {
      visibility: hidden;
    }

    .learning-reference-display.match-case-mode
    .learning-reference-letter.case-matched span {
      visibility: visible;
      color: #bbf7d0;
    }

    .learning-reference-display.match-case-mode
    .learning-reference-letter.case-matched {
      border-color: #86efac;
      background: rgba(34, 197, 94, 0.18);
      box-shadow:
        0 0 0 4px rgba(134, 239, 172, 0.16);
    }

    .learning-reference-controls {
      min-height: 32px;
      margin-top: clamp(12px, 1.5vh, 18px);

      display: grid;
      justify-items: center;
      gap: 7px;
    }

    .learning-reference-control-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      flex-wrap: wrap;
    }

    .learning-reference-secondary-controls {
      display: none;
    }

    .learning-reference-controls.show-more
    .learning-reference-secondary-controls {
      display: flex;
    }

    .learning-reference-control,
    .learning-reference-scope-select {
      min-height: 32px;
      padding: 6px 12px;

      border: 1px solid rgba(255, 255, 255, 0.24);
      border-radius: 999px;

      background: rgba(15, 23, 42, 0.30);
      color: #ffffff;

      font-size: 10.5px;
      line-height: 1;
      font-weight: 950;

      cursor: pointer;
      backdrop-filter: blur(5px);
    }

    .learning-reference-scope-select {
      padding-right: 28px;
      color-scheme: dark;
    }

    .learning-reference-control:hover,
    .learning-reference-control:focus-visible,
    .learning-reference-control.active,
    .learning-reference-scope-select:hover,
    .learning-reference-scope-select:focus-visible {
      border-color: #86efac;
      background: #dcfce7;
      color: #14532d;
      outline: none;
    }

    .learning-reference-primary-control {
      border-color: #86efac;
      background: #dcfce7;
      color: #14532d;
    }

    .learning-reference-status {
      min-height: 16px;
      color: rgba(255, 255, 255, 0.72);
      font-size: 9.5px;
      line-height: 1.2;
      font-weight: 850;
      text-align: center;
    }

    .learning-reference-scope-wrap {
      display: inline-flex;
      position: relative;
    }

    .learning-reference-visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .learning-reference-tooltip {
      position: relative;
    }

    .learning-reference-tooltip::before,
    .learning-reference-tooltip::after {
      position: absolute;
      z-index: 260;
      left: 50%;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition:
        opacity 0.14s ease,
        transform 0.14s ease,
        visibility 0.14s ease;
    }

    .learning-reference-tooltip::before {
      content: attr(data-tooltip);
      bottom: calc(100% + 11px);
      width: max-content;
      max-width: min(290px, 70vw);
      padding: 9px 11px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 10px;
      background: #0f172a;
      color: #ffffff;
      box-shadow: 0 10px 24px rgba(2, 6, 23, 0.28);
      font-size: 11px;
      line-height: 1.35;
      font-weight: 850;
      text-align: center;
      white-space: normal;
      transform: translate(-50%, 5px);
    }

    .learning-reference-tooltip::after {
      content: "";
      bottom: calc(100% + 5px);
      border: 6px solid transparent;
      border-top-color: #0f172a;
      transform: translate(-50%, 5px);
    }

    .learning-reference-tooltip:hover::before,
    .learning-reference-tooltip:hover::after {
      opacity: 1;
      visibility: visible;
      transform: translate(-50%, 0);
    }

    @media (hover: none) {
      .learning-reference-tooltip::before,
      .learning-reference-tooltip::after {
        display: none;
      }
    }


        .learning-reference-secondary-controls {
      display: flex;
    }
    /*
      Focus and projector modes enlarge the display enough for
      distance reading without recreating the oversized layout.
    */
    body.focus-mode
    .learning-reference-display,
    body.fullscreen-active
    .learning-reference-display,
    body.projector-mode
    .learning-reference-display {
      width: min(100%, 1380px);
      height: 100%;
      min-height: 0;

      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;

      align-content: stretch;
      padding:
        clamp(18px, 2.4vh, 30px)
        clamp(18px, 1.8vw, 28px)
        clamp(16px, 2vh, 24px);

      gap: 0;
    }

    body.focus-mode
    .learning-reference-number-section,
    body.fullscreen-active
    .learning-reference-number-section,
    body.projector-mode
    .learning-reference-number-section {
      align-self: start;
      margin: 0;
    }

    body.focus-mode
    .learning-reference-number-section +
    .learning-reference-alphabet-section,
    body.fullscreen-active
    .learning-reference-number-section +
    .learning-reference-alphabet-section,
    body.projector-mode
    .learning-reference-number-section +
    .learning-reference-alphabet-section {
      align-self: end;
      margin-top: clamp(24px, 4vh, 48px);
    }

    body.focus-mode
    .learning-reference-controls,
    body.fullscreen-active
    .learning-reference-controls,
    body.projector-mode
    .learning-reference-controls {
      align-self: end;
      margin-top: clamp(12px, 1.6vh, 18px);
    }

    body.focus-mode
    .learning-reference-number,
    body.fullscreen-active
    .learning-reference-number,
    body.projector-mode
    .learning-reference-number {
      height: clamp(100px, 14vh, 142px);
      min-height: 0;
    }

    body.focus-mode
    .learning-reference-number strong,
    body.fullscreen-active
    .learning-reference-number strong,
    body.projector-mode
    .learning-reference-number strong {
      font-size: clamp(31px, 3.3vw, 57px);
    }

    body.focus-mode
    .learning-reference-number span,
    body.fullscreen-active
    .learning-reference-number span,
    body.projector-mode
    .learning-reference-number span {
      font-size: clamp(9px, 0.88vw, 14px);
    }

    body.focus-mode
    .learning-reference-letter,
    body.fullscreen-active
    .learning-reference-letter,
    body.projector-mode
    .learning-reference-letter {
      height: clamp(108px, 15vh, 148px);
      min-height: 0;
    }

    body.focus-mode
    .learning-reference-letter strong,
    body.fullscreen-active
    .learning-reference-letter strong,
    body.projector-mode
    .learning-reference-letter strong {
      font-size: clamp(29px, 2.85vw, 49px);
    }

    body.focus-mode
    .learning-reference-letter span,
    body.fullscreen-active
    .learning-reference-letter span,
    body.projector-mode
    .learning-reference-letter span {
      font-size: clamp(19px, 1.8vw, 30px);
    }

    body.focus-mode
    .learning-reference-control,
    body.focus-mode
    .learning-reference-scope-select,
    body.fullscreen-active
    .learning-reference-control,
    body.fullscreen-active
    .learning-reference-scope-select,
    body.projector-mode
    .learning-reference-control,
    body.projector-mode
    .learning-reference-scope-select {
      min-height: 32px;
      padding: 6px 11px;
      font-size: 10px;
    }

    body.focus-mode
    .learning-reference-controls,
    body.fullscreen-active
    .learning-reference-controls,
    body.projector-mode
    .learning-reference-controls {
      margin-top: 10px;
      gap: 5px;
    }

    body.focus-mode
    .learning-reference-control-row,
    body.fullscreen-active
    .learning-reference-control-row,
    body.projector-mode
    .learning-reference-control-row {
      gap: 5px;
    }

    body.focus-mode
    .learning-reference-status,
    body.fullscreen-active
    .learning-reference-status,
    body.projector-mode
    .learning-reference-status {
      font-size: 9px;
    }

    @media (max-width: 900px) {
      .learning-reference-display {
        grid-template-rows:
          auto
          auto
          auto;
        align-content: start;
        overflow-y: auto;
      }

      .learning-reference-number-grid {
        grid-template-columns:
          repeat(5, minmax(0, 1fr));
      }

      .learning-reference-alphabet-grid {
        grid-template-columns:
          repeat(7, minmax(0, 1fr));
        grid-template-rows: none;
      }

      .learning-reference-number,
      .learning-reference-letter {
        min-height: 76px;
      }
    }

    .ready-screen-display.screen-sunrise {
      background:
        radial-gradient(circle at 16% 18%, #ffffff 0 7%, transparent 8%),
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.75), transparent 18%),
        repeating-linear-gradient(22deg, rgba(255, 255, 255, 0.16) 0 12px, transparent 12px 36px),
        linear-gradient(135deg, #ffe082, #ffb86b 46%, #f97316);
      color: #3b241f;
    }

    .ready-screen-display.screen-sunny {
      background:
        radial-gradient(circle at 14% 18%, #ffffff 0 8%, transparent 9%),
        radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.78), transparent 22%),
        repeating-radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.22) 0 4px, transparent 5px 28px),
        linear-gradient(135deg, #fef3c7, #fbbf24 50%, #fb923c);
      color: #3b241f;
    }

    .ready-screen-display.screen-planner {
      background:
        linear-gradient(rgba(255, 255, 255, 0.24) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.24) 2px, transparent 2px),
        linear-gradient(135deg, #dbeafe, #e0f2fe 44%, #bae6fd);
      background-size: 52px 52px, 52px 52px, auto;
      color: #0f3b57;
    }

    .ready-screen-display.screen-zap {
      background:
        linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.35) 38% 45%, transparent 45%),
        linear-gradient(135deg, #fef08a, #fb923c 52%, #ef4444);
      color: #3b241f;
    }

    .ready-screen-display.screen-question {
      background:
        radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.55), transparent 18%),
        radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.38), transparent 18%),
        linear-gradient(135deg, #c4b5fd, #a78bfa 45%, #7c3aed);
      color: #ffffff;
    }

    .ready-screen-display.screen-question .ready-screen-footer,
    .ready-screen-display.screen-focus .ready-screen-footer,
    .ready-screen-display.screen-exam .ready-screen-footer,
    .ready-screen-display.screen-chalk .ready-screen-footer {
      background: rgba(255, 255, 255, 0.16);
      border-color: rgba(255, 255, 255, 0.25);
    }

    .ready-screen-display.screen-bell {
      background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.58), transparent 18%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.17) 0 10px, transparent 10px 24px),
        linear-gradient(135deg, #fde68a, #facc15 48%, #eab308);
      color: #3b241f;
    }

    .ready-screen-display.screen-welcome {
      background:
        radial-gradient(circle at 20% 22%, rgba(255, 255, 255, 0.65), transparent 18%),
        radial-gradient(circle at 80% 28%, rgba(255, 255, 255, 0.35), transparent 18%),
        linear-gradient(135deg, #bbf7d0, #86efac 44%, #22c55e);
      color: #143f3a;
    }

    .ready-screen-display.screen-firstday {
      background:
        radial-gradient(circle at 12% 20%, #ffffff 0 10px, transparent 11px),
        radial-gradient(circle at 84% 18%, #ffffff 0 8px, transparent 9px),
        radial-gradient(circle at 76% 78%, #ffffff 0 12px, transparent 13px),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 12px, transparent 12px 28px),
        linear-gradient(135deg, #f9a8d4, #a78bfa 48%, #60a5fa);
      color: #ffffff;
    }

    .ready-screen-display.screen-calm {
      background:
        radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.45), transparent 16%),
        radial-gradient(circle at 76% 72%, rgba(255, 255, 255, 0.30), transparent 19%),
        linear-gradient(135deg, #bfdbfe, #c4b5fd 48%, #ddd6fe);
      color: #1e3a8a;
    }

    .ready-screen-display.screen-focus {
      background:
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.18), transparent 24%),
        radial-gradient(circle at 50% 48%, rgba(34, 197, 94, 0.24), transparent 42%),
        linear-gradient(135deg, #0f172a, #143f3a);
      color: #ffffff;
    }

    .ready-screen-display.screen-transition {
      background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.20) 0 16px, transparent 16px 34px),
        linear-gradient(135deg, #93c5fd, #38bdf8 48%, #06b6d4);
      color: #083344;
    }

    .ready-screen-display.screen-reading {
      background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.42) 50%, transparent 50%),
        linear-gradient(rgba(120, 53, 15, 0.08) 2px, transparent 2px),
        linear-gradient(135deg, #ffedd5, #fed7aa 45%, #fdba74);
      background-size: 120px 100%, 100% 42px, auto;
      color: #78350f;
    }

    .ready-screen-display.screen-writing {
      background:
        repeating-linear-gradient(0deg, rgba(30, 64, 175, 0.16) 0 2px, transparent 2px 42px),
        linear-gradient(90deg, rgba(239, 68, 68, 0.24) 0 4px, transparent 4px),
        linear-gradient(135deg, #eff6ff, #dbeafe);
      color: #1e3a8a;
    }

    .ready-screen-display.screen-exam {
      background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.16), transparent 28%),
        linear-gradient(135deg, #111827, #1e293b);
      color: #ffffff;
    }

    .ready-screen-display.screen-celebrate {
      background:
        radial-gradient(circle at 12% 18%, #ffffff 0 8px, transparent 9px),
        radial-gradient(circle at 28% 78%, #ffffff 0 6px, transparent 7px),
        radial-gradient(circle at 76% 22%, #ffffff 0 10px, transparent 11px),
        radial-gradient(circle at 88% 70%, #ffffff 0 7px, transparent 8px),
        repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.15) 0 10px, transparent 10px 24px),
        linear-gradient(135deg, #f472b6, #fb7185 45%, #f97316);
      color: #ffffff;
    }

    .ready-screen-display.screen-trip {
      background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0 14%, transparent 14% 100%),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.42), transparent 18%),
        linear-gradient(135deg, #a7f3d0, #67e8f9 50%, #60a5fa);
      color: #064e3b;
    }

    .ready-screen-display.screen-seasonal {
      background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.58), transparent 16%),
        radial-gradient(circle at 82% 70%, rgba(255, 255, 255, 0.34), transparent 18%),
        linear-gradient(135deg, #dcfce7, #bbf7d0 44%, #86efac);
      color: #14532d;
    }

    .ready-screen-display.screen-winter {
      background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.80), transparent 16%),
        radial-gradient(circle at 82% 30%, rgba(255, 255, 255, 0.52), transparent 16%),
        repeating-radial-gradient(circle at 70% 70%, rgba(255,255,255,0.42) 0 2px, transparent 3px 22px),
        linear-gradient(135deg, #dbeafe, #bfdbfe 46%, #93c5fd);
      color: #1e3a8a;
    }

    .ready-screen-display.screen-christmas {
      background:
        radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.72), transparent 15%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 12px, transparent 12px 28px),
        linear-gradient(135deg, #166534, #15803d 46%, #b91c1c);
      color: #ffffff;
    }

    .ready-screen-display.screen-summer {
      background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.78), transparent 17%),
        radial-gradient(circle at 80% 74%, rgba(255, 255, 255, 0.36), transparent 18%),
        linear-gradient(135deg, #fde68a, #67e8f9 48%, #38bdf8);
      color: #0f3b57;
    }

    .ready-screen-display.screen-chalk {
      background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 32%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 14px),
        linear-gradient(135deg, #1f2937, #111827);
      color: #fefce8;
      border: 8px solid #7c5a3a;
    }

    .ready-bank-tools {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 190px;
      gap: 10px;
      margin-bottom: 14px;
    }

    .ready-bank-tools input,
    .ready-bank-tools select,
    .ready-edit-grid input,
    .ready-edit-grid textarea,
    .ready-edit-grid select {
      width: 100%;
      border: 1px solid #d1d5db;
      border-radius: 13px;
      padding: 11px 12px;
      background: #ffffff;
      font-size: 14px;
      font-weight: 850;
    }

    .ready-bank-pinned {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 14px;
      padding: 12px;
      border: 1px solid #d9fbe8;
      border-radius: 18px;
      background: #f1fdf6;
    }

    .ready-bank-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
      gap: 10px;
    }

    .ready-bank-card {
      display: grid;
      gap: 8px;
      min-height: 150px;
      padding: 13px;
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      background: #ffffff;
      box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
    }

    .ready-bank-card.suggested {
      border-color: #86efac;
      background: #f1fdf6;
    }

    .ready-bank-card-title {
      color: #111827;
      font-size: 15px;
      font-weight: 950;
      line-height: 1.15;
    }

    .ready-bank-card-preview {
      color: #64748b;
      font-size: 12px;
      font-weight: 850;
      line-height: 1.3;
    }

    .ready-bank-card-actions {
      display: flex;
      gap: 7px;
      flex-wrap: wrap;
      margin-top: auto;
    }

    .ready-edit-grid {
      display: grid;
      gap: 11px;
    }

    .ready-expectations-editor {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid #d9fbe8;
      border-radius: 18px;
      background: #f1fdf6;
    }

    .ready-expectations-editor-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      color: #143f3a;
      font-size: 13px;
      font-weight: 950;
    }

    .ready-expectations-editor-note {
      color: #64748b;
      font-size: 12px;
      font-weight: 850;
      line-height: 1.35;
    }

    .ready-expectations-edit-list {
      display: grid;
      gap: 9px;
    }

    .ready-expectation-edit-row {
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1.2fr) auto;
      gap: 8px;
      align-items: center;
      padding: 10px;
      border: 1px solid #d9fbe8;
      border-radius: 16px;
      background: #ffffff;
    }

    .ready-expectation-edit-row input {
      width: 100%;
      border: 1px solid #d1d5db;
      border-radius: 12px;
      padding: 9px 10px;
      background: #ffffff;
      font-size: 13px;
      font-weight: 850;
    }

    .ready-expectation-edit-remove {
      min-height: 34px;
      padding: 7px 10px;
      border-radius: 999px;
      border: 1px solid #fecaca;
      background: #fff7f7;
      color: #991b1b;
      font-size: 11px;
      font-weight: 950;
      cursor: pointer;
      white-space: nowrap;
    }

    .ready-expectation-add-row {
      display: flex;
      justify-content: flex-start;
    }

    @media (max-width: 760px) {
      .ready-expectation-edit-row {
        grid-template-columns: 1fr;
      }
    }

    body[data-stage="readyScreen"] .left-rail,
    body[data-stage="readyScreen"] .right-rail {
      display: none !important;
    }

    body[data-stage="readyScreen"] .board-shell {
      grid-template-columns: 1fr !important;
      gap: 0 !important;
    }

    body[data-stage="readyScreen"] .stage-card {
      grid-template-rows: 1fr !important;
      padding: 12px !important;
    }

    body[data-stage="readyScreen"] .stage-top {
      display: none !important;
    }

    body[data-stage="readyScreen"] .stage-body {
      height: 100% !important;
      overflow: hidden !important;
    }

    body[data-stage="today"] .today-view-shell {
  grid-template-rows:
    auto
    auto
    auto
    minmax(0, 1fr)
    auto !important;
}

body[data-stage="today"] .today-ready-section {
  height: auto !important;
  min-height: 44px !important;
  align-self: stretch !important;
}

    /* =========================================================
       IPAD — DAILY CONTENT + CLASS SCREENS
       ONE HORIZONTAL SWIPE ROW
       ========================================================= */
    @media (
      min-width: 701px
    ) and (
      max-width: 1220px
    ) {
      body[data-stage="today"]
      .today-ready-section {
        width: 100% !important;

        min-height: 58px !important;

        display: flex !important;
        align-items: center !important;

        gap: 10px !important;

        padding:
          8px
          10px !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        flex-wrap: nowrap !important;

        scrollbar-width: none !important;

        -webkit-overflow-scrolling: touch;
      }

      body[data-stage="today"]
      .today-ready-section::-webkit-scrollbar {
        display: none !important;
      }

      body[data-stage="today"]
      .today-ready-section
      > div:first-child {
        flex: 0 0 auto !important;

        min-width: max-content !important;
      }

      body[data-stage="today"]
      .today-daily-content-card {
        flex: 0 0 auto !important;

        width: auto !important;
        min-width: max-content !important;

        white-space: nowrap !important;
      }

      body[data-stage="today"]
      .today-daily-content-copy,
      body[data-stage="today"]
      .today-daily-content-actions {
        flex: 0 0 auto !important;

        white-space: nowrap !important;
      }

      body[data-stage="today"]
      .today-ready-screens-group {
        flex: 0 0 auto !important;

        width: auto !important;
        min-width: max-content !important;

        margin-left: 0 !important;

        display: flex !important;
        align-items: center !important;

        gap: 8px !important;

        white-space: nowrap !important;
      }

      body[data-stage="today"]
      .today-ready-title {
        flex: 0 0 auto !important;

        margin: 0 !important;

        white-space: nowrap !important;
      }

      body[data-stage="today"]
      .today-ready-grid {
        flex: 0 0 auto !important;

        width: auto !important;
        min-width: max-content !important;

        display: flex !important;
        align-items: center !important;

        gap: 7px !important;

        overflow: visible !important;
      }

      body[data-stage="today"]
      .today-ready-screen-option {
        flex:
          0
          0
          150px !important;

        width: 150px !important;

        min-width: 150px !important;
        max-width: 150px !important;
      }

      body[data-stage="today"]
      .today-ready-button {
        width: 100% !important;

        min-width: 0 !important;

        white-space: nowrap !important;
      }

      body[data-stage="today"]
      .today-ready-choose-button {
        flex: 0 0 auto !important;
      }
    }


    /* =========================================================
       PHONE
       ========================================================= */
    @media (max-width: 700px) {
      .today-ready-section {
        grid-template-columns: 1fr auto;
        gap: 9px;
      }

      .today-ready-title {
        grid-column: 1 / 2;
      }

      .today-ready-grid {
        grid-column: 1 / -1;
        order: 3;

        display: grid;

        grid-template-columns:
          repeat(
            2,
            minmax(
              138px,
              1fr
            )
          );

        overflow: visible;
      }

      .today-ready-button {
        max-width: none;
        width: 100%;
        flex: none;
      }

      .today-ready-choose {
        grid-column: 1 / -1;
      }

      .ready-bank-tools,
      .ready-bank-pinned {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 560px) {
      .today-ready-section {
        grid-template-columns: 1fr;
      }

      .today-ready-grid {
        grid-template-columns: 1fr;
      }

      .today-ready-button {
        border-radius: 16px;
      }

      .today-ready-manage {
        width: 100%;
      }
    }

    .video-box {
      background: #111827;
      color: #e5e7eb;
      border-radius: 14px;
      min-height: 100px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 12px;
      font-size: 13px;
      line-height: 1.4;
      cursor: pointer;
    }

    /* =========================================================
       8. INTERACTIVE WIDGET STYLES
       ========================================================= */

    /* =========================================================
   RANDOM NUMBER GENERATOR
   Projector-friendly number generation for place value,
   rounding, mental maths and classroom activities.
   ========================================================= */

   .teacher-contributor-credit {
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 7px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: 0;
}

.teacher-contributor-credit strong {
  color: #14532d;
  font-weight: 950;
}

.teacher-contributor-credit-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 999px;
  background: #dcfce7;
  font-size: 12px;
}

@media (max-width: 560px) {
  .teacher-contributor-credit {
    width: 100%;
    border-radius: 12px;
    align-items: flex-start;
  }
}

.random-number-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto;
  gap: 12px;
}

.random-number-toolbar {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid #d9fbe8;
  border-radius: 18px;
  background: #ffffff;
}

.random-number-settings {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.random-number-mode-tabs {
  width: fit-content;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: #f1f5f9;
}

.random-number-mode-tab {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.random-number-mode-tab:hover {
  background: rgba(255, 255, 255, 0.72);
  color: #143f3a;
}

.random-number-mode-tab.active {
  border-color: #86efac;
  background: #ffffff;
  color: #166534;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.06);
}

.random-number-digits {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.random-number-digit-button {
  min-width: 62px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: #143f3a;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.random-number-digit-button:hover {
  border-color: #86efac;
  background: #f1fdf6;
}

.random-number-digit-button.active {
  border-color: #22c55e;
  background: #dcfce7;
  color: #14532d;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.14);
}

.random-number-range-fields {
  display: grid;
  grid-template-columns:
    minmax(130px, 180px)
    minmax(130px, 180px);
  gap: 9px;
}

.random-number-field {
  display: grid;
  gap: 5px;
}

.random-number-field label {
  color: #475569;
  font-size: 11px;
  font-weight: 950;
}

.random-number-field input,
.random-number-field select {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  outline: none;
}

.random-number-field input:focus,
.random-number-field select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.random-number-secondary-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.random-number-check {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.random-number-check input {
  width: 17px;
  height: 17px;
  accent-color: #22c55e;
}

.random-number-help {
  align-self: center;
  max-width: 265px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 850;
}

.random-number-credit {
  display: block;
  margin-top: 5px;
  color: #159957;
  font-size: 10px;
  font-weight: 900;
}

.random-number-display-card {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 15px;
  padding: clamp(22px, 4vw, 56px);
  border: 1px solid #d9fbe8;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(95, 220, 154, 0.23),
      transparent 28%
    ),
    radial-gradient(
      circle at 88% 84%,
      rgba(147, 197, 253, 0.20),
      transparent 27%
    ),
    linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.random-number-display-card::before {
  content: "123";
  position: absolute;
  right: -24px;
  bottom: -42px;
  color: rgba(20, 63, 58, 0.045);
  font-size: clamp(160px, 22vw, 340px);
  line-height: 1;
  font-weight: 950;
  pointer-events: none;
}

.random-number-results {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns:
    repeat(
      var(--random-number-columns, 1),
      minmax(0, 1fr)
    );
  gap: clamp(12px, 2vw, 24px);
  align-items: center;
  justify-items: center;
}

.random-number-result {
  width: 100%;
  min-width: 0;
  color: #143f3a;
  font-size: clamp(78px, 11vw, 190px);
  line-height: 0.9;
  font-weight: 950;
  letter-spacing: clamp(-7px, -0.35vw, -2px);
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 3px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(20, 63, 58, 0.10);
}

.random-number-results.multiple
.random-number-result {
  font-size: clamp(48px, 7vw, 110px);
  letter-spacing: -3px;
}

.random-number-result.rolling {
  animation: randomNumberRoll 0.12s linear infinite;
}

.random-number-placeholder {
  color: #64748b;
  font-size: clamp(34px, 4vw, 62px);
  line-height: 1;
  font-weight: 950;
  text-align: center;
}

.random-number-expanded {
  position: relative;
  z-index: 1;
  color: #475569;
  font-size: clamp(18px, 2vw, 30px);
  line-height: 1.25;
  font-weight: 900;
  text-align: center;
}

.random-number-message {
  position: relative;
  z-index: 1;
  min-height: 20px;
  color: #b45309;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}

.random-number-bottom {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 12px;
  align-items: center;
}

.random-number-history-wrap {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.random-number-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
  font-size: 11px;
  font-weight: 950;
}

.random-number-clear {
  border: 0;
  background: transparent;
  color: #159957;
  padding: 2px;
  font-size: 10px;
  font-weight: 950;
  cursor: pointer;
}

.random-number-clear:hover {
  text-decoration: underline;
}

.random-number-history {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.random-number-history::-webkit-scrollbar {
  display: none;
}

.random-number-history-item {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid #d9fbe8;
  border-radius: 999px;
  background: #f1fdf6;
  color: #143f3a;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.random-number-generate {
  min-width: 190px;
  min-height: 48px;
  padding: 11px 22px;
  border: 0;
  border-radius: 15px;
  background: #5fdc9a;
  color: #143f3a;
  box-shadow:
    0 9px 18px rgba(34, 197, 94, 0.20),
    inset 0 -3px 0 rgba(20, 63, 58, 0.12);
  font-size: 16px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

.random-number-generate:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.random-number-generate:active {
  transform: scale(0.97);
}

.random-number-generate:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

@keyframes randomNumberRoll {
  0% {
    transform: translateY(-2px) scale(0.99);
    opacity: 0.78;
  }

  50% {
    transform: translateY(2px) scale(1.025);
    opacity: 1;
  }

  100% {
    transform: translateY(-2px) scale(0.99);
    opacity: 0.78;
  }
}

body.focus-mode[data-stage="randomNumber"]
.stage-card,
body.fullscreen-active[data-stage="randomNumber"]
.stage-card {
  padding: 10px;
}

body.focus-mode[data-stage="randomNumber"]
.random-number-toolbar,
body.fullscreen-active[data-stage="randomNumber"]
.random-number-toolbar {
  padding: 9px 11px;
}

body.focus-mode[data-stage="randomNumber"]
.random-number-result,
body.fullscreen-active[data-stage="randomNumber"]
.random-number-result {
  font-size: clamp(120px, 17vw, 290px);
}

body.focus-mode[data-stage="randomNumber"]
.random-number-results.multiple
.random-number-result,
body.fullscreen-active[data-stage="randomNumber"]
.random-number-results.multiple
.random-number-result {
  font-size: clamp(70px, 10vw, 170px);
}

@media (max-width: 760px) {
  .random-number-toolbar,
  .random-number-bottom {
    grid-template-columns: 1fr;
  }

  .random-number-help {
    max-width: none;
  }

  .random-number-range-fields {
    grid-template-columns: 1fr 1fr;
  }

  .random-number-generate {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .random-number-range-fields {
    grid-template-columns: 1fr;
  }

  .random-number-result {
    font-size: clamp(58px, 20vw, 100px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .random-number-result.rolling {
    animation: none;
  }
}


/* Projector-Optimized 3D Polyhedral Layout Engine */
.dice-arena-floor {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 24px;
      width: 100%;
      height: auto;
      perspective: 1400px;
    }

    body.focus-mode .dice-arena-floor,
    body.fullscreen-active .dice-arena-floor {
      gap: 48px; 
    }

    .cube-3d-die {
      --die-size: min(150px, 22vh); /* Upscaled default size to fill the empty space beautifully */
      width: var(--die-size) !important;
      height: var(--die-size) !important;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.65s cubic-bezier(0.2, 1.55, 0.4, 1.1);
    }

    /* Keeps full screen/focus mode massively dominant for projector walls */
    body.focus-mode .cube-3d-die,
    body.fullscreen-active .cube-3d-die {
      --die-size: min(260px, 36vh) !important; 
    }

    .face-3d-die {
  position: absolute;
  width: 100%;
  height: 100%;

  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.28) 18%, transparent 36%),
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--board-accent) 28%, #ffffff),
      color-mix(in srgb, var(--board-accent) 10%, #ffffff) 48%,
      #ffffff
    );

  border: 6px solid var(--board-ink);
  border-radius: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: calc(var(--die-size) * 0.46) !important;
  font-weight: 950;
  color: var(--board-ink);

  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.48),
    0 8px 18px color-mix(in srgb, var(--board-ink) 18%, transparent);

  box-shadow:
    inset 0 12px 20px rgba(255, 255, 255, 0.72),
    inset 0 -18px 28px color-mix(in srgb, var(--board-ink) 16%, transparent),
    0 18px 34px rgba(15, 23, 42, 0.16),
    0 0 0 8px color-mix(in srgb, var(--board-accent) 16%, transparent);

  user-select: none;
}

.cube-3d-die::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 28px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--board-accent) 34%, transparent), transparent 68%);
  filter: blur(6px);
  opacity: 0.72;
  transform: translateZ(-18px);
  pointer-events: none;
}

    body.focus-mode .face-3d-die,
    body.fullscreen-active .face-3d-die {
      border-width: 5px; /* Thicker crisp outlines for projector clarity */
    }

    /* Flawless structural folding maps that seamlessly adapt to any size change */
    .df-front  { transform: rotateY(0deg) translateZ(calc(var(--die-size) / 2)); }
    .df-back   { transform: rotateY(180deg) translateZ(calc(var(--die-size) / 2)); }
    .df-left   { transform: rotateY(-90deg) translateZ(calc(var(--die-size) / 2)); }
    .df-right  { transform: rotateY(90deg) translateZ(calc(var(--die-size) / 2)); }
    .df-top    { transform: rotateX(90deg) translateZ(calc(var(--die-size) / 2)); }
    .df-bottom { transform: rotateX(-90deg) translateZ(calc(var(--die-size) / 2)); }

    /* Cosmic D20 number orb, projector-friendly and less fake than a flat hexagon */
.d20-hologram {
  --d20-size: min(260px, 34vh);

  width: var(--d20-size) !important;
  height: var(--d20-size) !important;

  position: relative;
  display: grid;
  place-items: center;

  border-radius: 50%;
  isolation: isolate;
  overflow: visible;

  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.95), rgba(255,255,255,0.18) 16%, transparent 27%),
    radial-gradient(circle at 68% 74%, rgba(95,220,154,0.45), transparent 28%),
    linear-gradient(145deg, #1e1b4b, #143f3a 48%, #020617);

  border: 7px solid rgba(95, 220, 154, 0.92);

  color: #ffffff;
  font-size: calc(var(--d20-size) * 0.42) !important;
  line-height: 1;
  font-weight: 950;

  text-shadow:
    0 4px 12px rgba(0,0,0,0.55),
    0 0 24px rgba(95,220,154,0.35);

  box-shadow:
    0 28px 64px rgba(15, 23, 42, 0.28),
    0 0 0 12px rgba(95, 220, 154, 0.10),
    0 0 52px rgba(124, 58, 237, 0.30),
    inset 0 -22px 38px rgba(0,0,0,0.35),
    inset 0 16px 26px rgba(255,255,255,0.14);

  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.d20-hologram::before {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;

  border-radius: 50%;
  border: 3px solid rgba(95, 220, 154, 0.42);

  box-shadow:
    0 0 30px rgba(95, 220, 154, 0.28),
    inset 0 0 24px rgba(147, 197, 253, 0.18);

  transform: rotateX(68deg) rotateZ(-18deg);
  animation: cosmicDiceOrbit 2.8s linear infinite;
}

.d20-hologram::after {
  content: "";
  position: absolute;
  inset: -34px;
  z-index: -2;

  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(95,220,154,0.26), transparent 56%),
    conic-gradient(from 80deg, transparent, rgba(147,197,253,0.42), transparent, rgba(251,191,36,0.32), transparent);

  filter: blur(2px);
  opacity: 0.88;
  animation: cosmicDiceGlow 3.6s ease-in-out infinite;
}

.d20-hologram.rolling {
  animation: cosmicDiceRoll 0.14s linear infinite;
}

@keyframes cosmicDiceOrbit {
  from { transform: rotateX(68deg) rotateZ(0deg); }
  to { transform: rotateX(68deg) rotateZ(360deg); }
}

@keyframes cosmicDiceGlow {
  0%, 100% { transform: scale(0.94); opacity: 0.72; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes cosmicDiceRoll {
  0% { transform: rotate(-5deg) scale(0.96); filter: blur(0); }
  50% { transform: rotate(5deg) scale(1.04); filter: blur(1px); }
  100% { transform: rotate(-5deg) scale(0.96); filter: blur(0); }
}

body.focus-mode .d20-hologram,
body.fullscreen-active .d20-hologram {
  --d20-size: min(420px, 54vh) !important;
  border-width: 9px;
}

    .spinner-wrap {
      width: min(360px, 70vw);
      height: min(360px, 70vw);
      border-radius: 50%;
      border: 12px solid #143f3a;
      background:
        conic-gradient(
          #5fdc9a 0deg 60deg,
          #ffffff 60deg 120deg,
          #bbf7d0 120deg 180deg,
          #f1fdf6 180deg 240deg,
          #d1fae5 240deg 300deg,
          #ffffff 300deg 360deg
        );
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto;
      position: relative;
      box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    }

    .spinner-wrap::before {
      content: "▼";
      position: absolute;
      top: -28px;
      left: 50%;
      transform: translateX(-50%);
      color: #143f3a;
      font-size: 34px;
    }

    .spinner-wheel {
      width: 72%;
      height: 72%;
      border-radius: 50%;
      background: #143f3a;
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 18px;
      font-size: clamp(20px, 3vw, 34px);
      font-weight: 900;
      line-height: 1.15;
    }

    .group-list {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      width: 100%;
      max-width: 900px;
    }

    .group-card {
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      padding: 14px;
      text-align: left;
    }

    .group-card h3 {
      margin: 0 0 8px;
      color: #143f3a;
    }

    .group-card p {
      margin: 0;
      color: #374151;
      font-weight: 800;
      line-height: 1.45;
    }

    .vote-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      width: 100%;
      max-width: 900px;
    }

    .vote-card {
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 20px;
      padding: 18px;
      cursor: pointer;
    }

    .vote-card strong {
      display: block;
      font-size: 36px;
      margin-bottom: 8px;
    }

    .vote-card span {
      display: block;
      color: #143f3a;
      font-weight: 900;
      margin-bottom: 8px;
    }

    .vote-bar {
      height: 12px;
      background: #e5e7eb;
      border-radius: 999px;
      overflow: hidden;
    }

    .vote-fill {
      height: 100%;
      background: #5fdc9a;
      width: 0;
    }

    .noise-meter {
      width: min(420px, 80vw);
      height: 44px;
      border-radius: 999px;
      background: #e5e7eb;
      overflow: hidden;
      border: 2px solid #cbd5e1;
    }

    .noise-fill {
      height: 100%;
      width: 0;
      background: #5fdc9a;
      border-radius: 999px;
      transition: width 0.12s linear;
    }

    .steps-list {
      width: min(900px, 100%);
      display: grid;
      gap: 12px;
    }

    .step-row {
      display: grid;
      grid-template-columns: 56px 1fr;
      gap: 14px;
      align-items: center;
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      padding: 13px;
    }

    .step-number {
      width: 56px;
      height: 56px;
      border-radius: 16px;
      background: #143f3a;
      color: #ffffff;
      font-size: 20px;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .step-row p {
      margin: 0;
      color: #111827;
      font-size: clamp(16px, 1.5vw, 22px);
      font-weight: 900;
      line-height: 1.35;
    }

    .video-stage {
      background: #111827;
      color: #ffffff;
      border-radius: 20px;
      min-height: 360px;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      padding: 24px;
      font-size: 26px;
      line-height: 1.4;
      flex-direction: column;
      gap: 18px;
      overflow: hidden;
    }

    .video-stage iframe {
      width: 100%;
      height: min(58vh, 560px);
      border: none;
      border-radius: 18px;
      background: #000000;
    }


    /* =========================================================
       8B. PROJECTOR-FRIENDLY FUN STAGES
       ========================================================= */

    .mission-stage {
      width: 100%;
      min-height: 100%;
      display: grid;
      align-items: stretch;
      gap: 16px;
    }

    .mission-hero-card {
      position: relative;
      overflow: hidden;
      background:
        radial-gradient(circle at 92% 12%, rgba(95, 220, 154, 0.28), transparent 28%),
        linear-gradient(135deg, #102f2b, #1d5a50);
      color: #ffffff;
      border-radius: 28px;
      padding: clamp(22px, 3vw, 42px);
      box-shadow: 0 22px 46px rgba(15, 23, 42, 0.16);
      display: grid;
      grid-template-columns: auto 1fr;
      gap: clamp(18px, 3vw, 34px);
      align-items: center;
      min-height: 260px;
      transform-style: preserve-3d;
    }

    .mission-hero-card::after {
      content: "";
      position: absolute;
      inset: auto -60px -80px auto;
      width: 260px;
      height: 260px;
      border-radius: 50%;
      border: 38px solid rgba(255,255,255,0.06);
      pointer-events: none;
    }

    .mission-icon-3d {
      width: clamp(110px, 16vw, 190px);
      height: clamp(110px, 16vw, 190px);
      border-radius: 38px;
      background: linear-gradient(145deg, #ffffff, #dffbea);
      color: #143f3a;
      display: grid;
      place-items: center;
      font-size: clamp(54px, 8vw, 100px);
      box-shadow:
        0 22px 42px rgba(0,0,0,0.22),
        inset 0 -10px 20px rgba(20,63,58,0.12),
        inset 0 10px 20px rgba(255,255,255,0.8);
      transform: rotateX(10deg) rotateY(-12deg);
    }

    .mission-copy { position: relative; z-index: 2; }

    .mission-kicker {
      display: inline-flex;
      align-items: center;
      align-self: center; /* Prevents stretching and centers the label beautifully */
      gap: 8px;
      padding: 7px 11px;
      border-radius: 999px;
      background: rgba(255,255,255,0.12);
      border: 1px solid rgba(255,255,255,0.22);
      color: #dffbea;
      font-size: 12px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      margin-bottom: 12px;
    }

    .mission-question {
  font-size: clamp(28px, 3.6vw, 56px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -1.4px;
  margin: 0;
}

    .mission-subline {
      margin-top: 14px;
      font-size: clamp(17px, 2vw, 25px);
      line-height: 1.35;
      color: #dffbea;
      font-weight: 800;
    }

    .student-action-row {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 14px;
    }

    .student-action-chip {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      background: #ffffff;
      color: #143f3a;
      border: 1px solid #d9fbe8;
      border-radius: 999px;
      padding: 10px 15px;
      font-weight: 900;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

    .vote-stage {
      display: grid;
      gap: 18px;
      width: 100%;
      height: 100%;
      align-content: center;
    }

    .vote-question-card {
      text-align: center;
      background:
        radial-gradient(circle at 50% 0%, rgba(95,220,154,0.22), transparent 30%),
        #ffffff;
      border: 1px solid #d9fbe8;
      border-radius: 26px;
      padding: 20px;
      box-shadow: 0 12px 26px rgba(15,23,42,0.06);
    }

    .vote-question-card h3 {
      margin: 0;
      color: #143f3a;
      font-size: clamp(28px, 4vw, 56px);
      line-height: 1.05;
      letter-spacing: -1.4px;
    }

    .vote-grid.fun-vote-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 14px;
      width: 100%;
      max-width: 1040px;
      margin: 0 auto;
      perspective: 1100px;
    }

    .vote-card.fun-vote-card {
      position: relative;
      overflow: hidden;
      min-height: 190px;
      background: linear-gradient(145deg, #ffffff, #f1fdf6);
      border: 1px solid #d9fbe8;
      border-radius: 26px;
      padding: 18px;
      cursor: pointer;
      transform-style: preserve-3d;
      transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
      box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    }

    .vote-card.fun-vote-card:hover {
      transform: translateY(-5px) rotateX(4deg);
      border-color: #5fdc9a;
      box-shadow: 0 20px 38px rgba(15, 23, 42, 0.14);
    }

    .vote-card.fun-vote-card:active { transform: scale(0.97); }

    .vote-card.fun-vote-card strong {
      display: block;
      font-size: clamp(42px, 6vw, 78px);
      margin-bottom: 8px;
      filter: drop-shadow(0 5px 6px rgba(15, 23, 42, 0.12));
    }

    .vote-card.fun-vote-card span {
      display: block;
      color: #143f3a;
      font-weight: 900;
      font-size: clamp(18px, 2vw, 26px);
      margin-bottom: 14px;
      line-height: 1.15;
    }

    .vote-count-pop {
      margin-top: 10px;
      font-weight: 900;
      color: #143f3a;
      font-size: 18px;
    }

    .vote-fill { transition: width 0.26s cubic-bezier(0.2, 1.5, 0.4, 1); }

    .steps-stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  height: 100%;
  width: 100%;
}

    .steps-progress {
      display: flex;
      gap: 8px;
      justify-content: center;
      flex-wrap: wrap;
    }

    /* One Step View - Universal Layout Core Engine */
    .routine-focus-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 20px;
      width: 100%;
      height: 100%;
      max-width: 1060px;
      margin: auto;
      padding: 12px;
      box-sizing: border-box;
      flex: 1;
    }

    .routine-focus-card {
      width: 100%;
      flex: 1;
      min-height: 240px;
      padding: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      border: 2px solid var(--board-ink);
      background: #ffffff;
      border-radius: 24px;
      cursor: pointer;
      box-shadow: 0 12px 32px rgba(15, 23, 42, 0.04);
      transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
      box-sizing: border-box;
    }

    .routine-focus-card:hover {
      transform: translateY(-2px);
      border-color: var(--board-accent);
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    }

    .routine-focus-text {
      font-size: clamp(26px, 4.2vw, 54px);
      margin: 0;
      line-height: 1.25;
      text-align: center;
      color: var(--board-ink);
      font-weight: 950;
    }

    /* Fullscreen Projector & Clean Focus Display Enhancements */
    body.fullscreen-active .routine-focus-card,
    body.focus-mode .routine-focus-card {
      min-height: 380px;
      padding: 60px 50px;
      border-radius: 32px;
      box-shadow: 0 20px 48px rgba(15, 23, 42, 0.06);
    }

    body.fullscreen-active .routine-focus-text,
body.focus-mode .routine-focus-text {
  font-size: clamp(44px, 6.8vw, 92px);
  line-height: 1.2;
}

/* =========================================================
   CLASSROOM ROUTINES — CLEAN FOCUS / PROJECTOR SIZING
   Enlarges the Show All Steps view for classroom visibility.
   ========================================================= */

body.focus-mode[data-stage="steps"] .steps-stage,
body.fullscreen-active[data-stage="steps"] .steps-stage,
body.focus-mode[data-stage="routines"] .steps-stage,
body.fullscreen-active[data-stage="routines"] .steps-stage {
  gap: 14px;
}

body.focus-mode[data-stage="steps"] .steps-progress,
body.fullscreen-active[data-stage="steps"] .steps-progress,
body.focus-mode[data-stage="routines"] .steps-progress,
body.fullscreen-active[data-stage="routines"] .steps-progress {
  gap: 10px !important;
  padding: 8px 0 !important;
}

body.focus-mode[data-stage="steps"] .step-dot,
body.fullscreen-active[data-stage="steps"] .step-dot,
body.focus-mode[data-stage="routines"] .step-dot,
body.fullscreen-active[data-stage="routines"] .step-dot {
  width: 34px;
  height: 34px;
  font-size: 14px;
  border-width: 2px;
}

body.focus-mode[data-stage="steps"] .routine-viewport-container,
body.fullscreen-active[data-stage="steps"] .routine-viewport-container,
body.focus-mode[data-stage="routines"] .routine-viewport-container,
body.fullscreen-active[data-stage="routines"] .routine-viewport-container {
  min-height:
    0;

  padding:
    3px
    22px
    14px !important;

  justify-content:
    flex-start;

  overflow-y:
    auto !important;

  overflow-x:
    hidden !important;

  overscroll-behavior:
    contain;

  scrollbar-gutter:
    stable;
}


/*
  When Routine steps are shown beside a presentation,
  let only the steps column scroll and let every row
  size itself from its full text.
*/
body.focus-mode[data-stage="routines"]
.routine-side-presentation
.routine-main-steps,
body.fullscreen-active[data-stage="routines"]
.routine-side-presentation
.routine-main-steps {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;

  display: grid !important;

  grid-auto-rows:
    max-content !important;

  align-content:
    start !important;

  overflow-y:
    auto !important;

  overflow-x:
    hidden !important;

  overscroll-behavior:
    contain;

  scrollbar-gutter:
    stable;

  gap: 8px !important;

  padding-right:
    4px !important;

  padding-bottom:
    8px !important;
}


body.focus-mode[data-stage="steps"] .steps-list.fun-steps-list,
body.fullscreen-active[data-stage="steps"] .steps-list.fun-steps-list,
body.focus-mode[data-stage="routines"] .steps-list.fun-steps-list,
body.fullscreen-active[data-stage="routines"] .steps-list.fun-steps-list {
  width: min(1040px, 100%) !important;
  max-width: 1040px !important;

  gap: 6px !important;

  align-content: start !important;
}


/*
  Presentation mode must allow each Routine card
  to grow to the height required by its text.
*/
body.focus-mode[data-stage="routines"]
.routine-side-presentation
.step-row.fun-step-row,
body.fullscreen-active[data-stage="routines"]
.routine-side-presentation
.step-row.fun-step-row {
  min-height: 58px !important;
  height: auto !important;
  max-height: none !important;

  grid-template-columns:
    40px
    minmax(0, 1fr)
    40px;

  gap: 11px;

  padding:
    8px
    12px !important;

  border-width: 2px;
  border-radius: 15px;

  align-items: center !important;

  overflow: visible !important;
}


/*
  Keep the large classroom style for Routine mode
  when there is no presentation beside it.
*/
body.focus-mode[data-stage="steps"] .step-row.fun-step-row,
body.fullscreen-active[data-stage="steps"] .step-row.fun-step-row,
body.focus-mode[data-stage="routines"]
.routine-side-none
.step-row.fun-step-row,
body.fullscreen-active[data-stage="routines"]
.routine-side-none
.step-row.fun-step-row {
  min-height: 54px !important;

  grid-template-columns:
    40px
    minmax(0, 1fr)
    40px;

  gap: 11px;

  padding:
    5px
    12px;

  border-width: 2px;
  border-radius: 15px;
}


body.focus-mode[data-stage="steps"]
.step-number.fun-step-number,
body.fullscreen-active[data-stage="steps"]
.step-number.fun-step-number,
body.focus-mode[data-stage="routines"]
.step-number.fun-step-number,
body.fullscreen-active[data-stage="routines"]
.step-number.fun-step-number {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;

  border-radius: 12px !important;

  font-size: 16px !important;
}


/*
  Presentation mode uses adaptive multi-line text.
*/
body.focus-mode[data-stage="routines"]
.routine-side-presentation
.step-row.fun-step-row p,
body.fullscreen-active[data-stage="routines"]
.routine-side-presentation
.step-row.fun-step-row p {
  min-width: 0;

  width: 100%;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  margin: 0 !important;

  font-size:
    clamp(
      15px,
      1.2vw,
      19px
    ) !important;

  line-height:
    1.25 !important;

  white-space:
    normal !important;

  overflow:
    visible !important;

  text-overflow:
    clip !important;

  overflow-wrap:
    break-word;

  word-break:
    normal;
}


/*
  Keep larger text when Routine has no presentation.
*/
body.focus-mode[data-stage="steps"]
.step-row.fun-step-row p,
body.fullscreen-active[data-stage="steps"]
.step-row.fun-step-row p,
body.focus-mode[data-stage="routines"]
.routine-side-none
.step-row.fun-step-row p,
body.fullscreen-active[data-stage="routines"]
.routine-side-none
.step-row.fun-step-row p {
  font-size:
    clamp(
      18px,
      1.55vw,
      25px
    ) !important;

  line-height: 1.15 !important;
}


body.focus-mode[data-stage="steps"] .step-check,
body.fullscreen-active[data-stage="steps"] .step-check,
body.focus-mode[data-stage="routines"] .step-check,
body.fullscreen-active[data-stage="routines"] .step-check {
  width: 40px;
  height: 40px;

  font-size: 22px;
}

body.focus-mode[data-stage="steps"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="steps"] .board-bottom-toolbar,
body.focus-mode[data-stage="routines"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="routines"] .board-bottom-toolbar {
  padding: 10px 16px !important;
}

body.focus-mode[data-stage="steps"]
  .board-bottom-toolbar .btn,
body.fullscreen-active[data-stage="steps"]
  .board-bottom-toolbar .btn,
body.focus-mode[data-stage="routines"]
  .board-bottom-toolbar .btn,
body.fullscreen-active[data-stage="routines"]
  .board-bottom-toolbar .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

    .step-dot {
      width: 26px;
      height: 26px;
      font-size: 12px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      background: #ffffff;
      border: 2px solid #d9fbe8;
      color: #143f3a;
      font-weight: 900;
      box-shadow: 0 6px 12px rgba(15,23,42,0.06);
    }

    .step-dot.done {
      background: #5fdc9a;
      border-color: #5fdc9a;
    }

    .steps-list.fun-steps-list {
  display: grid;
  gap: 6px;
  width: min(980px, 100%);
  margin: 0 auto;
  align-content: center;
}

    .step-row.fun-step-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 6px 12px;
  box-shadow: 0 6px 16px rgba(15,23,42,0.04);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

    .step-row.fun-step-row:hover {
      transform: translateY(-3px);
      border-color: #5fdc9a;
      box-shadow: 0 18px 35px rgba(15,23,42,0.10);
    }

    .step-row.fun-step-row.done {
      background: linear-gradient(145deg, #f1fdf6, #ffffff);
      border-color: #5fdc9a;
    }

    .step-row.fun-step-row.done p {
      text-decoration: line-through;
      color: #64748b;
    }

    .step-number.fun-step-number {
      width: 68px;
      height: 68px;
      border-radius: 22px;
      background:
        radial-gradient(circle at 35% 25%, rgba(255,255,255,0.35), transparent 30%),
        #143f3a;
      color: #ffffff;
      font-size: 22px;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 -7px 12px rgba(0,0,0,0.18);
    }

    .step-row.fun-step-row p {
      margin: 0;
      color: #111827;
      font-size: clamp(16px, 1.6vw, 24px);
      font-weight: 900;
      line-height: 1.3;
    }

    .step-check {
      width: 44px;
      height: 44px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      background: #f1f5f9;
      color: #143f3a;
      font-size: 22px;
      font-weight: 900;
    }

    .step-row.done .step-check {
      background: #5fdc9a;
      color: #143f3a;
    }

    .noise-stage {
      display: grid;
      grid-template-columns: minmax(240px, 0.95fr) minmax(300px, 1.05fr);
      gap: 24px;
      align-items: center;
      height: 100%;
      width: 100%;
    }

    .noise-orb-card {
      background:
        radial-gradient(circle at 50% 30%, rgba(95,220,154,0.25), transparent 34%),
        linear-gradient(135deg, #ffffff, #f8fafc);
      border: 1px solid #d9fbe8;
      border-radius: 30px;
      padding: 28px;
      text-align: center;
      box-shadow: 0 18px 40px rgba(15,23,42,0.08);
    }

    .noise-orb {
      width: min(260px, 32vw);
      height: min(260px, 32vw);
      border-radius: 50%;
      margin: 0 auto 18px;
      display: grid;
      place-items: center;
      font-size: clamp(64px, 9vw, 128px);
      background:
        radial-gradient(circle at 35% 25%, rgba(255,255,255,0.9), transparent 24%),
        #5fdc9a;
      box-shadow:
        0 20px 45px rgba(15,23,42,0.18),
        inset 0 -18px 30px rgba(20,63,58,0.20);
      transition: transform 0.18s ease, background 0.18s ease;
    }

    .noise-orb.pulse { animation: noisePulse 0.7s ease-in-out infinite; }

    @keyframes noisePulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.045); }
      100% { transform: scale(1); }
    }

    .noise-word {
      font-size: clamp(28px, 4vw, 56px);
      color: #143f3a;
      font-weight: 900;
      letter-spacing: -1.3px;
      line-height: 1.05;
    }

    .noise-helper {
      color: #64748b;
      font-weight: 800;
      margin-top: 8px;
      font-size: clamp(15px, 1.4vw, 19px);
    }

    .noise-control-card {
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 28px;
      padding: 24px;
      box-shadow: 0 14px 30px rgba(15,23,42,0.06);
    }

    .noise-meter.fun-noise-meter {
      width: 100%;
      height: 56px;
      border-radius: 999px;
      background: #e5e7eb;
      overflow: hidden;
      border: 2px solid #cbd5e1;
      margin: 14px 0;
    }

    .noise-fill.fun-noise-fill {
      height: 100%;
      width: 0;
      background: linear-gradient(90deg, #5fdc9a, #fbbf24, #ef4444);
      border-radius: 999px;
      transition: width 0.12s linear;
    }

    .noise-levels {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 9px;
      margin-top: 14px;
    }

    .noise-level-chip {
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      padding: 10px;
      text-align: center;
      font-weight: 900;
      color: #143f3a;
      background: #f8fafc;
    }

    .noise-level-chip.active {
      border-color: #5fdc9a;
      background: #f1fdf6;
      box-shadow: 0 8px 18px rgba(95,220,154,0.18);
    }

    @media (max-width: 900px) {
      .mission-hero-card,
      .noise-stage {
        grid-template-columns: 1fr;
      }

      .mission-icon-3d {
        width: 100px;
        height: 100px;
        border-radius: 28px;
        font-size: 54px;
      }

      .step-row.fun-step-row {
        grid-template-columns: 54px 1fr;
      }

      .step-check {
        grid-column: 1 / -1;
        width: 100%;
      }
    }

    /* =========================================================
   SEATING PLAN
   Real classroom desks, shared seats and usable templates
   ========================================================= */

body[data-stage="seating"] .stage-body {
  overflow: hidden;
}

.seating-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.seating-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 11px;
  border: 1px solid #e5e7eb;
  border-radius: 17px;
  background: #ffffff;
}

.seating-toolbar-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.seating-layout-button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: var(--board-ink);
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.seating-layout-button:hover {
  border-color: var(--board-accent);
  background: #f1fdf6;
}

.seating-layout-button.active {
  border-color: var(--board-ink);
  background: var(--board-ink);
  color: #ffffff;
}

.seating-custom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #f8fafc;
}

.seating-custom-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seating-custom-control label {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.seating-custom-control select,
.seating-custom-control input {
  min-height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: var(--board-ink);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}

.seating-room {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbe3ea;
  border-radius: 22px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    #f8fafc;
  background-size: 30px 30px;
  overflow: auto;
}

.seating-front {
  justify-self: center;
  width: min(560px, 72%);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border: 3px solid var(--board-ink);
  border-radius: 10px;
  background: #ffffff;
  color: var(--board-ink);
  text-align: center;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
}

.seating-plan-canvas {
  min-height: 0;
  width: 100%;
  display: grid;
  gap: 15px;
  align-content: center;
  justify-content: center;
  padding: 4px;
}

/* Shared physical desk */

.seating-desk {
  position: relative;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: repeat(var(--desk-capacity, 2), minmax(0, 1fr));
  gap: 5px;
  padding: 10px 8px 8px;
  border: 3px solid #94a3b8;
  border-bottom-width: 7px;
  border-radius: 13px 13px 9px 9px;
  background:
    linear-gradient(
      145deg,
      #ffffff,
      color-mix(in srgb, var(--board-accent) 8%, #ffffff)
    );
  box-shadow:
    0 8px 15px rgba(15, 23, 42, 0.08),
    inset 0 -4px 0 rgba(15, 23, 42, 0.05);
}

.seating-desk::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -12px;
  height: 8px;
  border-left: 5px solid #64748b;
  border-right: 5px solid #64748b;
  pointer-events: none;
}

.seating-desk-number {
  position: absolute;
  top: -9px;
  left: 9px;
  min-width: 22px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #64748b;
  color: #ffffff;
  font-size: 8px;
  font-weight: 950;
}

.seating-place {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #94a3b8;
  text-align: center;
  font-size: 11px;
  font-weight: 950;
  cursor: grab;
  user-select: none;
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease,
    box-shadow 0.14s ease;
}

.seating-place.occupied {
  border-style: solid;
  border-color: color-mix(
    in srgb,
    var(--board-accent) 65%,
    #cbd5e1
  );
  background: #ffffff;
  color: var(--board-ink);
}

.seating-place:hover {
  transform: translateY(-2px);
  border-color: var(--board-accent-2);
}

.seating-place.dragging {
  opacity: 0.35;
}

.seating-place.drop-target {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.seating-place-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pairs */

.seating-plan-canvas.template-pairs {
  grid-template-columns: repeat(
    var(--desk-columns, 3),
    minmax(150px, 210px)
  );
  column-gap: clamp(22px, 4vw, 58px);
  row-gap: 22px;
}

/* Rows */

.seating-plan-canvas.template-rows {
  grid-template-columns: repeat(
    var(--desk-columns, 4),
    minmax(130px, 190px)
  );
  column-gap: 16px;
  row-gap: 24px;
}

/* Horseshoe */

/* =========================================================
   TRUE SINGLE U-SHAPE
   ========================================================= */

.seating-plan-canvas.template-horseshoe,
.seating-plan-canvas.template-double-u {
  width: 100%;
  height: auto !important;
  min-height: 100%;
  display: block;
  padding: 4px;
}

.seating-single-u {
  width: 100%;
  height: auto !important;
  min-height: 100%;

  display: grid;
  grid-template-columns:
    minmax(95px, 15%)
    1fr
    minmax(95px, 15%);

  grid-template-rows: 1fr auto;
  grid-template-areas:
    "left open right"
    ". bottom .";

  column-gap: clamp(16px, 3vw, 56px);
  row-gap: 24px;
}

.seating-u-side {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  height: 100% !important;
  min-height: 0 !important;
}

.seating-u-left {
  grid-area: left;
}

.seating-u-right {
  grid-area: right;
}

.seating-single-u .seating-u-left {
  --u-side-count: var(--u-left-count);
}

.seating-single-u .seating-u-right {
  --u-side-count: var(--u-right-count);
}

.seating-u-open-space {
  grid-area: open;
  min-width: 0;
  min-height: 200px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: clamp(10px, 0.95vw, 14px);
  font-weight: 900;
  text-align: center;
}

.seating-u-open-space span {
  padding: 10px 16px;
  border: 2px dashed rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.seating-u-bottom {
  grid-area: bottom;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(
    var(--u-bottom-count, 5),
    minmax(0, 1fr)
  );
  gap: clamp(10px, 1.3vw, 18px);
}

.seating-single-u .seating-u-bottom {
  --u-bottom-count: var(--u-bottom-count);
}

.seating-single-u .seating-desk,
.seating-double-u-layout .seating-desk {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 6px 5px;
}

.seating-single-u .seating-place,
.seating-double-u-layout .seating-place {
  min-height: 22px !important;
  height: 100%;
  font-size: clamp(9px, 0.75vw, 12px) !important;
  padding: 2px 4px !important;
}

.seating-single-u .seating-desk-number,
.seating-double-u-layout .seating-desk-number {
  top: -7px;
  font-size: 7px;
}

.seating-single-u .seating-desk::before,
.seating-double-u-layout .seating-desk::before {
  bottom: -7px;
  height: 5px;
}

/* =========================================================
   UNIFIED SIDE COLUMNS (Horseshoe & Double U)
   Removes overlapping duplicates and forces inward rotation
   ========================================================= */

/* Left Side Columns (Outer & Inner Left Columns Facing Right) */
.seating-single-u .seating-u-left,
.seating-double-u-layout .seating-u-left,
.seating-double-u-layout .seating-inner-u-left {
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(4px, 0.6vh, 8px) !important;
}

.seating-single-u .seating-u-left .seating-desk,
.seating-double-u-layout .seating-u-left .seating-desk,
.seating-double-u-layout .seating-inner-u-left .seating-desk {
  width: 100% !important;
  max-width: 86px !important;
  height: clamp(42px, 5.8vh, 66px) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: repeat(var(--desk-capacity, 2), minmax(0, 1fr)) !important;
  border-width: 3px 3px 3px 7px !important;
  border-radius: 13px 9px 9px 13px !important;
  padding: 4px 4px 4px 8px !important;
  box-shadow: -4px 0 0 rgba(15, 23, 42, 0.05), 0 6px 12px rgba(15, 23, 42, 0.06) !important;
}

.seating-single-u .seating-u-left .seating-desk::before,
.seating-double-u-layout .seating-u-left .seating-desk::before,
.seating-double-u-layout .seating-inner-u-left .seating-desk::before {
  content: "" !important;
  position: absolute !important;
  top: 6px !important;
  bottom: 6px !important;
  left: -11px !important;
  right: auto !important;
  width: 6px !important;
  height: auto !important;
  border-top: 4px solid #64748b !important;
  border-bottom: 4px solid #64748b !important;
  border-left: none !important;
  border-right: none !important;
}

/* Right Side Columns (Outer & Inner Right Columns Facing Left) */
.seating-single-u .seating-u-right,
.seating-double-u-layout .seating-u-right,
.seating-double-u-layout .seating-inner-u-right {
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(4px, 0.6vh, 8px) !important;
}

.seating-single-u .seating-u-right .seating-desk,
.seating-double-u-layout .seating-u-right .seating-desk,
.seating-double-u-layout .seating-inner-u-right .seating-desk {
  width: 100% !important;
  max-width: 86px !important;
  height: clamp(42px, 5.8vh, 66px) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: repeat(var(--desk-capacity, 2), minmax(0, 1fr)) !important;
  border-width: 3px 7px 3px 3px !important;
  border-radius: 9px 13px 13px 9px !important;
  padding: 4px 8px 4px 4px !important;
  box-shadow: 4px 0 0 rgba(15, 23, 42, 0.05), 0 6px 12px rgba(15, 23, 42, 0.06) !important;
}

.seating-single-u .seating-u-right .seating-desk::before,
.seating-double-u-layout .seating-u-right .seating-desk::before,
.seating-double-u-layout .seating-inner-u-right .seating-desk::before {
  content: "" !important;
  position: absolute !important;
  top: 6px !important;
  bottom: 6px !important;
  right: -11px !important;
  left: auto !important;
  width: 6px !important;
  height: auto !important;
  border-top: 4px solid #64748b !important;
  border-bottom: 4px solid #64748b !important;
  border-left: none !important;
  border-right: none !important;
}

/* =========================================================
   DOUBLE U-SHAPE
   ========================================================= */

.seating-double-u-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.seating-double-u-outer {
  width: 100%;
  height: 100%;
  min-height: 0;

  display: grid;
  grid-template-columns:
    minmax(95px, 14%)
    minmax(0, 1fr)
    minmax(95px, 14%);

  grid-template-rows:
    minmax(0, 1fr)
    minmax(62px, 17%);

  grid-template-areas:
    "left centre right"
    ". bottom .";

  column-gap: clamp(22px, 3.7vw, 58px);
  row-gap: clamp(12px, 1.6vh, 22px);
}

.seating-double-u-centre {
  grid-area: centre;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 44px);
}

.seating-double-u-inner {
  width: min(74%, 680px);
  height: min(76%, 430px);
  min-height: 0;

  display: grid;
  grid-template-columns:
    minmax(82px, 20%)
    minmax(0, 1fr)
    minmax(82px, 20%);

  grid-template-rows:
    minmax(0, 1fr)
    minmax(58px, 26%);

  grid-template-areas:
    "inner-left inner-space inner-right"
    ". inner-bottom .";

  column-gap: clamp(16px, 2.4vw, 34px);
  row-gap: clamp(10px, 1.3vh, 17px);
}

.seating-inner-u-left {
  grid-area: inner-left;
}

.seating-inner-u-right {
  grid-area: inner-right;
}

.seating-inner-u-space {
  grid-area: inner-space;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(148, 163, 184, 0.26);
  border-radius: 22px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 900;
}

.seating-inner-u-bottom {
  grid-area: inner-bottom;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(
    var(--inner-bottom-count, 3),
    minmax(0, 1fr)
  );
  gap: clamp(7px, 1vw, 12px);
}

/* Compact normal Class Board view */

body:not(.focus-mode):not(.fullscreen-active)
  .seating-single-u {
  grid-template-columns:
    minmax(88px, 18%)
    minmax(0, 1fr)
    minmax(88px, 18%);
  column-gap: 14px;
  row-gap: 10px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .seating-double-u-outer {
  grid-template-columns:
    minmax(80px, 16%)
    minmax(0, 1fr)
    minmax(80px, 16%);
  column-gap: 12px;
  row-gap: 9px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .seating-double-u-inner {
  width: 82%;
  height: 78%;
  grid-template-columns:
    minmax(68px, 22%)
    minmax(0, 1fr)
    minmax(68px, 22%);
  column-gap: 9px;
  row-gap: 8px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .seating-single-u .seating-place,
body:not(.focus-mode):not(.fullscreen-active)
  .seating-double-u-layout .seating-place {
  font-size: 8px;
  padding: 3px 2px;
}

.seating-plan-canvas.template-carpet {
  grid-template-columns: repeat(
    var(--carpet-columns, 6),
    minmax(58px, 80px)
  );
  gap: 13px;
  align-content: center;
}

.seating-carpet-place {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 7px;
  border: 3px solid #cbd5e1;
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 32% 26%,
      #ffffff,
      color-mix(in srgb, var(--board-accent) 20%, #ffffff)
    );
  color: var(--board-ink);
  text-align: center;
  font-size: 10.5px;
  font-weight: 950;
  cursor: grab;
  box-shadow: 0 7px 13px rgba(15, 23, 42, 0.08);
}

.seating-carpet-place.drop-target {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

/* Custom */

.seating-plan-canvas.template-custom {
  width: 100%;
  min-height: 0;

  display: grid;
  grid-template-columns: repeat(
    var(--desk-columns, 4),
    minmax(0, 1fr)
  );

  grid-auto-rows: minmax(82px, auto);
  gap: clamp(12px, 1.4vw, 20px);

  align-content: start;
  justify-content: stretch;

  padding:
    clamp(18px, 2.2vh, 30px)
    clamp(8px, 1vw, 16px)
    32px;

  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.seating-plan-canvas.template-custom .seating-desk {
  width: 100%;
  min-width: 0;
  min-height: 78px;
  height: auto;
}

.seating-plan-canvas.template-custom .seating-place {
  min-width: 0;
  min-height: 54px;
  font-size: clamp(10px, 0.95vw, 14px);
}

/* Normal mode has a narrower centre board */
body:not(.focus-mode):not(.fullscreen-active)
  .seating-plan-canvas.template-custom {
  gap: 11px;
  padding-top: 20px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .seating-plan-canvas.template-custom
  .seating-desk {
  padding-left: 5px;
  padding-right: 5px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .seating-plan-canvas.template-custom
  .seating-place {
  padding: 5px 3px;
  font-size: 9px;
}

/* Prevent the front board from colliding with the first desk row */
body[data-stage="seating"]
  .seating-room:has(.template-custom) {
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 18px;
  overflow: hidden;
}

@media (max-width: 900px) {
  .seating-plan-canvas.template-pairs,
  .seating-plan-canvas.template-rows,
  .seating-plan-canvas.template-custom {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .seating-plan-canvas.template-horseshoe {
    min-height: 560px;
  }

  .seating-front {
    width: 90%;
  }
}

    /* =========================================================
       ATTENDANCE + QUICK CLASS LIST
       ========================================================= */

    .board-attendance-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin-bottom: 14px;
      padding: 4px;
      border-radius: 13px;
      background: #f1f5f9;
    }

    .board-attendance-tab {
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 7px 12px;
      border: 1px solid transparent;
      border-radius: 10px;
      background: transparent;
      color: #64748b;
      font-size: 12px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
    }

    .board-attendance-tab:hover {
      background: rgba(255, 255, 255, 0.72);
      color: #143f3a;
    }

    .board-attendance-tab.active {
      border-color: #bbf7d0;
      background: #ffffff;
      color: #166534;
      box-shadow: 0 2px 7px rgba(15, 23, 42, 0.06);
    }

    .board-attendance-panel {
      display: none;
    }

    .board-attendance-panel.active {
      display: block;
    }

    .board-attendance-summary {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
      gap: 8px;
      align-items: stretch;
      margin-bottom: 12px;
    }

    .board-attendance-stat {
      min-width: 0;
      padding: 10px 12px;
      border: 1px solid #e5e7eb;
      border-radius: 14px;
      background: #ffffff;
    }

    .board-attendance-stat strong {
      display: block;
      color: #143f3a;
      font-size: 20px;
      line-height: 1;
      font-weight: 950;
    }

    .board-attendance-stat span {
      display: block;
      margin-top: 4px;
      color: #64748b;
      font-size: 10px;
      line-height: 1;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .board-attendance-mark-all {
      min-height: 100%;
      padding: 8px 14px;
    }

    .board-attendance-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 8px;
    }

    .board-attendance-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-height: 50px;
      padding: 9px 10px 9px 12px;
      border: 1px solid #d9fbe8;
      border-radius: 14px;
      background: #f8fafc;
      color: #143f3a;
      cursor: pointer;
      user-select: none;
    }

    .board-attendance-row.absent {
      border-color: #fecaca;
      background: #fef2f2;
    }

    .board-attendance-student-name {
      min-width: 0;
      overflow: hidden;
      color: #143f3a;
      font-size: 13px;
      line-height: 1.2;
      font-weight: 950;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .board-attendance-toggle {
  position: relative;
  width: 82px;
  height: 30px;
  flex: 0 0 82px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 9px 0 31px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.25px;
}

    .board-attendance-toggle::before {
  content: "";
  position: absolute;
  left: 5px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.16);
}

    .board-attendance-row.absent .board-attendance-toggle {
      justify-content: flex-start;
      padding: 0 26px 0 9px;
      background: #fee2e2;
      color: #991b1b;
    }

    .board-attendance-row.absent .board-attendance-toggle::before {
      right: 5px;
      left: auto;
      background: #ef4444;
    }

    .board-attendance-row input {
      position: absolute;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }

    .board-class-list-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .board-class-list-actions .btn {
      min-height: 34px;
      padding: 7px 12px;
      font-size: 11px;
    }

    .board-class-list-open-settings {
      margin-left: auto;
    }

    .board-class-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

    .board-class-list-row {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 15px;
  background: #ffffff;
}

    .board-class-list-copy {
      min-width: 0;
    }

    .board-class-list-name {
      overflow: hidden;
      color: #111827;
      font-size: 13px;
      line-height: 1.2;
      font-weight: 950;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .board-class-list-birthday {
      margin-top: 4px;
      color: #64748b;
      font-size: 11px;
      line-height: 1.2;
      font-weight: 800;
    }

    .board-class-list-row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: auto;
}

    .board-class-list-row-actions button {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #143f3a;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

    .board-class-list-row-actions button:hover {
      border-color: #86efac;
      background: #eefbf4;
    }

    .board-class-list-row-actions button.remove {
      border-color: #fecaca;
      background: #fff7f7;
      color: #991b1b;
    }

    .board-class-list-empty {
      padding: 28px 18px;
      border: 1px dashed #cbd5e1;
      border-radius: 16px;
      background: #f8fafc;
      color: #64748b;
      text-align: center;
    }

    .board-class-list-empty strong {
      display: block;
      margin-bottom: 6px;
      color: #143f3a;
      font-size: 15px;
    }

    .board-class-list-empty p {
      margin: 0 0 14px;
      font-size: 12px;
      line-height: 1.4;
      font-weight: 750;
    }

    .board-student-editor {
      display: none;
      margin-bottom: 12px;
      padding: 13px;
      border: 1px solid #bbf7d0;
      border-radius: 16px;
      background: #f1fdf6;
    }

    .board-student-editor.show {
      display: block;
    }

    .board-student-editor-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 190px;
      gap: 10px;
    }

    .board-student-editor label {
      display: block;
      margin-bottom: 5px;
      color: #475569;
      font-size: 10px;
      line-height: 1;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .board-student-editor input {
      width: 100%;
      min-height: 40px;
      margin: 0;
      padding: 9px 11px;
      border: 1px solid #d1d5db;
      border-radius: 11px;
      background: #ffffff;
      color: #111827;
      font-size: 13px;
      font-weight: 800;
    }

    .board-student-editor-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 10px;
    }

    .board-class-paste-panel {
      display: none;
      margin-bottom: 12px;
      padding: 13px;
      border: 1px solid #bfdbfe;
      border-radius: 16px;
      background: #eff6ff;
    }

    .board-class-paste-panel.show {
      display: block;
    }

    .board-class-paste-panel textarea {
      width: 100%;
      min-height: 150px;
      margin: 0;
      padding: 10px 12px;
      border: 1px solid #bfdbfe;
      border-radius: 12px;
      background: #ffffff;
      color: #111827;
      font-size: 13px;
      line-height: 1.45;
      resize: vertical;
    }

    .board-class-paste-help {
      margin: 0 0 8px;
      color: #475569;
      font-size: 11px;
      line-height: 1.35;
      font-weight: 800;
    }

    .board-class-paste-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 9px;
    }

    @media (max-width: 1100px) {
  .board-class-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .board-attendance-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .board-attendance-mark-all {
    grid-column: 1 / -1;
  }

  .board-student-editor-grid {
    grid-template-columns: 1fr;
  }

  .board-class-list-open-settings {
    width: 100%;
    margin-left: 0;
  }

  .board-class-list {
    grid-template-columns: 1fr;
  }
}

    /* =========================================================
       9. WIDGET TRAY AND MODALS
       ========================================================= */

    .widget-tray {
      position: fixed;
      inset: auto 12px 12px auto;
      width: 360px;
      max-width: 94vw;
      background: #ffffff;
      border: 1px solid #e5e7eb;
      box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
      border-radius: 22px;
      z-index: 80;
      padding: 16px;
      display: none;
    }

    .widget-tray.open {
      display: block;
    }

    .widget-tray h2 {
      margin: 0 0 12px;
      color: #143f3a;
    }

    .replace-select {
      width: 100%;
      border: 1px solid #d1d5db;
      border-radius: 14px;
      padding: 10px;
      margin: 6px 0 12px;
      font-weight: 800;
      color: #143f3a;
      background: #ffffff;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.48);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 120;
      padding: 18px;
      backdrop-filter: blur(5px);
    }

    .modal-backdrop.show {
      display: flex;
    }

    #settingsModal.modal-backdrop.show,
#dailyContentModal.modal-backdrop.show {
  z-index: 1000100 !important;
}

#settingsModal.modal-backdrop.show
.modal-card,
#dailyContentModal.modal-backdrop.show
.modal-card {
  position: relative;
  z-index: 1000101 !important;
}

    .modal-card {
      width: min(1060px, 96vw);
      max-height: 92vh;
      background: #ffffff;
      border-radius: 24px;
      box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
      overflow: hidden;
      display: grid;
      grid-template-rows: auto 1fr auto;
    }

    /* =========================================================
   EDIT LESSON MODAL
   Compact, organised and teacher-friendly
   ========================================================= */

#periodModal {
  padding: 12px;
}

#periodModal .modal-card {
  width: min(1240px, 98vw);
  height: min(820px, 96vh);
  max-height: 96vh;
  border-radius: 20px;
}

/* Compact heading */

#periodModal .modal-head {
  min-height: 68px;
  padding: 11px 16px;
  gap: 12px;
}

#periodModal .modal-head h2 {
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.5px;
}

#periodModal .modal-head p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.2;
}

#periodModal #periodModalLessonContext {
  margin: 3px 0 0 !important;
  color: #159957 !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  font-weight: 950 !important;
}

#periodModal .period-modal-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

#periodModal .period-modal-status.ready {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

#periodModal .period-modal-status.incomplete {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

#periodModal .period-modal-status.not-prepared {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

#periodModal .modal-head .icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  font-size: 18px;
}

/* Main editing area */

#periodModal .modal-body {
  min-height: 0;
  padding: 12px 16px;
  overflow: hidden;
}

#periodModal .period-edit-layout {
  height: 100%;
  display: grid;
  grid-template-columns:
    minmax(350px, 0.82fr)
    minmax(520px, 1.18fr);
  gap: 16px;
  align-items: stretch;
}

/* Left side: lesson setup */

#periodModal .period-edit-left {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 8px 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

#periodModal .period-edit-left > label,
#periodModal .period-edit-left > .day-tabs,
#periodModal .period-edit-left > select,
#periodModal .period-edit-left > input,
#periodModal .period-edit-left > .period-edit-full-row,
#periodModal .period-edit-left > .period-video-section,
#periodModal .period-edit-left > .period-optional-extras {
  grid-column: 1 / -1;
}

#periodModal .period-optional-extras {
  width: 100%;
  min-width: 0;
  max-height: 100%;
}

#periodModal .period-optional-extras[open] {
  max-height: calc(96vh - 330px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#periodModal .period-optional-extras[open] > summary {
  position: sticky;
  top: 0;
  z-index: 3;
}

#periodModal .period-edit-pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns:
    minmax(150px, 0.9fr)
    minmax(190px, 1.1fr);
  gap: 12px;
}

#periodModal .period-edit-field,
#periodModal .period-edit-full-row {
  min-width: 0;
  margin: 0;
}

#periodModal .period-edit-left label,
#periodModal .period-edit-right label {
  display: block;
  margin: 0 0 6px;
  color: #475569;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

#periodModal .period-edit-left input,
#periodModal .period-edit-left select,
#periodModal .period-step-display-compact select {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 850;
}

#periodModal #periodModalDayTabs {
  display: flex;
  gap: 4px;
  margin: 0 !important;
  padding: 3px;
  border-radius: 11px;
  background: #e9eef3;
}

#periodModal #periodModalDayTabs button {
  min-height: 30px;
  flex: 1 1 0;
  min-width: 0;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 10px;
}

/* Keep related resources visually together without adding sections */

#periodModal .period-edit-full-row,
#periodModal .period-video-section {
  padding-top: 1px;
}

#periodModal .period-video-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 9px;
}

#periodModal .period-video-section label {
  margin: 0;
}

#periodModal .period-video-section input {
  min-width: 0;
}

#periodModal .period-video-section label:nth-of-type(1) {
  grid-column: 1;
  grid-row: 1;
}

#periodModal .period-video-section input:nth-of-type(1) {
  grid-column: 1;
  grid-row: 2;
}

#periodModal .period-video-section label:nth-of-type(2) {
  grid-column: 2;
  grid-row: 1;
}

#periodModal .period-video-section input:nth-of-type(2) {
  grid-column: 2;
  grid-row: 2;
}

/* Right side: lesson content */

#periodModal .period-edit-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid #d9fbe8;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

#periodModal .period-instructions-heading {
  min-height: 36px;
  margin: 0 0 9px;
  align-items: center;
}

#periodModal .period-instructions-heading label {
  color: #143f3a;
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: none;
}

#periodModal .period-instructions-subtitle {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.15;
}

#periodModal .instruction-mode-switch {
  flex: 0 0 auto;
  padding: 3px;
}

#periodModal .instruction-mode-button {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 10px;
}

/* Summary editor no longer consumes the entire modal */

#periodModal #simpleInstructionsEditor {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 7px;
}

#periodModal .period-format-toolbar {
  min-height: 28px;
  justify-content: flex-start;
  gap: 5px;
}

#periodModal .period-format-button {
  min-height: 27px;
  padding: 4px 9px;
  font-size: 10px;
}

#periodModal .period-edit-right .period-instructions-textarea {
  width: 100%;
  min-height: 180px;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 12px;
  resize: none;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

#periodModal .period-format-help {
  margin: 0;
  font-size: 10px;
  line-height: 1.2;
}

/* Student steps */

#periodModal .instruction-steps-editor {
  min-height: 0;
  height: 100%;
  gap: 8px;
}

#periodModal .instruction-steps-editor-head {
  min-height: 32px;
}

#periodModal .instruction-steps-editor-head > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

#periodModal .instruction-steps-editor-head strong {
  font-size: 12px;
}

#periodModal .instruction-steps-editor-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 9.5px;
}

#periodModal #addInstructionStepButton {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 10px;
}

/* Replace the tall explanation card with one compact row */

#periodModal .instruction-step-display-setting {
  min-height: 42px;
  grid-template-columns: minmax(0, 1fr) 165px;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 12px;
}

#periodModal .instruction-step-display-setting > div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#periodModal .instruction-step-display-setting strong {
  flex: 0 0 auto;
  font-size: 10.5px;
  white-space: nowrap;
}

#periodModal .instruction-step-display-setting span {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 9.5px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#periodModal .instruction-step-display-setting select {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
}

/* Compact step cards */

#periodModal .instruction-step-edit-list {
  gap: 6px;
  padding: 0 4px 6px 0;
}

#periodModal .instruction-step-edit-row {
  display: grid;

  grid-template-columns:
    34px
    minmax(0, 1fr)
    auto;

  grid-template-areas:
    "number title actions"
    ". text text"
    ". attachments attachments";

  gap: 8px;

  align-items: start;

  padding: 10px;

  border: 1px solid #d9fbe8;
  border-radius: 14px;

  background: #f8fffb;
}

#periodModal .instruction-step-number {
  grid-area: number;
}

#periodModal .instruction-step-edit-row > input {
  grid-area: title;

  width: 100%;
  min-width: 0;
}

#periodModal .instruction-step-edit-row > textarea {
  grid-area: text;

  width: 100%;

  min-height: 92px !important;
  height: auto;

  padding: 10px 11px;

  font-size: 12px;
  line-height: 1.4;

  resize: vertical;
}

#periodModal .instruction-step-attachments-editor {
  grid-area: attachments;
}

#periodModal .instruction-step-row-actions {
  grid-area: actions;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 4px;
}

#periodModal .instruction-step-number {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  font-size: 11px;
}

#periodModal .instruction-step-edit-row input {
  min-height: 36px;

  padding: 8px 10px;

  border: 1px solid #d1d5db;
  border-radius: 10px;

  background: #ffffff;

  font-size: 11.5px;
  font-weight: 850;
}

#periodModal .instruction-step-edit-row textarea {
  min-height: 44px;
  height: 44px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.25;
  resize: vertical;
}

#periodModal .instruction-step-row-actions {
  grid-template-columns: repeat(4, 27px);
  gap: 3px;
}

#periodModal .instruction-step-row-button {
  width: 27px;
  height: 27px;
  font-size: 10px;
}

/* Clear, fixed action bar */

#periodModal .modal-foot {
  min-height: 60px;
  padding: 9px 16px;
  gap: 7px;
  background: #ffffff;
  flex-wrap: nowrap;
}

#periodModal .modal-foot .btn {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 11px;
}

#periodModal #backToTimetableButton {
  margin-right: auto;
}

#periodModal .modal-foot .btn-primary {
  min-width: 145px;
}

/* Smaller screens */

@media (max-width: 980px) {
  #periodModal .modal-body {
    overflow-y: auto;
  }

  #periodModal .period-edit-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  #periodModal .period-edit-left,
  #periodModal .period-edit-right {
    overflow: visible;
  }

  #periodModal .period-edit-right {
    min-height: 500px;
  }
}

@media (max-width: 650px) {
  #periodModal {
    padding: 0;
  }

  #periodModal .modal-card {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  #periodModal .period-edit-left,
  #periodModal .period-video-section,
  #periodModal .period-edit-pair {
    grid-template-columns: 1fr;
  }

  #periodModal .period-video-section > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  #periodModal .period-instructions-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  #periodModal .instruction-step-display-setting {
    grid-template-columns: 1fr;
  }

  #periodModal .instruction-step-display-setting span {
    display: none;
  }

  #periodModal .instruction-step-edit-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  #periodModal .instruction-step-edit-row textarea,
  #periodModal .instruction-step-row-actions {
    grid-column: 2;
  }

  #periodModal .modal-foot {
    overflow-x: auto;
    justify-content: flex-start;
  }

  #periodModal #backToTimetableButton {
    margin-right: 0;
  }
}

    /* 💡 Onboarding Command Center: Dynamic Edge-to-Edge Blueprint Overrides */
    .modal-card.help-guide-fullscreen {
      width: 100vw !important;
      max-width: 100vw !important;
      height: 100vh !important;
      max-height: 100vh !important;
      border-radius: 0 !important;
      border: none !important;
    }

    /* Force parent backdrop container layout engine to release padding bounds when active */
    #settingsModal.show:has(.help-guide-fullscreen) {
      padding: 0 !important;
    }

    .modal-head {
      padding: 16px 20px;
      border-bottom: 1px solid #e5e7eb;
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: center;
    }

    .modal-head h2 {
      margin: 0;
      color: #143f3a;
      letter-spacing: -0.8px;
    }

    .modal-head p {
      margin: 3px 0 0;
      color: #6b7280;
      font-size: 13px;
      font-weight: 700;
    }

    .modal-body {
      padding: 18px 20px;
      overflow: auto;
      min-height: 0;
    }

    .modal-foot {
      padding: 13px 20px;
      border-top: 1px solid #e5e7eb;
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }

    .modal-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }

    .period-edit-layout {
      height: 100%;
      grid-template-columns:
        minmax(420px, 0.9fr)
        minmax(0, 1.1fr);
      align-items: stretch;
      gap: 20px;
    }

    .period-edit-left,
    .period-edit-right {
      min-width: 0;
    }

    .period-edit-left {
      display: flex;
      flex-direction: column;
    }

    .period-edit-pair {
      display: grid;
      grid-template-columns:
        minmax(150px, 0.72fr)
        minmax(240px, 1.28fr);
      gap: 12px;
    }

    .period-edit-field {
      min-width: 0;
    }

    .period-edit-field input,
    .period-edit-field select {
      width: 100%;
    }

    .period-edit-full-row {
      width: 100%;
    }

    .period-video-section {
      display: grid;
      grid-template-columns: 1fr;
      gap: 0;
      margin-top: 0;
    }

    .period-video-section input {
      width: 100%;
    }

    .period-optional-extras {
      width: 100%;
      margin-top: 2px;
      border: 1px solid #dbe3e8;
      border-radius: 14px;
      background: #f8fafc;
      overflow: hidden;
    }

    .period-optional-extras > summary {
      min-height: 46px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 13px;
      color: #143f3a;
      font-size: 12px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
      list-style: none;
      user-select: none;
    }

    .period-optional-extras > summary::-webkit-details-marker {
      display: none;
    }

    .period-optional-extras > summary::after {
      content: "▾";
      color: #159957;
      font-size: 14px;
      line-height: 1;
      font-weight: 950;
      transition: transform 0.16s ease;
    }

    .period-optional-extras:not([open]) > summary::after {
      transform: rotate(-90deg);
    }

    .period-optional-extras > summary:hover {
      background: #eefbf4;
    }

    .period-optional-extras > summary span {
      min-width: 0;
    }

    .period-optional-extras > summary small {
      margin-left: auto;
      padding: 4px 8px;
      border-radius: 999px;
      background: #e2e8f0;
      color: #64748b;
      font-size: 9px;
      line-height: 1;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: 0.4px;
    }

    .period-optional-extras[open] > summary {
      border-bottom: 1px solid #dbe3e8;
      background: #eefbf4;
    }

    .period-optional-extras-body {
      display: grid;
      gap: 11px;
      padding: 12px;
      background: #ffffff;
    }

    .period-slides-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
    }

    .period-slides-heading > label {
      margin: 0 !important;
    }

    #periodModal .period-apply-all-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin: 0;
      color: #159957;
      font-size: 11px;
      line-height: 1;
      font-weight: 900;
      text-transform: none;
      letter-spacing: 0;
      white-space: nowrap;
      cursor: pointer;
    }

    #periodModal .period-apply-all-label input {
      width: 15px;
      min-height: 15px;
      height: 15px;
      margin: 0;
      padding: 0;
      accent-color: #159957;
      cursor: pointer;
    }

    .period-field-optional {
      margin-left: 5px;
      color: #94a3b8;
      font-size: 10px;
      font-weight: 850;
      text-transform: none;
      letter-spacing: 0;
    }

    .period-edit-right {
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    .period-instructions-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
    }

    .period-instructions-heading label {
      margin-bottom: 0 !important;
    }

    .period-format-toolbar {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex-wrap: wrap;
    }

    .period-format-button {
      min-height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 5px 10px;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      background: #ffffff;
      color: #143f3a;
      font-size: 11px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
      cursor: pointer;
    }

    .period-format-button:hover {
      border-color: #86efac;
      background: #f1fdf6;
    }

    .period-format-button:active {
      transform: scale(0.96);
    }

    .period-edit-right .period-instructions-textarea {
      flex: 1 1 auto;
      width: 100%;
      min-height: 560px;
      height: 100%;
      max-height: none;
      resize: none;
      line-height: 1.55;
      margin-bottom: 7px;

      font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;

      font-size: 16px;
      font-weight: 500;
      letter-spacing: -0.01em;
    }

    .period-format-help {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.3;
  font-weight: 800;
}

.period-instructions-subtitle {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.instruction-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f8fafc;
}

.instruction-mode-button {
  min-height: 30px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}

.instruction-mode-button:hover {
  color: var(--board-ink);
  background: #ffffff;
}

.instruction-mode-button.active {
  background: var(--board-ink);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.instruction-steps-editor {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.instruction-steps-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.instruction-steps-editor-head > div {
  display: grid;
  gap: 2px;
}

.instruction-steps-editor-head strong {
  color: var(--board-ink);
  font-size: 13px;
  font-weight: 950;
}

.instruction-steps-editor-head span {
  color: #64748b;
  font-size: 10.5px;
  font-weight: 850;
}

.instruction-step-display-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 15px;
  background: #eff6ff;
}

.instruction-step-display-setting > div {
  display: grid;
  gap: 3px;
}

.instruction-step-display-setting strong {
  color: #1e3a5f;
  font-size: 12px;
  font-weight: 950;
}

.instruction-step-display-setting span {
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 800;
}

.instruction-step-display-setting select {
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #ffffff;
  color: var(--board-ink);
  font-size: 11px;
  font-weight: 900;
}

.instruction-step-edit-list {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 5px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.instruction-step-edit-row {
  display: grid;
  grid-template-columns:
    34px
    minmax(110px, 0.42fr)
    minmax(0, 1fr)
    auto;
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid #d9fbe8;
  border-radius: 15px;
  background: #f8fffb;
}

.instruction-step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--board-ink);
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
}

.instruction-step-edit-row input,
.instruction-step-edit-row textarea {
  width: 100%;
  margin: 0 !important;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  background: #ffffff;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.instruction-step-edit-row input {
  min-height: 38px;
  padding: 8px 10px;
}

.instruction-step-edit-row textarea {
  min-height: 62px;
  padding: 9px 10px;
  line-height: 1.35;
  resize: vertical;
}

.instruction-step-row-actions {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 5px;
}

.instruction-step-row-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: var(--board-ink);
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.instruction-step-row-button:hover {
  border-color: #86efac;
  background: #eefbf4;
}

.instruction-step-row-button.danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.instruction-step-row-button.danger:hover {
  background: #fef2f2;
}

.instruction-step-empty {
  padding: 22px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 850;
}

/* student-facing instruction steps */

.student-instruction-steps {
  width: 100%;
  display: grid;
  gap: 12px;
}

.student-instruction-step {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
  padding: 15px 17px;
  border: 1px solid #d9fbe8;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.student-instruction-step-number {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--board-ink);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}

.student-instruction-step-copy {
  min-width: 0;
}

.student-instruction-step-title {
  margin-bottom: 5px;
  color: var(--board-ink);
  font-size: clamp(18px, 1.7vw, 26px);
  line-height: 1.1;
  font-weight: 950;
}

.student-instruction-step-text {
  color: #374151;
  font-size: clamp(17px, 1.55vw, 24px);
  line-height: 1.35;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.student-instruction-one-step {
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  outline: none;
}

.student-instruction-one-step:focus-visible {
  border-radius: 20px;
  box-shadow:
    0 0 0 4px
    color-mix(
      in srgb,
      var(--board-accent) 24%,
      transparent
    );
}

.student-instruction-navigation {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns:
    48px
    minmax(0, 1fr)
    48px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid #d9fbe8;
  border-radius: 999px;
  background: #f8fafc;
}

.student-instruction-navigation-centre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.student-instruction-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  white-space: nowrap;
}

.student-instruction-view-button {
  min-width: 31px;
  min-height: 23px;
  padding: 4px 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

.student-instruction-view-button:hover {
  background: #eefbf4;
  color: var(--board-ink);
}

.student-instruction-view-button.active {
  background: var(--board-accent);
  color: var(--board-ink);
}

.student-instruction-all-view {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  outline: none;
}

.student-instruction-all-toolbar {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 5px 3px 10px;
  border: 1px solid #d9fbe8;
  border-radius: 999px;
  background: #f8fafc;
}

.task-instructions-heading-row {
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.task-instructions-heading-label {
  color: #64748b;
  font-size: 9.5px;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}



.student-instruction-all-label {
  color: #64748b;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.student-instruction-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--board-ink);
  color: #ffffff;
  font-size: 12.5px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.student-instruction-nav-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--board-ink);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.student-instruction-nav-button.next {
  justify-content: center;
}

.student-instruction-nav-button:hover:not(:disabled) {
  background: #eefbf4;
}

.student-instruction-nav-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.student-instruction-focus-card {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(22px, 3vw, 46px);
  border: 2px solid var(--board-ink);
  border-radius: 23px;
  background:
    radial-gradient(
      circle at top left,
      rgba(95, 220, 154, 0.18),
      transparent 34%
    ),
    #ffffff;
  text-align: center;

  /*
    Main lesson steps should fit the available card.

    Do not force the teacher to scroll just to see
    the remainder of the current instruction.
  */
  overflow: hidden;
}

.student-instruction-focus-card
  .student-instruction-step-title {
  margin-bottom: 7px;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.1;
}

.student-instruction-focus-card
  .student-instruction-step-text {
  font-size: clamp(18px, 2.1vw, 32px);
  line-height: 1.28;
  font-weight: 850;
}

/*
  Compact layout when Slides and instructions share the screen.
  Only the narrow lesson guide rail is reduced.
*/
.task-slides-instruction-panel
  .student-instruction-one-step {
  min-height: 0;
  gap: 7px;
}

.task-slides-instruction-panel
  .student-instruction-navigation {
  min-height: 32px;
  grid-template-columns:
    minmax(28px, 1fr)
    auto
    minmax(28px, 1fr);
  gap: 3px;
  padding: 3px;
}

.task-slides-instruction-panel
  .student-instruction-navigation-centre {
  gap: 3px;
}

.task-slides-instruction-panel
  .student-instruction-view-toggle {
  padding: 1px;
}

.task-slides-instruction-panel
  .student-instruction-view-button {
  min-width: 25px;
  min-height: 20px;
  padding: 3px 5px;
  font-size: 8px;
}

.task-slides-instruction-panel
  .student-instruction-all-toolbar {
  min-height: 28px;
  padding: 2px 3px 2px 8px;
}

.task-slides-instruction-panel
  .student-instruction-all-label {
  font-size: 8.5px;
}

.task-slides-instruction-panel
  .student-instruction-progress {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 9px;
}

.task-slides-instruction-panel
  .student-instruction-nav-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

.task-slides-instruction-panel
  .student-instruction-nav-button span {
  display: none;
}

.task-slides-instruction-panel
  .student-instruction-focus-card {
  min-height: 0;
  height: 100%;
  grid-template-columns:
    minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 16px 16px;
  border-width: 1px;
  border-radius: 15px;
  align-items: flex-start;
  text-align: left;
}

.task-slides-instruction-panel
  .student-instruction-step-title {
  margin-bottom: 6px;
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 1.12;
}

.task-slides-instruction-panel
  .student-instruction-step-text {
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.38;
  font-weight: 750;
}

/* Compact Show All layout beside Slides */
.task-slides-instruction-panel
  .student-instruction-steps {
  gap: 7px;
}

.task-slides-instruction-panel
  .student-instruction-step {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
}

.task-slides-instruction-panel
  .student-instruction-step-number {
  display: none !important;
}

.task-slides-instruction-panel
  .student-instruction-step-title {
  font-size: 13px;
}

.task-slides-instruction-panel
  .student-instruction-step-text {
  font-size: 12px;
  line-height: 1.35;
}

body.focus-mode .student-instruction-focus-card,
body.fullscreen-active .student-instruction-focus-card {
  min-height: 420px;
}

body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-title,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-title {
  font-size: clamp(30px, 3.4vw, 50px);
}

/*
  Present mode lesson text starts large.

  JavaScript measures the available card space and reduces
  the text size only when necessary so the whole instruction
  remains visible without scrolling.
*/
body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-text,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-text {
  font-size: 68px;
  line-height: 1.16;
  overflow: visible;
  max-height: none;
}


/*
  Auto-fit stages.

  Short steps remain projector-large.
  Longer steps progressively reduce in size.
*/
body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-1,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-1 {
  font-size: 58px;
}

body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-2,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-2 {
  font-size: 50px;
}

body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-3,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-3 {
  font-size: 42px;
}

body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-4,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-4 {
  font-size: 36px;
}

body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-5,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-5 {
  font-size: 30px;
}

body.focus-mode
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-6,
body.fullscreen-active
  .student-instruction-focus-card
  .student-instruction-step-text.present-fit-6 {
  font-size: 25px;
  line-height: 1.2;
}

/*
  Slides remain compact even when Projector or Clean Focus
  enlarges the rest of the Classboard.
*/
body.focus-mode
  .task-slides-instruction-panel
  .student-instruction-focus-card,
body.fullscreen-active
  .task-slides-instruction-panel
  .student-instruction-focus-card {
  min-height: 0;
  padding: 16px 13px;
}

body.focus-mode
  .task-slides-instruction-panel
  .student-instruction-step-title,
body.fullscreen-active
  .task-slides-instruction-panel
  .student-instruction-step-title {
  font-size: clamp(15px, 1.35vw, 20px);
}

body.focus-mode
  .task-slides-instruction-panel
  .student-instruction-step-text,
body.fullscreen-active
  .task-slides-instruction-panel
  .student-instruction-step-text {
  font-size: clamp(14px, 1.18vw, 18px);
}

body.focus-mode .student-instruction-step,
body.fullscreen-active .student-instruction-step {
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 24px;
}

body.focus-mode .student-instruction-step-number,
body.fullscreen-active .student-instruction-step-number {
  width: 66px;
  height: 66px;
  font-size: 27px;
}

body.focus-mode .student-instruction-step-title,
body.fullscreen-active .student-instruction-step-title {
  font-size: clamp(25px, 2.5vw, 38px);
}

body.focus-mode .student-instruction-step-text,
body.fullscreen-active .student-instruction-step-text {
  font-size: clamp(24px, 2.7vw, 42px);
}

body.focus-mode .student-instruction-focus-card,
body.fullscreen-active .student-instruction-focus-card {
  min-height: 420px;
}

@media (max-width: 850px) {
  .instruction-step-display-setting,
  .instruction-step-edit-row {
    grid-template-columns: 1fr;
  }

  .instruction-step-row-actions {
    grid-template-columns: repeat(4, 34px);
  }

  .student-instruction-step {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .student-instruction-step-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 16px;
  }
}

    @media (max-width: 850px) {
      .period-edit-layout,
      .period-edit-pair {
        grid-template-columns: 1fr;
      }

      .period-edit-layout {
        height: auto;
      }

      .period-edit-right .period-instructions-textarea {
        min-height: 360px;
        height: 360px;
        resize: vertical;
      }
    }

    .modal-field label,
    .tray-label {
      display: block;
      font-size: 12px;
      font-weight: 900;
      color: #4b5563;
      margin-bottom: 5px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .modal-field input:not([type="radio"]),
    .modal-field textarea,
    .modal-field select {
      width: 100%;
      border: 1px solid #d1d5db;
      border-radius: 14px;
      padding: 12px;
      font-size: 15px;
      outline: none;
      background: #ffffff;
      margin-bottom: 12px;
    }

    .modal-field input[type="radio"] {
      width: 18px;
      height: 18px;
      min-width: 18px;
      margin: 0;
      padding: 0;
      flex: 0 0 18px;
      accent-color: #22c55e;
      cursor: pointer;
    }

    .modal-field label:has(
      input[type="radio"]
    ) {
      width: fit-content;
      display: flex !important;
      align-items: center;
      gap: 9px;
      margin: 0 0 9px !important;
      color: #334155 !important;
      font-size: 14px !important;
      line-height: 1.25;
      font-weight: 850 !important;
      letter-spacing: 0 !important;
      text-transform: none !important;
      cursor: pointer;
    }

    .modal-field label:has(
      input[type="radio"]
    ):last-child {
      margin-bottom: 0 !important;
    }

    .modal-field textarea {
      min-height: 126px;
      resize: vertical;
      line-height: 1.45;
    }

    .modal-field .period-instructions-textarea {
      min-height: 340px;
      height: 340px;
      max-height: 55vh;
      resize: vertical;
      line-height: 1.5;
    }

    .modal-field input:not([type="radio"]):focus,
    .modal-field textarea:focus,
    .modal-field select:focus {
      border-color: #22c55e;
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
    }

    .modal-field input[type="radio"]:focus-visible {
      outline: 3px solid rgba(34, 197, 94, 0.22);
      outline-offset: 3px;
    }

    .day-tabs {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 8px;
      margin-bottom: 14px;
    }

    .day-tab {
      border: 1px solid #d1d5db;
      background: #f8fafc;
      color: #143f3a;
      border-radius: 999px;
      padding: 10px;
      font-weight: 900;
      cursor: pointer;
    }

    .day-tab.active {
      background: #143f3a;
      color: #ffffff;
      border-color: #143f3a;
    }

    .timetable-edit-grid {
      display: grid;
      gap: 9px;
    }

    .edit-row {
  display: grid;
  grid-template-columns: 145px 1fr 1.1fr auto;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 9px;
}

.edit-row input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 14px;
  margin: 0;
}

.edit-row input[type="time"] {
  min-width: 132px;
  font-weight: 900;
  text-align: center;
  padding-left: 12px;
  padding-right: 12px;
  line-height: 1.2;
}


/* =========================================================
   TIMETABLE EDITOR — DAY / WEEK VIEW
   ========================================================= */

.timetable-editor-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 4px;

  border: 1px solid #dbe6df;
  border-radius: 999px;

  background: #f8fafc;
}

.timetable-editor-view-button {
  min-height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 7px 12px;

  border: 0;
  border-radius: 999px;

  background: transparent;

  color: #64748b;

  font-size: 10.5px;
  line-height: 1;
  font-weight: 950;

  white-space: nowrap;
  cursor: pointer;
}

.timetable-editor-view-button:hover {
  background: #ffffff;
  color: #143f3a;
}

.timetable-editor-view-button.active {
  background: #143f3a;
  color: #ffffff;

  box-shadow:
    0 3px 8px
    rgba(15, 23, 42, 0.12);
}


.timetable-week-overview {
  display: grid;
  gap: 10px;

  min-width: 0;
}


#timetableDayEditorView[hidden],
#timetableWeekEditorView[hidden] {
  display: none !important;
}


.timetable-week-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  flex-wrap: wrap;
}


.timetable-week-overview-title {
  display: grid;
  gap: 3px;
}


.timetable-week-overview-title strong {
  color: #143f3a;

  font-size: 15px;
  line-height: 1.1;
  font-weight: 950;
}


.timetable-week-overview-title span {
  color: #64748b;

  font-size: 10px;
  line-height: 1.3;
  font-weight: 800;
}


.timetable-week-grid-wrap {
  width: 100%;
  min-width: 0;

  overflow-x: auto;
  overflow-y: visible;

  padding:
    2px
    2px
    10px;

  scrollbar-width: thin;
}


.timetable-week-grid {
  min-width: 920px;

  display: grid;

  grid-template-columns:
    88px
    repeat(
      5,
      minmax(
        150px,
        1fr
      )
    );

  gap: 6px;
}


.timetable-week-corner,
.timetable-week-day-head,
.timetable-week-time {
  min-height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  font-weight: 950;
}


.timetable-week-corner {
  background: #143f3a;
  color: #ffffff;

  font-size: 10px;
}


.timetable-week-day-head {
  flex-direction: column;
  gap: 3px;

  padding: 7px;

  border: 1px solid #d9fbe8;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f1fdf6
    );

  color: #143f3a;

  cursor: pointer;
}


.timetable-week-day-head:hover,
.timetable-week-day-head:focus-visible {
  border-color: #5fdc9a;

  background: #eefbf4;

  outline: none;
}


.timetable-week-day-head strong {
  font-size: 12px;
}


.timetable-week-day-head span {
  color: #64748b;

  font-size: 9px;
  font-weight: 850;
}


.timetable-week-day-head.is-today {
  border:
    2px solid
    #22c55e;

  background:
    linear-gradient(
      145deg,
      #f0fdf4,
      #dcfce7
    );

  box-shadow:
    0 0 0 3px
    rgba(
      34,
      197,
      94,
      0.10
    );
}


.timetable-week-day-head.is-today
strong {
  color:
    #166534;
}


.timetable-week-day-head.is-today
span {
  color:
    #4b7b5a;
}


.timetable-week-today-badge {
  min-height:
    18px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  padding:
    3px
    7px;

  border-radius:
    999px;

  background:
    #22c55e;

  color:
    #ffffff !important;

  font-size:
    8px !important;

  line-height:
    1;

  font-weight:
    950 !important;

  letter-spacing:
    0.2px;

  text-transform:
    uppercase;
}


.timetable-week-cell.is-today {
  border-color:
    #bbf7d0;

  background:
    #f7fef9;

  box-shadow:
    inset
    0
    0
    0
    1px
    rgba(
      34,
      197,
      94,
      0.05
    );
}


.timetable-week-time {
  min-height: 68px;

  padding: 7px;

  border: 1px solid #dbe6df;

  background: #f8fafc;

  color: #475569;

  font-size: 10.5px;

  text-align: center;
}


.timetable-week-cell {
  min-width: 0;
  min-height: 68px;

  padding: 5px;

  border: 1px dashed #e2e8f0;
  border-radius: 12px;

  background: #fbfcfd;
}


.timetable-week-empty {
  width: 100%;
  height: 100%;
  min-height: 56px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 9px;

  background: transparent;

  color: #cbd5e1;

  font-size: 16px;
  font-weight: 950;

  cursor: pointer;
}


.timetable-week-empty:hover,
.timetable-week-empty:focus-visible {
  background: #f1fdf6;

  color: #159957;

  outline: none;
}


.timetable-week-lesson {
  width: 100%;
  min-height: 56px;

  display: grid;
  align-content: center;
  gap: 4px;

  padding: 8px 9px;

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

  text-align: left;

  cursor: pointer;

  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}


.timetable-week-lesson:hover,
.timetable-week-lesson:focus-visible {
  transform: translateY(-2px);

  box-shadow:
    0 7px 16px
    rgba(15, 23, 42, 0.12);

  outline: none;
}


.timetable-week-lesson-title {
  overflow: hidden;

  color: inherit;

  font-size: 11px;
  line-height: 1.15;
  font-weight: 950;

  display: -webkit-box;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  line-clamp: 2;
}


.timetable-week-lesson-note {
  overflow: hidden;

  color: inherit;

  opacity: 0.72;

  font-size: 8.5px;
  line-height: 1.15;
  font-weight: 800;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/*
 * Soft subject colours.
 * The same subject family receives the same colour
 * throughout the week.
 */

.timetable-week-colour-1 {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.timetable-week-colour-2 {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.timetable-week-colour-3 {
  background: #faf5ff;
  border-color: #e9d5ff;
  color: #7e22ce;
}

.timetable-week-colour-4 {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.timetable-week-colour-5 {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #be185d;
}

.timetable-week-colour-6 {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

.timetable-week-colour-7 {
  background: #fefce8;
  border-color: #fef08a;
  color: #a16207;
}

.timetable-week-colour-8 {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}


.timetable-week-break {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}


.timetable-week-lunch {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}


@media (max-width: 700px) {
  .timetable-editor-view-switch {
    width: 100%;
  }

  .timetable-editor-view-button {
    flex: 1 1 0;
  }
}

/* User-Friendly Timetable Row Insertion Focus Highlight */
@keyframes rowHighlightPulse {
  0% { background-color: rgba(34, 197, 94, 0.25); border-color: #22c55e; transform: scale(1.01); }
  100% { background-color: #f8fafc; border-color: #e5e7eb; transform: scale(1); }
}

.new-row-pulse {
  animation: rowHighlightPulse 2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

    .row-actions {
      display: flex;
      gap: 5px;
      align-items: center;
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%) translateY(20px);
      background: #143f3a;
      color: #ffffff;
      padding: 13px 17px;
      border-radius: 999px;
      font-weight: 900;
      box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
      opacity: 0;
      pointer-events: none;
      transition: all 0.25s ease;
      z-index: 180;
      max-width: 90vw;
      text-align: center;
    }

    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    /* 🔒 Premium Trial Lock Layer Styles */
    body.trial-expired main,
    body.trial-expired header {
      filter: blur(8px);
      pointer-events: none;
      user-select: none;
      transition: filter 0.5s ease;
    }

    .trial-lock-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.3);
      backdrop-filter: blur(4px);
      z-index: 9999999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      font-family: Arial, sans-serif;
    }

    .trial-lock-overlay.active {
      display: flex;
    }

    .trial-lock-card {
      background: #ffffff;
      max-width: 560px;
      width: 100%;
      border-radius: 28px;
      padding: 34px 38px;
      text-align: center;
      box-shadow:
        0 28px 76px
        rgba(
          15,
          23,
          42,
          0.28
        );
      border:
        1px solid
        #e5e7eb;
    }


    .trial-lock-icon {
      width:
        100%;

      display:
        flex;

      justify-content:
        center;

      align-items:
        center;

      margin-bottom:
        12px;
    }


    .trial-lock-icon img {
      width:
        82px;

      height:
        82px;

      display:
        block;

      border-radius:
        20px;

      box-shadow:
        0 10px 24px
        rgba(
          15,
          23,
          42,
          0.14
        );
    }


    .trial-lock-eyebrow {
      margin-bottom:
        8px;

      color:
        #7c3aed;

      font-size:
        10px;

      line-height:
        1;

      font-weight:
        950;

      letter-spacing:
        0.65px;

      text-transform:
        uppercase;
    }


    .trial-lock-card h2 {
      margin:
        0
        0
        10px;

      color:
        #143f3a;

      font-size:
        30px;

      line-height:
        1.08;

      font-weight:
        950;

      letter-spacing:
        -0.7px;
    }


    .trial-lock-card p {
      max-width:
        440px;

      margin:
        0
        auto
        18px;

      color:
        #64748b;

      font-size:
        15px;

      line-height:
        1.45;

      font-weight:
        750;
    }


    .trial-lock-value {
      margin-top:
        4px;

      margin-bottom:
        16px;

      padding:
        11px
        14px;

      border:
        1px solid
        #bbf7d0;

      border-radius:
        15px;

      background:
        #f0fdf4;

      color:
        #166534;

      font-size:
        13px;

      line-height:
        1.3;

      font-weight:
        950;
    }


    .trial-lock-value[hidden] {
      display:
        none !important;
    }


    .trial-lock-price {
      margin-bottom:
        17px;

      padding:
        14px;

      border:
        1px solid
        #e2e8f0;

      border-radius:
        17px;

      background:
        #f8fafc;

      text-align:
        center;
    }


    .trial-lock-price strong {
      display:
        block;

      color:
        #143f3a;

      font-size:
        30px;

      line-height:
        1.05;

      font-weight:
        950;

      letter-spacing:
        -0.7px;
    }


    .trial-lock-price span {
      display:
        block;

      margin-top:
        6px;

      color:
        #64748b;

      font-size:
        10.5px;

      line-height:
        1.25;

      font-weight:
        800;
    }


    .trial-lock-actions {
      display:
        grid;

      gap:
        9px;
    }


    .trial-lock-primary {
      width:
        100%;

      min-height:
        56px;

      padding:
        14px
        24px;

      border:
        0;

      border-radius:
        999px;

      background:
        linear-gradient(
          135deg,
          #7c3aed,
          #6d28d9
        ) !important;

      color:
        #ffffff !important;

      font-size:
        16px;

      line-height:
        1;

      font-weight:
        950;

      letter-spacing:
        -0.2px;

      text-decoration:
        none;

      box-shadow:
        0 10px 24px
        rgba(
          109,
          40,
          217,
          0.28
        );
    }


    .trial-lock-secondary {
      width:
        100%;

      min-height:
        46px;

      border:
        1px solid
        #d1d5db;

      border-radius:
        999px;

      background:
        #ffffff;

      color:
        #475569;

      font-size:
        14px;

      font-weight:
        900;

      cursor:
        pointer;
    }

    .save-status {
      display: none !important; /* Hides the visual overlay block completely while keeping local persistence functions active */
      position: fixed;
      right: 14px;
      bottom: 14px;
      background: rgba(255,255,255,0.94);
      border: 1px solid #e5e7eb;
      color: #64748b;
      border-radius: 999px;
      padding: 8px 12px;
      font-size: 12px;
      font-weight: 900;
      z-index: 75;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    /* Dynamic 3D Spinner Auto-Sizing Layout Engine */
    #wrapper3D {
      --wheel-size: min(320px, 42vh) !important; /* Kept compact to fully prevent normal mode scrollbars */
      width: var(--wheel-size) !important;
      height: var(--wheel-size) !important;
    }

    .spinner-control-panel {
      padding: 14px !important;
      gap: 12px !important;
    }

    /* Aggressive upscaling optimized to fit perfectly without causing vertical scrollbars */
    body.focus-mode #wrapper3D,
    body.fullscreen-active #wrapper3D {
      --wheel-size: min(760px, 73vh) !important; /* Fills empty space perfectly without spilling over the bottom */
      margin-top: -15px !important; /* Nudges the entire 3D wheel element upward cleanly as requested */
    }

    body.focus-mode .spinner-control-panel,
    body.fullscreen-active .spinner-control-panel {
      padding: 28px !important;
      gap: 24px !important;
    }

    /* 3D Neon Slot Machine Cabinet Engine Styles */
    .picker-theater-stage {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 100%;
      min-height: 260px;
      perspective: 1400px;
      border-radius: 26px;
      cursor: pointer;
      outline: none;
      transition:
        background 0.16s ease,
        transform 0.16s ease;
    }

    .picker-theater-stage:hover,
    .picker-theater-stage:focus-visible {
      background:
        rgba(
          95,
          220,
          154,
          0.08
        );
    }

    .picker-theater-stage:hover
    .slot-machine-cabinet,
    .picker-theater-stage:focus-visible
    .slot-machine-cabinet {
      transform:
        translateY(-2px)
        scale(1.01);
    }

    .picker-theater-stage:active
    .slot-machine-cabinet {
      transform:
        scale(0.985);
    }

    .slot-machine-cabinet {
      width: min(540px, 85vw);
      height: 160px; /* Taller baseline container depth */
      background: linear-gradient(180deg, #0d2d29, #061816);
      border: 5px solid #143f3a;
      border-radius: 24px;
      position: relative;
      overflow: hidden;
      box-shadow: 0 22px 50px rgba(15,23,42,0.22), inset 0 0 30px rgba(0,0,0,0.85), 0 0 20px rgba(34,197,94,0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      transition:
        transform 0.16s ease,
        box-shadow 0.16s ease;
    }

    /* Massive visual presentation upgrade when screen real estate drops standard rails open */
    body.focus-mode .slot-machine-cabinet,
    body.fullscreen-active .slot-machine-cabinet {
      width: min(860px, 85vw) !important; /* Spans across screen canvas */
      height: 250px !important; /* Substantial depth layout presence */
      border-width: 6px;
      box-shadow: 0 35px 75px rgba(15,23,42,0.35), inset 0 0 45px rgba(0,0,0,0.9), 0 0 35px rgba(34,197,94,0.22);
      margin-top: -20px; /* Centers layout within vertical spaces */
    }

    .slot-reel-viewport {
      width: 92%;
      height: 78%;
      background: #ffffff;
      border: 4px solid #cbd5e1;
      border-radius: 14px;
      overflow: hidden;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 8px 18px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.03);
    }

    .slot-name-card {
      font-size: 42px; /* Upscaled default base typography */
      font-weight: 900;
      color: #143f3a;
      text-align: center;
      width: 100%;
      letter-spacing: -1.5px;
      transform-style: preserve-3d;
      transition: all 0.15s ease-out;
    }

    body.focus-mode .slot-name-card,
    body.fullscreen-active .slot-name-card {
      font-size: 72px; /* Giant, readable lettering clear to the back rows */
      letter-spacing: -2.5px;
    }

    /* Enhanced speed blur settings matching increased container dimensions */
    .slot-name-card.shuffling {
      animation: slotBlurSpinLoop 0.06s linear infinite;
    }

    @keyframes slotBlurSpinLoop {
      0% { transform: translateY(-45px) scaleY(0.7); opacity: 0.25; filter: blur(3px); }
      50% { transform: translateY(0px) scaleY(1.2); opacity: 1; }
      100% { transform: translateY(45px) scaleY(0.7); opacity: 0.25; filter: blur(3px); }
    }

    /* Vibrant celebration scale tracking loop configuration */
    .slot-name-card.winner-pop {
      animation: slotWinnerPop 0.48s cubic-bezier(0.175, 0.885, 0.32, 1.4) forwards;
    }

    @keyframes slotWinnerPop {
      0% { transform: scale(0.5) translateZ(0px); opacity: 0.2; }
      50% { transform: scale(1.08) translateZ(45px); color: #22c55e; }
      100% { transform: scale(1) translateZ(40px); color: #22c55e; text-shadow: 0 0 12px rgba(34,197,94,0.25); }
    }


    /* =========================================================
       RANDOM STUDENT PICKER MODES
       Simple = existing slot picker
       Fun = anonymous floating Class Reward-style avatars
       ========================================================= */

    .picker-mode-switch {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px;
      border: 1px solid #e2e8f0;
      border-radius: 999px;
      background: #f1f5f9;
      box-shadow:
        0 4px 10px
        rgba(15, 23, 42, 0.04);
    }

    .picker-mode-button {
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 7px 14px;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: #64748b;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
      cursor: pointer;
      transition:
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
    }

    .picker-mode-button:hover {
      background: rgba(255, 255, 255, 0.8);
      color: #143f3a;
    }

    .picker-mode-button.active {
      background: #143f3a;
      color: #ffffff;
      box-shadow:
        0 4px 10px
        rgba(20, 63, 58, 0.18);
    }

    .picker-mode-button:active {
      transform: scale(0.96);
    }

    .picker-mode-header {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      flex: 0 0 auto;
    }


    /* FUN PICKER */

    .picker-fun-stage {
      width: 100%;
      height: 100%;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 9px;
      flex: 1 1 auto;
    }

    .picker-fun-board {
      position: relative;
      width: 100%;
      min-height: 300px;
      flex: 1 1 auto;
      overflow: hidden;
      border: 1px solid
        color-mix(
          in srgb,
          var(--board-accent) 30%,
          #e2e8f0
        );
      border-radius: 24px;
      background:
        radial-gradient(
          circle at 18% 18%,
          color-mix(
            in srgb,
            var(--board-accent) 18%,
            transparent
          ),
          transparent 34%
        ),
        radial-gradient(
          circle at 82% 78%,
          rgba(59, 130, 246, 0.08),
          transparent 34%
        ),
        linear-gradient(
          145deg,
          #ffffff,
          #f8fafc
        );
      box-shadow:
        inset 0 0 0 1px
        rgba(255,255,255,0.7),
        0 10px 24px
        rgba(15, 23, 42, 0.06);
    }

    .picker-fun-board::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      opacity: 0.34;
      background-image:
        radial-gradient(
          circle,
          rgba(20, 63, 58, 0.13) 1px,
          transparent 1.5px
        );
      background-size: 28px 28px;
    }

    .picker-fun-instruction {
      position: absolute;
      top: 12px;
      left: 50%;
      z-index: 10;
      transform: translateX(-50%);
      max-width: calc(100% - 24px);
      min-height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 7px 13px;
      border: 1px solid #d9fbe8;
      border-radius: 999px;
      background:
        rgba(255,255,255,0.92);
      color: #64748b;
      font-size: 10.5px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
      box-shadow:
        0 5px 14px
        rgba(15,23,42,0.07);
      backdrop-filter: blur(8px);
      pointer-events: none;
    }

    .picker-fun-avatar {
      --picker-x: 50%;
      --picker-y: 50%;
      --picker-drift-x: 8px;
      --picker-drift-y: 7px;
      --picker-rotate: 4deg;
      --picker-duration: 5.5s;
      --picker-delay: 0s;

      position: absolute;
      left: var(--picker-x);
      top: var(--picker-y);
      z-index: 3;

      width: 64px;
      height: 64px;

      display: grid;
      place-items: center;

      padding: 0;

      border:
        2px solid
        rgba(20,63,58,0.11);

      border-radius: 22px;

      background:
        radial-gradient(
          circle at 35% 25%,
          #ffffff,
          #f8fafc 68%
        );

      color: #143f3a;

      font-size: 34px;
      line-height: 1;

      cursor: pointer;

      box-shadow:
        0 10px 20px
        rgba(15,23,42,0.12),
        inset 0 -7px 12px
        rgba(15,23,42,0.035);

      transform:
        translate(-50%, -50%);

      animation:
  pickerFunFloat
  var(--picker-duration)
  cubic-bezier(
    0.45,
    0.05,
    0.25,
    0.95
  )
  var(--picker-delay)
  infinite
  alternate;

      transition:
        width 0.2s ease,
        height 0.2s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease,
        opacity 0.16s ease,
        filter 0.16s ease;
    }

    .picker-fun-avatar:hover,
    .picker-fun-avatar:focus-visible {
      z-index: 20;
      border-color: #5fdc9a;
      background: #ffffff;
      box-shadow:
        0 15px 30px
        rgba(15,23,42,0.17),
        0 0 0 6px
        rgba(95,220,154,0.14);
      outline: none;
      animation-play-state: paused;
    }

    .picker-fun-avatar:active {
      width: 59px;
      height: 59px;
    }

    .picker-fun-avatar.is-picked {
      opacity: 0.52;
      filter: saturate(0.65);
      border-color: #cbd5e1;
    }

    .picker-fun-avatar.is-picked::after {
      content: "✓";
      position: absolute;
      right: -5px;
      top: -5px;
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border: 2px solid #ffffff;
      border-radius: 999px;
      background: #22c55e;
      color: #ffffff;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      box-shadow:
        0 3px 8px
        rgba(15,23,42,0.15);
    }

    .picker-fun-avatar.just-revealed {
      z-index: 30;
      opacity: 1;
      filter: none;
      border-color: #22c55e;
      animation:
        pickerFunRevealPop
        0.6s
        cubic-bezier(
          0.175,
          0.885,
          0.32,
          1.35
        )
        both;
    }

    .picker-fun-reveal {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 40;

  min-width: min(420px, calc(100% - 30px));
  max-width: calc(100% - 30px);

  display: grid;
  grid-template-columns:
    auto
    minmax(0, 1fr)
    auto;
  align-items: center;
  gap: 11px;

  padding: 10px 15px;

  border: 2px solid #bbf7d0;
  border-radius: 18px;

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

  color: #143f3a;

  box-shadow:
    0 16px 34px
    rgba(15,23,42,0.16);

  backdrop-filter:
    blur(10px);

  transform:
    translate(-50%, 18px)
    scale(0.94);

  opacity: 0;
  visibility: hidden;

  /*
    Needed so the new
    "Pick another" button
    can be clicked.
  */
  pointer-events: auto;

  transition:
    opacity 0.18s ease,
    transform 0.25s
    cubic-bezier(
      0.175,
      0.885,
      0.32,
      1.2
    ),
    visibility 0.18s ease;
}

    .picker-fun-reveal.show {
      opacity: 1;
      visibility: visible;
      transform:
        translate(-50%, 0)
        scale(1);
    }

    .picker-fun-reveal-avatar {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      border-radius: 15px;
      background: #eefbf4;
      font-size: 27px;
    }

    .picker-fun-reveal-copy {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .picker-fun-reveal-copy span {
      color: #64748b;
      font-size: 9px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0.65px;
      text-transform: uppercase;
    }

    .picker-fun-reveal-copy strong {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #143f3a;
      font-size: clamp(20px, 2vw, 30px);
      line-height: 1.05;
      font-weight: 950;
      white-space: nowrap;
    }

    @keyframes pickerFunFloat {
  0% {
    transform:
      translate(
        -50%,
        -50%
      )
      translate(
        -120px,
        -80px
      )
      rotate(-8deg)
      scale(0.96);
  }

  20% {
    transform:
      translate(
        -50%,
        -50%
      )
      translate(
        110px,
        -35px
      )
      rotate(7deg)
      scale(1.04);
  }

  40% {
    transform:
      translate(
        -50%,
        -50%
      )
      translate(
        55px,
        95px
      )
      rotate(-5deg)
      scale(0.98);
  }

  60% {
    transform:
      translate(
        -50%,
        -50%
      )
      translate(
        -105px,
        70px
      )
      rotate(8deg)
      scale(1.05);
  }

  80% {
    transform:
      translate(
        -50%,
        -50%
      )
      translate(
        125px,
        40px
      )
      rotate(-6deg)
      scale(1);
  }

  100% {
    transform:
      translate(
        -50%,
        -50%
      )
      translate(
        -65px,
        -95px
      )
      rotate(5deg)
      scale(0.97);
  }
}

    @keyframes pickerFunRevealPop {
      0% {
        transform:
          translate(-50%, -50%)
          scale(0.7)
          rotate(-6deg);
      }

      55% {
        transform:
          translate(-50%, -50%)
          scale(1.22)
          rotate(4deg);
      }

      100% {
        transform:
          translate(-50%, -50%)
          scale(1)
          rotate(0deg);
      }
    }

    body.focus-mode
    .picker-fun-avatar,
    body.fullscreen-active
    .picker-fun-avatar {
      width: 82px;
      height: 82px;
      border-radius: 27px;
      font-size: 44px;
    }

    body.focus-mode
    .picker-fun-reveal,
    body.fullscreen-active
    .picker-fun-reveal {
      min-width: min(
        480px,
        calc(100% - 40px)
      );
      padding: 14px 19px;
    }

    body.focus-mode
    .picker-fun-reveal-avatar,
    body.fullscreen-active
    .picker-fun-reveal-avatar {
      width: 61px;
      height: 61px;
      font-size: 34px;
    }

    body.focus-mode
    .picker-fun-reveal-copy strong,
    body.fullscreen-active
    .picker-fun-reveal-copy strong {
      font-size:
        clamp(
          28px,
          3vw,
          42px
        );
    }

    @media (
      prefers-reduced-motion:
      reduce
    ) {
      .picker-fun-avatar {
        animation: none;
      }

      .picker-fun-avatar.just-revealed {
        animation: none;
      }
    }


    body.focus-mode .corkboard-arena,
    body.fullscreen-active .corkboard-arena {
      gap: var(--note-gap, 32px) !important;
      padding: 28px !important;
    }

    /* Projector-Friendly 3D Corkboard Felt Layout Suite - Strict 4-Column Row Lock */
    .corkboard-arena {
      display: grid;
      grid-template-columns: repeat(4, 1fr) !important; /* Mathematically forces exactly 4 notes per row */
      align-content: start;
      justify-content: center;
      justify-items: center;
      gap: var(--note-gap, 20px);
      width: 100%;
      height: 100%;
      min-height: 250px;
      padding: 18px;
      background: #f1f5f9;
      border-radius: 20px;
      border: 1px solid #cbd5e1;
      box-shadow: inset 0 4px 12px rgba(15,23,42,0.06);
      overflow-y: auto;
    }

    body.focus-mode .corkboard-arena,
    body.fullscreen-active .corkboard-arena {
      gap: var(--note-gap, 32px) !important;
      padding: 24px !important;
    }

    .corkboard-note {
      position: relative;
      width: 100%; /* Dynamically matches the exact split width of the 4 columns */
      height: var(--note-h, 180px); /* Keeps a realistic square structure aspect ratio */
      padding: 28px 16px 16px;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      font-size: var(--note-font, 15px);
      font-weight: 700;
      line-height: 1.4;
      color: #1e293b;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
      transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.28), box-shadow 0.22s;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      overflow: hidden;
    }

    .corkboard-note:hover {
      transform: scale(1.08) rotate(0deg) !important;
      box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
      z-index: 30;
    }

    /* Lightbox Modal Pop-up Layout Configurations */
    .note-lightbox-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.5);
      backdrop-filter: blur(6px);
      z-index: 999999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    
    .note-lightbox-card {
      width: min(650px, 90vw);
      min-height: min(420px, 60vh);
      padding: 48px 34px;
      border-radius: 4px;
      box-shadow: 0 30px 70px rgba(0,0,0,0.25);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      font-size: clamp(24px, 3.5vw, 42px);
      font-weight: 700;
      line-height: 1.4;
      color: #1e293b;
      position: relative;
      text-align: center;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .corkboard-note:hover {
      transform: scale(1.08) rotate(0deg) !important; /* Resets structural tilt on focus */
      box-shadow: 0 22px 40px rgba(15,23,42,0.16);
      z-index: 30;
    }

    .note-pushpin {
      position: absolute;
      top: -10px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 22px;
      filter: drop-shadow(0 4px 4px rgba(0,0,0,0.15));
      z-index: 5;
      user-select: none;
    }

    body.focus-mode .note-pushpin,
    body.fullscreen-active .note-pushpin {
      font-size: 32px !important;
      top: -16px !important;
    }

    /* Dynamic Corkboard Controls Panel Auto-Hide Engine */
    .corkboard-controls-panel {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: min(20px, 3vw);
      width: 100%;
      max-width: 860px;
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      padding: 10px 20px;
      box-shadow: 0 4px 12px rgba(15,23,42,0.03);
      margin-top: auto;
      margin-bottom: 4px;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      opacity: 1;
      transform: translateY(0);
    }

    /* Lift the panel out of the layout entirely when sidebars are hidden */
    body.focus-mode .corkboard-controls-panel,
    body.fullscreen-active .corkboard-controls-panel {
      position: absolute !important;
      bottom: 8px !important;
      left: 50% !important;
      transform: translateX(-50%) translateY(14px) !important; /* Center horizontally and nudge low */
      width: calc(100% - 40px) !important;
      opacity: 0.01 !important; /* Retains a micro-hitbox for your cursor to target */
      z-index: 100;
      margin: 0 !important;
    }

    /* Smoothly slide up and fade in on hover */
    body.focus-mode .corkboard-controls-panel:hover,
    body.fullscreen-active .corkboard-controls-panel:hover {
      opacity: 1 !important;
      transform: translateX(-50%) translateY(0) !important;
      box-shadow: 0 15px 35px rgba(15, 23, 42, 0.16);
    }

    /* =========================================================
       10. FULL SCREEN MODES
       ========================================================= */

    /*
  Hide the complete Class Board header in both
  Full Screen and Focus View.

  Focus View should show only the active classroom tool,
  its essential controls and the previous/next tool pills.
*/
body.fullscreen-active .top-line,
body.fullscreen-active header,
body.focus-mode .top-line,
body.focus-mode header {
  display: none !important;
}

/*
  Recover the header space so Focus View uses
  the full height of the classroom display.
*/
body.focus-mode main,
body.fullscreen-active main {
  height: 100vh !important;
  padding: 4px !important;
}

body.fullscreen-active[data-stage="whiteboard"] .stage-top {
  display: none !important;
}

body.fullscreen-active[data-stage="whiteboard"] .stage-card {
  grid-template-rows: minmax(0, 1fr) !important;
  padding: 8px !important;
}

body.fullscreen-active[data-stage="whiteboard"] .stage-body {
  height: 100% !important;
  min-height: 0 !important;
}    /* Clean up title clutter on the main landing view */
    body[data-stage="today"] #stageLabel,
    body[data-stage="today"] #stageTitle {
      display: none !important;
    }

    

    body.fullscreen-active .board-shell {
      grid-template-columns:
        212px
        minmax(0, 1fr)
        258px;
      gap: 6px;
    }

    /*
      Respect independently collapsed rails while Hide Header
      is active. Without these overrides, fullscreen-active
      restores the hidden widget column to 258px and leaves a
      large empty area.
    */

    body.fullscreen-active.left-rail-collapsed
    .board-shell {
      grid-template-columns:
        38px
        minmax(0, 1fr)
        258px;
    }

    body.fullscreen-active.right-rail-collapsed
    .board-shell {
      grid-template-columns:
        212px
        minmax(0, 1fr)
        38px;
    }

    body.fullscreen-active.left-rail-collapsed.right-rail-collapsed
    .board-shell {
      grid-template-columns:
        38px
        minmax(0, 1fr)
        38px;
    }

    /*
  PRESENT TO CLASS AGENDA

  Keep the timetable available on the left
  during Focus / Present to Class.

  The right widget rail and normal toolbar
  remain hidden so the presentation stays clean.
*/

body.focus-mode .left-rail {
  display: flex !important;
}

body.focus-mode .right-rail,
body.focus-mode .quick-strip {
  display: none !important;
}

/*
  Collapsed agenda:
  leave only the small restore arrow visible.
*/
body.focus-mode .board-shell {
  grid-template-columns:
    38px
    minmax(0, 1fr) !important;

  gap: 6px !important;
}

/*
  Open agenda:
  show the existing timetable beside
  the active classroom tool.
*/
body.focus-mode:not(
  .left-rail-collapsed
)
.board-shell {
  grid-template-columns:
    224px
    minmax(0, 1fr) !important;

  gap: 6px !important;
}

/*
  Do not show the Dashboard/home shortcut
  inside the collapsed student-facing agenda.
*/
body.focus-mode
.collapsed-back-to-teacher-button {
  display: none !important;
}

    body.focus-mode .centre-board,
    body.fullscreen-active .centre-board {
      grid-template-rows: 1fr !important;
      gap: 0 !important;
    }

    /* Force the card wrapper container elements to preserve top typography metrics gracefully on projector walls */
body.focus-mode .stage-card,
body.fullscreen-active .stage-card {
  padding: 20px 24px 24px !important;
  border-radius: 24px !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 16px !important;
}



body[data-stage="vote"] .stage-body {
  overflow: hidden !important;
  height: 100% !important;
}

body[data-stage="vote"] .vote-stage {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  gap: 12px !important;
  padding-bottom: 4px !important;
}

    /* Re-introduce the heading text elements with high-impact, tight geometry adjustments */
    body.focus-mode .stage-top,
    body.fullscreen-active .stage-top {
      display: grid !important;
      grid-template-columns: 1fr auto !important;
      border-bottom: 2px dashed color-mix(in srgb, var(--board-ink) 14%, transparent) !important;
      padding-bottom: 12px !important;
      margin-bottom: 4px !important;
    }

    body.focus-mode .stage-title,
    body.fullscreen-active .stage-title {
      font-size: clamp(21px, 2vw, 31px) !important;
      letter-spacing: -0.7px !important;
      line-height: 1.08 !important;
    }

    body.focus-mode .stage-label,
    body.fullscreen-active .stage-label {
      font-size: 10px !important;
      letter-spacing: 1px !important;
    }

    /* 💎 Auto-expand internal containers cleanly without overflow mess */
    body.focus-mode .stage-body,
    body.fullscreen-active .stage-body {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: stretch;
    }

    body.focus-mode .activity-card,
    body.fullscreen-active .activity-card {
      height: 100%;
      max-width: none;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    body.focus-mode .large-tool,
    body.fullscreen-active .large-tool {
      height: 100%;
      justify-content: space-between;
      padding: 10px 0;
    }

    body.focus-mode .stage-title {
      font-size: clamp(38px, 5vw, 72px);
    }

    body.video-only .top-line,
    body.video-only header,
    body.video-only .left-rail,
    body.video-only .right-rail,
    body.video-only .quick-strip,
    body.video-only .stage-top {
      display: none !important;
    }

    body.video-only main {
      height: 100vh !important;
      padding: 0 !important;
    }

    body.video-only .board-shell {
      height: 100vh !important;
      grid-template-columns: 1fr !important;
      gap: 0 !important;
    }

    body.video-only .centre-board {
      grid-template-rows: 1fr !important;
      gap: 0 !important;
    }

    body.video-only .stage-card,
    body.video-only .stage-body {
      border-radius: 0 !important;
      border: none !important;
      padding: 0 !important;
      background: #000000 !important;
      height: 100vh !important;
    }

    /* 🎬 SUBTITLE COLLISION FIX: Safely pinches the player canvas up to prevent text overlapping */
    body.video-only .board-video-layout {
      padding-bottom: 84px !important;
      box-sizing: border-box !important;
    }

    /* Force our newly upgraded large flex utility block to go 100% full screen width */
    body.video-only .large-tool {
  padding: 0 !important;
  gap: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  position: relative !important;
}

    /* Force the video gallery grid wrapper container to drop split columns and maximize screen size */
    body.video-only .video-gallery {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
  background: #000000 !important;
  padding-bottom: 92px !important;
}

    body.video-only .video-gallery iframe {
      width: 100vw !important;
      height: 100vh !important;
      border-radius: 0 !important;
      border: none !important;
    }

    /* Keep video controls available in Video Only Mode */
body.video-only[data-stage="video"] .board-bottom-toolbar,
body.video-only.focus-mode[data-stage="video"] .board-bottom-toolbar,
body.video-only.fullscreen-active[data-stage="video"] .board-bottom-toolbar,
body.video-only.focus-mode.fullscreen-active[data-stage="video"] .board-bottom-toolbar {
  display: grid !important;
  grid-template-columns: auto minmax(280px, 1fr) auto auto auto auto !important;
  align-items: center !important;
  justify-content: center !important;
  column-gap: 8px !important;
  row-gap: 8px !important;

  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: 18px !important;
  top: auto !important;
  transform: translateX(-50%) !important;

  width: min(1180px, calc(100vw - 96px)) !important;
  max-width: calc(100vw - 96px) !important;
  min-height: 56px !important;

  z-index: 9999998 !important;
  margin: 0 !important;
  padding: 10px 14px !important;

  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(229, 231, 235, 0.9) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32) !important;

  opacity: 1 !important;
  visibility: visible !important;
}

body.video-only[data-stage="video"] .board-toolbar-label {
  min-width: 170px !important;
  width: auto !important;
  flex: 0 0 auto !important;
}

body.video-only[data-stage="video"] .board-toolbar-label span {
  font-size: 10px !important;
}

body.video-only[data-stage="video"] .board-toolbar-label strong {
  font-size: 17px !important;
  white-space: nowrap !important;
}

body.video-only[data-stage="video"] .board-video-only-switcher {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

body.video-only[data-stage="video"] .board-video-only-switcher::-webkit-scrollbar {
  display: none !important;
}

body.video-only[data-stage="video"] .board-video-only-switcher .btn,
body.video-only[data-stage="video"] .board-bottom-toolbar > .btn {
  min-height: 38px !important;
  height: 38px !important;
  padding: 7px 13px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

body.video-only[data-stage="video"] .board-bottom-toolbar .btn-primary {
  box-shadow: none !important;
}

@media (max-width: 1150px) {
  body.video-only[data-stage="video"] .board-bottom-toolbar,
  body.video-only.focus-mode[data-stage="video"] .board-bottom-toolbar,
  body.video-only.fullscreen-active[data-stage="video"] .board-bottom-toolbar,
  body.video-only.focus-mode.fullscreen-active[data-stage="video"] .board-bottom-toolbar {
    grid-template-columns: auto minmax(220px, 1fr) auto auto !important;
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
    bottom: 14px !important;
  }

  body.video-only[data-stage="video"] .board-bottom-toolbar > .btn {
    min-height: 36px !important;
    height: 36px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
}

/* Keep non-video stages clean if video-only is ever triggered elsewhere */
body.video-only:not([data-stage="video"]) .board-bottom-toolbar {
  display: none !important;
}

    /* Force the floating exit button to reveal itself safely over the video canvas */
    body.video-only #exitVideoOnlyBtn {
  display: none !important;
}

    /* =========================================================
       11. RESPONSIVE
       ========================================================= */

    @media (max-width: 1220px) {
      html,
      body {
        overflow: auto;
        height: auto;
      }

      main {
        height: auto;
        overflow: visible;
      }

      .board-shell {
        height: auto;
        grid-template-columns: 1fr;
      }

      .left-rail,
      .right-rail,
      .centre-board {
        overflow: visible;
      }

      .centre-board {
        order: -1;
      }

      .stage-card {
        min-height: 650px;
      }

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

      .right-rail {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
      }

      .timetable-panel {
        height: 520px;
      }

      .brand-row {
        flex-wrap: wrap;
      }
    }

    @media (max-width: 700px) {
      header {
        height: auto;
        padding: 10px 5%;
      }

      .top-nav {
        flex-direction: column;
        align-items: flex-start;
      }

      .nav-actions {
        justify-content: flex-start;
      }

      .logo {
        font-size: 22px;
      }

      .class-select-wrap {
        width: 100%;
      }

      .class-select {
        max-width: none;
        flex: 1;
      }

      main {
        padding: 10px 5% 34px;
      }

      .stage-card {
        min-height: 620px;
        padding: 14px;
      }

      .stage-top {
        grid-template-columns: 1fr;
      }

      .date-card {
        min-width: 0;
      }

      .stage-title {
        font-size: 34px;
      }

      .big-heading {
        font-size: 29px;
      }

      .big-text {
        font-size: 22px;
      }

      .info-grid,
      .vote-grid,
      .group-list,
      .stage-grid,
      .modal-grid,
      .right-rail {
        grid-template-columns: 1fr;
      }

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

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

      .mini-row {
        grid-template-columns: 38px 1fr;
      }

      .mini-row .show-btn {
        grid-column: 1 / -1;
      }

      .modal-backdrop {
        padding: 10px;
        align-items: stretch;
      }

      .modal-card {
        max-height: none;
        height: 100%;
      }

      .day-tabs {
        grid-template-columns: 1fr;
      }

      .edit-row {
        grid-template-columns: 1fr;
      }
    }
  
/* =========================================================
   14. DAILY MUST-USE CLASS BOARD UPGRADE
   Compact, playful, projector-friendly and teacher-simple
   ========================================================= */

:root {
  --board-accent: #63d79a;
  --board-accent-2: #20945e;

  --board-bg-a: #edf7f1;
  --board-bg-b: #f8faf9;

  --board-ink: #173f39;

  --board-card: rgba(255, 255, 255, 0.96);

  --board-shadow:
    0 14px 34px
    rgba(15, 23, 42, 0.08);

  --board-hero-a: #123f39;
  --board-hero-b: #205e52;

  --board-surface-soft: #eef8f2;
  --board-border: #dce9e2;
}


/* 🌿 CALM */

body.theme-calm {
  --board-accent: #63d79a;
  --board-accent-2: #20945e;

  --board-bg-a: #edf7f1;
  --board-bg-b: #f8faf9;

  --board-ink: #173f39;

  --board-card:
    rgba(255, 255, 255, 0.96);

  --board-shadow:
    0 14px 34px
    rgba(15, 23, 42, 0.07);

  --board-hero-a: #123f39;
  --board-hero-b: #246456;

  --board-surface-soft: #eef8f2;
  --board-border: #dce9e2;
}


/* 🧠 FOCUS */

body.theme-focus {
  --board-accent: #7fb3e8;
  --board-accent-2: #356da8;

  --board-bg-a: #eef4f9;
  --board-bg-b: #f8fafc;

  --board-ink: #23435f;

  --board-card:
    rgba(255, 255, 255, 0.97);

  --board-shadow:
    0 12px 30px
    rgba(30, 58, 95, 0.07);

  --board-hero-a: #203d59;
  --board-hero-b: #315e87;

  --board-surface-soft: #edf4fa;
  --board-border: #d7e3ed;
}


/* ☀️ WARM */

body.theme-warm {
  --board-accent: #e3b65c;
  --board-accent-2: #a96e32;

  --board-bg-a: #faf5ea;
  --board-bg-b: #fffdf8;

  --board-ink: #59442f;

  --board-card:
    rgba(255, 254, 250, 0.97);

  --board-shadow:
    0 14px 32px
    rgba(92, 64, 38, 0.07);

  --board-hero-a: #6b4a2d;
  --board-hero-b: #98704b;

  --board-surface-soft: #faf2e4;
  --board-border: #eadfce;
}


/* 🌊 OCEAN */

body.theme-ocean {
  --board-accent: #65c8c9;
  --board-accent-2: #287e89;

  --board-bg-a: #edf8f8;
  --board-bg-b: #f4f8fb;

  --board-ink: #194f59;

  --board-card:
    rgba(255, 255, 255, 0.95);

  --board-shadow:
    0 14px 34px
    rgba(22, 78, 99, 0.07);

  --board-hero-a: #174e59;
  --board-hero-b: #237684;

  --board-surface-soft: #eaf7f7;
  --board-border: #d3e8e8;
}


/* 🍏 BRIGHT */

body.theme-bright {
  --board-accent: #9ed45c;
  --board-accent-2: #5d9137;

  --board-bg-a: #f4f8eb;
  --board-bg-b: #fafcf7;

  --board-ink: #344c2d;

  --board-card:
    rgba(255, 255, 255, 0.97);

  --board-shadow:
    0 14px 32px
    rgba(64, 91, 43, 0.07);

  --board-hero-a: #355a2d;
  --board-hero-b: #5f843c;

  --board-surface-soft: #f2f8e9;
  --board-border: #deead1;
}


/* 🌌 GALAXY */

body.theme-galaxy {
  --board-accent: #9b8bd5;
  --board-accent-2: #6655a7;

  --board-bg-a: #f1f0f8;
  --board-bg-b: #faf9fc;

  --board-ink: #343353;

  --board-card:
    rgba(255, 255, 255, 0.96);

  --board-shadow:
    0 15px 36px
    rgba(48, 46, 87, 0.09);

  --board-hero-a: #252544;
  --board-hero-b: #4d477d;

  --board-surface-soft: #f0eef8;
  --board-border: #dedbed;
}


/* 🧑‍🏫 CHALKBOARD */

body.theme-chalk {
  --board-accent: #d7c779;
  --board-accent-2: #8b7940;

  --board-bg-a: #f3f0e8;
  --board-bg-b: #faf9f5;

  --board-ink: #30463f;

  --board-card:
    rgba(255, 254, 249, 0.97);

  --board-shadow:
    0 14px 32px
    rgba(32, 54, 46, 0.08);

  --board-hero-a: #233c34;
  --board-hero-b: #36584c;

  --board-surface-soft: #f3efe4;
  --board-border: #e2dcc9;
}


/* 🍬 PLAYFUL */

body.theme-candy {
  --board-accent: #d58ab3;
  --board-accent-2: #9b5a87;

  --board-bg-a: #f8f1f6;
  --board-bg-b: #f7f5fb;

  --board-ink: #59405d;

  --board-card:
    rgba(255, 255, 255, 0.97);

  --board-shadow:
    0 14px 34px
    rgba(85, 54, 89, 0.08);

  --board-hero-a: #654161;
  --board-hero-b: #895d83;

  --board-surface-soft: #f8edf4;
  --board-border: #ead9e5;
}

html,
body {
  background:
    radial-gradient(circle at 10% 12%, color-mix(in srgb, var(--board-accent) 22%, transparent), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(251, 191, 36, 0.10), transparent 21%),
    linear-gradient(135deg, var(--board-bg-a), var(--board-bg-b));
}

.top-line {
  background: linear-gradient(90deg, var(--board-ink), var(--board-accent), var(--board-ink));
}

header {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.board-shell {
  perspective: 1200px;
}

.panel,
.stage-card {
  background: var(--board-card);
  border-color: rgba(20, 63, 58, 0.10);
  box-shadow: var(--board-shadow);
}

.stage-card {
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--board-accent) 24%, transparent), transparent 30%),
    radial-gradient(circle at 100% 10%, rgba(251, 191, 36, 0.12), transparent 26%),
    linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(20, 63, 58, 0.12);
}

.stage-title,
.panel-head h2,
.large-display,
.large-sub,
.stage-tile h3,
.mini-title {
  color: var(--board-ink) !important;
}

.stage-label,
.meta-pill,
.show-btn {
  color: var(--board-accent-2) !important;
}

.btn-primary {
  background: var(--board-accent) !important;
  color: var(--board-ink) !important;
}

.btn-dark {
  background: var(--board-ink) !important;
  color: #ffffff !important;
}

.btn-soft {
  background: color-mix(in srgb, var(--board-accent) 12%, #ffffff) !important;
  color: var(--board-ink) !important;
  border-color: color-mix(in srgb, var(--board-accent) 45%, #ffffff) !important;
}

.quick-strip {
  gap: 8px;
}

.quick-launch {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(20, 63, 58, 0.09);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  min-height: 48px; /* Sleeker profile footprint */
  display: flex !important;
  flex-direction: row !important; /* Switches from block layout to modern side-by-side row pills */
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 6px 14px !important;
  transform-style: preserve-3d;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.quick-launch::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--board-accent) 7%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.quick-launch:hover::before {
  opacity: 1;
}

.quick-launch:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--board-accent) 48%, #ffffff);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.quick-launch:active {
  transform: translateY(1px) scale(0.96);
}

.quick-launch span {
  font-size: 18px; /* Scaled down slightly to read symmetrically next to typography labels */
  line-height: 1;
  filter: none;
  transform: translateZ(12px);
  opacity: 0.92;
}

.quick-launch small {
  font-size: 11px;
  color: color-mix(in srgb, var(--board-ink) 84%, #64748b);
  transform: translateZ(10px);
  font-weight: 950;
}

.quick-launch.is-active {
  background: var(--board-ink);
  color: #ffffff;
  border-color: color-mix(in srgb, var(--board-accent) 65%, #ffffff);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.14),
    0 0 0 3px color-mix(in srgb, var(--board-accent) 22%, transparent);
}

.quick-launch.is-active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  height: 4px;
  border-radius: 999px;
  background: var(--board-accent);
  opacity: 1;
}

.quick-launch.is-active small,
.quick-launch.is-active span {
  color: #ffffff;
}

.activity-card,
.stage-tile,
.group-card,
.vote-card,
.step-row,
.noise-orb-card,
.noise-control-card,
.trusty-board-card {
  transform-style: preserve-3d;
}

.activity-card {
  background:
    radial-gradient(circle at 95% 5%, color-mix(in srgb, var(--board-accent) 18%, transparent), transparent 25%),
    #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(20,63,58,0.10);
  box-shadow: 0 16px 34px rgba(15,23,42,0.08);
}

.info-tile {
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
}

.widget-slot {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.widget-slot:hover {
  transform: translateY(-2px);
}

.mini-row {
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.mini-row:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--board-accent) 65%, #ffffff);
  box-shadow: 0 10px 20px rgba(15,23,42,0.08);
}

.class-board-confetti {
  position: fixed;
  top: -24px;
  width: 10px;
  height: 18px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 9999998;
  animation: confettiFall 1100ms ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}

.stage-pop {
  animation: stagePop 0.22s cubic-bezier(.2,1.5,.4,1);
}

@keyframes stagePop {
  0% { transform: scale(0.985); opacity: 0.72; }
  100% { transform: scale(1); opacity: 1; }
}

.teacher-toolbar-card {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(15,23,42,0.05);
}

.teacher-control-note {
  font-size: 12px;
  color: #64748b;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}

.role-arena {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(280px, 1.05fr);
  gap: 18px;
  align-items: center;
}

.role-spotlight {
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--board-accent) 24%, transparent), transparent 35%),
    linear-gradient(145deg, #ffffff, #f8fafc);
  border: 1px solid #d9fbe8;
  border-radius: 30px;
  padding: 26px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(15,23,42,0.10);
}

.role-badge-3d {
  width: min(220px, 28vw);
  height: min(220px, 28vw);
  margin: 0 auto 16px;
  border-radius: 44px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255,255,255,0.95), transparent 27%),
    linear-gradient(145deg, var(--board-accent), var(--board-ink));
  display: grid;
  place-items: center;
  font-size: clamp(54px, 8vw, 108px);
  box-shadow:
    0 22px 45px rgba(15,23,42,0.20),
    inset 0 -18px 30px rgba(0,0,0,0.16);
  transform: rotateX(10deg) rotateY(-10deg);
}

.role-result-name {
  font-size: clamp(32px, 5vw, 72px);
  line-height: 1;
  font-weight: 900;
  color: var(--board-ink);
  letter-spacing: -2px;
}

.role-result-role {
  margin-top: 8px;
  font-size: clamp(20px, 2.7vw, 38px);
  font-weight: 900;
  color: var(--board-accent-2);
}

.role-control-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.06);
}

/* =========================================================
   ROLE PICKER: STUDENT → ROLE PROJECTOR CARDS
   ========================================================= */

.role-match-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.role-match-board {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 74px minmax(250px, 1fr);
  gap: clamp(14px, 2.2vw, 28px);
  align-items: center;
  width: 100%;
}

.role-match-card {
  min-height: clamp(230px, 36vh, 360px);
  border-radius: 30px;
  padding: clamp(18px, 2.4vw, 32px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  text-align: center;
  box-shadow:
    0 20px 46px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.8);
  overflow: hidden;
}

.role-match-student {
  background:
    radial-gradient(circle at 50% 0%, rgba(95, 220, 154, 0.24), transparent 35%),
    linear-gradient(145deg, #ecfdf5, #bbf7d0);
  border: 1px solid #bbf7d0;
  color: #143f3a;
}

.role-match-role {
  background:
    radial-gradient(circle at 50% 0%, rgba(167, 139, 250, 0.23), transparent 35%),
    linear-gradient(145deg, #f5f3ff, #ddd6fe);
  border: 1px solid #ddd6fe;
  color: #5b21b6;
}

.role-match-label {
  font-size: clamp(11px, 1.1vw, 15px);
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}

.role-match-icon {
  width: clamp(74px, 8vw, 118px);
  height: clamp(74px, 8vw, 118px);
  border-radius: 28px;
  margin-top: clamp(10px, 1.3vw, 18px);
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 12px 25px rgba(15,23,42,0.08);
  font-size: clamp(36px, 4.5vw, 66px);
}

.role-match-value {
  width: 100%;
  max-width: 100%;
  margin-top: clamp(14px, 1.7vw, 22px);

  font-size: clamp(28px, 4.1vw, 62px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -1.4px;

  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

.role-match-value {
  font-size: clamp(24px, 3.3vw, 48px);
  letter-spacing: -1px;
}

.role-match-role .role-match-value {
  font-size: clamp(22px, 3vw, 42px);
}
.role-match-helper {
  margin-top: clamp(12px, 1.5vw, 20px);
  font-size: clamp(15px, 1.7vw, 24px);
  line-height: 1.2;
  font-weight: 900;
  opacity: 0.72;
}

.role-match-arrow {
  width: clamp(54px, 6vw, 82px);
  height: clamp(54px, 6vw, 82px);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--board-ink);
  color: #ffffff;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 950;
  box-shadow: 0 18px 35px rgba(15,23,42,0.18);
}

.role-match-toolbar {
  min-height: 56px !important;
  padding: 7px 12px !important;
}

.role-match-toolbar .btn {
  min-height: 34px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
}

body[data-stage="roles"] .stage-body {
  overflow: hidden !important;
}

body[data-stage="roles"] .role-stage-vertical {
  height: 100%;
  min-height: 0;
}


/* =========================================================
   ROLE PICKER — IPAD FILL AVAILABLE TOOL SPACE
   ========================================================= */

@media (min-width: 701px) and (max-width: 1220px) {
  body[data-stage="roles"]
  .stage-body {
    height: 100% !important;

    min-height: 0 !important;

    overflow: hidden !important;
  }

  body[data-stage="roles"]
  .role-stage-vertical {
    width: 100% !important;

    height: 100% !important;

    min-height: 0 !important;

    display: flex !important;

    flex-direction: column !important;
  }

  body[data-stage="roles"]
  .role-match-stage {
    width: 100% !important;

    height: 100% !important;

    min-height: 0 !important;

    flex: 1 1 auto !important;

    display: grid !important;

    grid-template-rows:
      minmax(
        0,
        1fr
      )
      auto !important;

    gap: 12px !important;
  }

  body[data-stage="roles"]
  .role-match-board {
    width: 100% !important;

    height: 100% !important;

    min-height: 0 !important;

    display: grid !important;

    grid-template-columns:
      minmax(
        0,
        1fr
      )
      64px
      minmax(
        0,
        1fr
      ) !important;

    gap:
      clamp(
        14px,
        2.2vw,
        24px
      ) !important;

    align-items: stretch !important;
  }

  body[data-stage="roles"]
  .role-match-card {
    width: 100% !important;

    height: 100% !important;

    min-height: 0 !important;

    padding:
      clamp(
        20px,
        3vw,
        34px
      ) !important;

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;

    justify-content: center !important;
  }

  body[data-stage="roles"]
  .role-match-label {
    flex: 0 0 auto !important;
  }

  body[data-stage="roles"]
  .role-match-icon {
    flex: 0 0 auto !important;

    width:
      clamp(
        86px,
        10vw,
        126px
      ) !important;

    height:
      clamp(
        86px,
        10vw,
        126px
      ) !important;

    font-size:
      clamp(
        42px,
        5vw,
        68px
      ) !important;
  }

  body[data-stage="roles"]
  .role-match-value {
    flex: 0 0 auto !important;

    margin-top:
      clamp(
        18px,
        2.4vw,
        28px
      ) !important;

    font-size:
      clamp(
        38px,
        5vw,
        58px
      ) !important;
  }

  body[data-stage="roles"]
  .role-match-role
  .role-match-value {
    font-size:
      clamp(
        34px,
        4.5vw,
        54px
      ) !important;
  }

  body[data-stage="roles"]
  .role-match-helper {
    flex: 0 0 auto !important;

    max-width: 360px !important;

    margin-top:
      16px !important;

    font-size:
      clamp(
        15px,
        2vw,
        20px
      ) !important;
  }

  body[data-stage="roles"]
  .role-match-arrow {
    align-self: center !important;

    width: 58px !important;

    height: 58px !important;

    font-size: 28px !important;
  }

  body[data-stage="roles"]
  .role-match-toolbar {
    flex: 0 0 auto !important;

    width: 100% !important;

    min-height: 58px !important;

    margin: 0 !important;
  }
}

body[data-stage="roles"] .role-result-name.shuffling,
body[data-stage="roles"] .role-result-role.shuffling {
  animation: roleMatchShuffle 0.12s linear infinite;
}

@keyframes roleMatchShuffle {
  0% { transform: translateY(-2px) scale(0.98); filter: blur(0.5px); }
  50% { transform: translateY(2px) scale(1.02); filter: blur(1px); }
  100% { transform: translateY(-2px) scale(0.98); filter: blur(0.5px); }
}

body.focus-mode[data-stage="roles"] .stage-card,
body.fullscreen-active[data-stage="roles"] .stage-card {
  padding: 18px 22px 20px !important;
}

body.focus-mode[data-stage="roles"] .role-match-board,
body.fullscreen-active[data-stage="roles"] .role-match-board {
  grid-template-columns: minmax(280px, 1fr) 86px minmax(280px, 1fr);
  gap: clamp(18px, 2.5vw, 36px);
}

body.focus-mode[data-stage="roles"] .role-match-card,
body.fullscreen-active[data-stage="roles"] .role-match-card {
  min-height: clamp(260px, 42vh, 420px);
}

@media (max-width: 900px) {
  .role-match-board {
    grid-template-columns: 1fr;
  }

  .role-match-arrow {
    transform: rotate(90deg);
    margin: 0 auto;
  }

  .role-match-card {
    min-height: 220px;
  }

  .role-match-toolbar {
    overflow: auto;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  .role-match-card {
    min-height: 230px;
    padding: 18px;
  }

  .role-match-value {
  font-size: clamp(30px, 4vw, 56px);
  letter-spacing: -1.5px;
}

  .role-match-icon {
    width: 74px;
    height: 74px;
    font-size: 38px;
  }

  .role-match-helper {
    font-size: clamp(13px, 1.35vw, 18px);
  }
}

.group-list .group-card,
.group-card.fun-group-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--board-accent) 20%, transparent), transparent 32%),
    linear-gradient(145deg, #ffffff, #f8fafc);
  border-radius: 24px;
  border: 1px solid #d9fbe8;
  box-shadow: 0 14px 26px rgba(15,23,42,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.group-list .group-card:hover,
.group-card.fun-group-card:hover {
  transform: translateY(-4px) rotateX(3deg);
  box-shadow: 0 20px 38px rgba(15,23,42,0.13);
}

.group-list .group-card h3,
.group-card.fun-group-card h3 {
  font-size: clamp(19px, 1.9vw, 28px);
  display: flex;
  gap: 8px;
  align-items: center;
}

.group-list .group-card h3::before,
.group-card.fun-group-card h3::before {
  content: "👥";
}

.group-list .group-card p,
.group-card.fun-group-card p {
  font-size: clamp(17px, 1.6vw, 24px);
}

.modal-card {
  border: 1px solid rgba(20,63,58,0.12);
}

.question-helper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}

.question-chip {
  border: 1px solid #d9fbe8;
  background: #f1fdf6;
  color: #143f3a;
  border-radius: 14px;
  padding: 10px;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
}

.question-chip:hover {
  border-color: var(--board-accent);
  background: #ffffff;
}

/* =========================================================
   BOARD STYLE PICKER
   ========================================================= */

.board-style-picker {
  display: grid;
  gap: 22px;
}

.board-style-section {
  display: grid;
  gap: 11px;
}

.board-style-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.board-style-section-heading > div {
  display: grid;
  gap: 3px;
}

.board-style-section-heading strong {
  color: #143f3a;
  font-size: 14px;
  line-height: 1;
  font-weight: 950;
}

.board-style-section-heading span {
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 800;
}


.theme-choice-grid {
  display: grid;
  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );
  gap: 10px;
}


.theme-choice {
  position: relative;

  min-width: 0;
  min-height: 132px;

  display: flex;
  flex-direction: column;
  align-items: stretch;

  padding: 7px 7px 11px;

  border:
    1px solid
    #dbe3e8;

  border-radius: 17px;

  background: #ffffff;

  color: #143f3a;

  text-align: left;

  cursor: pointer;

  overflow: hidden;

  box-shadow:
    0 5px 14px
    rgba(15, 23, 42, 0.05);

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}


.theme-choice:hover,
.theme-choice:focus-visible {
  border-color:
    var(--board-accent);

  box-shadow:
    0 10px 22px
    rgba(15, 23, 42, 0.10);

  transform:
    translateY(-2px);

  outline: none;
}


.theme-choice-preview {
  position: relative;

  width: 100%;
  height: 62px;

  display: grid !important;
  place-items: center;

  margin: 0 0 9px !important;

  border-radius: 12px;

  overflow: hidden;

  font-size: inherit !important;
}


.theme-choice-emoji {
  position: relative;
  z-index: 2;

  display: block !important;

  margin: 0 !important;

  font-size: 28px !important;

  filter:
    drop-shadow(
      0 3px 5px
      rgba(15, 23, 42, 0.12)
    );
}


.theme-choice strong {
  display: block;

  padding:
    0
    4px;

  color: #143f3a;

  font-size: 11.5px;
  line-height: 1.15;
  font-weight: 950;
}


.theme-choice small {
  display: block;

  margin-top: 3px;

  padding:
    0
    4px;

  color: #64748b;

  font-size: 9px;
  line-height: 1.2;
  font-weight: 800;
}


.theme-choice.active {
  border-color:
    var(--board-accent-2);

  box-shadow:
    0 0 0 2px
    color-mix(
      in srgb,
      var(--board-accent) 32%,
      transparent
    ),
    0 12px 24px
    rgba(15, 23, 42, 0.10);
}


.theme-choice.active::after {
  content: "✓";

  position: absolute;

  top: 12px;
  right: 12px;

  z-index: 4;

  width: 22px;
  height: 22px;

  display: grid;
  place-items: center;

  border-radius: 999px;

  background: #ffffff;

  color: #166534;

  font-size: 11px;
  line-height: 1;
  font-weight: 950;

  box-shadow:
    0 3px 9px
    rgba(15, 23, 42, 0.15);
}


/* Real colour previews */

.theme-choice-calm
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #f1fdf6,
      #5fdc9a
    );
}

.theme-choice-bright
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #f7fee7,
      #a3e635
    );
}

.theme-choice-focus
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #eff6ff,
      #60a5fa
    );
}

.theme-choice-warm
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #fffbeb,
      #fbbf24
    );
}

.theme-choice-ocean
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #ecfeff,
      #06b6d4
    );
}

.theme-choice-sunset
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #fff7ed,
      #fb7185
    );
}

.theme-choice-galaxy
.theme-choice-preview {
  background:
    radial-gradient(
      circle at 30% 30%,
      #8b5cf6,
      transparent 35%
    ),
    linear-gradient(
      135deg,
      #111827,
      #312e81
    );
}

.theme-choice-chalk
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #334155,
      #0f172a
    );
}

.theme-choice-candy
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #fce7f3,
      #f472b6,
      #a78bfa
    );
}

.theme-choice-forest
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #ecfdf5,
      #15803d
    );
}

.theme-choice-sunrise
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #fefce8,
      #fbbf24,
      #fb7185
    );
}

.theme-choice-slate
.theme-choice-preview {
  background:
    linear-gradient(
      135deg,
      #f8fafc,
      #94a3b8
    );
}


.board-style-reset {
  width: fit-content;

  min-height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding:
    7px
    11px;

  border:
    1px solid
    #d1d5db;

  border-radius:
    999px;

  background:
    #f8fafc;

  color:
    #475569;

  font-size:
    10px;

  line-height:
    1;

  font-weight:
    900;

  cursor:
    pointer;
}


.board-style-reset:hover {
  border-color:
    #86efac;

  background:
    #eefbf4;

  color:
    #166534;
}


@media (max-width: 900px) {
  .theme-choice-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}


@media (max-width: 520px) {
  .theme-choice-grid {
    grid-template-columns:
      1fr;
  }
}

@media (max-width: 900px) {
  .role-arena,
  .theme-choice-grid,
  .question-helper-grid {
    grid-template-columns: 1fr;
  }
}

  
/* =========================================================
   15. CLASS BOARD DAILY HUB UPGRADE PATCH
   Interactive widgets, tighter stages, teacher-friendly controls
   ========================================================= */

.quick-launch {
  isolation: isolate;
}

.quick-launch small {
  font-weight: 950;
}

.quick-launch:not(.is-active)::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 13px;
  border: 1px solid rgba(20, 63, 58, 0.045);
  opacity: 1;
  pointer-events: none;
}

.widget-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.widget-action-grid .small-btn,
.widget-action-grid .btn {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 11px;
  justify-content: center;
}

.widget-big-button {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--board-accent) 48%, #ffffff);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.92), transparent 44%),
    linear-gradient(145deg, #ffffff, color-mix(in srgb, var(--board-accent) 12%, #ffffff));
  color: var(--board-ink);
  border-radius: 16px;
  padding: 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15,23,42,0.07);
  transition: transform .14s ease, box-shadow .14s ease;
}

.widget-big-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15,23,42,0.11);
}

.widget-big-button:active {
  transform: scale(.97);
}

.widget-mini-result {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: var(--board-ink);
  font-weight: 900;
  text-align: center;
  line-height: 1.3;
}

.board-bottom-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: min(16px, 2.5vw);
  width: 100%;
  max-width: 940px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 10px 16px;
  box-shadow: 0 8px 20px rgba(15,23,42,0.05);
  margin-top: auto;
}

.board-toolbar-label {
  display: flex;
  flex-direction: column;
  min-width: 145px;
  text-align: left;
}

.board-toolbar-label span {
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .65px;
  color: #64748b;
}

.board-toolbar-label strong {
  font-size: 16px;
  color: var(--board-ink);
  font-weight: 950;
  line-height: 1.15;
}

.spinner-stage-vertical,
.role-stage-vertical,
.noise-stage-vertical {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  width: 100%;
  gap: 18px;
  min-height: 420px;
  padding: 6px 0;
}

.spinner-wheel-zone,
.role-spotlight-zone,
.noise-spotlight-zone {
  flex: 1;
  width: 100%;
  min-height: 260px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.noise-spotlight-zone {
  gap: 18px;
  flex-wrap: wrap;
}

.role-stage-vertical .role-spotlight {
  width: min(720px, 100%);
}

.role-stage-vertical .role-control-card,
.noise-stage-vertical .noise-control-card {
  width: min(940px, 100%);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/*
  Keep essential tool controls visible in Clean Focus
  and Projector mode.

  Classroom Routines uses the stage ID "steps".
  "routines" is also included for backwards compatibility.
*/
body.focus-mode:not([data-stage="spinner"]):not([data-stage="video"]):not([data-stage="roles"]):not([data-stage="notes"]):not([data-stage="dailyLinks"]):not([data-stage="mysteryBoxes"]):not([data-stage="steps"]):not([data-stage="routines"]) .board-bottom-toolbar,
body.fullscreen-active:not([data-stage="spinner"]):not([data-stage="video"]):not([data-stage="roles"]):not([data-stage="notes"]):not([data-stage="dailyLinks"]):not([data-stage="mysteryBoxes"]):not([data-stage="steps"]):not([data-stage="routines"]) .board-bottom-toolbar {
  display: none !important;
}

body.focus-mode[data-stage="spinner"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="spinner"] .board-bottom-toolbar,
body.focus-mode[data-stage="video"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="video"] .board-bottom-toolbar,
body.focus-mode[data-stage="roles"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="roles"] .board-bottom-toolbar,
body.focus-mode[data-stage="notes"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="notes"] .board-bottom-toolbar,
body.focus-mode[data-stage="dailyLinks"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="dailyLinks"] .board-bottom-toolbar,
body.focus-mode[data-stage="mysteryBoxes"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="mysteryBoxes"] .board-bottom-toolbar,
body.focus-mode[data-stage="steps"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="steps"] .board-bottom-toolbar,
body.focus-mode[data-stage="routines"] .board-bottom-toolbar,
body.fullscreen-active[data-stage="routines"] .board-bottom-toolbar {
  display: flex !important;
  position: relative !important;
  margin: 8px auto 0 !important;
  width: 100% !important;
  z-index: 70 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Small visible hover target at the bottom of the notes board */
body.focus-mode[data-stage="notes"] .board-bottom-toolbar::before,
body.fullscreen-active[data-stage="notes"] .board-bottom-toolbar::before {
  content: "Notes controls";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(20, 63, 58, 0.88);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.4px;
  white-space: nowrap;
  opacity: 0.65;
}

body.focus-mode[data-stage="notes"] .board-bottom-toolbar:hover::before,
body.fullscreen-active[data-stage="notes"] .board-bottom-toolbar:hover::before {
  opacity: 0;
}



.corkboard-arena.free-note-board {
  position: relative;
  display: block !important;
  width: 100%;
  min-height: 420px;
  flex: 1 1 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.35), transparent 18%),
    linear-gradient(135deg, #e7d2a7, #c89d63);
  border: 10px solid #8b5e34;
  box-shadow:
    inset 0 0 28px rgba(0,0,0,.16),
    0 18px 38px rgba(15,23,42,.10);
  transition:
    width .22s ease,
    max-width .22s ease,
    min-height .22s ease;
}

body.focus-mode[data-stage="notes"] .stage-body,
body.fullscreen-active[data-stage="notes"] .stage-body {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.focus-mode[data-stage="notes"] .large-tool,
body.fullscreen-active[data-stage="notes"] .large-tool {
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
}

body.focus-mode[data-stage="notes"] .corkboard-arena.free-note-board,
body.fullscreen-active[data-stage="notes"] .corkboard-arena.free-note-board {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  flex: 1 1 100%;
}

body.focus-mode[data-stage="notes"] .notes-stage-layout,
body.fullscreen-active[data-stage="notes"] .notes-stage-layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr auto !important;
  gap: 12px !important;
  height: 100% !important;
}

body.left-rail-collapsed .corkboard-arena.free-note-board,
body.right-rail-collapsed .corkboard-arena.free-note-board,
body.left-rail-collapsed.right-rail-collapsed .corkboard-arena.free-note-board,
body.focus-mode .corkboard-arena.free-note-board,
body.fullscreen-active .corkboard-arena.free-note-board {
  width: 100%;
  max-width: none;
}

body.left-rail-collapsed .stage-body,
body.right-rail-collapsed .stage-body,
body.left-rail-collapsed.right-rail-collapsed .stage-body {
  width: 100%;
}

body.left-rail-collapsed .large-tool,
body.right-rail-collapsed .large-tool,
body.left-rail-collapsed.right-rail-collapsed .large-tool {
  width: 100%;
  max-width: none;
}

.corkboard-note.draggable-note {
  position: absolute;
  width: clamp(160px, 18vw, 250px);
  min-height: 118px;
  height: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 2;
}

.corkboard-note.draggable-note:active {
  cursor: grabbing;
  z-index: 50;
}

.note-drag-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.theme-choice {
  transition: transform .15s ease, box-shadow .15s ease;
}

.theme-choice:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15,23,42,.08);
}

  
/* =========================================================
   16. CLASS BOARD POLISH PATCH
   Focus-safe spinner, adaptive notes, live widgets and themes
   ========================================================= */

/* Keep spinner and vote clear of the stage heading in clean-focus/projector mode */
body.focus-mode[data-stage="spinner"] .stage-top,
body.fullscreen-active.focus-mode[data-stage="spinner"] .stage-top,
body.focus-mode[data-stage="vote"] .stage-top,
body.fullscreen-active[data-stage="vote"] .stage-top {
  display: none !important;
}

body.focus-mode[data-stage="spinner"] .stage-card,
body.fullscreen-active.focus-mode[data-stage="spinner"] .stage-card {
  grid-template-rows: 1fr !important;
  padding-top: 8px !important;
}

body.focus-mode[data-stage="spinner"] .stage-body,
body.fullscreen-active.focus-mode[data-stage="spinner"] .stage-body {
  height: 100%;
  overflow: hidden;
}

/* Wheel always fits with controls visible */
#wrapper3D {
  --wheel-size: min(500px, 52vh, 58vw) !important;
  width: var(--wheel-size) !important;
  height: var(--wheel-size) !important;
  flex: 0 0 auto;
  margin: 0 auto !important;
}

.spinner-stage-vertical {
  min-height: 0 !important;
  height: 100%;
  overflow: hidden;
  gap: 8px !important;
}

.spinner-wheel-zone {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow: hidden;
  padding: 4px 0 !important;
}

.spinner-stage-vertical .board-bottom-toolbar {
  flex: 0 0 auto;
  width: min(900px, calc(100% - 20px));
  min-height: 52px;
  padding: 7px 13px;
  margin: 0 auto 2px;
  opacity: 1 !important;
  transform: none !important;
  position: relative !important;
}

body.focus-mode #wrapper3D,
body.fullscreen-active #wrapper3D {
  --wheel-size: min(620px, 62vh, 68vw) !important;
  margin: 0 auto !important;
}

/* Urgent final ten seconds */
.timer-urgent {
  color: #dc2626 !important;
  animation: urgentTimerPulse .72s ease-in-out infinite;
  text-shadow: 0 0 22px rgba(220, 38, 38, .2);
}

.timer-warning {
  color: #d97706 !important;
}

@keyframes urgentTimerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

/* Adaptive draggable notes */
.corkboard-arena.free-note-board {
  --adaptive-note-w: 220px;
  --adaptive-note-min-h: 150px;
  --adaptive-note-font: 17px;
}

.corkboard-note.draggable-note {
  width: var(--adaptive-note-w) !important;
  min-height: var(--adaptive-note-min-h) !important;
  height: auto !important;
  font-size: var(--adaptive-note-font) !important;
  padding: 34px 14px 14px !important;
}

.note-inline-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex !important;
  align-items: center;
  gap: 5px;
  z-index: 100;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px) scale(0.96);
  pointer-events: none;

  transition:
    opacity 0.16s ease,
    visibility 0.16s ease,
    transform 0.16s ease;
}

.corkboard-note.draggable-note:hover > .note-inline-actions,
.corkboard-note.draggable-note:focus-within > .note-inline-actions,
.note-inline-actions:hover {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

.note-inline-actions button {
  pointer-events: auto;
  position: relative;
  z-index: 101;
}

@media (hover: none), (pointer: coarse) {
  .note-inline-actions {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}

.note-inline-actions button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.86);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.note-inline-actions button:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

/* Live widget mini experiences */
.widget-live-stage {
  margin-top: 8px;
  min-height: 70px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(95,220,154,.18), transparent 46%),
    linear-gradient(145deg,#ffffff,#f8fafc);
  display: grid;
  place-items: center;
  padding: 9px;
  color: var(--board-ink);
  font-size: 28px;
  font-weight: 950;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}

.widget-live-stage.is-rolling {
  animation: widgetShake .12s linear infinite;
}

@keyframes widgetShake {
  0% { transform: rotate(-2deg) scale(.98); }
  50% { transform: rotate(2deg) scale(1.02); }
  100% { transform: rotate(-2deg) scale(.98); }
}



/* More engaging birthday stage */
.birthday-party-stage {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.birthday-hero {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 30px;
  padding: 26px;
  background:
    radial-gradient(circle at 15% 20%, rgba(249,168,212,.35), transparent 26%),
    radial-gradient(circle at 85% 20%, rgba(103,232,249,.32), transparent 25%),
    linear-gradient(135deg,#fff7ed,#fdf2f8,#ecfeff);
  border: 1px solid #fbcfe8;
  box-shadow: 0 18px 42px rgba(15,23,42,.09);
}

.birthday-cake {
  font-size: clamp(76px, 11vw, 150px);
  filter: drop-shadow(0 16px 14px rgba(15,23,42,.16));
  animation: birthdayBounce 1.6s ease-in-out infinite;
}

@keyframes birthdayBounce {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.birthday-name {
  font-size: clamp(28px, 4.2vw, 58px);
  font-weight: 950;
  color: var(--board-ink);
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.birthday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(190px,1fr));
  gap: 10px;
  width: 100%;
}

.birthday-person-card {
  border-radius: 18px;
  padding: 13px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
  font-weight: 900;
  color: var(--board-ink);
}

/* Video gallery */
.video-gallery {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  align-content: start;
}

.video-gallery iframe {
  width: 100%;
  min-height: 250px;
  border: none;
  border-radius: 18px;
  background: #000;
}

.video-empty-card {
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  min-height: 220px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: #64748b;
  font-weight: 900;
  text-align: center;
  padding: 18px;
}

@media (max-width: 820px) {
  .video-gallery { grid-template-columns: 1fr; }
}



/* =========================================================
   CLASS LIST & SHARED REWARDS
   Individual praise feeds one shared class goal.
   ========================================================= */

.class-list-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.class-list-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(20,63,58,0.1);
  box-shadow: 0 8px 18px rgba(15,23,42,0.05);
}

.class-list-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
}

.class-list-tab {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: #64748b;
  font-weight: 950;
  cursor: pointer;
}

.class-list-tab.active {
  background: var(--board-ink);
  color: #ffffff;
}

.class-list-points-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--board-accent) 18%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--board-accent) 48%, #ffffff);
  color: var(--board-ink);
  font-weight: 950;
}

.class-list-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 12px;
  overflow: hidden;
}

.class-list-main.controls-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.class-list-main.controls-collapsed .class-list-control-panel {
  display: none;
}

.class-stage-scroll {
  min-height: 0;
  overflow: auto;
  padding: 2px 4px 12px;
}

.class-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-content: start;
}

.class-avatar-card {
  position: relative;
  min-height: 150px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 6px;
  padding: 12px 10px;
  border: 1px solid rgba(20,63,58,0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.82), transparent 45%),
    linear-gradient(145deg, #ffffff, color-mix(in srgb, var(--board-accent) 10%, #ffffff));
  color: var(--board-ink);
  box-shadow: 0 12px 24px rgba(15,23,42,0.06);
  overflow: hidden;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.class-avatar-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--board-accent) 68%, #ffffff);
  box-shadow: 0 18px 34px rgba(15,23,42,0.12);
}

.class-avatar-card:active {
  transform: scale(.97);
}

.class-list-stage,
.class-list-points-pill.class-total {
  position: relative;
}

.class-points-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  border: 1px solid color-mix(in srgb, var(--board-accent) 55%, #ffffff);
  color: var(--board-ink);
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(15,23,42,.12);
  z-index: 8;
  animation: classPointsBurst .72s ease forwards;
}

.class-points-burst.header {
  left: auto;
  right: 10px;
  top: -8px;
  transform: none;
}

.class-points-burst.whole-class {
  top: 18px;
}

@keyframes classPointsBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px) scale(.86);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -6px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -36px) scale(1.05);
  }
}

.class-avatar-card.is-absent {
  opacity: 0.48;
  filter: grayscale(0.35);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.75), transparent 45%),
    linear-gradient(145deg, #ffffff, #f1f5f9);
  border-color: #cbd5e1;
}

.class-avatar-card.is-absent:hover {
  transform: none;
  box-shadow: 0 12px 24px rgba(15,23,42,0.06);
}

.class-attendance-toggle {
  min-height: 30px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.class-attendance-toggle.absent {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.class-reward-mode-hint {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 950;
}

.class-reward-mode-hint.award {
  background: color-mix(in srgb, var(--board-accent) 18%, #ffffff);
  color: var(--board-ink);
}

.class-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.class-avatar-card.is-birthday {
  border-color: #fbbf24;
  background:
    radial-gradient(circle at 50% 0%, rgba(254,240,138,.38), transparent 44%),
    linear-gradient(145deg, #ffffff, #fffbeb);
}

.class-avatar-face {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(20,63,58,0.1);
  font-size: 34px;
  box-shadow: inset 0 -8px 14px rgba(15,23,42,.04), 0 8px 16px rgba(15,23,42,.08);
}

.class-avatar-name {
  width: 100%;
  text-align: center;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.class-avatar-meta {
  min-height: 24px;
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.class-avatar-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 950;
}

.class-avatar-badge.birthday {
  background: #fef3c7;
  color: #92400e;
}

.class-avatar-face-award {
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;

  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease;
}

.class-avatar-face-award:hover:not(:disabled),
.class-avatar-face-award:focus-visible:not(:disabled) {
  transform:
    translateY(-2px)
    scale(1.04);

  border-color:
    var(--board-accent);

  background:
    #f0fdf4;

  box-shadow:
    inset 0 -8px 14px
      rgba(15,23,42,.04),
    0 10px 22px
      rgba(20,63,58,.15);

  outline: none;
}

.class-avatar-face-award:active:not(:disabled) {
  transform:
    scale(0.96);
}

.class-avatar-face-award.disabled,
.class-avatar-face-award:disabled {
  cursor: not-allowed;
}

.class-avatar-shuffle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(20,63,58,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  cursor: pointer;
  font-weight: 950;
}

.class-list-control-panel {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.class-reward-panel-card {
  padding: 16px;
  border: 1px solid rgba(20,63,58,.1);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15,23,42,.06);
}

.class-reward-panel-card h3 {
  margin: 0 0 7px;
  color: var(--board-ink);
  font-size: 18px;
}

.class-reward-progress {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
  margin: 12px 0 8px;
}

.class-reward-progress div {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--board-accent), #facc15);
  transition: width .22s ease;
}

.class-control-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.class-control-grid .btn {
  min-height: 40px;
  padding: 8px 10px;
}

.class-reason-select {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 9px 11px;
  font-weight: 900;
  color: var(--board-ink);
  background: #ffffff;
}

.class-history-list {
  max-height: 170px;
  overflow: auto;
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.class-history-row {
  padding: 8px 10px;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.class-rewards-modal-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--board-accent) 24%, transparent), transparent 34%),
    linear-gradient(145deg, #f8fafc, #ffffff);
  border: 1px solid rgba(20,63,58,.10);
}

.class-rewards-modal-intro strong {
  display: block;
  color: var(--board-ink);
  font-size: 18px;
  font-weight: 950;
}

.class-rewards-modal-intro span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.class-rewards-modal-list {
  display: grid;
  gap: 10px;
}

.class-reward-edit-row {
  display: grid;

  grid-template-columns:
    34px
    56px
    minmax(0, 1fr)
    120px
    auto;

  gap: 10px;
  align-items: center;

  padding: 12px;

  border:
    1px solid
    rgba(
      20,
      63,
      58,
      .10
    );

  border-radius: 20px;

  background:
    radial-gradient(
      circle at 0% 0%,
      rgba(
        255,
        255,
        255,
        .88
      ),
      transparent 36%
    ),
    linear-gradient(
      145deg,
      #ffffff,
      color-mix(
        in srgb,
        var(--board-accent) 8%,
        #ffffff
      )
    );

  box-shadow:
    0 10px 22px
    rgba(
      15,
      23,
      42,
      .055
    );

  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.class-reward-edit-row.dragging {
  opacity: 0.42;
  transform: scale(0.99);
}

.class-reward-drag-handle {
  width: 34px;
  height: 42px;

  display: inline-grid;
  place-items: center;

  padding: 0;

  border:
    1px solid #d1d5db;

  border-radius: 11px;

  background: #f8fafc;
  color: #64748b;

  font-size: 18px;
  line-height: 1;
  font-weight: 950;

  cursor: grab;
}

.class-reward-drag-handle:hover {
  border-color: #86efac;
  background: #eefbf4;
  color: #166534;
}

.class-reward-drag-handle:active {
  cursor: grabbing;
}

.class-reward-step-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--board-ink);
  color: #ffffff;
  font-size: 17px;
  font-weight: 950;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.16);
}

.class-reward-edit-main {
  min-width: 0;
}

.class-reward-edit-main label,
.class-reward-cost-field label {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .55px;
}

.class-reward-edit-row input {
  width: 100%;
  min-height: 40px;
  margin: 0;
  border: 1px solid #d1d5db;
  border-radius: 13px;
  padding: 9px 11px;
  background: #ffffff;
  color: var(--board-ink);
  font-size: 14px;
  font-weight: 900;
}

.class-reward-cost-field {
  min-width: 0;
}

.class-reward-cost-field input {
  text-align: center;
}

.class-reward-delete-btn {
  min-height: 40px;
  padding: 8px 12px;
}

@media (max-width: 900px) {
  .class-list-main {
    grid-template-columns: 1fr;
  }

  .class-list-control-panel {
    order: -1;
  }

  .class-reward-edit-row {
  grid-template-columns: 1fr;
}

.class-reward-step-badge {
  width: 100%;
  height: 38px;
  border-radius: 14px;
}

.class-rewards-modal-intro {
  grid-template-columns: 1fr;
}
}

.mini-calm-stage {
  --calm-state: #10b981;

  width: 100%;
  height: 100%;
  min-height: 440px;

  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;

  padding: 18px;
  border-radius: 28px;

  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--calm-state) 28%, transparent), transparent 35%),
    linear-gradient(135deg, #071b16, #0f172a 54%, #10251d);

  color: #ffffff;
  overflow: hidden;

  transition:
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.mini-calm-stage.noise-state-quiet {
  --calm-state: #10b981;
}

.mini-calm-stage.noise-state-warning {
  --calm-state: #f59e0b;
}

.mini-calm-stage.noise-state-loud {
  --calm-state: #ef4444;
}


.noise-state-reward .mini-calm-mascot {
  animation: miniCalmReward 0.82s ease-in-out infinite;
}

@keyframes miniCalmReward {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-18px) scale(1.05);
  }
}

.mini-calm-stage.noise-state-reward {
  --calm-state: #facc15;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(250, 204, 21, 0.38),
      transparent 36%
    ),
    radial-gradient(
      circle at 80% 72%,
      rgba(34, 197, 94, 0.24),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      #10251d,
      #0f172a 52%,
      #2b2106
    );
}

.mini-calm-visual {
  position: relative;
  min-height: 390px;

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

  overflow: hidden;
}

.mini-calm-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mini-calm-rings span {
  position: absolute;
  left: 50%;
  top: 55%;

  width: 260px;
  height: 260px;

  border: 2px solid color-mix(in srgb, var(--calm-state) 62%, transparent);
  border-radius: 50%;

  transform: translate(-50%, -50%);
  animation: miniCalmRing 2.4s ease-out infinite;
}

.mini-calm-rings span:nth-child(2) {
  animation-delay: 0.8s;
}

.mini-calm-rings span:nth-child(3) {
  animation-delay: 1.6s;
}

@keyframes miniCalmRing {
  0% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(0.7);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.65);
  }
}

.mini-calm-message {
  position: relative;
  z-index: 4;

  text-align: center;
  margin-bottom: 8px;
}

.mini-calm-message strong {
  display: block;

  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1;
  font-weight: 950;
}

.mini-calm-message span {
  display: block;

  margin-top: 7px;
  color: #cbd5e1;
  font-weight: 800;
}

.mini-calm-mascot {
  position: relative;
  z-index: 3;

  width: auto;
  height: min(250px, 34vh);
  max-width: 82%;

  object-fit: contain;

  filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.34));
  animation: miniCalmFloat 2.8s ease-in-out infinite;
}

.noise-state-warning .mini-calm-mascot {
  animation: miniCalmWarning 0.9s ease-in-out infinite;
}

.noise-state-loud .mini-calm-mascot {
  animation: miniCalmLoud 0.38s ease-in-out infinite;
}

@keyframes miniCalmFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes miniCalmWarning {
  0%,
  100% {
    transform: rotate(-1deg);
  }

  50% {
    transform: rotate(1deg);
  }
}

@keyframes miniCalmLoud {
  0%,
  100% {
    transform: translateX(-4px) rotate(-2deg);
  }

  50% {
    transform: translateX(4px) rotate(2deg);
  }
}

.mini-calm-wave {
  position: relative;
  z-index: 4;

  height: 42px;
  margin-top: 4px;

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

.mini-calm-wave span {
  width: 5px;
  height: 8px;

  background: var(--calm-state);
  border-radius: 999px;

  transition:
    height 0.08s linear,
    background 0.2s ease;
}

.mini-calm-panel {
  align-self: center;

  width: 100%;
  padding: 22px;

  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.11),
      rgba(255, 255, 255, 0.055)
    );

  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.mini-calm-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mini-calm-kicker {
  display: block;

  color: #94a3b8;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.mini-calm-status-row strong {
  display: block;
  margin-top: 3px;

  font-size: 21px;
  font-weight: 950;
}

.mini-calm-points {
  flex: 0 0 auto;

  padding: 8px 12px;
  border-radius: 999px;

  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.26);

  color: #facc15;
  font-weight: 950;
}

.mini-calm-meter {
  height: 18px;
  margin-top: 20px;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.mini-calm-meter div {
  width: 0%;
  height: 100%;

  background: var(--calm-state);
  border-radius: inherit;

  box-shadow: 0 0 18px color-mix(in srgb, var(--calm-state) 55%, transparent);

  transition:
    width 0.08s linear,
    background 0.2s ease;
}

.mini-calm-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;

  margin-top: 8px;

  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
}

.mini-calm-goal {
  margin-top: 18px;
  padding: 14px;

  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
}

.mini-calm-goal > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  font-weight: 900;
}

.mini-calm-progress {
  height: 7px;
  margin-top: 10px;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.mini-calm-progress div {
  width: 0%;
  height: 100%;

  background: linear-gradient(90deg, #10b981, #facc15);
  border-radius: inherit;

  transition: width 0.25s linear;
}

.mini-calm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;

  margin-top: 16px;
}

.mini-calm-actions .btn {
  min-height: 42px;
  padding: 9px 11px;
}

.mini-calm-privacy {
  margin: 12px 0 0;

  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

/* Mini widget */

.noise-widget-mini {
  display: flex;
  align-items: center;
  gap: 10px;

  min-height: 78px;
  padding: 10px;

  border: 1px solid #dbe5e1;
  border-radius: 17px;

  background: linear-gradient(145deg, #f0fdf4, #ffffff);

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.noise-widget-mini img {
  width: 58px;
  height: 58px;

  object-fit: contain;

  border-radius: 15px;
  background: #ffffff;
}

.noise-widget-mini strong,
.noise-widget-mini span {
  display: block;
}

.noise-widget-mini strong {
  color: var(--board-ink);
  font-size: 14px;
  font-weight: 950;
}

.noise-widget-mini span {
  margin-top: 3px;

  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.noise-widget-mini.widget-noise-warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.noise-widget-mini.widget-noise-loud {
  background: #fef2f2;
  border-color: #fecaca;
}

.noise-widget-meter {
  height: 10px;
  margin-top: 8px;

  overflow: hidden;

  background: #e5e7eb;
  border-radius: 999px;
}

.noise-widget-meter div {
  width: 0%;
  height: 100%;

  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  border-radius: inherit;

  transition: width 0.08s linear;
}

@media (max-width: 900px) {
  .mini-calm-stage {
    grid-template-columns: 1fr;
  }

  .mini-calm-visual {
    min-height: 280px;
  }

  .mini-calm-mascot {
    height: 190px;
  }
}


/* =========================================================
   CLASS CALM METER: FULLSCREEN / CLEAN FOCUS SCALE-UP
   ========================================================= */

body.focus-mode[data-stage="noise"] .mini-calm-stage,
body.fullscreen-active[data-stage="noise"] .mini-calm-stage {
  width: 100%;
  height: 100%;
  min-height: 0;

  grid-template-columns:
    minmax(0, 1.28fr)
    minmax(420px, 0.72fr);

  gap: 28px;
  padding: 28px 34px;
  border-radius: 32px;
}

body.focus-mode[data-stage="noise"] .mini-calm-visual,
body.fullscreen-active[data-stage="noise"] .mini-calm-visual {
  min-height: 0;
  height: 100%;
  padding: 12px 0 4px;

  display: grid;
  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto;

  align-items: center;
  justify-items: center;

  overflow: hidden;
}

body.focus-mode[data-stage="noise"] .mini-calm-message,
body.fullscreen-active[data-stage="noise"] .mini-calm-message {
  align-self: start;
  margin: 0;
  padding-top: 4px;
}

body.focus-mode[data-stage="noise"] .mini-calm-message strong,
body.fullscreen-active[data-stage="noise"] .mini-calm-message strong {
  font-size: clamp(50px, 5.7vw, 82px);
  line-height: 1.05;
}

body.focus-mode[data-stage="noise"] .mini-calm-message span,
body.fullscreen-active[data-stage="noise"] .mini-calm-message span {
  margin-top: 9px;
  font-size: clamp(18px, 1.8vw, 27px);
  line-height: 1.2;
}

body.focus-mode[data-stage="noise"] .mini-calm-mascot,
body.fullscreen-active[data-stage="noise"] .mini-calm-mascot {
  align-self: center;

  width: auto;
  height: min(430px, 51vh);
  max-width: 88%;
  max-height: 100%;
}

body.focus-mode[data-stage="noise"] .mini-calm-wave,
body.fullscreen-active[data-stage="noise"] .mini-calm-wave {
  align-self: end;
}

body.focus-mode[data-stage="noise"] .mini-calm-rings span,
body.fullscreen-active[data-stage="noise"] .mini-calm-rings span {
  width: min(500px, 48vw);
  height: min(500px, 48vw);
}

body.focus-mode[data-stage="noise"] .mini-calm-wave,
body.fullscreen-active[data-stage="noise"] .mini-calm-wave {
  height: 64px;
  gap: 7px;
}

body.focus-mode[data-stage="noise"] .mini-calm-wave span,
body.fullscreen-active[data-stage="noise"] .mini-calm-wave span {
  width: 7px;
}

body.focus-mode[data-stage="noise"] .mini-calm-panel,
body.fullscreen-active[data-stage="noise"] .mini-calm-panel {
  width: 100%;
  max-width: 620px;
  padding: 30px;
  border-radius: 28px;
}

body.focus-mode[data-stage="noise"] .mini-calm-kicker,
body.fullscreen-active[data-stage="noise"] .mini-calm-kicker {
  font-size: 12px;
}

body.focus-mode[data-stage="noise"] .mini-calm-status-row strong,
body.fullscreen-active[data-stage="noise"] .mini-calm-status-row strong {
  font-size: clamp(27px, 2.6vw, 38px);
}

body.focus-mode[data-stage="noise"] .mini-calm-points,
body.fullscreen-active[data-stage="noise"] .mini-calm-points {
  padding: 11px 16px;
  font-size: 18px;
}

body.focus-mode[data-stage="noise"] .mini-calm-meter,
body.fullscreen-active[data-stage="noise"] .mini-calm-meter {
  height: 24px;
  margin-top: 24px;
}

body.focus-mode[data-stage="noise"] .mini-calm-labels,
body.fullscreen-active[data-stage="noise"] .mini-calm-labels {
  margin-top: 10px;
  font-size: 13px;
}

body.focus-mode[data-stage="noise"] .mini-calm-goal,
body.fullscreen-active[data-stage="noise"] .mini-calm-goal {
  margin-top: 24px;
  padding: 18px;
  border-radius: 20px;
}

body.focus-mode[data-stage="noise"] .mini-calm-goal > div:first-child,
body.fullscreen-active[data-stage="noise"] .mini-calm-goal > div:first-child {
  font-size: 20px;
}

body.focus-mode[data-stage="noise"] .mini-calm-progress,
body.fullscreen-active[data-stage="noise"] .mini-calm-progress {
  height: 10px;
  margin-top: 14px;
}

body.focus-mode[data-stage="noise"] .mini-calm-actions,
body.fullscreen-active[data-stage="noise"] .mini-calm-actions {
  gap: 12px;
  margin-top: 22px;
}

body.focus-mode[data-stage="noise"] .mini-calm-actions .btn,
body.fullscreen-active[data-stage="noise"] .mini-calm-actions .btn {
  min-height: 52px;
  padding: 12px 16px;
  font-size: 15px;
}

body.focus-mode[data-stage="noise"] .mini-calm-privacy,
body.fullscreen-active[data-stage="noise"] .mini-calm-privacy {
  margin-top: 16px;
  font-size: 12px;
}

/* Prevent the main board title from consuming too much fullscreen space */
body.focus-mode[data-stage="noise"] .stage-top,
body.fullscreen-active[data-stage="noise"] .stage-top {
  padding-bottom: 8px;
}

body.focus-mode[data-stage="noise"] .stage-title,
body.fullscreen-active[data-stage="noise"] .stage-title {
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.05;
}

/* Larger single-column layout on narrower projector screens */
@media (max-width: 1100px) {
  body.focus-mode[data-stage="noise"] .mini-calm-stage,
  body.fullscreen-active[data-stage="noise"] .mini-calm-stage {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  body.focus-mode[data-stage="noise"] .mini-calm-panel,
  body.fullscreen-active[data-stage="noise"] .mini-calm-panel {
    max-width: 820px;
    margin: 0 auto;
  }

  body.focus-mode[data-stage="noise"] .mini-calm-mascot,
  body.fullscreen-active[data-stage="noise"] .mini-calm-mascot {
    height: min(360px, 44vh);
  }
}


.mini-calm-points {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 4px;
  row-gap: 1px;
}

.mini-calm-points small {
  grid-column: 1 / -1;
  display: block;

  color: #fde68a;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.noise-goal-picker {
  margin-top: 18px;
}

.noise-goal-picker > span {
  display: block;
  margin-bottom: 8px;

  color: #cbd5e1;
  font-size: 11px;
  font-weight: 900;
}

.noise-goal-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.noise-goal-btn {
  min-height: 40px;

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;

  font: inherit;
  font-size: 12px;
  font-weight: 900;

  cursor: pointer;

  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.noise-goal-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.noise-goal-btn.active {
  background: var(--calm-state);
  border-color: var(--calm-state);
  color: #0f172a;
}

.noise-points-explainer {
  display: block;
  margin-top: 10px;

  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}


/* =========================================================
   CLASS CALM METER: RUNNING MODE
   ========================================================= */

.noise-running-only {
  display: none !important;
}

.mini-calm-stage.is-running .noise-setup-only {
  display: none !important;
}

.mini-calm-stage.is-running .noise-running-only {
  display: inline-flex !important;
}

.mini-calm-stage.is-running .mini-calm-panel {
  padding: 28px;
}

.mini-calm-stage.is-running .mini-calm-status-row strong {
  font-size: clamp(27px, 2.7vw, 40px);
}

.mini-calm-stage.is-running .mini-calm-meter {
  height: 24px;
  margin-top: 26px;
}

.mini-calm-stage.is-running .mini-calm-goal {
  margin-top: 24px;
  padding: 20px;
}

.mini-calm-stage.is-running .mini-calm-goal > div:first-child {
  font-size: 20px;
}

.mini-calm-stage.is-running #noiseCalmTimer {
  font-size: clamp(28px, 3vw, 42px);
}

.mini-calm-stage.is-running .mini-calm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}



.mini-calm-stage.is-running .mini-calm-actions .btn {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

/* Temporarily reveal setup controls while the meter is running */
.mini-calm-stage.is-running.show-running-settings .noise-setup-only {
  display: block !important;
}

.mini-calm-stage.is-running.show-running-settings .mini-calm-actions .noise-setup-only {
  display: inline-flex !important;
}

.mini-calm-stage.is-running.show-running-settings .noise-goal-picker {
  display: block !important;
}

.mini-calm-stage.is-running.show-running-settings .mini-calm-privacy {
  display: block !important;
}

/* Keep Start hidden while monitoring even when settings are reopened */
.mini-calm-stage.is-running.show-running-settings #noiseStartBtn {
  display: none !important;
}

/* Keep reopened calm-meter controls tidy in normal board view */
body:not(.focus-mode):not(.fullscreen-active)
  .mini-calm-stage.is-running.show-running-settings
  .mini-calm-panel {
  padding: 18px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .mini-calm-stage.is-running.show-running-settings
  .noise-goal-picker {
  margin-top: 12px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .mini-calm-stage.is-running.show-running-settings
  .mini-calm-goal {
  margin-top: 14px;
  padding: 14px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .mini-calm-stage.is-running.show-running-settings
  .mini-calm-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .mini-calm-stage.is-running.show-running-settings
  .mini-calm-actions .btn {
  min-height: 42px;
  padding: 8px 10px;
  font-size: 12px;
}

body:not(.focus-mode):not(.fullscreen-active)
  .mini-calm-stage.is-running.show-running-settings
  .mini-calm-privacy {
  margin: 9px 0 0;
  font-size: 9.5px;
  line-height: 1.3;
  text-align: center;
}



/* =========================================================
   GROUPS: PROJECTOR FIT FIX
   Shows more groups on screen without making names unreadable
   ========================================================= */

body[data-stage="groups"] .stage-body {
  overflow: hidden !important;
}

body[data-stage="groups"] .large-tool {
  justify-content: flex-start !important;
  gap: 12px !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 0 !important;
}

body[data-stage="groups"] .group-size-controls {
  flex: 0 0 auto;
  gap: 8px !important;
  margin-bottom: 4px !important;
}

body[data-stage="groups"] .group-size-controls button {
  min-height: 38px !important;
  min-width: 58px !important;
  padding: 8px 13px !important;
  font-size: 14px !important;
}

/* Normal board view, compact enough with side panels open */
body[data-stage="groups"] .group-list {
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
  overflow: auto !important;
  padding: 2px 4px 10px !important;
}

body[data-stage="groups"] .group-card,
body[data-stage="groups"] .fun-group-card {
  min-height: 134px !important;
  padding: 14px !important;
  border-radius: 20px !important;
}

body[data-stage="groups"] .group-card h3,
body[data-stage="groups"] .fun-group-card h3 {
  margin: 0 0 10px !important;
  font-size: clamp(24px, 2.25vw, 38px) !important;
  line-height: 1 !important;
  letter-spacing: -1px !important;
  gap: 7px !important;
}

body[data-stage="groups"] .group-name-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 6px !important;
}

body[data-stage="groups"] .group-name-pill {
  min-height: 36px !important;
  padding: 7px 13px !important;
  font-size: clamp(14px, 1.25vw, 19px) !important;
  border-width: 1px !important;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.05) !important;
}

/* Projector / clean focus, fit 8 to 10 groups more comfortably */
body.focus-mode[data-stage="groups"] .stage-card,
body.fullscreen-active[data-stage="groups"] .stage-card {
  padding: 18px 22px 20px !important;
  gap: 10px !important;
}

body.focus-mode[data-stage="groups"] .stage-top,
body.fullscreen-active[data-stage="groups"] .stage-top {
  padding-bottom: 8px !important;
  margin-bottom: 0 !important;
}

body.focus-mode[data-stage="groups"] .stage-title,
body.fullscreen-active[data-stage="groups"] .stage-title {
  font-size: clamp(30px, 3.2vw, 46px) !important;
}

body.focus-mode[data-stage="groups"] .group-list,
body.fullscreen-active[data-stage="groups"] .group-list {
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  gap: 12px !important;
  overflow: auto !important;
  padding: 2px 4px 12px !important;
}

body.focus-mode[data-stage="groups"] .group-card,
body.fullscreen-active[data-stage="groups"] .group-card,
body.focus-mode[data-stage="groups"] .fun-group-card,
body.fullscreen-active[data-stage="groups"] .fun-group-card {
  min-height: 142px !important;
  padding: 15px !important;
  border-radius: 22px !important;
}

body.focus-mode[data-stage="groups"] .group-card h3,
body.fullscreen-active[data-stage="groups"] .group-card h3,
body.focus-mode[data-stage="groups"] .fun-group-card h3,
body.fullscreen-active[data-stage="groups"] .fun-group-card h3 {
  margin: 0 0 10px !important;
  font-size: clamp(26px, 2.45vw, 42px) !important;
  line-height: 1 !important;
}

body.focus-mode[data-stage="groups"] .group-name-pills,
body.fullscreen-active[data-stage="groups"] .group-name-pills {
  gap: 8px !important;
  margin-top: 7px !important;
}

body.focus-mode[data-stage="groups"] .group-name-pill,
body.fullscreen-active[data-stage="groups"] .group-name-pill {
  min-height: 38px !important;
  padding: 7px 14px !important;
  font-size: clamp(15px, 1.35vw, 21px) !important;
  border-width: 1px !important;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.05) !important;
}

/* If there are only a few groups, keep them readable but not massive */
body.focus-mode[data-stage="groups"] .group-list:has(.group-card:nth-child(1):last-child),
body.fullscreen-active[data-stage="groups"] .group-list:has(.group-card:nth-child(1):last-child) {
  max-width: 620px !important;
  grid-template-columns: 1fr !important;
}

body.focus-mode[data-stage="groups"] .group-list:has(.group-card:nth-child(2):last-child),
body.fullscreen-active[data-stage="groups"] .group-list:has(.group-card:nth-child(2):last-child) {
  max-width: 900px !important;
  grid-template-columns: repeat(2, 1fr) !important;
}

body.focus-mode[data-stage="groups"] .group-list:has(.group-card:nth-child(3):last-child),
body.fullscreen-active[data-stage="groups"] .group-list:has(.group-card:nth-child(3):last-child) {
  max-width: 1120px !important;
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Short projector or laptop screens, compress one more step */
@media (max-height: 850px) and (min-width: 900px) {
  body[data-stage="groups"] .group-card,
  body[data-stage="groups"] .fun-group-card {
    min-height: 120px !important;
    padding: 12px !important;
  }

  body[data-stage="groups"] .group-card h3,
  body[data-stage="groups"] .fun-group-card h3 {
    margin-bottom: 8px !important;
    font-size: clamp(22px, 2vw, 34px) !important;
  }

  body[data-stage="groups"] .group-name-pill {
    min-height: 32px !important;
    padding: 6px 11px !important;
    font-size: clamp(13px, 1.1vw, 17px) !important;
  }

  body.focus-mode[data-stage="groups"] .group-list,
  body.fullscreen-active[data-stage="groups"] .group-list {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
    gap: 10px !important;
  }
}


/* =========================================================
   LIVE VOTE RESPONSIVE FIT FIX
   Prevents normal and projector views becoming squashed
   ========================================================= */



body[data-stage="vote"] .vote-question-card {
  flex: 0 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  padding: 10px 16px !important;
  border-radius: 22px !important;
}

body[data-stage="vote"] .vote-question-card .mission-kicker {
  margin-bottom: 8px;
  padding: 6px 11px;
  font-size: 11px;
}

body[data-stage="vote"] .vote-question-card h3 {
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.06;
  letter-spacing: -1px;
}

/* Compact the live QR and class-code panel */
body[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] {
  width: min(690px, 100%) !important;
  margin: 12px auto 0 !important;
  padding: 13px !important;
  border-radius: 20px !important;
}

body[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] > div {
  grid-template-columns: 132px minmax(0, 1fr) !important;
  gap: 15px !important;
}

body[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] > div > div:first-child {
  width: 132px !important;
  min-height: 132px !important;
  padding: 7px !important;
  border-radius: 14px !important;
}

body[data-stage="vote"] #liveVoteQrCode,
body[data-stage="vote"] #liveVoteQrCode img,
body[data-stage="vote"] #liveVoteQrCode canvas {
  width: 118px !important;
  height: 118px !important;
}

/* Keep all four answer cards on one clean row */
body[data-stage="vote"] .vote-grid.fun-vote-grid {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px;
  width: 100%;
  max-width: none;
  margin: 0;
  align-items: stretch;
}

body[data-stage="vote"] .vote-card.fun-vote-card {
  min-width: 0;
  min-height: 168px;
  padding: 12px 10px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body[data-stage="vote"] .vote-card.fun-vote-card strong {
  font-size: clamp(38px, 4.7vw, 64px);
  margin-bottom: 5px;
}

body[data-stage="vote"] .vote-card.fun-vote-card span {
  font-size: clamp(16px, 1.65vw, 23px);
  line-height: 1.12;
  margin-bottom: 10px;
}

body[data-stage="vote"] .vote-count-pop {
  margin-top: 7px;
  font-size: 15px;
}

body[data-stage="vote"] .vote-stage > .large-actions {
  flex: 0 0 auto;
  margin-top: 0;
  padding-bottom: 2px;
}

body[data-stage="vote"] .vote-stage > .large-actions .btn {
  padding: 10px 17px;
  font-size: 14px;
}

/* Fix for the combined view: Stretch the vote interface to fill the screen canvas */
body.focus-mode[data-stage="vote"] .stage-card,
body.fullscreen-active[data-stage="vote"] .stage-card {
  grid-template-rows: 1fr !important;
  padding: 32px !important;
}

body.focus-mode[data-stage="vote"] .vote-stage,
body.fullscreen-active[data-stage="vote"] .vote-stage {
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  height: 100% !important;
  gap: 24px !important;
}

/* TARGET ONLY COMBINED MODE: When Clean Focus AND Projector are active together */
body.focus-mode.fullscreen-active[data-stage="vote"] .vote-stage {
  /* Shift proportions to give the QR section 1.6x more layout presence than the cards */
  grid-template-rows: 1.6fr 1fr auto !important;
  gap: 20px !important;
}

body.focus-mode.fullscreen-active[data-stage="vote"] .vote-question-card {
  padding: 24px !important;
}

/* Force question text to become noticeably larger */
body.focus-mode.fullscreen-active[data-stage="vote"] .vote-question-card h3 {
  font-size: clamp(34px, 4.2vw, 54px) !important;
}

/* Expand the dark green join console box layout dimensions */
body.focus-mode.fullscreen-active[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] {
  width: min(840px, 100%) !important;
  padding: 20px 24px !important;
  margin-top: 14px !important;
}

body.focus-mode.fullscreen-active[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] > div {
  grid-template-columns: 264px minmax(0, 1fr) !important;
  gap: 28px !important;
}

body.focus-mode.fullscreen-active[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] > div > div:first-child {
  width: 264px !important;
  height: 264px !important;
  min-height: 264px !important;
  padding: 12px !important; /* Slightly larger canvas cushion for visual balance */
  border-radius: 16px !important;
}

body.focus-mode.fullscreen-active[data-stage="vote"] #liveVoteQrCode,
body.focus-mode.fullscreen-active[data-stage="vote"] #liveVoteQrCode img {
  width: 100% !important;
  height: 100% !important;
}

/* Magnify the 6-digit classroom registration code display typography */
body.focus-mode.fullscreen-active[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] div[style*="font-size:clamp(36px"] {
  font-size: clamp(52px, 6.5vw, 84px) !important;
  letter-spacing: 6px !important;
}

body.focus-mode[data-stage="vote"] .vote-question-card,
body.fullscreen-active[data-stage="vote"] .vote-question-card {
  padding: 13px 20px;
}

body.focus-mode[data-stage="vote"] .vote-question-card h3,
body.fullscreen-active[data-stage="vote"] .vote-question-card h3 {
  font-size: clamp(38px, 4.8vw, 72px) !important;
  font-weight: 900;
  letter-spacing: -1.5px;
}

body.focus-mode[data-stage="vote"] .vote-card.fun-vote-card,
body.fullscreen-active[data-stage="vote"] .vote-card.fun-vote-card {
  min-height: 176px;
  padding: 13px;
}

body.focus-mode[data-stage="vote"] .stage-body,
body.fullscreen-active[data-stage="vote"] .stage-body {
  overflow-y: auto !important;
}

/* Stack safely on genuinely narrow displays */
@media (max-width: 820px) {
  body[data-stage="vote"] .vote-grid.fun-vote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] > div {
    grid-template-columns: 1fr !important;
  }

  body[data-stage="vote"] .vote-question-card > div[style*="margin:18px auto 0"] > div > div:first-child {
    margin: 0 auto;
  }
}


/* =========================================================
   FINAL LIVE-VOTE HEIGHT AND PROJECTOR QR FIX
   ========================================================= */

/* ---------------------------------------------------------
   NORMAL BOARD MODE
   Fit the question, join panel, cards and controls on screen
   --------------------------------------------------------- */

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .stage-card {
  padding: 12px !important;
  gap: 8px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .stage-top {
  min-height: 72px;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .stage-title {
  font-size: clamp(27px, 2.8vw, 42px) !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .stage-body {
  overflow: hidden !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-stage {
  display: grid !important;
  /* Allocate 1.4 parts to the question area, and 1 part to the buttons */
  grid-template-rows: 1.4fr 1fr auto !important; 
  align-content: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 12px;
  padding: 0;
}

/* Compact question area */
body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-question-card {
  padding: 10px 14px !important;
  border-radius: 20px;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-question-card .mission-kicker {
  margin-bottom: 5px;
  padding: 5px 10px;
  font-size: 10px;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-question-card h3 {
  font-size: clamp(25px, 2.8vw, 40px) !important;
  line-height: 1.02;
  margin: 0;
}

/* Standardize live vote QR elements inside normal mode side panels */
    body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] #liveVoteQrCode,
    body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] #liveVoteQrCode div,
    body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] #liveVoteQrCode img {
      display: block !important;
      width: 100% !important;
      height: 100% !important;
      max-width: 100% !important;
      max-height: 100% !important;
      margin: 0 auto !important;
      padding: 0 !important;
    }

    /* Safely target and hide the redundant rendering canvas built by the script library */
    body[data-stage] [id*="QrCode"] canvas,
    body[data-stage] .live-join-qr canvas {
      display: none !important;
    }

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-question-card h3 {
  font-size: clamp(24px, 2.6vw, 34px) !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-question-card .mission-kicker {
  display: inline-flex !important; /* Bring back label cleanly */
  margin-bottom: 6px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] div[style*="margin-top:10px"] {
  margin-top: 5px !important;
  font-size: 11px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] div[style*="margin-top:13px"] {
  margin-top: 7px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
#liveVoteParticipantCount {
  margin-top: 6px !important;
  font-size: 13px;
}

/* Compact answer cards enough to leave space for controls */
body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
.vote-grid.fun-vote-grid {
  min-height: 0;
  height: 100%;
  gap: 9px;
  align-items: stretch;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-grid.fun-vote-grid {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: auto !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-card.fun-vote-card {
  min-height: 0 !important;
  height: 100% !important;
  padding: 6px !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 4px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-card.fun-vote-card strong {
  font-size: clamp(22px, 2.5vw, 32px) !important;
  margin-bottom: 0px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-card.fun-vote-card span {
  font-size: clamp(12px, 1.2vw, 15px) !important;
  margin-bottom: 2px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-card.fun-vote-card strong {
  font-size: clamp(24px, 3vw, 36px) !important;
  margin-bottom: 2px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-card.fun-vote-card span {
  font-size: clamp(13px, 1.3vw, 16px) !important;
  margin-bottom: 4px !important;
}

/* Ensure clean focus and projector modes expand to fill full screen without bounds */
body.focus-mode[data-stage="vote"] .vote-card.fun-vote-card,
body.fullscreen-active[data-stage="vote"] .vote-card.fun-vote-card {
  min-height: 210px !important;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
.vote-card.fun-vote-card strong {
  font-size: clamp(34px, 4vw, 54px) !important;
  margin-bottom: 3px;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
.vote-card.fun-vote-card span {
  font-size: clamp(15px, 1.55vw, 21px) !important;
  line-height: 1.08;
  margin-bottom: 7px;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-bar {
  height: 9px;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] .vote-count-pop {
  margin-top: 5px;
  font-size: 13px;
}

/* Always reserve a visible row for the teacher controls */
body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
.vote-stage > .large-actions {
  display: flex !important;
  flex: 0 0 auto;
  min-height: 42px;
  margin: 0 !important;
  padding: 0 0 2px;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
.vote-stage > .large-actions .btn {
  min-height: 38px;
  padding: 8px 15px;
  font-size: 13px;
}


/* ---------------------------------------------------------
   PROJECTOR AND CLEAN-FOCUS MODE
   Make the QR code much larger and easier to scan
   --------------------------------------------------------- */

body.focus-mode[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"],
body.fullscreen-active[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] {
  width: min(820px, 100%) !important;
  padding: 16px 19px !important;
}

body.focus-mode[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] > div,
body.fullscreen-active[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] > div {
  grid-template-columns: 264px minmax(0, 1fr) !important;
  gap: 22px !important;
}

body.focus-mode[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] > div > div:first-child,
body.fullscreen-active[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] > div > div:first-child {
  width: 264px !important;
  min-height: 264px !important;
  padding: 12px !important; /* Visual cushion matching your platform templates */
  border-radius: 17px !important;
}

body.focus-mode[data-stage="vote"] #liveVoteQrCode,
body.focus-mode[data-stage="vote"] #liveVoteQrCode img,
body.fullscreen-active[data-stage="vote"] #liveVoteQrCode,
body.fullscreen-active[data-stage="vote"] #liveVoteQrCode img {
  width: 100% !important;
  height: 100% !important;
}

/* Larger class code for projection */
body.focus-mode[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] div[style*="font-size:clamp(36px"],
body.fullscreen-active[data-stage="vote"]
.vote-question-card > div[style*="margin:18px auto 0"] div[style*="font-size:clamp(36px"] {
  font-size: clamp(46px, 6vw, 76px) !important;
}

/* Use the available lower space without making cards excessively tall */
body.focus-mode[data-stage="vote"] .vote-card.fun-vote-card,
body.fullscreen-active[data-stage="vote"] .vote-card.fun-vote-card {
  min-height: 170px !important;
  max-height: 230px;
}

/* Keep projector controls visible */
body.focus-mode[data-stage="vote"] .vote-stage > .large-actions,
body.fullscreen-active[data-stage="vote"] .vote-stage > .large-actions {
  display: flex !important;
  min-height: 44px;
  flex: 0 0 auto;
  margin: 0 !important;
  padding-bottom: 2px;
}


/* ---------------------------------------------------------
   SHORTER LAPTOP SCREENS
   Additional reduction only when genuinely necessary
   --------------------------------------------------------- */

@media (max-height: 820px) and (min-width: 821px) {
  body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
  .vote-question-card h3 {
    font-size: clamp(22px, 2.4vw, 34px) !important;
  }

  body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
  .vote-card.fun-vote-card strong {
    font-size: clamp(29px, 3.5vw, 45px) !important;
  }

  body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
  .vote-card.fun-vote-card span {
    font-size: clamp(13px, 1.35vw, 18px) !important;
  }

  body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
  .vote-question-card > div[style*="margin:18px auto 0"] {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }

  body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"]
  .vote-question-card > div[style*="margin:18px auto 0"] > div > div:first-child {
    width: 92px !important;
    min-height: 92px !important;
  }

  body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] #liveVoteQrCode,
  body:not(.focus-mode):not(.fullscreen-active)[data-stage="vote"] #liveVoteQrCode img {
    width: 100% !important;
    height: 100% !important;
  }
}


/* =========================================================
   17. COMPACT LIVE NOTES TOOLBAR
   ========================================================= */
.notes-stage-layout {
  gap: 8px !important;
}

.notes-live-toolbar {
  width: 100%;
  max-width: none;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

.notes-live-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  margin-right: 2px;
}

.notes-live-qr {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  padding: 3px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid #d1d5db;
}

.notes-live-qr img,
.notes-live-qr canvas,
.notes-live-qr > div {
  width: 42px !important;
  height: 42px !important;
}

.notes-live-code {
  min-width: 0;
  text-align: left;
}

.notes-live-code span {
  display: block;
  color: #64748b;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .65px;
}

.notes-live-code strong {
  display: block;
  margin-top: 1px;
  color: #143f3a;
  font-size: 23px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 2px;
}

.notes-live-code small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.notes-live-toolbar .btn {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
}

.notes-response-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #143f3a;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.notes-response-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #22c55e;
}

.corkboard-note.student-draggable-note {
  cursor: grab !important;
  touch-action: none;
}

.corkboard-note.student-draggable-note:active {
  cursor: grabbing !important;
  z-index: 60;
}

@media (max-width: 900px) {
  .notes-live-toolbar {
    justify-content: flex-start;
  }

  .notes-live-identity {
    width: 100%;
  }
}


/* =========================================================
   18. LIVE PARTICIPATION SUITE
   Emoji check-in, secret code, quiz and mystery word
   ========================================================= */

.live-suite-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.live-suite-hub {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: center;
  flex: 1;
}

.live-suite-card {
  border: 1px solid #d9fbe8;
  border-radius: 24px;
  padding: 20px;
  background:
    radial-gradient(circle at 92% 8%, rgba(95,220,154,.22), transparent 30%),
    linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.live-suite-card:hover {
  transform: translateY(-4px);
  border-color: #5fdc9a;
  box-shadow: 0 20px 42px rgba(15,23,42,.13);
}

.live-suite-icon {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: linear-gradient(145deg, #ffffff, #dffbea);
  box-shadow: inset 0 -8px 14px rgba(20,63,58,.08), 0 12px 22px rgba(15,23,42,.1);
}

.live-suite-card h3 {
  margin: 0 0 5px;
  color: #143f3a;
  font-size: clamp(20px, 2vw, 29px);
}

.live-suite-card p {
  margin: 0;
  color: #64748b;
  font-weight: 750;
  line-height: 1.4;
}

.live-join-panel {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 14px;
  border-radius: 22px;
  background: #143f3a;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(15,23,42,.18);
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.live-join-qr {
  width: 118px;
  height: 118px;
  border-radius: 15px;
  padding: 7px;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.live-join-qr img,
.live-join-qr canvas,
.live-join-qr > div {
  width: 104px !important;
  height: 104px !important;
}

.live-join-copy small {
  display: block;
  color: #bbf7d0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .75px;
}

.live-join-code {
  margin-top: 4px;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 4px;
}

.live-join-status {
  margin-top: 8px;
  color: #d1fae5;
  font-size: 13px;
  font-weight: 900;
}

.live-join-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.live-join-actions .btn {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
}

.live-activity-toolbar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid #e5e7eb;
  border-radius: 17px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

.live-response-pill {
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #143f3a;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.live-response-pill.on {
  border-color: #5fdc9a;
  background: #f1fdf6;
}

.emoji-result-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.emoji-result-card {
  min-height: 138px;
  border: 1px solid #d9fbe8;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f1fdf6);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}

.emoji-result-card strong {
  display: block;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1;
}

.emoji-result-card span {
  display: block;
  color: #143f3a;
  font-weight: 950;
  margin-top: 7px;
}

.emoji-result-card small {
  display: block;
  color: #64748b;
  font-weight: 900;
  margin-top: 5px;
}

.secret-code-hero,
.quiz-live-hero,
.mystery-live-hero {
  border: 1px solid #d9fbe8;
  border-radius: 26px;
  padding: 18px;
  background:
    radial-gradient(circle at 90% 8%, rgba(95,220,154,.22), transparent 32%),
    linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 12px 28px rgba(15,23,42,.07);
  text-align: center;
}

.secret-code-icon,
.mystery-word-icon {
  font-size: clamp(54px, 7vw, 94px);
  filter: drop-shadow(0 12px 12px rgba(15,23,42,.14));
}

.secret-code-hero h2,
.quiz-live-hero h2,
.mystery-live-hero h2 {
  margin: 5px 0 7px;
  color: #143f3a;
  font-size: clamp(28px, 3.4vw, 50px);
  line-height: 1.06;
}

.secret-code-hero p,
.quiz-live-hero p,
.mystery-live-hero p {
  margin: 0;
  color: #64748b;
  font-weight: 800;
  line-height: 1.45;
}

.teacher-private-card {
  width: min(700px, 100%);
  margin: 0 auto;
  padding: 13px 16px;
  border: 1px dashed #f59e0b;
  border-radius: 18px;
  background: #fffbeb;
  color: #7c2d12;
  text-align: center;
}

.teacher-private-card small {
  display: block;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .65px;
}

.teacher-private-code {
  margin-top: 5px;
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 950;
  letter-spacing: 5px;
}

.live-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.live-stat-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 13px;
  background: #ffffff;
  text-align: center;
}

.live-stat-card strong {
  display: block;
  color: #143f3a;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1;
}

.live-stat-card span {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .55px;
}

.teacher-response-list {
  width: 100%;
  max-height: 150px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.teacher-response-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.quiz-question-preview {
  width: 100%;
  border: 1px solid #d9fbe8;
  border-radius: 20px;
  padding: 14px;
  background: #ffffff;
  text-align: left;
}

.quiz-question-preview strong {
  display: block;
  color: #143f3a;
  font-size: 17px;
  margin-bottom: 8px;
}

.quiz-option-preview {
  display: inline-flex;
  margin: 3px 5px 3px 0;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
}

.quiz-editor-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 13px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.quiz-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.quiz-editor-head strong {
  color: #143f3a;
}

.mystery-pattern {
  display: flex;
  justify-content: center;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px auto;
  min-height: 72px;
}

.mystery-slot {
  width: clamp(28px, 3.8vw, 50px);
  min-height: clamp(42px, 5vw, 66px);
  border-bottom: 5px solid #143f3a;
  display: grid;
  place-items: center;
  color: #143f3a;
  font-size: clamp(26px, 4vw, 52px);
  font-weight: 950;
  text-transform: uppercase;
}

.mystery-space {
  width: 22px;
}

.mystery-solved-banner {
  padding: 12px 16px;
  border-radius: 18px;
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #166534;
  font-weight: 950;
  text-align: center;
}

.notes-projector-join-card {
  display: none;
}

/* Normal mode layout split parameters for student Sticky Pinboards */
.notes-stage-layout.is-live {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 270px !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  grid-template-areas:
    "main join"
    "toolbar toolbar" !important;
  gap: 12px !important;
}

.notes-stage-layout .free-note-board { grid-area: main; }
.notes-stage-layout .notes-normal-join-column { grid-area: join; }
.notes-stage-layout .notes-live-toolbar { grid-area: toolbar; }

body.live-qr-hidden .notes-stage-layout.is-live {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas:
    "main"
    "toolbar" !important;
}

body.focus-mode[data-stage="notes"] .notes-stage-layout.is-live,
body.fullscreen-active[data-stage="notes"] .notes-stage-layout.is-live {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(245px, 310px) !important;
  grid-template-rows: 1fr auto !important;
  gap: 16px !important;
  align-items: stretch !important;
}

/* Hide normal-view panel when projector/focus overlays take over to avoid layout duplication */
body.focus-mode[data-stage="notes"] .notes-stage-layout .notes-normal-join-column,
body.fullscreen-active[data-stage="notes"] .notes-stage-layout .notes-normal-join-column {
  display: none !important;
}

body.focus-mode[data-stage="notes"] .corkboard-arena.free-note-board,
body.fullscreen-active[data-stage="notes"] .corkboard-arena.free-note-board {
  grid-column: 1;
  grid-row: 1;
  height: 100% !important;
}

body.focus-mode[data-stage="notes"] .notes-projector-join-card,
body.fullscreen-active[data-stage="notes"] .notes-projector-join-card {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: #143f3a;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 18px 42px rgba(15,23,42,.2);
}

body.focus-mode[data-stage="notes"] .notes-live-toolbar,
body.fullscreen-active[data-stage="notes"] .notes-live-toolbar {
  display: flex !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  width: 100% !important;
}

.notes-projector-qr {
  width: 224px;
  height: 224px;
  padding: 8px;
  border-radius: 18px;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.notes-projector-qr img,
.notes-projector-qr canvas,
.notes-projector-qr > div {
  width: 208px !important;
  height: 208px !important;
}

.notes-projector-code {
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 4px;
}

.notes-projector-join-card p {
  margin: 0;
  color: #d1fae5;
  font-weight: 850;
  line-height: 1.4;
}

/* Enforce identical full-height flex column layouts across all live panels including Class Vote */
body.focus-mode[data-stage="vote"] .live-join-panel,
body.fullscreen-active[data-stage="vote"] .live-join-panel,
body.focus-mode[data-stage="emoji"] .live-join-panel,
body.fullscreen-active[data-stage="emoji"] .live-join-panel,
body.focus-mode[data-stage="secretCode"] .live-join-panel,
body.fullscreen-active[data-stage="secretCode"] .live-join-panel,
body.focus-mode[data-stage="quiz"] .live-join-panel,
body.fullscreen-active[data-stage="quiz"] .live-join-panel,
body.focus-mode[data-stage="mysteryWord"] .live-join-panel,
body.fullscreen-active[data-stage="mysteryWord"] .live-join-panel {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  gap: 12px !important;
  padding: 16px !important;
}

/* Standardize the white background canvas container frame layout dimensions unconditionally */
body[data-stage] .live-join-qr,
body[data-stage] .notes-projector-qr {
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  padding: 10px !important; /* Creates a clean, uniform cushion around the QR matrix */
  background: #ffffff !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

/* Maximize the QR frame container layout footprint on presentation screens */
/* Moderate scaling for standard side-column live tools so they do not break layouts */
body.focus-mode[data-stage="emoji"] .live-join-qr,
body.fullscreen-active[data-stage="emoji"] .live-join-qr,
body.focus-mode[data-stage="quiz"] .live-join-qr,
body.fullscreen-active[data-stage="quiz"] .live-join-qr,
body.focus-mode[data-stage="vote"] .live-join-qr,
body.fullscreen-active[data-stage="vote"] .live-join-qr,
body.focus-mode[data-stage="notes"] .notes-projector-qr,
body.fullscreen-active[data-stage="notes"] .notes-projector-qr {
  width: 220px !important;
  height: 220px !important;
  min-width: 220px !important;
  min-height: 220px !important;
  padding: 12px !important;
  border-radius: 16px !important;
}

/* Isolated massive scale exclusively for the Projector QR Link Sharer stage */
body.focus-mode[data-stage="qrLinks"] .shared-live-join-panel > div:nth-child(2),
body.fullscreen-active[data-stage="qrLinks"] .shared-live-join-panel > div:nth-child(2) {
  width: 360px !important;
  height: 360px !important;
  min-width: 360px !important;
  min-height: 360px !important;
  padding: 18px !important; /* Scaled canvas cushion padding to balance the massive size */
  border-radius: 24px !important;
}

/* Fluidly constraint the QR size boundaries without forcing hidden script assets to render */
    body[data-stage] .live-join-qr div,
    body[data-stage] .live-join-qr img,
    body[data-stage] .notes-projector-qr div,
    body[data-stage] .notes-projector-qr img,
    body[data-stage] [id*="QrCode"],
    body[data-stage] [id*="QrCode"] div,
    body[data-stage] [id*="QrCode"] img {
      width: 100% !important;
      height: 100% !important;
      max-width: 100% !important;
      max-height: 100% !important;
      display: block !important;
      object-fit: contain !important;
      margin: 0 auto !important;
      padding: 0 !important;
      background: transparent !important;
    }

body.focus-mode .teacher-response-list,
body.fullscreen-active .teacher-response-list {
  display: none !important;
}

/* Universal Theme Adaptive Rules for Live Panels & Projector Cards */
.live-join-panel, 
.shared-live-join-panel, 
.notes-projector-join-card,
.vote-live-join-panel {
  background: var(--board-ink) !important;
  color: #ffffff !important;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* 📱 Auto-Upscale Quiz Layout when QR panel is hidden */
body.live-qr-hidden .quiz-layout .quiz-question-preview {
  padding: 24px !important;
  border-radius: 26px !important;
}
body.live-qr-hidden .quiz-layout .quiz-question-preview strong {
  font-size: clamp(22px, 2.5vw, 36px) !important;
  margin-bottom: 16px !important;
}
body.live-qr-hidden .quiz-layout .quiz-option-preview {
  font-size: clamp(14px, 1.6vw, 22px) !important;
  padding: 10px 18px !important;
  margin: 6px 8px 6px 0 !important;
  border-radius: 14px !important;
}
.live-join-copy small, 
.notes-projector-join-card div:first-child {
  color: var(--board-accent) !important;
}

@media (max-width: 900px) {
  .live-suite-hub,
  .emoji-result-grid,
  .live-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .live-join-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .live-join-qr {
    margin: 0 auto;
  }

  body.focus-mode[data-stage="notes"] .notes-stage-layout,
  body.fullscreen-active[data-stage="notes"] .notes-stage-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
  }

  body.focus-mode[data-stage="notes"] .notes-projector-join-card,
  body.fullscreen-active[data-stage="notes"] .notes-projector-join-card {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
  }
}

@media (max-width: 620px) {
  .live-suite-hub,
  .emoji-result-grid,
  .live-stat-grid {
    grid-template-columns: 1fr;
  }

  .live-suite-card {
    grid-template-columns: 58px 1fr;
  }

  .live-suite-icon {
    width: 58px;
    height: 58px;
    font-size: 30px;
  }
}


/* =========================================================
   19. ORGANISED NAVIGATION AND ADAPTIVE LIVE ACTIVITY LAYOUT
   ========================================================= */

/* Header: keep the top level calm and easy to understand. */
.nav-actions {
  position: relative;
  flex-wrap: nowrap;
  gap: 7px;
}


/* =========================================================
   TEACH HEADER MENU
   ========================================================= */

/* Show Teach menu on Dashboard only. */
body:not([data-stage="today"])
#teachHeaderMenu {
  display: none !important;
}

.teach-header-menu {
  position: relative;
  flex: 0 0 auto;
}

.teach-header-menu > summary {
  list-style: none;
}

.teach-header-menu > summary::-webkit-details-marker {
  display: none;
}

.teach-header-trigger {
  min-width: 98px;
  min-height: 40px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  padding: 0 13px;

  border: 1px solid #cbd5e1;
  border-radius: 999px;

  background: #ffffff;
  color: #143f3a;

  font-size: 12px;
  line-height: 1;
  font-weight: 950;

  cursor: pointer;

  box-shadow:
    0 2px 6px
    rgba(15, 23, 42, 0.04);

  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.teach-header-trigger:hover,
.teach-header-trigger:focus-visible {
  border-color: #86efac;
  background: #f0fdf4;

  box-shadow:
    0 5px 12px
    rgba(15, 23, 42, 0.08);

  outline: none;
  transform: translateY(-1px);
}

.teach-header-trigger-icon {
  font-size: 15px;
  line-height: 1;
}

.teach-header-chevron {
  color: #64748b;
  font-size: 10px;
  line-height: 1;

  transition:
    transform 0.16s ease;
}

.teach-header-menu[open]
.teach-header-chevron {
  transform: rotate(180deg);
}


/* Contextual timetable shortcut beside Teach */

.teach-header-quick-button {
  width: auto;
  min-width: 40px;
  height: 40px;

  display: none;
  align-items: center;
  justify-content: center;

  gap: 6px;

  padding:
    0
    11px;

  border: 1px solid #cbd5e1;
  border-radius: 999px;

  background: #ffffff;
  color: #143f3a;

  line-height: 1;
  font-weight: 950;

  cursor: pointer;

  box-shadow:
    0 2px 6px
    rgba(15, 23, 42, 0.04);

  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}


.teach-header-quick-icon {
  flex:
    0
    0
    auto;

  font-size:
    16px;

  line-height:
    1;
}


.teach-header-timetable-mode-label {
  flex:
    0
    0
    auto;

  color:
    #475569;

  font-size:
    10px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;
}

.teach-header-quick-button:hover,
.teach-header-quick-button:focus-visible {
  border-color: #86efac;
  background: #f0fdf4;

  box-shadow:
    0 5px 12px
    rgba(15, 23, 42, 0.08);

  outline: none;
  transform: translateY(-1px);
}


/* Dashboard = edit timetable */

body[data-stage="today"]
.teach-header-quick-edit {
  display: inline-flex;

  border-color:
    #fbbf24;

  background:
    #fffbeb;

  color:
    #92400e;

  box-shadow:
    0 3px 8px
    rgba(
      245,
      158,
      11,
      0.14
    );
}

body[data-stage="today"]
.teach-header-quick-edit:hover,
body[data-stage="today"]
.teach-header-quick-edit:focus-visible {
  border-color:
    #f59e0b;

  background:
    #fef3c7;

  color:
    #78350f;

  box-shadow:
    0 5px 12px
    rgba(
      245,
      158,
      11,
      0.20
    );
}


/* Other screens = view timetable */

body:not([data-stage="today"])
.teach-header-quick-timetable {
  display: inline-flex;
}


.teach-header-panel {
  position: absolute;

  top: calc(100% + 9px);
  left: 0;

  width: 310px;

  padding: 8px;

  border: 1px solid #dbe6df;
  border-radius: 16px;

  background: #ffffff;

  box-shadow:
    0 18px 45px
    rgba(15, 23, 42, 0.18);

  z-index: 10000;
}

.teach-header-heading {
  padding:
    7px
    10px
    6px;

  color: #7a8b9a;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;

  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.teach-header-divider {
  height: 1px;

  margin:
    6px
    5px;

  background: #e5e7eb;
}

.teach-header-item {
  width: 100%;

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

  margin: 3px 0;

  padding:
    9px
    11px;

  border: 0;
  border-radius: 12px;

  background: transparent;
  color: #173f39;

  font: inherit;
  text-align: left;

  cursor: pointer;
}

.teach-header-item:hover,
.teach-header-item:focus-visible {
  background: #f1f8f4;
  outline: none;
}

.teach-header-item-icon {
  width: 32px;
  min-width: 32px;
  height: 32px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: #eefbf4;
  color: #166534;

  font-size: 15px;
  line-height: 1;
  font-weight: 950;
}

.teach-header-item-copy {
  min-width: 0;

  display: grid;
  gap: 3px;
}

.teach-header-item-copy strong {
  color: #143f3a;

  font-size: 12px;
  line-height: 1.15;
  font-weight: 950;
}

.teach-header-item-copy small {
  color: #64748b;

  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 750;
}

.nav-primary-btn {
  min-height: 38px;
  padding: 9px 13px;
}


/*
  Compact secondary header controls

  Each control remains icon-only until that individual
  control is hovered or keyboard-focused.
*/

.compact-header-action {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 999px;
  transition:
    width 0.22s ease,
    min-width 0.22s ease,
    max-width 0.22s ease,
    gap 0.22s ease,
    padding 0.22s ease,
    transform 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.compact-header-action-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.compact-header-action-label {
  display: block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  transition:
    max-width 0.22s ease,
    opacity 0.16s ease;
}

.manage-classes-header-btn {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  gap: 7px;
  padding-right: 13px;
}

.manage-classes-header-btn
.compact-header-action-label {
  max-width: 92px;
  opacity: 1;
}

.edit-timetable-header-btn {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  gap: 7px;
  padding-right: 13px;
}

.edit-timetable-header-btn
.compact-header-action-label {
  max-width: 92px;
  opacity: 1;
}

.compact-header-action:hover,
.compact-header-action:focus-visible {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  gap: 7px;
  padding-right: 13px;
  outline: none;
  transform: translateY(-1px);
}

.compact-header-action:hover
.compact-header-action-label,
.compact-header-action:focus-visible
.compact-header-action-label {
  max-width: 92px;
  opacity: 1;
}


/*
 * Menu and Hide header are permanent
 * icon-only secondary controls.
 */
.board-menu-trigger,
.hide-header-action {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  gap: 0 !important;
  padding:
    0
    10px !important;
}


.board-menu-trigger
.compact-header-action-label,
.hide-header-action
.compact-header-action-label,
.board-menu-trigger:hover
.compact-header-action-label,
.board-menu-trigger:focus-visible
.compact-header-action-label,
.board-menu-trigger[aria-expanded="true"]
.compact-header-action-label,
.hide-header-action:hover
.compact-header-action-label,
.hide-header-action:focus-visible
.compact-header-action-label {
  max-width: 0 !important;
  opacity: 0 !important;
}



/*
  Hide Header receives a softer neutral treatment so it
  does not compete with Present to Class.
*/

.hide-header-action {
  border-color: #dbe3e8 !important;
  background: #ffffff !important;
  color: #475569 !important;
  box-shadow: none !important;
}

.hide-header-action .compact-header-action-icon {
  color: #64748b;
  font-size: 15px;
}

.hide-header-action:hover,
.hide-header-action:focus-visible {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  box-shadow:
    0 5px 12px rgba(15, 23, 42, 0.08) !important;
}

.present-to-class-icon {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 15px;
  border: 2px solid #2563eb;
  border-radius: 999px;
  background: #ffffff;
}

.present-to-class-icon::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
}


body[data-stage="task"]
.present-to-class-btn
.present-to-class-icon {
  border-color:
    #ffffff;

  background:
    rgba(
      255,
      255,
      255,
      0.14
    );
}

.present-lesson-launch-group {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.present-to-class-btn {
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  box-shadow:
    0 4px 10px
    rgba(37, 99, 235, 0.08);
}


/*
  In the lesson workspace, Present to Class
  becomes the clear primary teaching action.
*/
body[data-stage="task"]
.present-to-class-btn {
  min-height: 42px;
  padding:
    9px
    16px;

  border-color:
    #2563eb;

  background:
    #2563eb;

  color:
    #ffffff;

  font-size:
    12px;

  font-weight:
    950;

  box-shadow:
    0 7px 18px
    rgba(
      37,
      99,
      235,
      0.22
    );
}

.present-lesson-setup-btn {
  width: 35px;
  min-width: 35px;
  min-height: 38px;
  display: none;
  place-items: center;
  padding: 0;
  border:
    1px solid
    #93c5fd;
  border-left: 0;
  border-radius:
    0
    999px
    999px
    0;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  box-shadow:
    0 4px 10px
    rgba(37, 99, 235, 0.08);
}


body[data-stage="task"]
.present-lesson-setup-btn {
  min-height: 42px;

  border-color:
    #2563eb;

  border-left:
    1px solid
    rgba(
      255,
      255,
      255,
      0.28
    );

  background:
    #1d4ed8;

  color:
    #ffffff;

  box-shadow:
    0 7px 18px
    rgba(
      37,
      99,
      235,
      0.22
    );
}

.present-lesson-launch-group
.has-present-lesson-setup {
  border-radius: 999px;
}

.present-lesson-launch-group
.present-to-class-btn {
  border-radius: 999px;
}

.present-lesson-launch-group.has-present-lesson-setup
.present-to-class-btn {
  border-radius:
    999px
    0
    0
    999px;
}

.present-lesson-launch-group.has-present-lesson-setup
.present-lesson-setup-btn {
  display: inline-grid;
}

.present-lesson-setup-btn[hidden] {
  display: none !important;
}

.present-lesson-setup-btn:hover,
.present-lesson-setup-btn:focus-visible {
  border-color: #60a5fa;
  background: #dbeafe;
  color: #1d4ed8;
  outline: none;
}

.present-lesson-setup-btn:active {
  transform: scale(0.94);
}

.present-to-class-btn:hover {
  border-color: #60a5fa;
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow:
    0 6px 14px rgba(37, 99, 235, 0.14);
}

.present-to-class-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.24);
  outline-offset: 2px;
}

.present-to-class-btn[aria-pressed="true"] {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.present-to-class-btn[aria-pressed="true"]
.present-to-class-icon {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.present-to-class-btn[aria-pressed="true"]
.present-to-class-icon::after {
  width: 9px;
  height: 9px;
  background: #4ade80;
  box-shadow:
    0 0 0 3px rgba(74, 222, 128, 0.22),
    0 0 8px rgba(74, 222, 128, 0.5);
}

.response-mode-nav-btn {
  min-width: 154px;
  border-color: #86efac !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.1s ease;
}

.response-mode-nav-btn.is-one-response {
  border-color: #86efac !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
}

.response-mode-nav-btn.is-repeat-response {
  border-color: #fdba74 !important;
  background: #fff7ed !important;
  color: #9a3412 !important;
}

.response-mode-nav-btn.is-locked {
  border-color: #cbd5e1 !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
}

.live-activities-button {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  min-height: 40px;

  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;

  padding: 0 7px;

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

  background: transparent;
  color: #166534;

  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;

  box-shadow: none;

  transition:
    width 0.22s ease,
    min-width 0.22s ease,
    max-width 0.22s ease,
    gap 0.22s ease,
    padding 0.22s ease,
    transform 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.live-activities-button:hover,
.live-activities-button:focus-visible {
  width: 154px;
  min-width: 154px;
  max-width: 154px;
  gap: 8px;
  padding-right: 12px;

  border-color: #bbf7d0;
  background: #f0fdf4;

  outline: none;
  transform: translateY(-1px);

  box-shadow:
    0 6px 16px rgba(22, 101, 52, 0.10);
}

.live-activities-button:active {
  transform: scale(0.97);
}

.live-activities-icon {
  display: none;
}

.live-activities-copy {
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;

  transition:
    max-width 0.22s ease,
    opacity 0.16s ease;
}

.live-activities-copy small {
  display: none;
}

.live-activities-copy strong {
  display: block;
  color: #166534;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.live-activities-button:hover
.live-activities-copy,
.live-activities-button:focus-visible
.live-activities-copy {
  max-width: 98px;
  opacity: 1;
}

.live-activities-status {
  width: 34px;
  min-width: 34px;
  height: 19px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 0 7px;

  border: 1px solid #dc2626;
  border-radius: 999px;

  background: #dc2626;
  color: #ffffff;

  font-size: 8px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.55px;

  box-shadow:
    0 3px 8px rgba(220, 38, 38, 0.20);
}

.live-activities-dot {
  display: none;
}

@keyframes liveActivitiesPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.55;
    transform: scale(0.78);
  }
}

#liveActivitiesNavBtn.is-active {
  border-color: #ffffff;

  box-shadow:
    0 10px 24px
    rgba(127, 29, 29, 0.36),
    0 0 0 4px
    rgba(254, 202, 202, 0.26);
}

#liveActivitiesNavBtn.is-active
.live-activities-status {
  background: #facc15;
  border-color: #facc15;
  color: #422006;
}

@media (max-width: 980px) {
  .live-activities-button {
    min-width: 0;
    grid-template-columns: 30px auto;
    padding-right: 12px;
  }

  .live-activities-copy small,
  .live-activities-status {
    display: none;
  }
}

@media (max-width: 700px) {
  .live-activities-button {
    min-height: 38px;
    padding: 3px 10px 3px 4px;
  }

  .live-activities-icon {
    width: 29px;
    height: 29px;
    font-size: 15px;
  }

  .live-activities-copy strong {
    font-size: 12px;
  }
}

.board-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.board-menu-trigger {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
}

.board-menu-trigger:hover,
.board-menu-trigger:focus-visible,
.board-menu-trigger[aria-expanded="true"] {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  gap: 0;
}

@media (hover: none) {
  .compact-header-action:hover {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    gap: 0;
    padding-right: 11px;
  }

  .compact-header-action:hover
  .compact-header-action-label {
    max-width: 0;
    opacity: 0;
  }

  .live-activities-button:hover {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    transform: none;
  }

  .live-activities-button:hover
  .live-activities-copy {
    max-width: 0;
    opacity: 0;
  }
}

.board-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;

  z-index:
    1000000;

  width:
    min(
      330px,
      calc(
        100vw - 24px
      )
    );

  max-height:
    min(
      620px,
      calc(
        100vh - 82px
      )
    );

  overflow:
    auto;

  display:
    none;

  padding:
    10px;

  border:
    1px solid
    #dbe4e1;

  border-radius:
    20px;

  background:
    rgba(
      255,
      255,
      255,
      .985
    );

  box-shadow:
    0
    24px
    65px
    rgba(
      15,
      23,
      42,
      .22
    );

  backdrop-filter:
    blur(
      16px
    );
}


/*
 * iPad header scrolls horizontally.
 * The board menu must escape that scroll container,
 * otherwise Safari clips it behind the Class Board.
 */
@media (
  min-width: 701px
) and (
  max-width: 1220px
) {
  header {
    overflow:
      visible !important;

    z-index:
      100000 !important;
  }

  .board-menu-wrap {
    position:
      static !important;

    z-index:
      1000001 !important;
  }

  .board-menu-panel {
    position:
      fixed !important;

    top:
      92px !important;

    right:
      12px !important;

    left:
      auto !important;

    z-index:
      1100000 !important;

    width:
      min(
        330px,
        calc(
          100vw - 24px
        )
      ) !important;

    max-height:
      calc(
        100vh - 108px
      ) !important;

    overflow-y:
      auto !important;

    overflow-x:
      hidden !important;

    overscroll-behavior:
      contain;

    -webkit-overflow-scrolling:
      touch;

    box-shadow:
      0
      26px
      70px
      rgba(
        15,
        23,
        42,
        .28
      ) !important;
  }
}

.board-menu-panel.open {
  display: block;
  animation: boardMenuIn .16s ease-out;
}

@keyframes boardMenuIn {
  from { opacity: 0; transform: translateY(-7px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.board-menu-heading {
  padding: 7px 10px 9px;

  color: #64748b;

  font-size: 10px;
  line-height: 1;

  font-weight: 950;

  letter-spacing: .75px;

  text-transform: uppercase;
}


.board-menu-section-label {
  margin:
    8px
    10px
    4px;

  color: #94a3b8;

  font-size: 8.5px;
  line-height: 1;

  font-weight: 950;

  letter-spacing: .75px;

  text-transform: uppercase;
}


.board-menu-item {
  width: 100%;

  min-height: 50px;

  display: grid !important;

  grid-template-columns:
    32px
    minmax(0, 1fr);

  gap: 10px;

  align-items: center;

  padding:
    7px
    9px;

  border: 0;

  border-radius: 13px;

  background: transparent;

  color: #143f3a;

  text-align: left;

  cursor: pointer;
}


.board-menu-item[hidden] {
  display: none !important;
}


.board-menu-item:hover,
.board-menu-item:focus-visible {
  background: #f1fdf6;

  outline: none;
}


.board-menu-item > span:first-child {
  width: 32px;
  height: 32px;

  display: grid;

  place-items: center;

  border-radius: 10px;

  background: #eefbf4;

  font-size: 16px;
}


.board-menu-item strong,
.board-menu-item small {
  display: block;
}


.board-menu-item strong {
  color: #143f3a;

  font-size: 12.5px;
  line-height: 1.12;

  font-weight: 950;
}


.board-menu-item small {
  margin-top: 2px;

  color: #64748b;

  font-size: 9.5px;
  line-height: 1.2;

  font-weight: 750;
}


.board-menu-item:disabled {
  opacity: .62;
}


.board-menu-danger {
  color: #991b1b;
}


.board-menu-danger strong {
  color: #991b1b;
}


.board-menu-divider {
  height: 1px;

  margin:
    8px
    5px;

  background: #e5e7eb;
}

/* Ten genuinely different board tools now fit cleanly in the lower strip. */
.quick-strip {
  position: relative !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  padding: 0 10px 4px !important;
  scroll-snap-type: x proximity;

  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 18px,
    #000 calc(100% - 18px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 18px,
    #000 calc(100% - 18px),
    transparent 100%
  );
}

.quick-strip::-webkit-scrollbar {
  display: none;
}




.quick-strip {
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 34px,
    #000 calc(100% - 34px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 34px,
    #000 calc(100% - 34px),
    transparent 100%
  );
}

.quick-strip .quick-launch {
  flex: 0 0 auto !important; /* Frees width limits so characters can sit cleanly on a single row line */
  min-width: max-content !important;
  scroll-snap-align: start;
}

.quick-strip .toolbar-more-button {
  flex: 0 0 auto !important;
  min-width: 92px !important;

  background: var(--board-ink) !important;
  color: #ffffff !important;
  border: 1px solid var(--board-ink) !important;

  box-shadow:
    0 9px 20px rgba(15, 23, 42, 0.18),
    0 0 0 3px color-mix(
      in srgb,
      var(--board-accent) 18%,
      transparent
    ) !important;
}

.quick-strip .toolbar-more-button span,
.quick-strip .toolbar-more-button small {
  color: #ffffff !important;
  opacity: 1 !important;
}

.quick-strip .toolbar-more-button span {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 14px !important;
}
.quick-strip .toolbar-more-button small {
  font-size: 11.5px !important;
  font-weight: 950 !important;
}

.quick-strip .toolbar-more-button:hover {
  background: color-mix(
    in srgb,
    var(--board-ink) 88%,
    #ffffff
  ) !important;

  border-color: var(--board-accent) !important;

  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.23),
    0 0 0 4px color-mix(
      in srgb,
      var(--board-accent) 24%,
      transparent
    ) !important;
}

/* Live Activities hub. Vote and Sticky Notes now live here too. */
.live-suite-hub {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: stretch;
}

.live-suite-card {
  min-height: 144px;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 13px;
  padding: 16px;
}

.live-suite-icon {
  width: 64px;
  height: 64px;
  border-radius: 19px;
  font-size: 33px;
}

.live-suite-card h3 {
  font-size: clamp(18px, 1.65vw, 25px);
}

.live-suite-card p {
  font-size: 12px;
  line-height: 1.35;
}

/* Shared layout used by Vote, Emoji, Secret Code, Quiz and Mystery Word. */
.participation-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "main"
    "toolbar";
  gap: 11px;
  overflow: hidden;
}

.participation-layout.is-live {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 292px);
  grid-template-areas:
    "main join"
    "toolbar toolbar";
}

.participation-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 2px;
}

.participation-join-column {
  grid-area: join;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.participation-toolbar,
.live-activity-toolbar.participation-toolbar {
  grid-area: toolbar;
  width: 100%;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}

.participation-toolbar .btn,
.participation-toolbar .live-response-pill {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
}

.shared-live-join-panel,
.participation-join-column .live-join-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  border-radius: 22px;
}

.participation-join-column .live-join-qr {
  width: 160px !important;
  height: 160px !important;
  background: #ffffff !important;
  padding: 8px !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  flex-shrink: 0 !important;
}

.participation-join-column .live-join-qr img,
.participation-join-column .live-join-qr canvas {
  width: 144px !important;
  height: 144px !important;
  max-width: 144px !important;
  max-height: 144px !important;
}

.participation-join-column .live-join-copy {
  width: 100%;
  min-width: 0;
}

.participation-join-column .live-join-code {
  font-size: clamp(32px, 4vw, 50px);
  letter-spacing: 4px;
}

.participation-join-column .live-join-actions {
  justify-content: center;
}

.qr-visibility-toggle.on {
  border-color: #5fdc9a;
  background: #f1fdf6;
}

/* With QR hidden the activity immediately reclaims the full stage width. */
body.live-qr-hidden:not([data-stage="qrLinks"]) .participation-layout.is-live {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas:
    "main"
    "toolbar" !important;
}

body.live-qr-hidden:not([data-stage="qrLinks"]) .participation-join-column,
body.live-qr-hidden:not([data-stage="qrLinks"]) .live-join-panel,
body.live-qr-hidden:not([data-stage="qrLinks"]) .vote-live-join-panel,
body.live-qr-hidden:not([data-stage="qrLinks"]) .notes-projector-join-card,
body.live-qr-hidden:not([data-stage="qrLinks"]) .notes-live-identity {
  display: none !important;
}

/* Vote now uses the same predictable responsive system as the other activities. */
.vote-participation-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 11px;
  overflow: hidden;
}

.vote-participation-main .vote-question-card {
  padding: 13px 16px !important;
  border-radius: 20px !important;
}

.vote-participation-main .vote-question-card h3 {
  font-size: clamp(24px, 3vw, 42px) !important;
}

.vote-participation-main .vote-grid.fun-vote-grid {
  min-height: 0;
  height: 100%;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
  gap: 9px !important;
  align-items: stretch;
  overflow: auto;
}

.vote-participation-main .vote-card.fun-vote-card {
  min-height: 132px !important;
  height: auto !important;
  padding: 12px !important;
  border-radius: 19px !important;
}

.vote-participation-main .vote-card.fun-vote-card strong {
  font-size: clamp(34px, 4vw, 58px) !important;
}

.vote-participation-main .vote-card.fun-vote-card span {
  font-size: clamp(15px, 1.55vw, 21px) !important;
}

.vote-live-join-panel .live-join-status {
  line-height: 1.3;
}

/* The four newer activities use the stage efficiently without vertical clutter. */
.emoji-layout .emoji-result-grid {
  flex: 1 1 auto;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  align-items: stretch;
}

.emoji-layout .emoji-result-card {
  min-height: 120px;
}

.secret-layout .live-stat-grid,
.quiz-layout .live-stat-grid,
.mystery-layout .live-stat-grid {
  flex: 0 0 auto;
}

.quiz-layout .quiz-question-preview,
.secret-layout .teacher-response-list,
.quiz-layout .teacher-response-list,
.mystery-layout .teacher-response-list {
  min-height: 0;
  max-height: none;
}

.secret-code-hero,
.quiz-live-hero,
.mystery-live-hero {
  flex: 0 0 auto;
  padding: 14px;
}

.secret-code-icon,
.mystery-word-icon {
  font-size: clamp(42px, 5vw, 72px);
}

.secret-code-hero h2,
.quiz-live-hero h2,
.mystery-live-hero h2 {
  font-size: clamp(25px, 3vw, 42px);
}

/* Sticky Notes: QR panel reduces the board only while visible. */
body.focus-mode[data-stage="notes"] .notes-stage-layout,
body.fullscreen-active[data-stage="notes"] .notes-stage-layout {
  grid-template-columns: minmax(0, 1fr) minmax(235px, 300px) !important;
}

body.live-qr-hidden.focus-mode[data-stage="notes"] .notes-stage-layout,
body.live-qr-hidden.fullscreen-active[data-stage="notes"] .notes-stage-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.live-qr-hidden.focus-mode[data-stage="notes"] .corkboard-arena.free-note-board,
body.live-qr-hidden.fullscreen-active[data-stage="notes"] .corkboard-arena.free-note-board {
  grid-column: 1 !important;
  width: 100% !important;
}

.notes-live-toolbar {
  min-height: 50px;
  padding: 6px 8px;
}

.notes-live-identity {
  min-width: 168px;
}

/* Clean focus and projector give the live stage more room. */
body.focus-mode[data-stage="emoji"] .participation-layout.is-live,
body.focus-mode[data-stage="secretCode"] .participation-layout.is-live,
body.focus-mode[data-stage="quiz"] .participation-layout.is-live,
body.focus-mode[data-stage="mysteryWord"] .participation-layout.is-live,
body.focus-mode[data-stage="vote"] .participation-layout.is-live {
  grid-template-columns: minmax(0, 1fr) minmax(255px, 320px);
}

body.fullscreen-active[data-stage="emoji"] .participation-layout.is-live,
body.fullscreen-active[data-stage="secretCode"] .participation-layout.is-live,
body.fullscreen-active[data-stage="quiz"] .participation-layout.is-live,
body.fullscreen-active[data-stage="mysteryWord"] .participation-layout.is-live,
body.fullscreen-active[data-stage="vote"] .participation-layout.is-live {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
}

/* =========================================================
   ISOLATED TASK PERIOD STAGE LAYOUT ENGINE
   ========================================================= */
.task-stage-split-container {
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  gap: 12px !important;
  align-items: stretch !important;
  min-height: 0 !important;
}

/* Toggles full-width layout for the side panel */
.task-stage-split-container.instructions-hidden .task-stage-main-card {
  display: none !important;
}

.task-stage-split-container.instructions-hidden .task-period-qr-side-panel {
  width: 100% !important;
  max-width: none !important;
}

.task-stage-main-card {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.task-stage-main-card .activity-card {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  display: block !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-bottom: 28px !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.task-period-qr-side-panel {
  width: 292px;
  background: var(--board-ink) !important;
  border-radius: 24px;
  padding: 24px 16px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  color: #ffffff !important;
  box-shadow: var(--board-shadow);
  flex-shrink: 0 !important;
}

.task-period-qr-wrapper {
  width: 180px;
  height: 180px;
  background: #ffffff !important;
  border-radius: 16px;
  padding: 10px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 16px !important;
  overflow: hidden !important;
}

.task-period-qr-wrapper img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain !important;
}

.task-period-qr-wrapper canvas {
  display: none !important;
}

.task-qr-resource-card {
  position: relative;
  padding-top: 58px !important;
}

.task-qr-resource-heading {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;

  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;

  color: #64748b;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}



/* Presentation View Scaling (Clean Focus or Projector active) */
body.focus-mode .task-period-qr-side-panel,
body.fullscreen-active .task-period-qr-side-panel {
  width: 400px !important;
  padding: 32px 24px !important;
}

/* Large QR used in the standard lesson instruction layout only */
body.focus-mode
  .task-period-qr-wrapper:not(.slides-task-qr-wrapper),
body.fullscreen-active
  .task-period-qr-wrapper:not(.slides-task-qr-wrapper) {
  width: 340px !important;
  height: 340px !important;
  border-radius: 24px !important;
  padding: 16px !important;
}

/* Keep the Slides QR inside its narrower right-hand column */
body.focus-mode .slides-task-qr-wrapper,
body.fullscreen-active .slides-task-qr-wrapper {
  width: min(200px, calc(100% - 8px)) !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  padding: 10px !important;
  border-radius: 16px !important;
}

/* Reduce button footprint and typography sizing for the lesson task controls */
.task-stage-main-card .large-actions {
  margin-top: 14px !important;
  gap: 6px !important;
  justify-content: flex-start !important;
}

.task-stage-main-card .large-actions .btn {
  font-size: 12px !important;
  padding: 6px 12px !important;
  min-height: 32px !important;
}

/* Compact button compression for normal mode to prevent row wrapping layout drops */
body:not(.focus-mode):not(.fullscreen-active) .task-stage-heading-actions {
  gap: 4px !important;
}

body:not(.focus-mode):not(.fullscreen-active) .task-stage-heading-actions .btn {
  font-size: 10px !important;
  padding: 4px 8px !important;
  min-height: 26px !important;
  letter-spacing: -0.1px !important;
}

/* Let the voting cards expand fluidly to fill the newly unlocked screen width */

/* Compresses buttons slightly only in normal mode so they fit side-by-side */
body:not(.focus-mode):not(.fullscreen-active) .task-stage-main-card .large-actions .btn {
  font-size: 11px !important;
  padding: 4px 10px !important;
  min-height: 28px !important;
  gap: 4px !important;
}

/* Let the voting cards expand fluidly to fill the newly unlocked screen width */
body[data-stage="vote"] .vote-grid.fun-vote-grid {
  max-width: none !important;
  width: 100% !important;
}

body.fullscreen-active[data-stage="emoji"] .stage-top,
body.fullscreen-active[data-stage="secretCode"] .stage-top,
body.fullscreen-active[data-stage="quiz"] .stage-top,
body.fullscreen-active[data-stage="mysteryWord"] .stage-top,
body.fullscreen-active[data-stage="vote"] .stage-top,
body.fullscreen-active[data-stage="notes"] .stage-top,
body.fullscreen-active[data-stage="seating"] .stage-top,
body.focus-mode[data-stage="seating"] .stage-top {
  display: none !important;
}

/* Give the seating layout container full height when the header is hidden */
body.fullscreen-active[data-stage="seating"] .stage-card,
body.focus-mode[data-stage="seating"] .stage-card {
  grid-template-rows: 1fr !important;
  padding: 12px !important;
}

body.fullscreen-active[data-stage="emoji"] .stage-card,
body.fullscreen-active[data-stage="secretCode"] .stage-card,
body.fullscreen-active[data-stage="quiz"] .stage-card,
body.fullscreen-active[data-stage="mysteryWord"] .stage-card,
body.fullscreen-active[data-stage="vote"] .stage-card,
body.fullscreen-active[data-stage="notes"] .stage-card {
  grid-template-rows: minmax(0, 1fr) !important;
  padding: 14px !important;
}

body.fullscreen-active .participation-join-column .live-join-qr {
  width: min(246px, 100%);
}

body.focus-mode .participation-join-column .live-join-qr {
  width: min(210px, 100%);
}

/* Responsive fallbacks for laptops, tablets and narrow browser windows. */
@media (max-width: 1180px) {
  .nav-primary-btn {
    padding-inline: 10px;
    font-size: 12px;
  }

  .quick-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .live-suite-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .board-menu-wrap {
    margin-left: auto;
  }

  .participation-layout.is-live,
  body.focus-mode .participation-layout.is-live,
  body.fullscreen-active .participation-layout.is-live {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "main"
      "join"
      "toolbar";
    overflow: auto;
  }

  .participation-join-column .live-join-panel {
    min-height: 190px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    text-align: left;
  }

  .participation-join-column .live-join-qr {
    width: 150px;
  }

  .participation-join-column .live-join-actions {
    justify-content: flex-start;
  }

  .vote-participation-main {
    overflow: visible;
  }
}

@media (max-width: 650px) {
  .nav-primary-btn {
    flex: 1 1 auto;
  }

  .board-menu-wrap,
  .board-menu-trigger {
    width: 100%;
  }

  .board-menu-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 20px);
  }

  .live-suite-hub {
    grid-template-columns: 1fr;
  }

  .participation-join-column .live-join-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .participation-join-column .live-join-actions {
    justify-content: center;
  }

  .emoji-layout .emoji-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.notes-projector-qr-toggle {
  display: none;
}

body.focus-mode[data-stage="notes"] .notes-projector-qr-toggle,
body.fullscreen-active[data-stage="notes"] .notes-projector-qr-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 145;
  display: inline-flex;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .14);
}



/* =========================================================
   CLASS BOARD FREEMIUM TOOLBAR + MINI TOOLS PATCH
   ========================================================= */
.quick-strip {
  grid-template-columns: repeat(13, minmax(0, 1fr)) !important;
}
.quick-launch.dragging-toolbar-tool {
  opacity: .45;
  transform: scale(.96) !important;
}
.quick-launch.toolbar-drop-target {
  outline: 3px solid var(--board-accent-2);
  outline-offset: 2px;
}
.quick-launch.locked-tool {
  position: relative;
}

/*
  Full-width classroom tools library
*/

#settingsModal
.modal-card:has(.toolbar-editor-shell) {
  width: min(1420px, calc(100vw - 40px)) !important;
  max-width: min(1420px, calc(100vw - 40px)) !important;
  height: min(880px, calc(100vh - 40px)) !important;
  max-height: calc(100vh - 40px) !important;
  display: grid !important;
  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto !important;
  overflow: hidden !important;
  border-radius: 26px !important;
  background: #f8fafc !important;
  box-shadow:
    0 30px 90px
    rgba(15, 23, 42, 0.30) !important;
}

#settingsModal
.modal-card:has(.toolbar-editor-shell)
.modal-head {
  min-height: 88px !important;
  padding: 18px 24px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

#settingsModal
.modal-card:has(.toolbar-editor-shell)
.modal-body {
  min-height: 0 !important;
  padding: 18px 24px 28px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #f8fafc !important;
}

#settingsModal
.modal-card:has(.toolbar-editor-shell)
.modal-footer {
  padding: 13px 24px !important;
  border-top: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

.toolbar-editor-shell {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
}

.toolbar-editor-summary {
  width: 100% !important;
  min-height: 66px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 13px 16px !important;
  border: 1px solid #dbe5ef !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  color: #143f3a !important;
  box-shadow:
    0 6px 18px
    rgba(15, 23, 42, 0.05) !important;
}

.toolbar-editor-summary span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #143f3a !important;
  font-size: 15px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
}

.toolbar-editor-summary span::before {
  content: "⭐";
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #eefbf4;
  font-size: 18px;
}

.toolbar-editor-summary strong {
  min-height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 7px 13px !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 999px !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
}

/*
  App-store category navigation
*/

.toolbar-category-tabs {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px !important;
  border: 1px solid #dbe5ef !important;
  border-radius: 17px !important;
  background: #ffffff !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  box-shadow:
    0 5px 16px
    rgba(15, 23, 42, 0.04) !important;
}

.toolbar-category-tabs::-webkit-scrollbar {
  display: none !important;
}

.toolbar-category-tab {
  width: auto !important;
  min-width: max-content !important;
  min-height: 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 13px !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  text-align: center !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  flex: 0 0 auto !important;
}

.toolbar-category-tab:hover {
  border-color: #dbe5ef !important;
  background: #f8fafc !important;
  color: #143f3a !important;
}

.toolbar-category-tab.active {
  border-color: #86efac !important;
  background: #eefbf4 !important;
  color: #166534 !important;
  box-shadow:
    0 4px 12px
    rgba(22, 101, 52, 0.08) !important;
}

.toolbar-category-tab.active::after {
  display: none !important;
}

.toolbar-category-tab-icon {
  width: 28px !important;
  height: 28px !important;
  display: inline-grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  border-radius: 9px !important;
  background: #f1f5f9 !important;
  font-size: 15px !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

.toolbar-category-tab.active
.toolbar-category-tab-icon {
  background: #dcfce7 !important;
}

/*
  Live activities notice
*/

.toolbar-live-reminder {
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  border-radius: 16px !important;
}

/*
  Tool library
*/

.toolbar-category-panels {
  width: 100% !important;
  min-width: 0 !important;
}

.toolbar-editor-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    ) !important;
  gap: 12px !important;
}

.toolbar-editor-item {
  min-width: 0 !important;
  min-height: 92px !important;
  display: grid !important;
  grid-template-columns:
    46px
    minmax(0, 1fr)
    auto !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px !important;
  border: 1px solid #dbe3ec !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow:
    0 5px 14px
    rgba(15, 23, 42, 0.04) !important;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease !important;
}

.toolbar-editor-item:hover {
  transform: translateY(-2px) !important;
  border-color: #86efac !important;
  box-shadow:
    0 10px 22px
    rgba(15, 23, 42, 0.08) !important;
}

.toolbar-editor-item.selected {
  border-color: #22c55e !important;
  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f0fdf4
    ) !important;
  box-shadow:
    0 0 0 2px
    rgba(34, 197, 94, 0.10),
    0 8px 18px
    rgba(15, 23, 42, 0.05) !important;
}

.toolbar-editor-icon {
  width: 46px !important;
  height: 46px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 14px !important;
  background: #f1f5f9 !important;
  font-size: 22px !important;
  line-height: 1 !important;
}

.toolbar-editor-item.selected
.toolbar-editor-icon {
  background: #dcfce7 !important;
}

.toolbar-editor-copy {
  min-width: 0 !important;
  display: grid !important;
  gap: 4px !important;
}

.toolbar-editor-copy strong {
  color: #111827 !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
  font-weight: 950 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.toolbar-editor-copy small {
  color: #64748b !important;
  font-size: 10.5px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
}

.toolbar-editor-check {
  width: 29px !important;
  height: 29px !important;
  display: inline-grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: transparent !important;
}

.toolbar-editor-item.selected
.toolbar-editor-check {
  border-color: #22c55e !important;
  background: #22c55e !important;
  color: #ffffff !important;
}

.toolbar-editor-item.selected
.toolbar-editor-check::before {
  content: "✓";
  font-size: 14px;
  font-weight: 950;
}

/*
  Coming soon
*/

.toolbar-coming-soon-section {
  width: 100% !important;
  margin-top: 6px !important;
  padding-top: 18px !important;
  border-top: 1px solid #e2e8f0 !important;
}

.toolbar-coming-soon-grid {
  display: grid !important;
  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    ) !important;
  gap: 12px !important;
}

@media (max-width: 1180px) {
  .toolbar-editor-grid,
  .toolbar-coming-soon-grid {
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      ) !important;
  }
}

@media (max-width: 850px) {
  #settingsModal
  .modal-card:has(.toolbar-editor-shell) {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    height: calc(100vh - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 20px !important;
  }

  .toolbar-editor-grid,
  .toolbar-coming-soon-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      ) !important;
  }
}

@media (max-width: 560px) {
  #settingsModal
  .modal-card:has(.toolbar-editor-shell)
  .modal-body {
    padding: 12px !important;
  }

  .toolbar-editor-summary {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .toolbar-editor-grid,
  .toolbar-coming-soon-grid {
    grid-template-columns: 1fr !important;
  }
}

.toolbar-category-tabs {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  padding: 0 6px;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
}

.toolbar-category-tab {
  position: relative;
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 2px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.toolbar-category-tab:hover {
  color: var(--board-ink);
  background: transparent;
}

.toolbar-category-tab.active {
  color: var(--board-ink);
  background: transparent;
  box-shadow: none;
}

.toolbar-category-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--board-accent-2);
}

.toolbar-category-tab-icon {
  font-size: 15px;
  line-height: 1;
  opacity: 0.85;
}

.toolbar-category-tab-count {
  min-width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
}

.toolbar-category-tab.active .toolbar-category-tab-count {
  background: #dcfce7;
  color: #15803d;
}

.toolbar-category-panels {
  min-height: 250px;
  padding-top: 18px;
}

.toolbar-category-panel {
  display: none;
}

.toolbar-category-panel.active {
  display: block;
}

.toolbar-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.toolbar-editor-choice {
  position: relative;
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 15px;
  background: #ffffff;
  color: #143f3a;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease,
    box-shadow 0.14s ease;
}

.toolbar-editor-choice:hover {
  transform: translateY(-1px);
  border-color: #86efac;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.toolbar-editor-choice-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 19px;
}

.toolbar-editor-choice-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.toolbar-editor-choice-copy strong {
  color: #111827;
  font-size: 12.5px;
  line-height: 1.15;
  font-weight: 950;
  overflow-wrap: anywhere;
}



.toolbar-editor-choice-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: transparent;
  font-size: 12px;
  font-weight: 950;
}

.toolbar-editor-choice.selected {
  border-color: #22c55e;
  background: #f1fdf6;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.toolbar-editor-choice.selected .toolbar-editor-choice-icon {
  background: #dcfce7;
}

.toolbar-editor-choice.selected .toolbar-editor-choice-check {
  border-color: #22c55e;
  background: #22c55e;
  color: #ffffff;
}

@media (max-width: 900px) {
  .toolbar-category-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .toolbar-category-tabs::-webkit-scrollbar {
    display: none;
  }

  .toolbar-category-tab {
    flex: 0 0 auto;
    min-width: 185px;
  }

  .toolbar-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .toolbar-editor-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-editor-grid {
    grid-template-columns: 1fr;
  }
}
.board-plus-lock-card {
  width: min(620px, 92vw);
  margin: auto;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, #ffffff, #fff8dc);
  border: 1px solid #f2bd35;
  box-shadow: 0 22px 52px rgba(15,23,42,.14);
  text-align: center;
  color: #143f3a;
}
.board-plus-lock-card .lock-icon { font-size: 58px; margin-bottom: 8px; }
.board-plus-lock-card h2 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 42px); letter-spacing: -1px; }
.board-plus-lock-card p { margin: 0 auto 18px; max-width: 500px; color: #64748b; font-weight: 800; line-height: 1.5; }
.class-board-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.class-board-modal-overlay.show { display: flex; }
.class-board-upgrade-card {
  width: min(560px, 100%);
  background: #ffffff;
  border-radius: 26px;
  padding: 30px 34px;
  text-align: center;
  box-shadow: 0 28px 76px rgba(15,23,42,.28);
  border: 1px solid #e5e7eb;
}
.class-board-upgrade-card h2 { margin: 0 0 8px; color: #143f3a; font-size: 25px; }
.class-board-upgrade-card p { color: #64748b; font-weight: 750; line-height: 1.45; }
.mini-bell-board-stage,
.mini-breathing-board-stage,
.teacher-mic-stage {
  width: 100%;
  height: 100%;
  min-height: 430px;
  border-radius: 28px;
  padding: clamp(18px, 3vw, 38px);
  display: grid;
  align-items: center;
  gap: 22px;
  overflow: hidden;
}
/*
 * Bell header actions are controlled by the active stage.
 * This remains reliable even when other features wrap showStage().
 */
#bellStageHeaderActions {
  display:
    none !important;
}

body[data-stage="bell"]
#bellStageHeaderActions {
  display:
    inline-flex !important;
}


.mini-bell-board-stage {
  grid-template-columns:
    minmax(240px, .82fr)
    minmax(300px, 1.18fr);

  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(251,191,36,.22),
      transparent 30%
    ),
    linear-gradient(
      145deg,
      #fff8dc,
      #ffffff
    );

  /*
   * Class Bell now contains additional controls.
   * Never clip them below the visible stage.
   */
  overflow-y: auto;
  overflow-x: hidden;

  align-items: center;

  scrollbar-gutter: stable;
}


/* =========================================================
   CLASS BELL — SHORT LAPTOP SCREEN
   Keep all bell controls visible on common teacher laptops.
   ========================================================= */

@media (max-height: 780px) and (min-width: 901px) {

  .mini-bell-board-stage {
    padding:
      14px
      24px;

    gap:
      18px;
  }


  .board-bell-3d {
    width:
      min(
        275px,
        29vw
      );
  }


  .board-bell-copy
  .meta-pill {
    margin-bottom:
      8px !important;
  }


  #boardBellSignalTitle {
    font-size:
      clamp(
        27px,
        3vw,
        39px
      ) !important;

    line-height:
      1.03 !important;

    margin-bottom:
      8px !important;
  }


  #boardBellSignalDescription {
    font-size:
      clamp(
        13px,
        1.25vw,
        17px
      ) !important;

    line-height:
      1.3 !important;
  }


  .board-bell-copy
  .large-actions {
    margin-top:
      10px !important;

    gap:
      6px !important;
  }


  .board-bell-copy
  .btn {
    min-height:
      34px !important;

    padding:
      6px
      11px !important;

    font-size:
      10.5px !important;
  }
}

.board-bell-3d {
  width: min(330px, 34vw);
  aspect-ratio: 1;
  margin: auto;
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
  transform-origin: 50% 12%;
  filter: drop-shadow(0 22px 22px rgba(120,70,0,.25));
}
.board-bell-3d.ringing { animation: boardBellRing .8s ease-in-out 2; }
@keyframes boardBellRing { 0%,100%{transform:rotate(0)} 18%{transform:rotate(-15deg)} 36%{transform:rotate(13deg)} 58%{transform:rotate(-9deg)} 78%{transform:rotate(5deg)} }
.board-bell-body {
  width: 68%;
  height: 58%;
  border-radius: 46% 46% 18% 18%/55% 55% 20% 20%;
  background: linear-gradient(100deg,#704000,#d48600 12%,#ffe985 36%,#ffd44a 52%,#ad6800 82%,#603500);
  box-shadow: inset -18px -10px 24px rgba(67,34,0,.34), inset 20px 8px 20px rgba(255,255,255,.42);
  position: relative;
}
.board-bell-body::before { content:""; position:absolute; left:36%; top:-38%; width:28%; height:38%; border-radius: 40px 40px 0 0; background:linear-gradient(90deg,#bd7500,#ffe37a,#9a5b00); }
.board-bell-body::after { content:""; position:absolute; left:-14%; right:-14%; bottom:-11%; height:27%; border-radius:50%; background:linear-gradient(#a65f00,#ffd85d 44%,#704000); }
.board-bell-clapper { position:absolute; left:43%; top:69%; width:14%; aspect-ratio:1; border-radius:50%; background:radial-gradient(circle at 35% 30%,#ffe784,#a76400 63%,#542f00); }
.board-bell-copy h2,
.teacher-mic-stage h2,
.mini-breathing-board-stage h2 { margin: 0; color: var(--board-ink); font-size: clamp(26px, 3.2vw, 46px); line-height: 1.05; letter-spacing: -1.2px; }
.board-bell-copy p,
.teacher-mic-stage p,
.mini-breathing-board-stage p { color: #64748b; font-size: clamp(16px, 1.5vw, 22px); font-weight: 850; line-height: 1.4; }
.mini-breathing-board-stage {
  grid-template-columns: minmax(300px, 1fr) minmax(280px, .75fr);
  background: radial-gradient(circle at 20% 15%, rgba(124,58,237,.20), transparent 32%), linear-gradient(145deg,#f5f3ff,#ecfeff);
}
.board-breath-circle {
  width: min(340px, 36vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: auto;
  background: linear-gradient(135deg,#06b6d4,#8b5cf6,#ec4899);
  color: white;
  box-shadow: 0 0 80px rgba(124,58,237,.28), inset 0 0 0 18px rgba(255,255,255,.12);
  transition: transform 1s ease;
}
.board-breath-circle.running { animation: boardBreathPulse 8s ease-in-out infinite; }
@keyframes boardBreathPulse { 0%,100%{transform:scale(.82)} 50%{transform:scale(1.22)} }
.board-breath-circle strong { font-size: clamp(44px, 6vw, 86px); line-height:1; }
.teacher-mic-stage {
  grid-template-columns: minmax(300px, .9fr) minmax(300px, 1.1fr);
  background: radial-gradient(circle at 15% 16%, rgba(95,220,154,.20), transparent 30%), linear-gradient(145deg,#071513,#102f2a);
  color: white;
}
.teacher-mic-stage h2 { color: #ffffff; }
.teacher-mic-stage p { color: #cbd5e1; }
.real-3d-microphone {
  width: min(330px, 32vw);
  height: min(430px, 48vh);
  margin: auto;
  position: relative;
  perspective: 1000px;
  filter: drop-shadow(0 24px 26px rgba(0,0,0,.35));
}
.mic-head {
  position:absolute; left:28%; top:2%; width:44%; height:34%; border-radius: 42% 42% 36% 36%;
  background: linear-gradient(145deg,#f8fafc,#94a3b8 52%,#334155);
  border: 4px solid rgba(255,255,255,.38);
  overflow:hidden;
}
.mic-head::before { content:""; position:absolute; inset:12px 8px; background: repeating-linear-gradient(90deg, rgba(15,23,42,.45) 0 3px, rgba(255,255,255,.18) 3px 7px); border-radius: inherit; opacity:.85; }
.mic-ring { position:absolute; left:22%; top:33%; width:56%; height:10%; border-radius:999px; background:linear-gradient(90deg,#0f172a,#5fdc9a,#0f172a); }
.mic-stem { position:absolute; left:43%; top:40%; width:14%; height:42%; border-radius:999px; background:linear-gradient(90deg,#020617,#64748b,#020617); }
.mic-base { position:absolute; left:22%; bottom:2%; width:56%; height:14%; border-radius:50%; background:radial-gradient(circle at 50% 20%,#94a3b8,#0f172a 70%); }
.mic-glow { position:absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle at 50% 25%, rgba(95,220,154,.32), transparent 58%); opacity:.4; }
.teacher-mic-stage.mic-live .mic-glow { animation: micGlow 1s ease-in-out infinite; }
@keyframes micGlow { 0%,100%{transform:scale(.95);opacity:.35} 50%{transform:scale(1.06);opacity:.75} }
.mic-meter { height: 26px; background: rgba(255,255,255,.11); border-radius:999px; overflow:hidden; border:1px solid rgba(255,255,255,.14); margin: 18px 0 10px; }
.mic-meter div { height:100%; width:0%; background:linear-gradient(90deg,#5fdc9a,#fbbf24,#ef4444); border-radius:inherit; transition:width .08s linear; }
body.theme-forest { --board-accent:#86efac; --board-accent-2:#16a34a; --board-bg-a:#ecfdf5; --board-bg-b:#f7fee7; --board-ink:#14532d; }
body.theme-sunrise { --board-accent:#fcd34d; --board-accent-2:#f97316; --board-bg-a:#fff7ed; --board-bg-b:#fefce8; --board-ink:#7c2d12; }
body.theme-slate { --board-accent:#cbd5e1; --board-accent-2:#475569; --board-bg-a:#f1f5f9; --board-bg-b:#ffffff; --board-ink:#1e293b; }
@media (max-width: 900px) {
  .mini-bell-board-stage, .mini-breathing-board-stage, .teacher-mic-stage { grid-template-columns: 1fr; }
  .quick-strip { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}

/* Upscale text dimensions, badge layout, and action buttons cleanly for projector walls */
body.focus-mode .board-bell-copy .meta-pill,
body.fullscreen-active .board-bell-copy .meta-pill {
  font-size: 15px !important;
  padding: 8px 16px !important;
}

body.focus-mode #boardBellSignalTitle,
body.fullscreen-active #boardBellSignalTitle {
  font-size: clamp(36px, 5vw, 64px) !important;
  line-height: 1.05 !important;
  margin-bottom: 18px !important;
}

body.focus-mode #boardBellSignalDescription,
body.fullscreen-active #boardBellSignalDescription {
  font-size: clamp(20px, 2.2vw, 28px) !important;
  line-height: 1.35 !important;
  max-width: 850px !important;
}

body.focus-mode .board-bell-copy .btn,
body.fullscreen-active .board-bell-copy .btn {
  min-height: 48px !important;
  padding: 10px 20px !important;
  font-size: 15px !important;
}

/*
 * Class Bell now manages its own responsive layout.
 * The previous 701px–1220px horizontal-scroll override
 * has been removed because it conflicted with the newer
 * bell settings and could push controls out of view.
 */

/* =========================================================
   IPAD / TABLET CLASS BOARD FIX
   Prevents header overlap and keeps tool strip in normal flow
   ========================================================= */

@media (min-width: 701px) and (max-width: 1220px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  header {
    height: auto !important;
    min-height: 92px !important;
    padding: 8px 10px !important;
    align-items: stretch !important;
  }

  .top-nav {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "brand menu"
      "actions actions" !important;
    gap: 7px !important;
    align-items: center !important;
  }

  .brand-row {
    grid-area: brand !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .logo {
    font-size: 20px !important;
    letter-spacing: -0.8px !important;
  }

  .class-select-wrap {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .class-select-wrap label {
    font-size: 9px !important;
  }

  .class-select {
    max-width: 260px !important;
    min-width: 0 !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
  }

  .nav-actions {
    grid-area: actions !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  .board-menu-wrap {
    grid-area: menu !important;
    justify-self: end !important;
  }

  .nav-actions .btn,
  .nav-primary-btn,
  .board-menu-trigger {
    min-height: 34px !important;
    padding: 7px 10px !important;
    font-size: 11px !important;
  }

  .response-mode-nav-btn {
    min-width: 130px !important;
  }

  .live-activities-button {
    min-width: 158px !important;
    min-height: 38px !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    padding: 3px 10px 3px 4px !important;
    box-shadow:
      0 6px 16px rgba(153, 27, 27, 0.24),
      0 0 0 2px rgba(239, 68, 68, 0.12) !important;
  }

  .live-activities-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
  }

  .live-activities-copy small,
  .live-activities-status {
    display: none !important;
  }

  .live-activities-copy strong {
    font-size: 11px !important;
  }

  main {
    height: auto !important;
    min-height: 0 !important;
    padding: 8px !important;
    overflow: visible !important;
  }

  .board-shell {
    height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .centre-board {
    order: -1 !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    gap: 10px !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .stage-card {
    min-height: 620px !important;
    height: auto !important;
    overflow: hidden !important;
  }

  .stage-top {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .stage-title {
    font-size: clamp(28px, 4.2vw, 42px) !important;
  }

  .date-card {
    min-width: 150px !important;
    min-height: 38px !important;
    padding: 8px 11px !important;
    font-size: 12px !important;
    border-radius: 15px !important;
    background: #143f3a !important;
    color: #ffffff !important;
  }

  .quick-strip {
    position: relative !important;
    z-index: 5 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
  }

  .quick-launch {
    min-height: 74px !important;
    padding: 7px 5px !important;
    border-radius: 15px !important;
  }

  .quick-launch span {
    font-size: 22px !important;
  }

  .quick-launch small {
    font-size: 10px !important;
    line-height: 1.05 !important;
    white-space: normal !important;
  }

    /*
   * iPad = tool-first Class Board.
   * Hide the desktop timetable and widget rails.
   */
  .left-rail,
  .right-rail {
    display: none !important;
  }

  .panel {
    min-height: 0 !important;
  }
  .save-status {
    right: 18px !important;
    bottom: 18px !important;
    z-index: 200 !important;
  }
}

/* Notes board needs extra care on iPad because the live toolbar is wide */
@media (min-width: 701px) and (max-width: 1220px) {
  body[data-stage="notes"] .notes-stage-layout.is-live {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) auto auto !important;
    grid-template-areas:
      "main"
      "join"
      "toolbar" !important;
  }

  body[data-stage="notes"] .notes-normal-join-column {
    min-height: 0 !important;
  }

  body[data-stage="notes"] .notes-live-toolbar {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    min-height: 54px !important;
    padding: 6px 8px !important;
  }

  body[data-stage="notes"] .notes-live-toolbar .btn,
  body[data-stage="notes"] .notes-response-toggle {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 10px !important;
  }

  body[data-stage="notes"] .notes-live-identity {
    flex: 0 0 auto !important;
    min-width: 170px !important;
  }

  body[data-stage="notes"] .corkboard-arena.free-note-board {
    min-height: 420px !important;
  }
}



/* =========================================================
   FINAL IPAD CLASS BOARD FIX
   Tablet layout, compact widgets, compact tool strip
   ========================================================= */

@media (min-width: 701px) and (max-width: 1220px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body {
    -webkit-text-size-adjust: 100% !important;
  }

  header {
    height: auto !important;
    min-height: 96px !important;
    padding: 8px 10px !important;
    align-items: stretch !important;
    position: relative !important;
    z-index: 200 !important;
  }

  .top-nav {
    width: 100% !important;

    display: flex !important;
    align-items: center !important;

    gap: 7px !important;

    overflow-x: auto !important;
    overflow-y: visible !important;

    flex-wrap: nowrap !important;

    scrollbar-width: none !important;

    -webkit-overflow-scrolling: touch;
  }

  .top-nav::-webkit-scrollbar {
    display: none !important;
  }

  .brand-row {
    display: flex !important;
    align-items: center !important;

    gap: 7px !important;

    flex: 0 0 auto !important;

    min-width: max-content !important;

    flex-wrap: nowrap !important;
  }

  .logo {
    flex: 0 0 auto !important;

    min-width: max-content !important;

    font-size: 16px !important;

    white-space: nowrap !important;
  }

  .class-select-wrap {
    display: flex !important;
    align-items: center !important;

    gap: 5px !important;

    flex: 0 0 auto !important;

    min-width: max-content !important;

    flex-wrap: nowrap !important;
  }

  .class-select-wrap label {
    display: none !important;
  }

  .class-switcher {
    min-width: 205px !important;
    flex: 0 0 205px !important;
  }

  .class-switcher-trigger {
    min-width: 205px !important;
    width: 205px !important;

    min-height: 40px !important;

    padding:
      7px
      10px !important;

    font-size: 11.5px !important;
  }

  .attendance-header-btn {
    flex: 0 0 auto !important;

    min-height: 40px !important;

    padding:
      7px
      10px !important;

    font-size: 11px !important;
  }

  .nav-actions {
    width: auto !important;

    min-width: max-content !important;

    display: flex !important;
    align-items: center !important;

    gap: 6px !important;

    flex: 0 0 auto !important;

    flex-wrap: nowrap !important;

    position: static !important;
  }

  .nav-actions > *,
  .present-lesson-launch-group,
  .present-to-class-btn,
  .present-lesson-setup-btn,
  .board-menu-wrap {
    flex: 0 0 auto !important;
  }

  .board-menu-wrap {
    margin-left: 0 !important;
  }

  .nav-actions .btn,
  .nav-primary-btn,
  .board-menu-trigger {
    min-height: 34px !important;
    padding: 7px 10px !important;
    font-size: 11px !important;
  }

  .response-mode-nav-btn {
    min-width: 132px !important;
  }

  .live-activities-button {
    min-width: 160px !important;
    min-height: 38px !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    padding: 3px 10px 3px 4px !important;
    box-shadow:
      0 6px 16px rgba(153, 27, 27, 0.22),
      0 0 0 2px rgba(239, 68, 68, 0.10) !important;
  }

  .live-activities-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
  }

  .live-activities-copy small,
  .live-activities-status {
    display: none !important;
  }

  .live-activities-copy strong {
    font-size: 11px !important;
  }

  main {
    height: auto !important;
    min-height: 0 !important;
    padding: 8px !important;
    overflow: visible !important;
  }

  .board-shell {
    height: auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .centre-board {
    order: -1 !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    gap: 10px !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

    .centre-board {
    width: 100% !important;

    min-height:
      calc(
        100svh - 118px
      ) !important;

    display: grid !important;

    grid-template-rows:
      minmax(
        0,
        1fr
      )
      62px !important;

    gap: 8px !important;
  }

  .stage-card {
    width: 100% !important;

    height: 100% !important;

    min-height: 0 !important;

    padding:
      14px !important;

    overflow:
      hidden !important;

    border-radius:
      20px !important;
  }

  .stage-body {
    min-height: 0 !important;

    height: 100% !important;

    overflow:
      auto !important;
  }

  .stage-top {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
  }

  .stage-label {
    font-size: 10px !important;
  }

  .stage-title {
    font-size: clamp(30px, 4.7vw, 44px) !important;
    line-height: 1.02 !important;
    letter-spacing: -1.2px !important;
  }

  .date-card {
    min-width: 0 !important;
    width: fit-content !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 14px !important;
  }

  .stage-body {
    min-height: 0 !important;
    overflow: auto !important;
  }

  .quick-strip {
    position: relative !important;

    z-index: 3 !important;

    width: 100% !important;

    display: grid !important;

    grid-template-columns:
      minmax(0, 1fr)
      78px !important;

    gap: 7px !important;

    height: 62px !important;

    min-height: 62px !important;

    overflow: hidden !important;
  }

  .quick-strip-tools {
    min-width: 0 !important;

    display: flex !important;

    align-items: stretch !important;

    gap: 7px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    flex-wrap: nowrap !important;

    scrollbar-width: none !important;

    -webkit-overflow-scrolling: touch;
  }

  .quick-strip-tools::-webkit-scrollbar {
    display: none !important;
  }

  .quick-strip-tools
  .quick-launch {
    flex:
      0
      0
      96px !important;

    width: 96px !important;

    min-width: 96px !important;
    max-width: 96px !important;

    height: 62px !important;

    min-height: 62px !important;

    padding:
      6px
      7px !important;

    border-radius: 14px !important;
  }

  .quick-strip-tools
  .quick-launch span {
    font-size: 18px !important;
  }

  .quick-strip-tools
  .quick-launch small {
    font-size: 9.5px !important;

    line-height: 1.05 !important;

    white-space: nowrap !important;

    overflow: hidden !important;

    text-overflow: ellipsis !important;
  }

  .quick-strip-more {
    width: 78px !important;

    min-width: 78px !important;
    max-width: 78px !important;

    height: 62px !important;

    position: relative !important;

    z-index: 5 !important;
  }

  .quick-strip-more
  .toolbar-more-button {
    width: 78px !important;

    min-width: 78px !important;

    height: 62px !important;

    min-height: 62px !important;
  }

  .left-rail,
  .right-rail {
    width: 100% !important;

    overflow: visible !important;

    min-height: 0 !important;
  }

  .left-rail {
    display: block !important;
  }

  .right-rail {
    display: grid !important;

    grid-template-columns:
      repeat(
        2,
        minmax(
          0,
          1fr
        )
      ) !important;

    gap: 10px !important;

    align-items: start !important;
  }

  .right-rail-controls {
    grid-column:
      1 / -1 !important;
  }

  .panel {
    height: auto !important;

    min-height: 0 !important;
  }

  .panel-head {
    min-height: 36px !important;

    padding:
      7px
      9px !important;
  }

  .panel-head h2 {
    font-size: 14px !important;
  }

  .widget-slot {
    width: 100% !important;

    height: auto !important;

    min-height: 0 !important;

    align-self: start !important;
  }

  .widget-slot
  .panel-body {
    height: auto !important;

    min-height: 0 !important;

    overflow: visible !important;

    padding: 9px !important;
  }

  .timer-display {
    font-size: clamp(38px, 7vw, 58px) !important;
    margin: 4px 0 10px !important;
  }

  .timer-buttons {
    grid-template-columns:
      repeat(
        2,
        minmax(
          0,
          1fr
        )
      ) !important;

    gap: 6px !important;
  }

  .timer-actions {
    grid-template-columns:
      repeat(
        2,
        minmax(
          0,
          1fr
        )
      ) !important;

    gap: 6px !important;
  }

  .timer-actions .small-btn,
  .timer-buttons button {
    min-height: 34px !important;
    padding: 7px 6px !important;
    font-size: 11px !important;
  }

  .mini-row {
    grid-template-columns: 38px minmax(0, 1fr) auto !important;
    padding: 8px !important;
  }

  .mini-title {
    font-size: 13px !important;
  }

  .mini-sub {
    font-size: 11px !important;
  }

  .timetable-panel {
    height: auto !important;
    max-height: none !important;
  }

  .timetable-panel .panel-body {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .timetable-list {
    padding-bottom: 0 !important;
  }

  .time-row {
    min-height: 48px !important;
  }

  .save-status {
    right: 18px !important;
    bottom: 18px !important;
    z-index: 300 !important;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  header {
    min-height: 0 !important;
  }

  /*
   * iPad portrait:
   * treat Class Board as a tablet workspace,
   * not a squeezed desktop layout.
   */

  .board-shell {
    display: flex !important;

    flex-direction: column !important;

    gap: 10px !important;

    height: auto !important;
    min-height: 100% !important;

    overflow: visible !important;
  }

  .centre-board {
    order: 1 !important;

    width: 100% !important;

    display: grid !important;

    grid-template-rows:
      auto
      auto !important;

    gap: 8px !important;

    overflow: visible !important;
  }

  .stage-card {
    width: 100% !important;

    height: auto !important;

    min-height:
      clamp(
        420px,
        58vh,
        520px
      ) !important;

    padding: 12px !important;

    overflow: hidden !important;
  }

  .stage-top {
    grid-template-columns:
      minmax(0, 1fr)
      auto !important;

    align-items: center !important;
  }

  .stage-title {
    font-size:
      clamp(
        26px,
        4vw,
        36px
      ) !important;
  }

  .date-card {
    width: fit-content !important;

    min-width: 0 !important;

    margin: 0 !important;

    padding:
      7px
      10px !important;

    font-size: 11px !important;
  }


  /*
   * Toolbar stays one compact horizontal swipe row.
   */

  .quick-strip {
    width: 100% !important;

    grid-template-columns:
      minmax(0, 1fr)
      76px !important;

    gap: 7px !important;

    height: 62px !important;

    min-height: 62px !important;

    overflow: hidden !important;
  }

  .quick-strip-tools {
    display: flex !important;

    gap: 7px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    flex-wrap: nowrap !important;

    scrollbar-width: none !important;

    -webkit-overflow-scrolling: touch;
  }

  .quick-strip-tools::-webkit-scrollbar {
    display: none !important;
  }

  .quick-strip-tools
  .quick-launch {
    flex:
      0
      0
      96px !important;

    width: 96px !important;

    min-width: 96px !important;

    height: 62px !important;

    min-height: 62px !important;
  }


  /*
   * iPad portrait stays tool-first.
   * Timetable is hidden from the main workspace.
   */

  .left-rail {
    display: none !important;
  }


  /*
   * iPad portrait stays tool-first.
   * Widget rail is hidden from the main workspace.
   */

  .right-rail {
    display: none !important;
  }

  .panel {
    height: auto !important;

    min-height: 0 !important;
  }


  /*
   * Timer stays compact instead of becoming a tall card.
   */

  .timer-display {
    font-size:
      42px !important;

    margin:
      5px
      0
      10px !important;
  }

  .timer-buttons {
    grid-template-columns:
      repeat(
        2,
        minmax(
          0,
          1fr
        )
      ) !important;
  }

  .timer-actions {
    grid-template-columns:
      repeat(
        2,
        minmax(
          0,
          1fr
        )
      ) !important;
  }

  .timer-buttons button,
  .timer-actions button {
    min-height:
      36px !important;
  }


  /*
   * Compact list-based widgets.
   */

  .daily-links-widget-list
  .daily-link-card {
    min-height: 42px !important;
  }

  .mini-row {
    min-height: 48px !important;

    padding: 8px !important;
  }
}

/* Role picker: stop huge vertical cards on iPad */
@media (min-width: 701px) and (max-width: 1220px) {
  body[data-stage="roles"] .role-match-stage {
    min-height: 0 !important;
    height: auto !important;
    gap: 10px !important;
  }

  body[data-stage="roles"] .role-match-board {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  body[data-stage="roles"] .role-match-card {
    min-height: 220px !important;
    padding: 16px !important;
    border-radius: 24px !important;
  }

  body[data-stage="roles"] .role-match-icon {
    width: 70px !important;
    height: 70px !important;
    border-radius: 20px !important;
    font-size: 34px !important;
    margin-top: 8px !important;
  }

  body[data-stage="roles"] .role-match-value {
    font-size: clamp(26px, 4.8vw, 46px) !important;
    line-height: 1.02 !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }

  body[data-stage="roles"] .role-match-role .role-match-value {
    font-size: clamp(23px, 4vw, 38px) !important;
  }

  body[data-stage="roles"] .role-match-helper {
    font-size: clamp(13px, 2vw, 18px) !important;
  }

  body[data-stage="roles"] .role-match-arrow {
    width: 50px !important;
    height: 50px !important;
    font-size: 26px !important;
    transform: none !important;
    margin: auto !important;
  }

  body[data-stage="roles"] .role-match-toolbar {
    min-height: 0 !important;
    padding: 9px !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }

  /* Force the inner groupings to stop wrapping and stay in a single scrollable line */
  body[data-stage="roles"] .role-match-toolbar > div {
    flex-wrap: nowrap !important;
    flex: 0 0 auto !important;
  }

  body[data-stage="roles"] .role-match-toolbar .btn,
  body[data-stage="roles"] .role-match-toolbar select {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    font-size: 11px !important;
  }
}

/* Video: iPad-friendly 2-column lesson video grid */
@media (min-width: 701px) and (max-width: 1220px) {
  body[data-stage="video"] .video-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    max-height: none !important;
    align-content: start !important;
  }

  body[data-stage="video"] .video-gallery iframe {
    min-height: 150px !important;
    height: 150px !important;
    border-radius: 16px !important;
  }

  body[data-stage="video"] .video-stage {
    min-height: 0 !important;
    padding: 10px !important;
  }

  body[data-stage="video"] .board-bottom-toolbar {
    min-height: 48px !important;
    padding: 8px 10px !important;
    gap: 7px !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }

  body[data-stage="video"] .board-bottom-toolbar .btn {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 7px 11px !important;
    font-size: 11px !important;
  }
}

/* Narrow portrait tablet, keep one column so videos do not become tiny */
@media (min-width: 701px) and (max-width: 820px) {
  body[data-stage="video"] .video-gallery {
    grid-template-columns: 1fr !important;
  }

  body[data-stage="video"] .video-gallery iframe {
    min-height: 170px !important;
    height: 170px !important;
  }
}

/* Dice and spinner controls: compact on iPad */
@media (min-width: 701px) and (max-width: 1220px) {
  body[data-stage="dice"] .large-tool,
  body[data-stage="spinner"] .large-tool {
    gap: 10px !important;
    justify-content: flex-start !important;
  }

  body[data-stage="dice"] .board-bottom-toolbar,
  body[data-stage="spinner"] .board-bottom-toolbar {
    width: 100% !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
    gap: 7px !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }

  body[data-stage="dice"] .board-bottom-toolbar .btn,
  body[data-stage="spinner"] .board-bottom-toolbar .btn {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 7px 11px !important;
    font-size: 11px !important;
  }

  body[data-stage="dice"] .d20-hologram {
    --d20-size: min(250px, 32vh) !important;
  }

  body[data-stage="dice"] .cube-3d-die {
    --die-size: min(130px, 18vh) !important;
  }

  body[data-stage="spinner"] #wrapper3D {
    --wheel-size: min(410px, 44vh, 72vw) !important;
  }
}

/* Notes: toolbar must scroll horizontally, not crush the board */
@media (min-width: 701px) and (max-width: 1220px) {
  body[data-stage="notes"] .notes-stage-layout.is-live {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) auto auto !important;
    grid-template-areas:
      "main"
      "join"
      "toolbar" !important;
    gap: 10px !important;
  }

  body[data-stage="notes"] .notes-normal-join-column {
    min-height: 0 !important;
  }

  body[data-stage="notes"] .notes-live-toolbar {
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    min-height: 52px !important;
    padding: 6px 8px !important;
  }

  body[data-stage="notes"] .notes-live-toolbar .btn,
  body[data-stage="notes"] .notes-response-toggle {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 10px !important;
  }

  body[data-stage="notes"] .notes-live-identity {
    flex: 0 0 auto !important;
    min-width: 170px !important;
  }

  body[data-stage="notes"] .corkboard-arena.free-note-board {
    min-height: 400px !important;
  }
}

/* Live activities: use one column on iPad, keep QR manageable */
@media (min-width: 701px) and (max-width: 1220px) {
  .participation-layout.is-live {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "join"
      "main"
      "toolbar" !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }

  .participation-join-column {
    min-height: 0 !important;
  }

  .participation-join-column .live-join-panel,
  .shared-live-join-panel {
    min-height: 0 !important;
    padding: 12px !important;
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    gap: 12px !important;
    text-align: left !important;
  }

  .participation-join-column .live-join-qr,
  body[data-stage] .live-join-qr {
    width: 120px !important;
    height: 120px !important;
    min-width: 120px !important;
    min-height: 120px !important;
    padding: 7px !important;
  }

  .participation-join-column .live-join-qr img,
  .participation-join-column .live-join-qr canvas,
  body[data-stage] .live-join-qr img,
  body[data-stage] .live-join-qr canvas {
    width: 106px !important;
    height: 106px !important;
  }

  .live-join-code {
    font-size: clamp(28px, 5vw, 42px) !important;
  }

  .participation-toolbar {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }

  .participation-toolbar .btn,
  .participation-toolbar .live-response-pill {
    flex: 0 0 auto !important;
  }
}

/* =========================================================
   FINAL IPAD FIX: VIDEO GRID + DICE TOOLBAR
   Must stay at the very end of the stylesheet
   ========================================================= */

/* Lesson videos, two per row on iPad/tablet (landscape and portrait) */
@media (min-width: 701px) and (max-width: 1220px) {
  body:not(.video-only)[data-stage="video"] .stage-card {
    min-height: 0 !important;
  }

  body:not(.video-only)[data-stage="video"] .stage-body {
    overflow: auto !important;
    height: 100% !important;
  }

  body:not(.video-only)[data-stage="video"] .large-tool {
    height: 100% !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  body:not(.video-only)[data-stage="video"] .video-gallery {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    gap: 10px !important;
    align-items: start !important;
    align-content: start !important;
    overflow: visible !important;
  }

  /* Full height and 1 column if there is only one video */
  body:not(.video-only)[data-stage="video"] .video-gallery:has(iframe:only-child) {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    align-content: stretch !important;
  }

  body:not(.video-only)[data-stage="video"] .video-gallery iframe {
    width: 100% !important;
    min-width: 0 !important;
    height: 165px !important;
    min-height: 165px !important;
    max-height: 165px !important;
    border-radius: 16px !important;
    display: block !important;
  }

  /* Single video takes full height */
  body:not(.video-only)[data-stage="video"] .video-gallery iframe:only-child {
    height: 100% !important;
    min-height: 300px !important;
    max-height: none !important;
  }

  body:not(.video-only)[data-stage="video"] .video-stage {
    height: auto !important;
    min-height: 0 !important;
    padding: 8px !important;
    overflow: visible !important;
  }
}

/* Dice toolbar, force one clean row on iPad/tablet */
.dice-bottom-toolbar {
  width: 100%;
  max-width: 940px;
  margin: auto auto 4px;
  padding: 10px 14px;

  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(15,23,42,0.03);
}

.dice-status-block {
  min-width: 0;
  text-align: left;
}

.dice-status-block > span {
  display: block;
  color: #6b7280;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.dice-status-block #diceRollTotalBox {
  margin-top: 1px;
  color: #143f3a;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dice-status-block #diceChallengeText {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.dice-main-btn {
  min-height: 38px !important;
  padding: 0 18px !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.dice-mode-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.dice-mode-buttons .btn {
  flex: 0 0 auto !important;
  min-height: 34px !important;
  padding: 4px 11px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

/* iPad compression, still one row */
@media (min-width: 701px) and (max-width: 1220px) {
  .dice-bottom-toolbar {
    max-width: none !important;
    grid-template-columns: minmax(130px, 1fr) auto auto auto !important;
    gap: 6px !important;
    padding: 8px !important;
  }

    body[data-stage="today"]
  .today-absent-section {
    display: grid !important;

    grid-template-columns:
      minmax(260px, 1.15fr)
      minmax(220px, 1fr)
      minmax(220px, 1fr);

    grid-template-rows:
      auto
      minmax(0, 1fr);

    gap: 8px !important;

    align-items: stretch !important;

    padding: 10px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    scrollbar-width: none !important;

    -webkit-overflow-scrolling: touch;
  }

  body[data-stage="today"]
  .today-absent-section::-webkit-scrollbar {
    display: none !important;
  }

  body[data-stage="today"]
  .today-absent-header {
    grid-column: 1 !important;
    grid-row: 1 !important;

    margin: 0 !important;
  }

  body[data-stage="today"]
  .today-absent-summary {
    grid-column: 1 !important;
    grid-row: 2 !important;

    min-width: 260px !important;

    height: 100% !important;

    margin: 0 !important;
  }

  body[data-stage="today"]
  .today-absent-names {
    grid-column: 1 !important;

    min-width: 260px !important;
  }

  body[data-stage="today"]
  .today-management-grid {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;

    width: 100% !important;

    min-width: 220px !important;

    display: block !important;

    margin: 0 !important;
  }

  body[data-stage="today"]
  .today-routine-shortcut-panel {
    width: 100% !important;
    height: 100% !important;

    min-height: 78px !important;

    margin: 0 !important;
  }

    body[data-stage="today"]
  .today-resource-panel {
    overflow: hidden !important;
  }

  body[data-stage="today"]
  .today-resource-tabs {
    display: flex !important;

    align-items: center !important;

    gap: 8px !important;

    overflow-x: auto !important;

    flex-wrap: nowrap !important;

    scrollbar-width: none !important;

    -webkit-overflow-scrolling: touch;
  }

  body[data-stage="today"]
  .today-resource-tabs::-webkit-scrollbar {
    display: none !important;
  }

  body[data-stage="today"]
  .today-resource-tabs > * {
    flex: 0 0 auto !important;

    white-space: nowrap !important;
  }

  body[data-stage="today"]
  .today-resource-grid,
  body[data-stage="today"]
  .today-resource-list {
    display: flex !important;

    align-items: stretch !important;

    gap: 8px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    flex-wrap: nowrap !important;

    scrollbar-width: none !important;

    -webkit-overflow-scrolling: touch;
  }

  body[data-stage="today"]
  .today-resource-grid::-webkit-scrollbar,
  body[data-stage="today"]
  .today-resource-list::-webkit-scrollbar {
    display: none !important;
  }

  body[data-stage="today"]
  .today-resource-grid > *,
  body[data-stage="today"]
  .today-resource-list > * {
    flex:
      0
      0
      230px !important;

    min-width:
      230px !important;
  }

  body[data-stage="today"]
  .today-birthday-panel {
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;

    width: 100% !important;

    min-width: 220px !important;
    min-height: 78px !important;

    height: 100% !important;

    margin: 0 !important;
  }

  .dice-status-block > span {
    font-size: 9px !important;
  }

  .dice-status-block #diceChallengeText {
    font-size: 10px !important;
  }

  .dice-main-btn {
    min-height: 34px !important;
    padding: 0 12px !important;
    font-size: 11px !important;
  }

  .dice-mode-buttons {
    gap: 5px !important;
  }

  .dice-mode-buttons .btn {
    min-height: 32px !important;
    padding: 4px 9px !important;
    font-size: 10px !important;
  }
}

/* Very narrow portrait, allow horizontal scroll instead of wrapping to two rows */
@media (min-width: 701px) and (max-width: 850px) {
  .dice-bottom-toolbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    gap: 6px !important;
  }

  .dice-status-block {
    flex: 0 0 130px !important;
  }

  .dice-main-btn,
  .dice-mode-buttons,
  .dice-mode-buttons .btn {
    flex: 0 0 auto !important;
  }
}




/* =========================================================
   FINAL FIX: STICKY NOTES FULL-WIDTH WHEN QR IS OFF
   Must stay at the very end of the main CSS.
   ========================================================= */

/* Notes stage must always be allowed to use the whole centre canvas */
body[data-stage="notes"] .stage-body,
body[data-stage="notes"] .notes-stage-layout,
body[data-stage="notes"] .corkboard-arena.free-note-board {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Default notes layout: one full-width board plus toolbar */
body[data-stage="notes"] .notes-stage-layout,
body[data-stage="notes"] .notes-stage-layout.is-live,
body.live-qr-hidden[data-stage="notes"] .notes-stage-layout,
body.live-qr-hidden[data-stage="notes"] .notes-stage-layout.is-live,
body.live-qr-hidden.focus-mode[data-stage="notes"] .notes-stage-layout,
body.live-qr-hidden.fullscreen-active[data-stage="notes"] .notes-stage-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  grid-template-areas:
    "main"
    "toolbar" !important;
  gap: 12px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
}

  body[data-stage="bell"]
  .stage-body {
    overflow: hidden !important;
  }

  body[data-stage="bell"]
  .mini-bell-board-stage {
    width: 100% !important;

    height: 100% !important;

    min-height: 0 !important;

    display: grid !important;

    grid-template-rows:
      minmax(
        0,
        1.45fr
      )
      auto !important;

    align-items: stretch !important;

    gap: 14px !important;
  }

  body[data-stage="bell"]
  .mini-bell-visual {
    min-height: 0 !important;

    display: grid !important;

    place-items: center !important;

    cursor: pointer;
  }

  body[data-stage="bell"]
  .board-bell-3d {
    transform:
      scale(
        1.18
      );
  }

  body[data-stage="bell"]
  .board-bell-copy {
    width: 100% !important;

    max-width: none !important;

    padding:
      0
      8px
      6px !important;
  }

  body[data-stage="bell"]
  .board-bell-copy
  h2 {
    font-size:
      clamp(
        28px,
        4.3vw,
        42px
      ) !important;

    margin-bottom:
      8px !important;
  }

  body[data-stage="bell"]
  .board-bell-copy
  p {
    max-width:
      820px !important;

    margin-bottom:
      0 !important;

    font-size:
      clamp(
        14px,
        1.8vw,
        18px
      ) !important;
  }

  body[data-stage="bell"]
  .board-bell-copy
  .large-actions {
    margin-top:
      12px !important;

    gap:
      7px !important;
  }

/* Only reserve a QR column when a live notes session exists AND QR is visible */
body:not(.live-qr-hidden)[data-stage="notes"] .notes-stage-layout.is-live {
  grid-template-columns: minmax(0, 1fr) minmax(245px, 310px) !important;
  grid-template-areas:
    "main join"
    "toolbar toolbar" !important;
}

/* Projector mode can use a slightly wider QR column, but only when QR is visible */
body:not(.live-qr-hidden).fullscreen-active[data-stage="notes"] .notes-stage-layout.is-live,
body:not(.live-qr-hidden).focus-mode[data-stage="notes"] .notes-stage-layout.is-live {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px) !important;
}

/* Corkboard always fills the available board area */
body[data-stage="notes"] .corkboard-arena.free-note-board,
body.live-qr-hidden[data-stage="notes"] .corkboard-arena.free-note-board,
body.live-qr-hidden.focus-mode[data-stage="notes"] .corkboard-arena.free-note-board,
body.live-qr-hidden.fullscreen-active[data-stage="notes"] .corkboard-arena.free-note-board {
  grid-area: main !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
}

/* If QR is visible, the corkboard stays in the left column */
body:not(.live-qr-hidden)[data-stage="notes"] .notes-stage-layout.is-live .corkboard-arena.free-note-board {
  grid-area: main !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
}

/* Hide all QR/join panels when QR is off */
body.live-qr-hidden[data-stage="notes"] .notes-normal-join-column,
body.live-qr-hidden[data-stage="notes"] .notes-projector-join-card,
body.live-qr-hidden[data-stage="notes"] .notes-live-identity,
body.live-qr-hidden.focus-mode[data-stage="notes"] .notes-projector-join-card,
body.live-qr-hidden.fullscreen-active[data-stage="notes"] .notes-projector-join-card {
  display: none !important;
}

/* In clean focus/projector, use the projector join card only when QR is visible */
body:not(.live-qr-hidden).focus-mode[data-stage="notes"] .notes-projector-join-card,
body:not(.live-qr-hidden).fullscreen-active[data-stage="notes"] .notes-projector-join-card {
  display: flex !important;
  grid-area: join !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
}

/* In clean focus/projector, do not show the normal join column */
body.focus-mode[data-stage="notes"] .notes-normal-join-column,
body.fullscreen-active[data-stage="notes"] .notes-normal-join-column {
  display: none !important;
}

/* Toolbar always sits underneath the board and uses full width */
body[data-stage="notes"] .notes-live-toolbar,
body.live-qr-hidden[data-stage="notes"] .notes-live-toolbar,
body.live-qr-hidden.focus-mode[data-stage="notes"] .notes-live-toolbar,
body.live-qr-hidden.fullscreen-active[data-stage="notes"] .notes-live-toolbar {
  grid-area: toolbar !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  width: 100% !important;
  max-width: none !important;
}


/* =========================================================
   CLASS BOARD INTEGRATED WHITEBOARD
   Opens instantly inside Class Board. Remote uses whiteboard-controller.html.
   ========================================================= */

.class-board-whiteboard-stage {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.class-board-whiteboard-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(20, 63, 58, 0.12);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  margin-bottom: 74px; /* Creates a clean layout window so the toolbar never blocks your grid lines or drawings */
}

/* Safely switches overflow to visible on normal mode only so the bar can sit in the empty space below */
body:not(.focus-mode):not(.fullscreen-active) .class-board-whiteboard-card {
  overflow: visible !important;
}

.class-board-whiteboard-card.grid {
  background-color: #ffffff;
  background-image:
    linear-gradient(#e5e7eb 1px, transparent 1px),
    linear-gradient(90deg, #e5e7eb 1px, transparent 1px);
  background-size: 40px 40px;
}

.class-board-whiteboard-card.lined {
  background-color: #ffffff;
  background-image: linear-gradient(#dbe4e1 1px, transparent 1px);
  background-size: 100% 48px;
}

.class-board-whiteboard-card.chalk {
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.05), transparent 24%),
    linear-gradient(135deg, #16352f, #0f2420);
}

.class-board-whiteboard-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 78px; /* Safe layout zone preventing drawings/tables from sliding under the tools */
  width: 100%;
  height: calc(100% - 78px);
  display: block;
  touch-action: none;
  background: transparent;
  cursor: crosshair;
}

.class-board-whiteboard-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #94a3b8;
  text-align: center;
  padding: 22px;
}

.class-board-whiteboard-empty strong {
  display: block;
  color: var(--board-ink);
  font-size: clamp(36px, 5vw, 76px);
  line-height: 1;
  letter-spacing: -2px;
  margin-bottom: 10px;
}

.class-board-whiteboard-empty span {
  display: block;
  color: #64748b;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 900;
}

.class-board-whiteboard-toolbar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 8;

  width: min(1180px, calc(100% - 28px));
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 8px 12px;
  border-radius: 22px;

  background: rgba(17, 24, 39, 0.92);
  color: #ffffff;

  box-shadow:
    0 20px 44px rgba(15, 23, 42, 0.26);

  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

/* Strictly targets normal mode to push the bar down into the empty gap under the card bounds */
body:not(.focus-mode):not(.fullscreen-active) .class-board-whiteboard-toolbar {
  bottom: -62px !important;
}

.class-board-whiteboard-tools,
.class-board-whiteboard-colours {
  display: flex;
  align-items: center;
  gap: 7px;
  scrollbar-width: none;
}

.class-board-whiteboard-tools {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 1px;
}

.class-board-whiteboard-colours {
  flex: 0 0 auto;
  min-width: max-content;
  overflow: visible;
}

.class-board-whiteboard-tools::-webkit-scrollbar,
.class-board-whiteboard-colours::-webkit-scrollbar {
  display: none;
}

.class-board-whiteboard-pill {
  width: 38px; /* Uniform width matches height metric exactly */
  height: 38px;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%; /* Pure symmetrical circles eliminate visual chaos */
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  color: #ffffff;
  font-size: 15px; /* Upscaled slightly for target visibility */
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, transform 0.1s ease;
}

.class-board-whiteboard-pill:active {
  transform: scale(0.92);
}

.class-board-whiteboard-pill.active {
  background: #5fdc9a;
  color: #143f3a;
  border-color: #5fdc9a;
}

.class-board-whiteboard-colour {
  width: 20px; /* Reduced to 20px to free up maximum layout zone space for tools */
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.24);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.class-board-whiteboard-colour.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(95, 220, 154, 0.45);
  transform: scale(1.15); /* Pronounced tactile pop when active */
}

/* Automatically upscale swatches back to 34px on projector walls */
body.focus-mode .class-board-whiteboard-colour,
body.fullscreen-active .class-board-whiteboard-colour {
  width: 34px;
  height: 34px;
  border-width: 3px;
}

.class-board-whiteboard-colour.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(95,220,154,.25);
}

.class-board-whiteboard-size-wrap {
  width: 92px;
  min-width: 92px;

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

  color: #cbd5e1;
  flex: 0 0 auto;
}

.class-board-whiteboard-size-wrap span {
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.class-board-whiteboard-size {
  width: 58px;
  min-width: 58px;
  height: 22px;
  margin: 0;

  accent-color: #5fdc9a;
  flex: 0 0 auto;
  cursor: pointer;
}

/*
  Larger pen-thickness control in Show to Class
  and Full Screen for easier projector use.
*/

body.focus-mode[data-stage="whiteboard"]
.class-board-whiteboard-size-wrap,
body.fullscreen-active[data-stage="whiteboard"]
.class-board-whiteboard-size-wrap {
  width: 146px;
  min-width: 146px;
  gap: 8px;
}

body.focus-mode[data-stage="whiteboard"]
.class-board-whiteboard-size-wrap span,
body.fullscreen-active[data-stage="whiteboard"]
.class-board-whiteboard-size-wrap span {
  font-size: 11px;
}

body.focus-mode[data-stage="whiteboard"]
.class-board-whiteboard-size,
body.fullscreen-active[data-stage="whiteboard"]
.class-board-whiteboard-size {
  width: 105px;
  min-width: 105px;
  height: 30px;
}

.class-board-whiteboard-quick-menu
.class-board-whiteboard-more-panel {
  left: auto !important;
  right: 0 !important;
  bottom: calc(100% + 10px) !important;

  width: 220px !important;
  max-width: calc(100vw - 28px) !important;

  padding: 8px !important;
  border-radius: 15px !important;

  transform: none !important;
}

.class-board-whiteboard-more-panel
.class-board-whiteboard-quick-panel-title {
  margin: 1px 4px 7px;
  font-size: 9px;
}

.class-board-whiteboard-more-list {
  display: grid;
  gap: 5px;
}

.class-board-whiteboard-more-action {
  width: 100%;
  min-height: 34px;

  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 7px;

  margin: 0;
  padding: 7px 9px;

  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.065);
  color: #ffffff;

  font-size: 10px;
  line-height: 1.1;
  font-weight: 950;
  text-align: left;

  cursor: pointer;
  box-shadow: none;
}

.class-board-whiteboard-more-action span:first-child {
  display: inline-grid;
  place-items: center;

  width: 20px;
  height: 20px;

  font-size: 12px;
  line-height: 1;
}

.class-board-whiteboard-more-action span:last-child {
  min-width: 0;
  white-space: nowrap;
}

.class-board-whiteboard-more-action:hover,
.class-board-whiteboard-more-action:focus-visible {
  border-color: #5fdc9a;
  background: rgba(95, 220, 154, 0.14);
  outline: none;
}

.class-board-whiteboard-more-action.danger {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(127, 29, 29, 0.12);
  color: #fca5a5;
}

.class-board-whiteboard-more-action.danger:hover,
.class-board-whiteboard-more-action.danger:focus-visible {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.20);
  color: #fecaca;
}

.class-board-whiteboard-more-divider {
  width: 100%;
  height: 1px;
  margin: 2px 0;

  background: rgba(255, 255, 255, 0.11);
}

/* =========================================================
   WHITEBOARD BACKGROUND AND TEMPLATE MENUS
   ========================================================= */

.class-board-whiteboard-quick-menu {
  position: relative;
  flex: 0 0 auto;
}

.class-board-whiteboard-quick-menu > summary {
  min-height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  padding: 0 10px;
  list-style: none;

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;

  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;

  cursor: pointer;
  user-select: none;
}

.class-board-whiteboard-quick-menu >
summary::-webkit-details-marker {
  display: none;
}

.class-board-whiteboard-quick-menu >
summary::after {
  content: "▴";
  margin-left: 2px;
  color: #94a3b8;
  font-size: 9px;
}

.class-board-whiteboard-quick-menu[open] >
summary {
  border-color: #5fdc9a;
  background: #5fdc9a;
  color: #143f3a;
}

.class-board-whiteboard-quick-menu[open] >
summary::after {
  color: #143f3a;
}

.class-board-whiteboard-quick-panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 13px);
  z-index: 80;

  width: min(760px, calc(100vw - 42px));
  padding: 10px;

  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 18px;

  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(14px);

  transform: translateX(-50%);
}

.class-board-whiteboard-quick-panel-title {
  margin: 0 4px 8px;
  color: #cbd5e1;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.class-board-whiteboard-choice-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;

  overflow-x: auto;
  overflow-y: hidden;

  padding: 2px 2px 7px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.class-board-whiteboard-choice {
  flex: 0 0 112px;
  min-height: 76px;

  display: grid;
  grid-template-rows:
    minmax(0, 1fr)
    auto;
  gap: 7px;

  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;

  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;

  font-size: 10px;
  line-height: 1;
  font-weight: 950;

  cursor: pointer;
}

.class-board-whiteboard-choice:hover,
.class-board-whiteboard-choice:focus-visible {
  border-color: #5fdc9a;
  background: rgba(95, 220, 154, 0.14);
  outline: none;
}

.class-board-whiteboard-choice.active {
  border-color: #5fdc9a;
  background: #5fdc9a;
  color: #143f3a;
}

.class-board-whiteboard-choice-preview {
  min-height: 43px;
  display: grid;
  place-items: center;

  border-radius: 9px;
  overflow: hidden;

  background: #ffffff;
  color: #143f3a;

  font-size: 18px;
  font-weight: 950;
}

.class-board-whiteboard-choice-preview.blank {
  background: #ffffff;
}

.class-board-whiteboard-choice-preview.grid {
  background-color: #ffffff;
  background-image:
    linear-gradient(
      rgba(37, 99, 235, 0.20) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(37, 99, 235, 0.20) 1px,
      transparent 1px
    );
  background-size: 11px 11px;
}

.class-board-whiteboard-choice-preview.lined {
  background-color: #ffffff;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0 10px,
      rgba(37, 99, 235, 0.26) 10px 11px
    );
}

.class-board-whiteboard-choice-preview.chalk {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0 2px,
      transparent 2px 10px
    ),
    #143f3a;

  color: #ffffff;
}

.class-board-whiteboard-template-preview {
  min-height: 43px;
  display: grid;
  place-items: center;

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

  background: #ffffff;
  color: #143f3a;

  font-size: 9px;
  line-height: 1.15;
  font-weight: 950;
  text-align: center;
}

/* Compact menus for Prompt and Teacher Remote */

.class-board-whiteboard-action-panel {
  width: min(420px, calc(100vw - 42px));
}

.class-board-whiteboard-prompt-popover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.class-board-whiteboard-prompt-popover input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 11px;

  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;

  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;

  font-size: 12px;
  font-weight: 850;
  outline: none;
}

.class-board-whiteboard-prompt-popover input::placeholder {
  color: #94a3b8;
}

.class-board-whiteboard-prompt-popover input:focus {
  border-color: #5fdc9a;
  box-shadow:
    0 0 0 3px rgba(95, 220, 154, 0.16);
}

.class-board-whiteboard-popover-button {
  min-height: 38px;
  padding: 8px 14px;

  border: 1px solid #5fdc9a;
  border-radius: 11px;

  background: #5fdc9a;
  color: #143f3a;

  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

.class-board-whiteboard-remote-copy {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
}

.class-board-whiteboard-remote-copy strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
}

.class-board-whiteboard-remote-copy span {
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.class-board-whiteboard-beta-line {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 23px;
  padding: 4px 8px;

  border: 1px solid rgba(251, 191, 36, 0.36);
  border-radius: 999px;

  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;
}

.class-board-whiteboard-remote-start {
  width: 100%;
}

.class-board-whiteboard-quick-panel
.class-board-whiteboard-qr {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

.class-board-whiteboard-quick-panel
.class-board-whiteboard-code {
  color: #ffffff;
}

.class-board-whiteboard-quick-panel
.class-board-whiteboard-qr-wrap {
  width: 174px;
  height: 174px;
}

.class-board-whiteboard-quick-panel
.class-board-whiteboard-qr-wrap img,
.class-board-whiteboard-quick-panel
.class-board-whiteboard-qr-wrap canvas {
  width: 152px !important;
  height: 152px !important;
}

.class-board-whiteboard-quick-panel
.class-board-whiteboard-qr p {
  color: #cbd5e1;
}

/* Additional background previews */

.class-board-whiteboard-choice-preview.dots {
  background-color: #ffffff;
  background-image:
    radial-gradient(
      circle,
      rgba(37, 99, 235, 0.34) 1.3px,
      transparent 1.5px
    );
  background-size: 13px 13px;
}

.class-board-whiteboard-choice-preview.handwriting {
  background-color: #ffffff;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0 8px,
      rgba(37, 99, 235, 0.18) 8px 9px,
      transparent 9px 16px,
      rgba(37, 99, 235, 0.36) 16px 17px,
      transparent 17px 24px,
      rgba(220, 38, 38, 0.18) 24px 25px
    );
}

.class-board-whiteboard-choice-preview.cream {
  background: #fff8e7;
}

@media (max-width: 900px) {
  .class-board-whiteboard-quick-menu >
  summary {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .class-board-whiteboard-quick-menu >
  summary::first-letter {
    font-size: 15px;
  }

  .class-board-whiteboard-quick-menu >
  summary::after {
    display: none;
  }
}

.class-board-whiteboard-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.class-board-whiteboard-side .panel {
  flex: 0 0 auto;
}

/* SURGICAL ACCORDION HEADER OVERRIDES */
.class-board-whiteboard-side .class-board-whiteboard-accordion-head,
.class-board-whiteboard-side .panel-head h3 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
}

/* Forces parent panel cards to handle absolute children anchor alignments */
.class-board-whiteboard-side .panel:first-child {
  position: relative !important;
}

/* Pins the compact Hide badge securely next to the dropdown indicator chevron arrow */
#classBoardHidePanelBtn {
  display: inline-flex !important;
  position: absolute !important;
  right: 36px !important; /* Docks cleanly on the left plane of the menu drop chevron arrow */
  top: 10px !important;
  width: auto !important;
  min-height: auto !important;
  padding: 3px 9px !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  border-radius: 6px !important;
  z-index: 100 !important; /* Layer tracking value keeping it interactive across open/closed shifts */
  margin: 0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

#classBoardHidePanelBtn:hover {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fecaca !important;
}

.class-board-whiteboard-side .panel-inner {
  padding: 14px;
}

.class-board-whiteboard-side h3 {
  margin: 0;
  color: var(--board-ink);
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.class-board-whiteboard-side p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.38;
  font-weight: 800;
}

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

.class-board-whiteboard-grid .btn {
  width: 100%;
  min-height: 32px; /* Tightened target box heights */
  padding: 4px 4px; /* Reduced side-padding to keep layout-critical text on a single line */
  font-size: 10.5px; /* Scaled down base typography text sizing slightly for clean fitment */
}

.class-board-whiteboard-qr {
  display: none;
  text-align: center;
}

.class-board-whiteboard-qr.show {
  display: block;
}

.class-board-whiteboard-qr-wrap {
  width: 186px;
  height: 186px;
  margin: 12px auto 8px;
  padding: 9px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.class-board-whiteboard-qr-wrap img,
.class-board-whiteboard-qr-wrap canvas {
  width: 164px !important;
  height: 164px !important;
}

.class-board-whiteboard-code {
  margin-top: 6px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 3px;
}

/*
  WHITEBOARD + PRESENT TO CLASS AGENDA

  Whiteboard previously forced every rail to disappear.
  Keep the left timetable/agenda available in Focus mode,
  matching the other classroom tools.

  True fullscreen can still hide all rails.
*/

body.focus-mode[data-stage="whiteboard"]
.left-rail {
  display: flex !important;
}

body.focus-mode[data-stage="whiteboard"]
.right-rail,
body.focus-mode[data-stage="whiteboard"]
.quick-strip,
body.fullscreen-active[data-stage="whiteboard"]
.left-rail,
body.fullscreen-active[data-stage="whiteboard"]
.right-rail,
body.fullscreen-active[data-stage="whiteboard"]
.quick-strip {
  display: none !important;
}

/*
  Whiteboard with Agenda collapsed.
*/
body.focus-mode[data-stage="whiteboard"]
.board-shell {
  grid-template-columns:
    38px
    minmax(0, 1fr) !important;

  gap: 6px !important;
}

/*
  Whiteboard with Agenda open.
*/
body.focus-mode[data-stage="whiteboard"]:not(
  .left-rail-collapsed
)
.board-shell {
  grid-template-columns:
    224px
    minmax(0, 1fr) !important;

  gap: 6px !important;
}

/*
  True fullscreen Whiteboard remains
  completely distraction-free.
*/
body.fullscreen-active[data-stage="whiteboard"]
.board-shell {
  grid-template-columns:
    1fr !important;
}

body.focus-mode[data-stage="whiteboard"] .centre-board,
body.fullscreen-active[data-stage="whiteboard"] .centre-board {
  grid-template-rows: 1fr !important;
}

body.focus-mode[data-stage="whiteboard"] .class-board-whiteboard-stage,
body.fullscreen-active[data-stage="whiteboard"] .class-board-whiteboard-stage {
  grid-template-columns: minmax(0, 1fr) !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.focus-mode[data-stage="whiteboard"] .class-board-whiteboard-card,
body.fullscreen-active[data-stage="whiteboard"] .class-board-whiteboard-card {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.focus-mode[data-stage="whiteboard"] .stage-body,
body.fullscreen-active[data-stage="whiteboard"] .stage-body {
  overflow: hidden !important;
}

body.focus-mode[data-stage="whiteboard"] .class-board-whiteboard-side,
body.fullscreen-active[data-stage="whiteboard"] .class-board-whiteboard-side {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  bottom: 14px !important;
  z-index: 40 !important;
  width: min(245px, calc(100vw - 32px)) !important; /* Unified presentation width rules to match compressed layout mechanics */
  display: flex !important;
  overflow-y: auto !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(20, 63, 58, 0.14) !important;
  border-radius: 24px !important;
  padding: 0 !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
  backdrop-filter: blur(12px) !important;
}

body.focus-mode[data-stage="whiteboard"] .class-board-whiteboard-stage.side-collapsed .class-board-whiteboard-side,
body.fullscreen-active[data-stage="whiteboard"] .class-board-whiteboard-stage.side-collapsed .class-board-whiteboard-side {
  display: none !important;
}

@media (max-width: 980px) {
  .class-board-whiteboard-stage {
    grid-template-columns: 1fr;
  }

  .class-board-whiteboard-side {
    display: none;
  }

  .class-board-whiteboard-toolbar {
    grid-template-columns: 1fr;
  }
}


.class-board-whiteboard-prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.class-board-whiteboard-prompt-row input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 8px 12px;
  color: #143f3a;
  font-size: 12px;
  font-weight: 850;
  outline: none;
}

.class-board-whiteboard-prompt-row input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}


.class-board-whiteboard-pill:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.class-board-whiteboard-delete-selected:not(:disabled) {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.class-board-whiteboard-card.is-selecting .class-board-whiteboard-canvas {
  cursor: grab;
}

.class-board-whiteboard-card.is-dragging .class-board-whiteboard-canvas {
  cursor: grabbing;
}

.class-board-whiteboard-card.is-pointing .class-board-whiteboard-canvas {
  cursor: pointer;
}

.class-board-whiteboard-accordion {
  overflow: hidden;
}

.class-board-whiteboard-accordion-head {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  color: var(--board-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font: inherit;
}

.class-board-whiteboard-accordion-head span {
  font-size: 14px;
  font-weight: 950;
}

.class-board-whiteboard-accordion-head strong {
  font-size: 18px;
  font-weight: 950;
}

/* Keeps the first accordion card structure active when collapsed so the Hide link stays alive */
.class-board-whiteboard-accordion:not(.open) .class-board-whiteboard-accordion-body {
  display: block !important;
  padding: 0 !important; /* Strips vertical padding space when closed to keep text rows clean */
}

/* Hides every individual content asset inside the collapsed body EXCEPT for our Hide button */
.class-board-whiteboard-accordion:not(.open) .class-board-whiteboard-accordion-body > *:not(#classBoardHidePanelBtn) {
  display: none !important;
}

.class-board-whiteboard-accordion.open .class-board-whiteboard-accordion-head strong {
  transform: rotate(0deg);
}


.class-board-whiteboard-custom-colour {
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffffff 0 35%, var(--custom-colour) 35% 100%);
  overflow: hidden;
  width: 20px; /* Synced to match the 20px standard palette array dimensions */
  height: 20px;
}

.class-board-whiteboard-custom-colour span {
  position: relative;
  z-index: 2;
  width: 12px; /* Proproportionally balanced internal circle cushion */
  height: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.82);
  color: #ffffff;
  font-size: 9px; /* Scaled text layout boundaries */
  font-weight: 950;
  line-height: 1;
}

/* Preserved projector scale parameters */
body.focus-mode .class-board-whiteboard-custom-colour,
body.fullscreen-active .class-board-whiteboard-custom-colour {
  width: 34px;
  height: 34px;
}

body.focus-mode .class-board-whiteboard-custom-colour span,
body.fullscreen-active .class-board-whiteboard-custom-colour span {
  width: 18px;
  height: 18px;
  font-size: 14px;
}

.class-board-whiteboard-custom-colour span {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.82);
  color: #ffffff;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.class-board-whiteboard-custom-colour input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}


.task-main-instruction {
  margin-top: 0;
  min-width: 0;
  max-width: 100%;
  font-size: clamp(20px, 1.75vw, 28px);
  line-height: 1.32;
  font-weight: 520;
  overflow-wrap: anywhere;
}

body.focus-mode[data-stage="task"] .task-stage-split-container,
body.fullscreen-active[data-stage="task"] .task-stage-split-container {
  min-height: 0 !important;
  overflow: hidden !important;
}

body.focus-mode[data-stage="task"] .task-stage-main-card .activity-card,
body.fullscreen-active[data-stage="task"] .task-stage-main-card .activity-card {
  height: 100% !important;
  min-height: 0 !important;

  /*
    Present mode should never require the teacher
    to scroll the lesson instructions.
  */
  overflow: hidden !important;

  padding:
    18px
    30px
    24px !important;

  justify-content:
    flex-start !important;
}


/*
  The instruction layout must be allowed to shrink
  to the real visible lesson area.
*/
body.focus-mode[data-stage="task"]
.task-main-instruction,
body.fullscreen-active[data-stage="task"]
.task-main-instruction {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;

  overflow: hidden !important;
}


body.focus-mode[data-stage="task"]
.student-instruction-one-step,
body.fullscreen-active[data-stage="task"]
.student-instruction-one-step {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;

  grid-template-rows:
    auto
    minmax(0, 1fr) !important;

  overflow: hidden !important;
}


body.focus-mode[data-stage="task"]
.student-instruction-focus-card,
body.fullscreen-active[data-stage="task"]
.student-instruction-focus-card {
  width: 100% !important;
  height: 100% !important;

  min-height: 0 !important;
  max-height: 100% !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;

  padding:
    clamp(
      18px,
      2.4vw,
      34px
    ) !important;
}


/*
  Slides / image / PDF layout:
  the SIDE PANEL scrolls, not the instruction card.
*/
body.focus-mode[data-stage="task"]
.task-slides-instruction-panel,
body.fullscreen-active[data-stage="task"]
.task-slides-instruction-panel {
  min-height: 0 !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}


body.focus-mode[data-stage="task"]
.task-slides-instruction-panel
.student-instruction-one-step,
body.fullscreen-active[data-stage="task"]
.task-slides-instruction-panel
.student-instruction-one-step {
  height: auto !important;
  min-height: 0 !important;
}


body.focus-mode[data-stage="task"]
.task-slides-instruction-panel
.student-instruction-focus-card,
body.fullscreen-active[data-stage="task"]
.task-slides-instruction-panel
.student-instruction-focus-card {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow: visible !important;
}

body.focus-mode[data-stage="task"] .task-main-instruction,
body.fullscreen-active[data-stage="task"] .task-main-instruction {
  font-size: clamp(18px, 1.75vw, 26px) !important;
  line-height: 1.38 !important;
  margin-top: 0 !important;
}

body.board-booting header,
body.board-booting main,
body.board-booting .save-status {
  visibility: hidden;
}

.board-boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999998;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(34, 197, 94, 0.18),
      transparent 30%
    ),

    radial-gradient(
      circle at 82% 24%,
      rgba(99, 102, 241, 0.14),
      transparent 30%
    ),

    radial-gradient(
      circle at 70% 82%,
      rgba(59, 130, 246, 0.10),
      transparent 28%
    ),

    linear-gradient(
      135deg,
      #effdf5 0%,
      #f8fafc 46%,
      #f5f3ff 100%
    );
}


.board-boot-screen::before {
  content: "";

  position: absolute;
  inset: 0;

  pointer-events: none;

  background-image:
    linear-gradient(
      rgba(99, 102, 241, 0.055) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(34, 197, 94, 0.05) 1px,
      transparent 1px
    );

  background-size:
    52px 52px;

  mask-image:
    radial-gradient(
      circle at center,
      transparent 16%,
      #000 48%,
      transparent 92%
    );

  opacity: 0.7;
}


.board-boot-screen::after {
  content: "";

  position: absolute;

  width: 680px;
  height: 680px;

  border-radius: 999px;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.08
    );

  box-shadow:
    0 0 0 90px
    rgba(
      34,
      197,
      94,
      0.025
    ),
    0 0 0 180px
    rgba(
      59,
      130,
      246,
      0.018
    );

  pointer-events: none;
}

body.board-booting .board-boot-screen {
  display: flex;
}

.board-boot-floaters {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.board-boot-floater {
  position: absolute;

  display: grid;
  place-items: center;

  width:
    clamp(
      48px,
      5vw,
      68px
    );

  height:
    clamp(
      48px,
      5vw,
      68px
    );

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.14
    );

  border-radius:
    22px;

  background:
    rgba(
      255,
      255,
      255,
      0.48
    );

  color:
    #4f46e5;

  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  font-size:
    clamp(
      18px,
      2vw,
      27px
    );

  line-height:
    1;

  font-weight:
    950;

  opacity:
    0.18;

  box-shadow:
    0 14px 34px
    rgba(
      79,
      70,
      229,
      0.08
    ),
    inset 0 1px 0
    rgba(
      255,
      255,
      255,
      0.86
    );

  backdrop-filter:
    blur(10px);

  transform:
    rotate(
      var(
        --boot-floater-rotation,
        0deg
      )
    );

  animation:
    boardBootFloat
    7s
    ease-in-out
    infinite;
}

.board-boot-floater-timer {
  top: 16%;
  left: 12%;
  --boot-floater-rotation: -8deg;
  animation-delay: 0s;
}

.board-boot-floater-bell {
  top: 18%;
  right: 12%;
  --boot-floater-rotation: 7deg;
  animation-delay: 1.4s;
}

.board-boot-floater-pencil {
  bottom: 15%;
  left: 15%;
  --boot-floater-rotation: 8deg;
  animation-delay: 0.8s;
}

.board-boot-floater-star {
  right: 15%;
  bottom: 14%;
  --boot-floater-rotation: -7deg;
  color: #d69e00;
  animation-delay: 2s;
}

.board-boot-card {
  position: relative;
  width: min(440px, 92vw);
  padding: 34px 34px 30px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(20, 63, 58, 0.12);
  border-radius: 30px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(95, 220, 154, 0.16),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.97);
  box-shadow:
    0 28px 70px rgba(20, 63, 58, 0.16),
    0 2px 8px rgba(15, 23, 42, 0.05);
}

.board-boot-card::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -78px;
  top: -82px;
  border: 24px solid rgba(95, 220, 154, 0.10);
  border-radius: 999px;
  pointer-events: none;
}

.board-boot-logo {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: #0f172a;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.6px;
}

.board-boot-logo-daily {
  font-weight: 900;
}

.board-boot-logo-dot {
  margin: 0 6px;
  color: #22c55e;
  font-size: 18px;
  font-weight: 950;
}

.board-boot-logo-teacher {
  color: #334155;
  font-weight: 650;
}

.board-boot-logo-teacher span {
  color: #22c55e;
  font-weight: 900;
}

.board-boot-ms-green-wrap {
  position: relative;
  width: 190px;
  height: 188px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
}

.board-boot-ms-green {
  display: block;
  width: auto;
  height: 184px;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 14px 18px rgba(20, 63, 58, 0.13));
  animation: boardBootMsGreenFloat 3.4s ease-in-out infinite;
}

.board-boot-spinner {
  position: absolute;
  right: 4px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border: 5px solid #d9fbe8;
  border-top-color: #143f3a;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 7px 16px rgba(20, 63, 58, 0.12),
    0 0 0 4px rgba(255, 255, 255, 0.70);
  animation: boardBootSpin 0.85s linear infinite;
}

.board-boot-card h1 {
  position: relative;
  z-index: 2;
  margin: 0 0 8px;
  color: #143f3a;
  font-size: clamp(23px, 2.4vw, 27px);
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.8px;
}

.board-boot-card p {
  position: relative;
  z-index: 2;
  max-width: 340px;
  margin: 0 auto;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.board-boot-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 12px;
  margin-top: 18px;
}

.board-boot-status span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #5fdc9a;
  animation: boardBootDot 1.1s ease-in-out infinite;
}

.board-boot-status span:nth-child(2) {
  animation-delay: 0.14s;
}

.board-boot-status span:nth-child(3) {
  animation-delay: 0.28s;
}

.board-boot-tagline {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  color: #143f3a;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.25;
  font-weight: 950;
  letter-spacing: -0.2px;
  opacity: 1;
}

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

@keyframes boardBootMsGreenFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-4px) rotate(1deg);
  }
}

@keyframes boardBootFloat {
  0%,
  100% {
    transform:
      translateY(0)
      rotate(var(--boot-floater-rotation, 0deg));
  }

  50% {
    transform:
      translateY(-9px)
      rotate(var(--boot-floater-rotation, 0deg));
  }
}

@keyframes boardBootDot {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 560px) {
  .board-boot-floater {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    font-size: 21px;
    opacity: 0.10;
  }

  .board-boot-floater-pencil,
  .board-boot-floater-star {
    display: none;
  }

  .board-boot-floater-timer {
    top: 10%;
    left: 5%;
  }

  .board-boot-floater-bell {
    top: auto;
    right: 5%;
    bottom: 10%;
  }

  .board-boot-card {
    width: min(390px, 94vw);
    padding: 28px 22px 25px;
    border-radius: 25px;
  }

  .board-boot-logo {
    margin-bottom: 21px;
    font-size: 19px;
  }

  .board-boot-ms-green-wrap {
  width: 160px;
  height: 158px;
  margin-bottom: 14px;
}

.board-boot-ms-green {
  height: 154px;
}

  .board-boot-card h1 {
    font-size: 25px;
  }

  .board-boot-card p {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-boot-spinner,
  .board-boot-status span,
  .board-boot-floater,
  .board-boot-ms-green {
    animation: none;
  }
}


body.video-only #exitVideoOnlyBtn {
  display: none !important;
}



.board-video-focus-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 35;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: clamp(18px, 2.2vw, 34px);
  background: rgba(255, 251, 235, 0.98);
  color: #713f12;
  text-align: center;
  overflow: hidden;
}

.board-video-focus-label {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 7px 13px;
  border-radius: 999px;
  background: #92400e;
  color: #ffffff;
  font-size: clamp(9px, 0.75vw, 12px);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.board-video-focus-text {
  width: min(92%, 780px);
  max-height: 62%;
  overflow: hidden;
  color: #713f12;
  font-size: clamp(22px, 2.25vw, 40px);
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: -0.8px;
  text-wrap: balance;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 7; /* Vendor prefixed */
  line-clamp: 7;        /* Standard property */
  -webkit-box-orient: vertical;
}

.board-video-focus-help {
  color: #92400e;
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 850;
  line-height: 1.25;
}

body.focus-mode .board-video-focus-text,
body.fullscreen-active .board-video-focus-text,
body.video-only .board-video-focus-text {
  width: min(92%, 980px);
  max-height: 70%;
  font-size: clamp(34px, 4.8vw, 76px);
  line-height: 1.04;
  -webkit-line-clamp: 8; /* Vendor prefixed */
  line-clamp: 8;        /* Standard property */
}

body.focus-mode .board-video-focus-overlay,
body.fullscreen-active .board-video-focus-overlay,
body.video-only .board-video-focus-overlay {
  padding: clamp(30px, 4vw, 70px);
}


.board-video-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 9px;
  background: #0f172a;
}

.board-video-only-switcher {
  display: none;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.board-video-only-switcher .btn {
  min-height: 34px !important;
  padding: 7px 11px !important;
  font-size: 12px !important;
}

body.video-only[data-stage="video"] .board-video-switcher {
  display: none !important;
}

body.video-only[data-stage="video"] .board-video-only-switcher {
  display: flex !important;
}

body.video-only[data-stage="video"] .board-bottom-toolbar {
  width: min(1120px, calc(100vw - 240px)) !important;
  max-width: calc(100vw - 240px) !important;
  gap: 8px !important;
}



/* =========================================================
   VIDEO UX POLISH PATCH
   Compact toolbar, collapsible checkpoints and stronger inline QR
   ========================================================= */

.video-checkpoint-sidebar-toggle {
  display: none !important;
}

.video-checkpoint-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  margin-top: 9px;
}

.video-checkpoint-card.is-collapsed .video-checkpoint-editor-body {
  display: none !important;
}

.video-checkpoint-editor-summary {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-checkpoint-summary-time {
  min-width: 54px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #143f3a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
}

.video-checkpoint-summary-title {
  min-width: 0;
  color: #143f3a;
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-checkpoint-mini-btn {
  min-height: 30px !important;
  padding: 5px 9px !important;
  font-size: 11px !important;
}

.video-checkpoint-control-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  align-items: flex-end !important;
}

.video-checkpoint-question-row {
  margin-top: 10px !important;
}

.video-checkpoint-question-row input {
  width: 100% !important;
  min-height: 48px !important;
  font-size: 15px !important;
}

.video-checkpoint-inline-label {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}

.video-checkpoint-control-pill {
  min-height: 48px !important;
  border-radius: 18px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  font-weight: 950 !important;
}

.video-checkpoint-control-row .modal-field {
  margin-bottom: 0 !important;
}

.video-checkpoint-control-row input {
  margin-bottom: 0 !important;
}

.video-checkpoint-behaviour-inline {
  display: contents !important;
}

.video-checkpoint-behaviour-inline button {
  min-height: 48px !important;
  padding: 10px 14px !important;
  border-radius: 18px !important;
  font-size: 14px !important;
}

.video-checkpoint-time-wrap {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

.video-checkpoint-time-wrap input {
  min-height: 48px !important;
  border-radius: 18px !important;
  font-size: 15px !important;
  text-align: center !important;
}

@media (max-width: 1100px) {
  .video-checkpoint-control-row {
    grid-template-columns: 1fr 1fr !important;
  }
}

.video-checkpoint-time-wrap {
  display: grid;
  grid-template-columns: minmax(62px, 82px) auto;
  gap: 6px;
  align-items: end;
}

.video-checkpoint-time-wrap .modal-field,
.video-checkpoint-control-row .modal-field {
  margin-bottom: 0 !important;
}

.video-checkpoint-time-wrap input,
.video-checkpoint-control-row input {
  margin-bottom: 0 !important;
}

.video-checkpoint-behaviour-inline {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.video-checkpoint-behaviour-inline button {
  min-height: 42px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #143f3a;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}

.video-checkpoint-behaviour-inline button.active {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.video-checkpoint-question-row input {
  margin-bottom: 0 !important;
}

.video-checkpoint-inline-qr {
  width: min(900px, 100%);
  margin: 18px auto 0;
  padding: 14px;
  border-radius: 22px;
  background: #143f3a;
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
  position: relative;
  z-index: 5;
  border: 2px solid #5fdc9a;
}

.video-checkpoint-inline-qr.is-hidden .video-checkpoint-qr-body {
  display: none !important;
}

.video-checkpoint-inline-qr.is-hidden {
  padding: 10px 14px;
  background: rgba(20, 63, 58, 0.92);
}

.video-checkpoint-qr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.video-checkpoint-qr-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.video-checkpoint-qr-box {
  width: 148px;
  height: 148px;
  padding: 8px;
  border-radius: 16px;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.video-checkpoint-qr-box img,
.video-checkpoint-qr-box canvas,
.video-checkpoint-qr-box > div {
  width: 132px !important;
  height: 132px !important;
}

.video-checkpoint-vote-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.video-checkpoint-vote-pill {
  min-height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 950;
}

.video-checkpoint-answer-correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #166534 !important;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.18) !important;
}

body.video-only[data-stage="video"] .board-bottom-toolbar {
  width: min(1040px, calc(100vw - 80px)) !important;
  max-width: calc(100vw - 80px) !important;
  min-height: 46px !important;
  padding: 7px 10px !important;
  gap: 6px !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(229, 231, 235, 0.62) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22) !important;
}

body.video-only[data-stage="video"] .board-video-only-switcher .btn,
body.video-only[data-stage="video"] .board-bottom-toolbar > .btn {
  min-height: 32px !important;
  height: 32px !important;
  padding: 5px 9px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
}

body.video-only[data-stage="video"] .board-toolbar-label {
  min-width: 118px !important;
}

body.video-only[data-stage="video"] .board-toolbar-label span {
  font-size: 9px !important;
  max-width: 120px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.video-only[data-stage="video"] .board-toolbar-label strong {
  font-size: 12px !important;
}

body.video-only[data-stage="video"] .board-video-only-switcher {
  gap: 5px !important;
}

body.video-only[data-stage="video"] .board-video-only-switcher .btn {
  max-width: 104px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 920px) {
  .video-checkpoint-editor-summary,
  .video-checkpoint-control-row,
  .video-checkpoint-qr-body {
    grid-template-columns: 1fr;
  }

  .video-checkpoint-time-wrap {
    grid-template-columns: 1fr;
  }

  .video-checkpoint-behaviour-inline {
    flex-wrap: wrap;
  }
}


/* =========================================================
   TEACHER-FRIENDLY VIDEO CHECKPOINT BUILDER
   Removes raw checkpoint syntax from the teacher workflow
   ========================================================= */


   #settingsModal:has(.video-editor-fullscreen) {
  padding: 0 !important;
}

.modal-card.video-editor-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

/* Fix: Surgically hide video-specific toolbar controls inside .video-builder-head unless the fullscreen video editor layout is active */
.modal-card:not(.video-editor-fullscreen) .video-builder-head select,
.modal-card:not(.video-editor-fullscreen) .video-builder-head button:not(.icon-btn),
.modal-card:not(.video-editor-fullscreen) .video-builder-head .btn,
.modal-card:not(.video-editor-fullscreen) .video-builder-head span:not(.stage-label):not(.teacher-control-note),
.modal-card:not(.video-editor-fullscreen) [onclick*="saveVideoFromModal"],
.modal-card:not(.video-editor-fullscreen) .video-checkpoint-actions {
  display: none !important;
}

.modal-card.video-editor-fullscreen .modal-head {
  padding: 12px 22px !important;
}

.modal-card.video-editor-fullscreen .modal-body {
  padding: 14px 22px 18px !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.modal-card.video-editor-fullscreen .modal-foot {
  padding: 10px 22px !important;
  background: rgba(255,255,255,0.96) !important;
  backdrop-filter: blur(10px) !important;
}

.modal-card.video-editor-fullscreen .video-builder-layout {
  min-height: 0 !important;
  height: auto !important;
  display: grid !important;
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr) !important;
  gap: 20px !important;
  align-items: start !important;
}

.modal-card.video-editor-fullscreen .video-builder-preview {
  position: sticky !important;
  top: 0 !important;
  align-self: start !important;
}

.modal-card.video-editor-fullscreen .video-builder-frame iframe {
  aspect-ratio: 16 / 9 !important;
  max-height: 48vh !important;
}

.modal-card.video-editor-fullscreen .video-builder-card {
  overflow: visible !important;
}

.modal-card.video-editor-fullscreen .video-builder-main {
  min-width: 0 !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-card {
  overflow: hidden !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-editor-body {
  min-width: 0 !important;
  overflow-x: auto !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-control-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  align-items: flex-end !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-time-wrap {
  display: grid !important;
  grid-template-columns: 82px 110px !important;
  gap: 6px !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-time-wrap input {
  min-width: 0 !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-behaviour-inline {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-behaviour-inline button {
  min-width: 0 !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
}

.modal-card.video-editor-fullscreen .video-checkpoint-question-row input {
  min-width: 0 !important;
}

@media (max-width: 1100px) {
  .modal-card.video-editor-fullscreen .video-builder-layout {
    grid-template-columns: 1fr !important;
  }

  .modal-card.video-editor-fullscreen .video-builder-preview {
    position: relative !important;
    top: auto !important;
  }

  .modal-card.video-editor-fullscreen .video-checkpoint-control-row {
    grid-template-columns: 1fr !important;
  }

  .modal-card.video-editor-fullscreen .video-checkpoint-time-wrap {
    grid-template-columns: 1fr auto !important;
  }

  .modal-card.video-editor-fullscreen .video-checkpoint-behaviour-inline {
    flex-wrap: wrap !important;
  }
}

.video-builder-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.video-builder-preview {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
}

.video-builder-frame {
  overflow: hidden;
  border-radius: 22px;
  background: #000000;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.video-builder-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000000;
}

.video-builder-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 22px;
  border-radius: 22px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-weight: 900;
  text-align: center;
}

.video-builder-tip {
  padding: 12px 14px;
  border-radius: 18px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #143f3a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.video-builder-main {
  display: grid;
  gap: 14px;
}

.video-builder-compact-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.75fr) minmax(220px, 1.25fr);
  gap: 10px;
  align-items: end;
}

.video-builder-compact-row .modal-field {
  margin-bottom: 0;
}

.video-builder-compact-row input {
  margin-bottom: 0 !important;
}

@media (max-width: 760px) {
  .video-builder-compact-row {
    grid-template-columns: 1fr;
  }
}

.video-builder-card {
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.video-builder-card.soft {
  background: #f8fafc;
}

.video-builder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.video-builder-head small {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.video-builder-head strong {
  display: block;
  margin-top: 3px;
  color: #143f3a;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.6px;
}

.video-checkpoint-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.video-checkpoint-actions .btn {
  min-width: 0 !important;
  white-space: nowrap !important;
}

.video-checkpoint-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  margin-top: 10px;
}

.video-checkpoint-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.video-checkpoint-type {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1fdf6;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 11px;
  font-weight: 950;
}

.video-checkpoint-grid {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 9px;
}

.video-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.video-choice-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.video-choice-letter {
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #143f3a;
  color: #ffffff;
  font-weight: 950;
}

.video-correct-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.video-correct-btn {
  min-height: 34px;
  min-width: 42px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #143f3a;
  font-weight: 950;
  cursor: pointer;
}

.video-correct-btn.active {
  background: #143f3a;
  color: #ffffff;
  border-color: #143f3a;
}

.video-response-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.video-response-toggle button {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #143f3a;
  font-weight: 950;
  cursor: pointer;
}

.video-response-toggle button.active {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.video-builder-list-empty {
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
  font-weight: 900;
}

@media (max-width: 980px) {
  .video-builder-layout {
    grid-template-columns: 1fr;
  }

  .video-builder-preview {
    position: relative;
  }

  .video-choice-grid,
  .video-response-toggle {
    grid-template-columns: 1fr;
  }
}


    .daily-link-stage-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      white-space: nowrap;
    }

    .daily-link-quick-pin {
      width: 31px;
      height: 31px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      border: 1px solid #d9fbe8;
      background: #ffffff;
      color: #159957;
      font-size: 15px;
      font-weight: 950;
      cursor: pointer;
      line-height: 1;
    }

    .daily-link-quick-pin:hover {
      background: #f1fdf6;
      border-color: #5fdc9a;
    }

/* Hide duplicate old stage date pill on Today View, including Clean focus and Projector mode */
body[data-stage="today"] .date-card,
body.focus-mode[data-stage="today"] .date-card,
body.fullscreen-active[data-stage="today"] .date-card {
  display: none !important;
}

/* Keep the old stage header hidden on Today View in every mode */
body[data-stage="today"] .stage-top,
body.focus-mode[data-stage="today"] .stage-top,
body.fullscreen-active[data-stage="today"] .stage-top {
  display: none !important;
}

/* Make Today View use the full card area in Clean focus and Projector mode */
body.focus-mode[data-stage="today"] .stage-card,
body.fullscreen-active[data-stage="today"] .stage-card {
  grid-template-rows: 1fr !important;
  padding: 12px !important;
}

body.focus-mode[data-stage="today"] .stage-body,
body.fullscreen-active[data-stage="today"] .stage-body {
  height: 100% !important;
  overflow: hidden !important;
}


/* Demo mode must always beat the Teacher Plus lock overlay */
html.class-board-demo-mode body.trial-expired main,
html.class-board-demo-mode body.trial-expired header,
body.class-board-demo-mode.trial-expired main,
body.class-board-demo-mode.trial-expired header {
  filter: none !important;
  pointer-events: auto !important;
  user-select: auto !important;
}

html.class-board-demo-mode .trial-lock-overlay,
html.class-board-demo-mode .trial-lock-overlay.active,
body.class-board-demo-mode .trial-lock-overlay,
body.class-board-demo-mode .trial-lock-overlay.active {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.class-board-demo-banner {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: #f1fdf6;
  border: 1px solid #bbf7d0;
  box-shadow: none;
}

.class-board-demo-banner.show {
  display: inline-flex;
}

.class-board-demo-banner strong {
  display: inline;
  color: #143f3a;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.class-board-demo-banner span {
  display: none;
}

.class-board-demo-banner a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 7px 11px;
  border: 1px solid #16a34a;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    #4ade80,
    #22c55e
  );
  color: #0d2d29;
  font-size: 11.5px;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 6px 14px rgba(34, 197, 94, 0.28);
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease;
}

.class-board-demo-banner a:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow:
    0 9px 18px rgba(34, 197, 94, 0.34);
}

.class-board-demo-banner a:active {
  transform: scale(0.97);
}

@media (max-width: 900px) {
  .class-board-demo-banner strong {
    display: none;
  }

  .class-board-demo-banner {
    padding: 4px;
  }

  .class-board-demo-banner a {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 11px;
  }
}

@media (max-width: 700px) {
  .class-board-demo-banner {
    width: 100%;
    justify-content: center;
    order: 99;
  }

  .class-board-demo-banner a {
    width: 100%;
  }
}

/* =========================================================
   MOBILE DEMO PREVIEW FIX
   Makes the Facebook demo readable after "Continue on mobile"
   without changing the desktop/projector layout.
   ========================================================= */

@media (max-width: 700px) {
  html,
  body {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.class-board-demo-mode {
    overflow-y: auto !important;
  }

  header {
    position: sticky !important;
    top: 0 !important;
    height: auto !important;
    padding: 12px 14px !important;
    z-index: 80 !important;
  }

  .top-nav,
  .brand-row,
  .class-select-wrap,
  .nav-actions {
    width: 100% !important;
  }

  .top-nav {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .brand-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .logo {
    justify-content: flex-start !important;
  }

  .class-select-wrap {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .class-select-wrap label {
    align-self: center !important;
  }

  .class-select {
    width: 100% !important;
    max-width: none !important;
  }

  .attendance-header-btn {
    display: none !important;
  }

  .nav-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .nav-actions > .btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 9px 10px !important;
    font-size: 13px !important;
  }

  .nav-actions .class-board-demo-banner {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    justify-content: center !important;
    order: 20 !important;
  }

  .nav-actions .class-board-demo-banner a {
    width: 100% !important;
    min-height: 42px !important;
    font-size: 14px !important;
  }

  main {
    height: auto !important;
    min-height: auto !important;
    padding: 10px 12px 28px !important;
    overflow: visible !important;
  }

  .board-shell {
    display: block !important;
    height: auto !important;
    min-height: auto !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .left-rail,
  .right-rail {
    display: none !important;
  }

  .centre-board {
    display: block !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .stage-card {
    height: auto !important;
    min-height: auto !important;
    display: block !important;
    padding: 10px !important;
    border-radius: 22px !important;
    overflow: visible !important;
  }

  .stage-body {
    height: auto !important;
    min-height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  body[data-stage="today"] .stage-card,
  body[data-stage="today"] .stage-body,
  body[data-stage="today"] .today-view-shell {
    height: auto !important;
    min-height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  body[data-stage="today"] .today-view-top {
    display: block !important;
    padding: 16px !important;
    text-align: center !important;
    border-radius: 22px !important;
    margin-bottom: 12px !important;
  }

  body[data-stage="today"] .today-greeting-row {
    display: grid !important;
    justify-items: center !important;
    gap: 10px !important;
  }

  body[data-stage="today"] .today-sun {
    width: 54px !important;
    height: 54px !important;
    font-size: 28px !important;
  }

  body[data-stage="today"] .today-greeting {
    font-size: 30px !important;
    line-height: 1.05 !important;
  }

  body[data-stage="today"] .today-date-line {
    font-size: 14px !important;
    margin-top: 8px !important;
  }

  body[data-stage="today"] .today-view-grid,
  body[data-stage="today"] .today-bottom-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  body[data-stage="today"] .today-card,
  body[data-stage="today"] .today-links-section,
  body[data-stage="today"] .today-absent-section {
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 16px !important;
    border-radius: 22px !important;
  }

  body[data-stage="today"] .today-next-title {
    font-size: 28px !important;
    line-height: 1.08 !important;
  }

  body[data-stage="today"] .today-next-text {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  body[data-stage="today"] .today-reminders-list {
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-stage="today"] .today-reminder-row {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    align-items: start !important;
  }

  body[data-stage="today"] .today-reminder-row > div:last-child {
    grid-column: 1 / -1 !important;
    justify-content: flex-start !important;
  }

  body[data-stage="today"] .today-pinned-links-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-stage="today"] .today-pinned-link {
    min-height: 64px !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
  }

  body[data-stage="today"] .today-absent-summary {
    grid-template-columns: 48px minmax(0, 1fr) !important;
  }

  .quick-strip {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 12px 2px 4px !important;
    scrollbar-width: none !important;
  }

  .quick-strip::-webkit-scrollbar {
    display: none !important;
  }

  .quick-launch {
    flex: 0 0 96px !important;
    min-width: 96px !important;
    min-height: 76px !important;
  }
}


    .live-activities-button {
      min-height: 44px !important;
      padding: 7px 12px !important;
      display: inline-flex !important;
      align-items: center !important;
      gap: 9px !important;
      border-radius: 999px !important;
      background: linear-gradient(135deg, #ef4444, #dc2626) !important;
      color: #ffffff !important;
      border: 1px solid #fecaca !important;
      box-shadow: 0 8px 22px rgba(220, 38, 38, 0.24) !important;
    }

    .live-activities-button:hover {
      background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
      border-color: #fca5a5 !important;
      transform: translateY(-1px);
    }

    .live-activities-icon {
      width: 28px !important;
      height: 28px !important;
      display: grid !important;
      place-items: center !important;
      border-radius: 999px !important;
      background: rgba(255, 255, 255, 0.18) !important;
      color: #ffffff !important;
      font-size: 15px !important;
      flex-shrink: 0 !important;
    }

    .live-activities-copy {
      display: grid !important;
      gap: 1px !important;
      line-height: 1.05 !important;
    }

    .live-activities-copy small {
      color: rgba(255, 255, 255, 0.82) !important;
      font-size: 9px !important;
      font-weight: 950 !important;
      letter-spacing: 0.55px !important;
      text-transform: uppercase !important;
      white-space: nowrap !important;
    }

    .live-activities-copy strong {
      color: #ffffff !important;
      font-size: 13px !important;
      font-weight: 950 !important;
      line-height: 1.05 !important;
      white-space: nowrap !important;
    }

    .live-activities-status {
      min-height: 22px !important;
      padding: 3px 8px !important;
      border-radius: 999px !important;
      background: #22c55e !important;
      border: 1px solid rgba(255, 255, 255, 0.45) !important;
      color: #ffffff !important;
      font-size: 9px !important;
      font-weight: 950 !important;
      letter-spacing: 0.35px !important;
      display: inline-flex !important;
      align-items: center !important;
      gap: 4px !important;
      white-space: nowrap !important;
    }

    .live-activities-dot {
      width: 6px !important;
      height: 6px !important;
      border-radius: 999px !important;
      background: #ffffff !important;
    }


        .ready-screen-decor {
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      overflow: hidden;
    }

    .ready-screen-decor span {
      position: absolute;
      display: grid;
      place-items: center;
      width: clamp(78px, 8vw, 150px);
      height: clamp(78px, 8vw, 150px);
      border-radius: 999px;
      font-size: clamp(48px, 5vw, 96px);
      background: rgba(255, 255, 255, 0.20);
      border: 1px solid rgba(255, 255, 255, 0.28);
      box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
      opacity: 0.92;
      transform: rotate(var(--decor-rotate, -8deg));
      backdrop-filter: blur(3px);
    }

    .ready-screen-decor span:nth-child(1) {
      top: 5%;
      left: 5%;
      --decor-rotate: -10deg;
    }

    .ready-screen-decor span:nth-child(2) {
      top: 8%;
      right: 6%;
      --decor-rotate: 9deg;
    }

    .ready-screen-decor span:nth-child(3) {
      bottom: 8%;
      left: 8%;
      --decor-rotate: 8deg;
    }

    .ready-screen-decor span:nth-child(4) {
      bottom: 7%;
      right: 8%;
      --decor-rotate: -7deg;
    }

    .ready-screen-display.screen-christmas .ready-screen-decor span,
    .ready-screen-display.screen-winter .ready-screen-decor span,
    .ready-screen-display.screen-summer .ready-screen-decor span,
    .ready-screen-display.screen-celebrate .ready-screen-decor span {
      opacity: 0.96;
      background: rgba(255, 255, 255, 0.24);
    }

    .ready-screen-display.screen-exam .ready-screen-decor,
    .ready-screen-display.screen-focus .ready-screen-decor {
      display: none;
    }


        @media (max-width: 980px) {
      .ready-screen-toolbar {
        grid-template-columns: 1fr auto;
      }

      .ready-screen-toolbar-pins {
        grid-column: 1 / -1;
        order: 3;
        justify-content: flex-start;
        overflow: visible;
        flex-wrap: wrap;
      }

      .ready-screen-toolbar-pin {
        max-width: none;
      }
    }

    @media (max-width: 620px) {
      .ready-screen-toolbar {
        grid-template-columns: 1fr;
      }

      .ready-screen-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
      }

      .ready-screen-toolbar-pin {
        min-width: 100%;
      }
    }


        .ready-screen-display.screen-expectations {
      background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.62), transparent 17%),
        radial-gradient(circle at 82% 74%, rgba(255, 255, 255, 0.36), transparent 19%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 12px, transparent 12px 30px),
        linear-gradient(135deg, #fef3c7, #bbf7d0 48%, #93c5fd);
      color: #143f3a;
    }

    .ready-screen-expectations-wrap {
      width: min(100%, 1180px);
      gap: clamp(18px, 2vw, 28px);
    }

    .ready-screen-expectations-headline {
      font-size: clamp(46px, 6.2vw, 112px);
      letter-spacing: -3px;
    }

    .ready-screen-expectations-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: clamp(10px, 1.2vw, 18px);
      align-items: stretch;
    }

    .ready-screen-expectation-card {
      min-height: clamp(150px, 15vw, 220px);
      display: grid;
      grid-template-rows: auto 1fr;
      gap: 10px;
      align-content: start;
      padding: clamp(14px, 1.4vw, 22px);
      border-radius: 28px;
      background: rgba(255, 255, 255, 0.72);
      border: 2px solid rgba(255, 255, 255, 0.68);
      box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13);
      backdrop-filter: blur(6px);
      text-align: center;
    }

    .ready-screen-expectation-icon {
      width: clamp(56px, 5vw, 82px);
      height: clamp(56px, 5vw, 82px);
      display: grid;
      place-items: center;
      justify-self: center;
      border-radius: 999px;
      background: #ffffff;
      font-size: clamp(34px, 3vw, 54px);
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
    }

    .ready-screen-expectation-card strong {
      display: block;
      color: #143f3a;
      font-size: clamp(19px, 1.8vw, 32px);
      line-height: 1.02;
      font-weight: 950;
      margin-bottom: 8px;
      -webkit-text-stroke: 0.6px rgba(15, 23, 42, 0.22);
      paint-order: stroke fill;
    }

    .ready-screen-expectation-card span {
      display: block;
      color: #374151;
      font-size: clamp(15px, 1.25vw, 22px);
      line-height: 1.18;
      font-weight: 900;
    }

    @media (max-width: 1100px) {
      .ready-screen-expectations-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (max-width: 720px) {
      .ready-screen-expectations-grid {
        grid-template-columns: 1fr;
      }
    }


        .ready-screen-toolbar-pin.active {
      border-color: #143f3a;
      background: #143f3a;
      color: #ffffff;
      box-shadow: 0 8px 18px rgba(20, 63, 58, 0.18);
      transform: none;
      cursor: default;
    }

    .ready-screen-toolbar-pin.active span {
      background: rgba(255, 255, 255, 0.18);
    }

    .ready-screen-toolbar-pin.active strong {
      color: #ffffff;
    }

    

        /* Classroom Screens only: true Clean focus.
       This affects only body.focus-mode[data-stage="readyScreen"].
       It does not change Clean focus for Timer, Spinner, Video, Notes, Groups or other tools. */

    body.focus-mode[data-stage="readyScreen"] header,
    body.focus-mode[data-stage="readyScreen"] .top-line,
    body.focus-mode[data-stage="readyScreen"] .stage-top,
    body.focus-mode[data-stage="readyScreen"] .quick-strip,
    body.focus-mode[data-stage="readyScreen"] .ready-screen-toolbar {
      display: none !important;
    }

    body.focus-mode[data-stage="readyScreen"] main {
      height: 100vh !important;
      padding: 0 !important;
      background: #000000 !important;
    }

    body.focus-mode[data-stage="readyScreen"] .board-shell {
      height: 100vh !important;
      grid-template-columns: 1fr !important;
      gap: 0 !important;
    }

    body.focus-mode[data-stage="readyScreen"] .left-rail,
    body.focus-mode[data-stage="readyScreen"] .right-rail {
      display: none !important;
    }

    body.focus-mode[data-stage="readyScreen"] .centre-board {
      height: 100vh !important;
      display: block !important;
    }

    body.focus-mode[data-stage="readyScreen"] .stage-card {
      height: 100vh !important;
      padding: 0 !important;
      border: none !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      background: #000000 !important;
      display: block !important;
    }

    body.focus-mode[data-stage="readyScreen"] .stage-body {
      height: 100vh !important;
      overflow: hidden !important;
    }

    body.focus-mode[data-stage="readyScreen"] .ready-screen-stage {
      height: 100vh !important;
      display: block !important;
      overflow: hidden !important;
    }

    body.focus-mode[data-stage="readyScreen"] .ready-screen-display {
      width: 100vw !important;
      height: 100vh !important;
      min-height: 100vh !important;
      border-radius: 0 !important;
      border: none !important;
      box-shadow: none !important;
    }


        /* =========================================================
       TEACHER VIEW TOUR + WELCOME
       Optional walkthrough. No section colour changes.
       ========================================================= */

    .teacher-tour-shade {
      position: fixed;
      inset: 0;
      z-index: 5000;
      background: rgba(15, 23, 42, 0.46);
      pointer-events: auto;
    }

    .teacher-tour-spotlight {
      position: fixed;
      z-index: 5002;
      border-radius: 20px;
      border: 4px solid rgba(95, 220, 154, 0.98);
      box-shadow:
        0 0 0 9999px rgba(15, 23, 42, 0.42),
        0 18px 44px rgba(15, 23, 42, 0.28);
      pointer-events: none;
      transition: all 0.18s ease;
    }

    .teacher-tour-card {
  position: fixed;
  z-index: 5003;
  width: min(500px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 26px;
  background: #ffffff;
  border: 2px solid #d7e5df;
  box-shadow: 0 28px 76px rgba(15, 23, 42, 0.34);
  color: #111827;
}

.teacher-tour-kicker {
  color: #159957;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 8px;
}

.teacher-tour-title {
  margin: 0 0 10px;
  color: #143f3a;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: -0.6px;
}

.teacher-tour-text {
  color: #475569;
  font-size: 18px;
  line-height: 1.48;
  font-weight: 800;
  margin: 0 0 18px;
}

.teacher-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.teacher-tour-action-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.teacher-tour-progress {
  color: #64748b;
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}

.teacher-tour-close {
  min-height: 42px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 15px;
  font-weight: 950;
  cursor: pointer;
  padding: 10px 13px;
  border-radius: 999px;
}

.teacher-tour-action-group .btn {
  min-height: 44px;
  padding: 10px 17px;
  font-size: 15px;
}


body.homepage-demo-tour-running .teacher-tour-card {
  width: min(540px, calc(100vw - 32px));
  padding: 26px;
}

body.homepage-demo-tour-running .teacher-tour-kicker {
  font-size: 15px;
}

body.homepage-demo-tour-running .teacher-tour-title {
  font-size: 30px;
}

body.homepage-demo-tour-running .teacher-tour-text {
  font-size: 19px;
  line-height: 1.5;
}

body.homepage-demo-tour-running .teacher-tour-progress,
body.homepage-demo-tour-running .teacher-tour-close,
body.homepage-demo-tour-running .teacher-tour-action-group .btn {
  font-size: 16px;
}

    .teacher-tour-close:hover {
      background: #f1f5f9;
      color: #111827;
    }

    .teacher-welcome-card {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 5004;

      width: min(720px, calc(100vw - 32px));
      max-height: calc(100vh - 32px);
      overflow-y: auto;

      padding: 28px;
      border: 1px solid #d9e2e8;
      border-radius: 28px;
      background: #ffffff;
      color: #111827;

      box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.30);
    }

    .teacher-welcome-icon {
      width: 58px;
      height: 58px;
      display: grid;
      place-items: center;
      margin-bottom: 16px;
      border-radius: 19px;
      background: #eefbf4;
      font-size: 31px;
    }

    .teacher-welcome-card h2 {
      margin: 0 0 10px;
      color: #143f3a;
      font-size: clamp(28px, 3vw, 38px);
      line-height: 1.05;
      font-weight: 950;
      letter-spacing: -1px;
    }

    .teacher-welcome-card p {
      max-width: 650px;
      margin: 0 0 22px;
      color: #526176;
      font-size: 16px;
      line-height: 1.5;
      font-weight: 750;
    }

    .teacher-welcome-list {
      display: grid;
      gap: 8px;
      margin: 0 0 22px;
      padding: 10px;
      border: 1px solid #d9fbe8;
      border-radius: 20px;
      background: #f7fdf9;
      list-style: none;
    }

    .teacher-welcome-list li {
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr);
      gap: 12px;
      align-items: center;
      min-height: 52px;
      padding: 7px 10px;
      color: #172033;
      font-size: 15px;
      line-height: 1.3;
      font-weight: 900;
    }

    .teacher-welcome-list span {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: #dff7eb;
      color: #143f3a;
      font-size: 14px;
      font-weight: 950;
    }

    .teacher-welcome-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }

    .teacher-welcome-actions .btn {
      min-height: 46px;
      padding: 11px 20px;
      font-size: 14px;
    }

    .teacher-welcome-actions .btn-primary {
      min-width: 174px;
    }

    @media (max-width: 600px) {
      .teacher-welcome-card {
        width: calc(100vw - 20px);
        padding: 20px;
        border-radius: 22px;
      }

      .teacher-welcome-card h2 {
        font-size: 28px;
      }

      .teacher-welcome-card p {
        font-size: 14px;
      }

      .teacher-welcome-actions {
        display: grid;
        grid-template-columns: 1fr;
      }

      .teacher-welcome-actions .btn {
        width: 100%;
      }
    }

    .class-board-feedback-offer {
      margin-top: 16px;
      padding: 13px 14px;
      border: 1px solid #fde68a;
      border-radius: 17px;
      background: #fffbeb;
      color: #78350f;
    }

    .class-board-feedback-offer-title {
      display: block;
      margin-bottom: 4px;
      color: #92400e;
      font-size: 14px;
      line-height: 1.2;
      font-weight: 950;
    }

    .class-board-feedback-offer-text {
      display: block;
      color: #a16207;
      font-size: 11.5px;
      line-height: 1.35;
      font-weight: 800;
    }

    .class-board-feedback-offer-button {
      width: 100%;
      min-height: 38px;
      margin-top: 10px;
      border: 1px solid #fbbf24;
      border-radius: 999px;
      background: #ffffff;
      color: #92400e;
      font-size: 12px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
    }

    .class-board-feedback-offer-button:hover {
      border-color: #f59e0b;
      background: #fef3c7;
    }

    .class-board-feedback-modal-card {
      width: min(620px, calc(100vw - 24px));
      max-height: min(760px, calc(100vh - 28px));
      display: flex;
      flex-direction: column;
      border-radius: 24px;
      background: #ffffff;
      box-shadow:
        0 28px 80px
        rgba(15, 23, 42, 0.28);
      overflow: hidden;
    }

    .class-board-feedback-modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      padding: 20px 22px 16px;
      border-bottom: 1px solid #e5e7eb;
    }

    .class-board-feedback-modal-head h2 {
      margin: 0 0 5px;
      color: #143f3a;
      font-size: 22px;
      line-height: 1.1;
      font-weight: 950;
      letter-spacing: -0.45px;
    }

    .class-board-feedback-modal-head p {
      margin: 0;
      color: #64748b;
      font-size: 12.5px;
      line-height: 1.45;
      font-weight: 800;
    }

    .class-board-feedback-modal-close {
      width: 34px;
      height: 34px;
      min-width: 34px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      background: #ffffff;
      color: #64748b;
      font-size: 20px;
      line-height: 1;
      font-weight: 900;
      cursor: pointer;
    }

    .class-board-feedback-modal-body {
      min-height: 0;
      display: grid;
      gap: 16px;
      padding: 18px 22px 22px;
      overflow-y: auto;
    }

    .class-board-feedback-field {
      display: grid;
      gap: 7px;
    }

    .class-board-feedback-field > label,
    .class-board-feedback-field > strong {
      color: #143f3a;
      font-size: 12px;
      line-height: 1.2;
      font-weight: 950;
    }

    .class-board-feedback-field small {
      color: #64748b;
      font-size: 10.5px;
      line-height: 1.35;
      font-weight: 800;
    }

    .class-board-feedback-options {
      display: grid;
      grid-template-columns:
        repeat(
          2,
          minmax(0, 1fr)
        );
      gap: 8px;
    }

    .class-board-feedback-option {
      min-height: 42px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px 10px;
      border: 1px solid #e5e7eb;
      border-radius: 13px;
      background: #f8fafc;
      color: #334155;
      font-size: 11.5px;
      line-height: 1.25;
      font-weight: 850;
      cursor: pointer;
    }

    .class-board-feedback-option input {
      width: 17px;
      height: 17px;
      flex: 0 0 auto;
      accent-color: #22c55e;
    }

    .class-board-feedback-textarea,
    .class-board-feedback-select,
    .class-board-feedback-input {
      width: 100%;
      margin: 0;
      border: 1px solid #d1d5db;
      border-radius: 13px;
      background: #ffffff;
      color: #111827;
      font-size: 13px;
      line-height: 1.4;
      font-weight: 750;
      outline: none;
    }



    @media (max-width: 760px) {
      .class-board-feedback-options {
        grid-template-columns: 1fr;
      }

      .class-board-feedback-modal-head,
      .class-board-feedback-modal-body {
        padding-left: 16px;
        padding-right: 16px;
      }

      .teacher-tour-card {
        left: 14px !important;
        right: 14px !important;
        top: auto !important;
        bottom: 14px !important;
        width: auto !important;
      }
    }


    .today-help-btn {
      width: 34px;
      height: 34px;
      min-width: 34px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      border: 1px solid #d9fbe8;
      background: #f1fdf6;
      color: #143f3a;
      font-size: 16px;
      font-weight: 950;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
    }

    .today-help-btn:hover {
      background: #dcfce7;
      border-color: #86efac;
      transform: translateY(-1px);
    }

    .teacher-welcome-checkbox {
      display: flex;
      align-items: center;
      gap: 9px;
      margin: 0 0 16px;
      padding: 10px 12px;
      border-radius: 16px;
      background: #f8fafc;
      border: 1px solid #e5e7eb;
      color: #475569;
      font-size: 13px;
      font-weight: 850;
      line-height: 1.25;
      cursor: pointer;
    }

    .teacher-welcome-checkbox input {
      width: 17px;
      height: 17px;
      accent-color: #22c55e;
      cursor: pointer;
    }


    .student-name-privacy-control {
      display: grid;
      gap: 6px;
      margin: 0 0 14px;
      padding: 12px;
      border: 1px solid #bbf7d0;
      border-radius: 16px;
      background: #f1fdf6;
    }

    .student-name-privacy-control label {
      color: #143f3a;
      font-size: 12px;
      line-height: 1.1;
      font-weight: 950;
    }

    .student-name-privacy-control select {
      width: 100%;
      min-height: 40px;
      margin: 0;
      padding: 8px 34px 8px 11px;
      border: 1px solid #86efac;
      border-radius: 12px;
      background: #ffffff;
      color: #143f3a;
      font-size: 13px;
      line-height: 1;
      font-weight: 900;
      outline: none;
      cursor: pointer;
    }

    .student-name-privacy-control select:hover,
    .student-name-privacy-control select:focus {
      border-color: #22c55e;
      box-shadow:
        0 0 0 3px
        rgba(34, 197, 94, 0.12);
    }

    .student-name-privacy-control small {
      color: #64748b;
      font-size: 10.5px;
      line-height: 1.3;
      font-weight: 800;
    }

    .board-menu-privacy-summary {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .board-menu-privacy-current {
      color: #64748b;
      font-size: 10px;
      line-height: 1.2;
      font-weight: 850;
    }


        .board-menu-help-btn {
      width: 26px;
      height: 26px;
      min-width: 26px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      border: 1px solid #d9fbe8;
      background: #f1fdf6;
      color: #143f3a;
      font-size: 13px;
      font-weight: 950;
      cursor: pointer;
    }

    .board-menu-help-btn:hover {
      background: #dcfce7;
      border-color: #86efac;
      transform: translateY(-1px);
    }


        .context-help-btn {
      border-color: #d9fbe8 !important;
      background: #f1fdf6 !important;
      color: #143f3a !important;
    }

    body[data-stage="today"] #contextHelpBtn {
      display: none !important;
    }

        .video-action-label-btn {
      gap: 5px !important;
      font-size: 12px !important;
      white-space: nowrap !important;
    }

    .video-action-label-btn span {
      font-size: 13px !important;
      line-height: 1 !important;
    }

    .video-action-label-btn small {
      font-size: 10.5px !important;
      font-weight: 950 !important;
      line-height: 1 !important;
      letter-spacing: -0.1px !important;
    }


        .today-section-label {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 23px;
      padding: 4px 9px;
      border-radius: 999px;
      font-size: 10.5px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0.15px;
      white-space: nowrap;
      border: 1px solid transparent;
    }

    .today-section-label.lesson {
      background: #dcfce7;
      color: #166534;
      border-color: #bbf7d0;
    }

    .today-section-label.reminders {
      background: #fef3c7;
      color: #92400e;
      border-color: #fde68a;
    }

    .today-section-label.screens {
      background: #dbeafe;
      color: #1e40af;
      border-color: #bfdbfe;
    }

    .today-section-label.links {
      background: #ede9fe;
      color: #5b21b6;
      border-color: #ddd6fe;
    }

    .today-section-label.absent {
      background: #ffe4e6;
      color: #9f1239;
      border-color: #fecdd3;
    }

    /* =========================================================
       DISTRACTION-FREE QR SHARER PRESENTATION ENGINE (MAX QR SIZE)
       ========================================================= */
    /* Collapse the left management list when Projector or Clean focus are active */
    /*
  Student QR Links in Clean Focus and Projector mode.

  Only hide the link-management area after a QR link has
  actually been selected. When no links exist, keep the
  management screen visible instead of showing a blank page.
*/

body.focus-mode[data-stage="qrLinks"]
  .qr-links-layout.is-live,
body.fullscreen-active[data-stage="qrLinks"]
  .qr-links-layout.is-live {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
}

body.focus-mode[data-stage="qrLinks"]
  .qr-links-layout.is-live
  .participation-main,
body.fullscreen-active[data-stage="qrLinks"]
  .qr-links-layout.is-live
  .participation-main {
  display: none !important;
}

/*
  No QR link selected yet:
  show the link creator and saved-links list normally.
*/

body.focus-mode[data-stage="qrLinks"]
  .qr-links-layout:not(.is-live),
body.fullscreen-active[data-stage="qrLinks"]
  .qr-links-layout:not(.is-live) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  height: 100% !important;
}

body.focus-mode[data-stage="qrLinks"]
  .qr-links-layout:not(.is-live)
  .participation-main,
body.fullscreen-active[data-stage="qrLinks"]
  .qr-links-layout:not(.is-live)
  .participation-main {
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
}

    body.focus-mode[data-stage="qrLinks"] .participation-join-column,
    body.fullscreen-active[data-stage="qrLinks"] .participation-join-column {
      width: 100% !important;
      height: 100% !important;
      max-width: none !important;
      margin: 0 auto !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    /* Target the green display template frame directly */
    body.focus-mode[data-stage="qrLinks"] .shared-live-join-panel,
    body.fullscreen-active[data-stage="qrLinks"] .shared-live-join-panel {
      display: grid !important;
      grid-template-columns: 1.1fr 1fr !important;
      grid-template-rows: auto 1fr !important;
      align-items: center !important;
      gap: 32px !important;
      padding: clamp(24px, 4vw, 48px) !important;
      width: 100% !important;
      max-width: 1140px !important;
      height: 100% !important;
      max-height: min(520px, 80vh) !important;
      border-radius: 36px !important;
    }

    /* Fix: Select the white container by structural index path to bypass inline string mismatches */
    body.focus-mode[data-stage="qrLinks"] .shared-live-join-panel > div:nth-child(2),
    body.fullscreen-active[data-stage="qrLinks"] .shared-live-join-panel > div:nth-child(2) {
      grid-column: 2 !important;
      grid-row: 2 !important;
      justify-self: center !important;
      align-self: center !important;
      /* Maximize the display scale footprint of the frame cushion envelope */
      width: min(380px, 46vh) !important;
      height: min(380px, 46vh) !important;
      border-radius: 28px !important;
      padding: 20px !important;
    }

    /* Fix: Force the dynamic generated QR image element to scale and fill 100% of its new boundaries */
    body.focus-mode[data-stage="qrLinks"] #projectorShareLiveQrCode,
    body.fullscreen-active[data-stage="qrLinks"] #projectorShareLiveQrCode,
    body.focus-mode[data-stage="qrLinks"] #projectorShareLiveQrCode img,
    body.fullscreen-active[data-stage="qrLinks"] #projectorShareLiveQrCode img {
      width: 100% !important;
      height: 100% !important;
      max-width: 100% !important;
      max-height: 100% !important;
      display: block !important;
    }

    /* Position title and instruction text block safely in Left Column track */
    body.focus-mode[data-stage="qrLinks"] .shared-live-join-panel > div:last-child,
    body.fullscreen-active[data-stage="qrLinks"] .shared-live-join-panel > div:last-child {
      grid-column: 1 !important;
      grid-row: 2 !important;
      text-align: left !important;
      align-self: center !important;
    }

    /* Position "Scan With Device Camera" banner text at the top */
    body.focus-mode[data-stage="qrLinks"] .shared-live-join-panel > div:first-child,
    body.fullscreen-active[data-stage="qrLinks"] .shared-live-join-panel > div:first-child {
      grid-column: 1 / -1 !important;
      grid-row: 1 !important;
      text-align: center !important;
      font-size: clamp(13px, 1.2vw, 16px) !important;
      margin-bottom: 0 !important;
    }

    /* Left Column typography variable scales */
    body.focus-mode[data-stage="qrLinks"] .shared-live-join-panel div[style*="font-size:20px"],
    body.fullscreen-active[data-stage="qrLinks"] .shared-live-join-panel div[style*="font-size:20px"] {
      font-size: clamp(38px, 4vw, 64px) !important;
      font-weight: 950 !important;
      line-height: 1.1 !important;
      margin-top: 0 !important;
    }

    body.focus-mode[data-stage="qrLinks"] .shared-live-join-panel p[style*="margin:8px"],
    body.fullscreen-active[data-stage="qrLinks"] .shared-live-join-panel p[style*="margin:8px"] {
      font-size: clamp(17px, 1.5vw, 23px) !important;
      color: #cbd5e1 !important;
      margin-top: 14px !important;
      line-height: 1.4 !important;
    }



/* Whiteboard Split-Panel Architecture Drawer Engine */
.whiteboard-left-action-panel {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 15;

  display: grid;
  gap: 7px;

  margin: 0;
  padding: 7px;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;

  background: rgba(17, 24, 39, 0.92);

  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.18);

  backdrop-filter: blur(12px);
  transform: translateY(-50%);
}

.whiteboard-left-action-panel >
summary::-webkit-details-marker {
  display: none;
}

.whiteboard-left-action-toggle {
  width: 38px;
  height: 38px;

  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 1px;

  padding: 0 4px 0 6px;
  list-style: none;

  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;

  cursor: pointer;
}

.whiteboard-left-action-toggle:hover {
  border-color: #5fdc9a;
  background: rgba(95, 220, 154, 0.14);
}

.whiteboard-left-action-toggle-icon {
  font-size: 14px;
  line-height: 1;
}

.whiteboard-left-action-toggle-arrow {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
  transition: transform 0.16s ease;
}

.whiteboard-left-action-panel:not([open])
.whiteboard-left-action-toggle {
  grid-template-columns: 1fr;
  padding: 0;
}

.whiteboard-left-action-panel:not([open])
.whiteboard-left-action-toggle-arrow {
  display: none;
}

.whiteboard-left-action-content {
  display: grid;
  gap: 7px;
}

.whiteboard-left-action-panel:not([open])
.whiteboard-left-action-content {
  display: none;
}

.whiteboard-left-action-divider {
  width: 100%;
  height: 1px;
  margin: 2px 0;
  background: rgba(255, 255, 255, 0.12);
}

/* Safety Isolation Filter for Destructive and Global Commands */
.whiteboard-safety-isolated-clear {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 15;
}

.whiteboard-safety-isolated-clear .class-board-whiteboard-pill {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.whiteboard-safety-isolated-clear .class-board-whiteboard-pill:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

/* Adjust tracking offset metrics for focus-projection setups */
body.focus-mode .whiteboard-left-action-panel,
body.fullscreen-active .whiteboard-left-action-panel {
  left: 20px;
}

/* Presentation-Only Extended Action Items */
.whiteboard-mode-only-btn {
  display: none !important;
}

body.focus-mode .whiteboard-mode-only-btn,
body.fullscreen-active .whiteboard-mode-only-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background 0.15s ease, transform 0.1s ease;
}

body.focus-mode .whiteboard-mode-only-btn:active,
body.fullscreen-active .whiteboard-mode-only-btn:active {
  transform: scale(0.95);
}

body.focus-mode .whiteboard-mode-only-btn.clear-btn,
body.fullscreen-active .whiteboard-mode-only-btn.clear-btn {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}

body.focus-mode .whiteboard-mode-only-btn.clear-btn:hover,
body.fullscreen-active .whiteboard-mode-only-btn.clear-btn:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

body.focus-mode .whiteboard-mode-only-btn.save-btn,
body.fullscreen-active .whiteboard-mode-only-btn.save-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
}

body.focus-mode .whiteboard-mode-only-btn.save-btn:hover,
body.fullscreen-active .whiteboard-mode-only-btn.save-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}


/* =========================================================
   REFINED CLASS BOARD LOADING SCREEN
   ========================================================= */

.board-boot-card {
  width: min(470px, 92vw);
  padding: 28px 38px 30px;
}

.board-boot-logo {
  margin-bottom: 10px;
  font-size: 21px;
}

.board-boot-eyebrow {
  position: relative;

  z-index: 2;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  min-height: 32px;

  margin-bottom: 12px;

  padding:
    6px
    13px;

  overflow: hidden;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.30
    );

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #eef2ff 0%,
      #f5f3ff 42%,
      #ecfeff 100%
    );

  color:
    #4338ca;

  font-size:
    10px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    1.15px;

  text-transform:
    uppercase;

  box-shadow:
    0 5px 16px
    rgba(
      79,
      70,
      229,
      0.12
    );
}


.board-boot-eyebrow::before {
  content: "";

  position: absolute;

  width:
    45px;

  height:
    70px;

  top:
    -20px;

  left:
    -60px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(
        255,
        255,
        255,
        0.90
      ),
      transparent
    );

  transform:
    rotate(18deg);

  animation:
    boardBootAiBadgeShimmer
    4s
    ease-in-out
    infinite;
}


.board-boot-ai-eyebrow-mark {
  position: relative;

  z-index: 2;

  display: inline-grid;

  width: 20px;
  height: 20px;

  place-items: center;

  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      #4f46e5,
      #7c3aed,
      #0891b2
    );

  color:
    #ffffff;

  font-size:
    12px;

  box-shadow:
    0 3px 10px
    rgba(
      79,
      70,
      229,
      0.28
    );
}


.board-boot-ai-eyebrow-live {
  position: relative;

  z-index: 2;

  padding:
    3px
    6px;

  border-radius:
    999px;

  background:
    #4338ca;

  color:
    #ffffff;

  font-size:
    8px;

  letter-spacing:
    0.6px;
}


@keyframes boardBootAiBadgeShimmer {
  0%,
  68% {
    left:
      -60px;
  }

  100% {
    left:
      calc(
        100% + 25px
      );
  }
}

.board-boot-ms-green-wrap {
  position: relative;
  width: 210px;
  height: 200px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.board-boot-character-halo {
  position: absolute;
  z-index: -2;

  width: 190px;
  height: 190px;

  border-radius: 999px;

  background:
    radial-gradient(
      circle,
      rgba(
        99,
        102,
        241,
        0.18
      ),
      rgba(
        34,
        211,
        238,
        0.10
      ) 48%,
      rgba(
        95,
        220,
        154,
        0.05
      ) 64%,
      transparent 74%
    );
}


/*
 * Large AI orb.
 * This deliberately sits behind and beside the
 * teacher character so AI becomes a visual hero.
 */
.board-boot-ai-orb {
  position: absolute;

  z-index: -1;

  top: 16px;
  right: -24px;

  width: 108px;
  height: 108px;

  display: grid;
  place-items: center;

  border-radius: 999px;

  background:
    radial-gradient(
      circle at 36% 30%,
      rgba(
        255,
        255,
        255,
        0.98
      ) 0%,
      rgba(
        238,
        242,
        255,
        0.98
      ) 37%,
      rgba(
        224,
        231,
        255,
        0.94
      ) 100%
    );

  box-shadow:
    0 12px 32px
    rgba(
      79,
      70,
      229,
      0.24
    ),
    0 0 48px
    rgba(
      34,
      211,
      238,
      0.18
    ),
    0 0 0 7px
    rgba(
      99,
      102,
      241,
      0.06
    );

  animation:
    boardBootAiOrbFloat
    3.2s
    ease-in-out
    infinite;
}


.board-boot-ai-orb::before {
  content: "";

  position: absolute;

  inset: -4px;

  z-index: -1;

  border-radius: inherit;

  background:
    conic-gradient(
      from 0deg,
      #22d3ee,
      #6366f1,
      #8b5cf6,
      #ec4899,
      #6366f1,
      #22d3ee
    );

  animation:
    boardBootAiOrbRotate
    7s
    linear
    infinite;
}


.board-boot-ai-orb::after {
  content: "";

  position: absolute;

  inset: 4px;

  z-index: -1;

  border-radius: inherit;

  background:
    #f8faff;
}


.board-boot-ai-orb-ring {
  position: absolute;

  inset: -11px;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.24
    );

  border-radius:
    999px;

  animation:
    boardBootAiRing
    2.8s
    ease-out
    infinite;
}


.board-boot-ai-orb-ring:nth-child(2) {
  inset: -20px;

  animation-delay:
    0.8s;
}


.board-boot-ai-orb-star {
  position: relative;

  z-index: 2;

  margin-top:
    -8px;

  color:
    #6d4aff;

  font-size:
    42px;

  line-height:
    1;

  text-shadow:
    0 5px 16px
    rgba(
      124,
      58,
      237,
      0.30
    );

  animation:
    boardBootAiStar
    2.1s
    ease-in-out
    infinite;
}


.board-boot-ai-orb-label {
  position: absolute;

  z-index: 3;

  bottom: 18px;

  color:
    #4338ca;

  font-size:
    10px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    1.2px;
}


.board-boot-ms-green {
  position: relative;

  z-index: 2;

  display: block;

  width: auto;
  height: 194px;

  max-width: 100%;

  object-fit: contain;
  object-position: center;

  filter:
    drop-shadow(
      0
      13px
      17px
      rgba(
        20,
        63,
        58,
        0.13
      )
    );

  animation:
    boardBootMsGreenFloat
    3.4s
    ease-in-out
    infinite;
}


.board-boot-spinner {
  position: absolute;

  z-index: 4;

  right: 1px;
  bottom: 7px;

  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border:
    5px solid
    #e0e7ff;

  border-top-color:
    #7c3aed;

  border-right-color:
    #22d3ee;

  border-radius:
    999px;

  background:
    #ffffff;

  box-shadow:
    0 8px 20px
    rgba(
      79,
      70,
      229,
      0.18
    ),
    0 0 0 5px
    rgba(
      255,
      255,
      255,
      0.78
    );

  animation:
    boardBootSpin
    0.85s
    linear
    infinite;
}


.board-boot-spinner span {
  width: 8px;
  height: 8px;

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #7c3aed,
      #22d3ee
    );
}


@keyframes boardBootAiOrbFloat {
  0%,
  100% {
    transform:
      translateY(0);
  }

  50% {
    transform:
      translateY(-7px);
  }
}


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


@keyframes boardBootAiRing {
  0% {
    transform:
      scale(0.88);

    opacity:
      0;
  }

  35% {
    opacity:
      0.48;
  }

  100% {
    transform:
      scale(1.13);

    opacity:
      0;
  }
}


@keyframes boardBootAiStar {
  0%,
  100% {
    transform:
      scale(0.90)
      rotate(-6deg);

    opacity:
      0.78;
  }

  50% {
    transform:
      scale(1.13)
      rotate(8deg);

    opacity:
      1;
  }
}

.board-boot-copy {
  position: relative;
  z-index: 2;
}

.board-boot-card h1 {
  max-width: 390px;
  margin: 0 auto 8px;
  color: #143f3a;
  font-size: clamp(27px, 3vw, 32px);
  line-height: 1.04;
  font-weight: 950;
  letter-spacing: -1.15px;
}

.board-boot-card p {
  max-width: 345px;
  margin: 0 auto;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 750;
}

.board-boot-progress {
  position: relative;

  z-index: 2;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  min-height: 32px;

  margin-top: 17px;

  padding:
    7px
    14px;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.26
    );

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #f5f3ff,
      #eef2ff,
      #ecfeff
    );

  color:
    #3730a3;

  font-size:
    11px;

  line-height:
    1;

  font-weight:
    950;

  box-shadow:
    0 5px 15px
    rgba(
      79,
      70,
      229,
      0.10
    );
}


.board-boot-progress-dot {
  width: 8px;
  height: 8px;

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #8b5cf6,
      #22d3ee
    );

  box-shadow:
    0 0 0 5px
    rgba(
      99,
      102,
      241,
      0.11
    );

  animation:
    boardBootProgressPulse
    1.2s
    ease-in-out
    infinite;
}

.board-boot-divider {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  width: min(290px, 86%);
  margin: 18px auto 0;
}

.board-boot-divider span {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(95, 220, 154, 0.62)
  );
}

.board-boot-divider span:last-child {
  background: linear-gradient(
    90deg,
    rgba(95, 220, 154, 0.62),
    transparent
  );
}

.board-boot-divider strong {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eefbf4;
  color: #159957;
  font-size: 11px;
  font-weight: 950;
}

.board-boot-tagline {
  position: relative;
  z-index: 2;
  margin-top: 11px;
  color: #143f3a;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 900;
  letter-spacing: -0.05px;
}

.board-boot-tagline span {
  position: relative;
  display: inline-block;
  margin-left: 2px;
  color: #159957;
  font-weight: 950;
}

.board-boot-tagline span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  border-radius: 999px;
  background: #5fdc9a;
  transform: rotate(-1.5deg);
}

@keyframes boardBootProgressPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.86);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 560px) {
  .board-boot-card {
    width: min(390px, 94vw);
    padding: 24px 22px 25px;
  }

  .board-boot-ms-green-wrap {
    width: 175px;
    height: 168px;
    margin-bottom: 8px;
  }

  .board-boot-ms-green {
    height: 164px;
  }

  .board-boot-card h1 {
    font-size: 26px;
  }

  .board-boot-eyebrow {
    margin-bottom: 8px;
  }

  .board-boot-divider {
    margin-top: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-boot-progress-dot,
  .board-boot-ms-green {
    animation: none;
  }
}
    

/* =========================================================
   COMPACT THEME-AWARE TEACHER VIEW HEADER
   ========================================================= */

.teacher-hero {
  margin: 0;
  min-height: 132px;
  padding: 14px 22px;
  border-radius: 22px;

  background:
    radial-gradient(
      circle at 24% 118%,
      color-mix(
        in srgb,
        var(--board-accent) 22%,
        transparent
      ),
      transparent 36%
    ),
    radial-gradient(
      circle at 92% -20%,
      color-mix(
        in srgb,
        var(--board-accent) 12%,
        transparent
      ),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      var(--board-hero-a),
      var(--board-hero-b)
    );

  color: #ffffff;

  display: grid;
  grid-template-columns:
    minmax(340px, 1fr)
    auto;

  align-items: center;
  gap: 18px;

  border:
    1px solid
    color-mix(
      in srgb,
      var(--board-accent) 18%,
      rgba(255, 255, 255, 0.12)
    );

  box-shadow:
    0 12px 28px
    color-mix(
      in srgb,
      var(--board-hero-a) 18%,
      transparent
    );
}

.teacher-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.teacher-hero-sun {
  width: 66px;
  height: 66px;

  display: block;

  flex: 0 0 66px;

  padding: 0;

  overflow: hidden;

  border-radius: 19px;

  background: transparent;

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.18
    );

  box-shadow:
    0
    5px
    14px
    rgba(
      0,
      0,
      0,
      0.12
    );
}

.teacher-hero-sun img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  border-radius: inherit;

transform: scale(1.30);
  transform-origin: center;
}

.teacher-hero-copy {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.teacher-hero-copy h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(30px, 2.6vw, 42px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -1.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-hero-message {
  max-width: 100%;
  margin-top: 9px;

  color:
    rgba(
      255,
      255,
      255,
      0.84
    );

  font-size:
    clamp(
      15px,
      1.35vw,
      20px
    );

  line-height: 1.2;
  font-weight: 750;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.teacher-hero-message.teacher-hero-message-changing {
  opacity: 0;
  transform: translateY(3px);
}

.teacher-help-inline {
  width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: transparent;
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.teacher-hero-stats {
  display: grid;
  grid-template-columns: 150px 210px 190px;
  gap: 10px;
  align-items: stretch;
}

.teacher-stat {
  min-height: 92px;
  padding: 11px 13px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.09);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.teacher-duty-stat {
  display: none;
  min-width: 0;
  min-height: 92px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.09);
  color: #ffffff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.teacher-essentials-mode[data-stage="today"]
.teacher-duty-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.teacher-duty-stat:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.teacher-duty-stat-title {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 950;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.teacher-duty-stat-details {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 850;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.teacher-stat-clickable {
  cursor: pointer;

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.teacher-date-stat {
  width: 190px;
  min-width: 190px;
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
}

.teacher-date-calendar {
  width: 38px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 28px;
  line-height: 1;
}

.teacher-hero-date {
  min-width: 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.25;
}

.teacher-hero-weekday {
  display: block;
  font-weight: 900;
}

.teacher-hero-full-date {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

.teacher-hero-date-day,
.teacher-hero-date-full {
  display: block;
}

.teacher-hero-date-full {
  margin-top: 2px;
}

.teacher-date-stat .teacher-help-inline {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  font-size: 12px;
}

.teacher-stat-clickable:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.teacher-stat-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10.5px;
  line-height: 1.1;
  font-weight: 900;
}

.teacher-stat-main {
  color: #ffffff;
  font-size: 16px;
  line-height: 1.08;
  font-weight: 950;
}

.teacher-stat-sub {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 850;
}

.teacher-stat-action {
  margin-top: 7px;
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.teacher-stat-value {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: #ffffff;
  font-size: 19px;
  line-height: 1;
  font-weight: 950;
}

.teacher-stat-value small {
  color: rgba(255, 255, 255, 0.80);
  font-size: 10px;
  font-weight: 900;
}

.teacher-stat-track {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.teacher-stat-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--board-accent);
}

.teacher-stat-fill.reward {
  background:
    color-mix(
      in srgb,
      var(--board-accent) 66%,
      #fbbf24
    );
}

/* Header task timer */

.teacher-task-timer {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.teacher-task-timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.teacher-task-timer-head .teacher-stat-label {
  margin: 0;
}

.teacher-task-timer-toggle {
  min-height: 25px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.teacher-task-timer-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.teacher-task-timer-toggle:active {
  transform: scale(0.95);
}

.teacher-task-timer-toggle.is-running {
  background: #ffffff;
  color: var(--board-ink);
}

/*
  Direct bell control beside the Present Lesson timer.
*/

.present-lesson-timer-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.present-lesson-bell-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.present-lesson-bell-button:hover,
.present-lesson-bell-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.present-lesson-bell-button:active {
  transform: scale(0.93);
}

.present-lesson-bell-icon {
  display: inline-block;
  transform-origin: 50% 12%;
}

.present-lesson-bell-button.ringing
.present-lesson-bell-icon {
  animation:
    presentLessonBellShake
    0.62s
    ease-in-out;
}

@keyframes presentLessonBellShake {
  0%,
  100% {
    transform: rotate(0deg);
  }

  15% {
    transform: rotate(-18deg);
  }

  30% {
    transform: rotate(16deg);
  }

  45% {
    transform: rotate(-13deg);
  }

  60% {
    transform: rotate(10deg);
  }

  75% {
    transform: rotate(-6deg);
  }

  90% {
    transform: rotate(3deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .present-lesson-bell-button.ringing
  .present-lesson-bell-icon {
    animation: none;
  }
}

.teacher-task-timer-value {
  margin-top: 12px;
  color: #ffffff;
  font-size: 21px;
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}

.teacher-task-timer .teacher-stat-track {
  margin-top: auto;
}

/* Automatic lesson-period progress */

.today-period-progress {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--board-accent) 35%,
      #e5e7eb
    );
  border-radius: 13px;
  background:
    color-mix(
      in srgb,
      var(--board-accent) 8%,
      #ffffff
    );
}

.today-period-progress-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--board-ink);
  font-size: 11px;
  font-weight: 850;
}

.today-period-progress-head strong {
  font-size: 12px;
  font-weight: 950;
}

.today-period-progress-head span:last-child {
  margin-left: auto;
  color: #64748b;
  white-space: nowrap;
}

.today-period-progress-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.today-period-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--board-accent-2);
  transition: width 1s linear;
}

/* Compact class reward card */

.teacher-reward-stat {
  display: flex;
  flex-direction: column;
}

.teacher-reward-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.teacher-reward-head .teacher-stat-label {
  margin: 0;
}

.teacher-reward-points {
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.teacher-reward-name {
  margin-top: 7px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.12;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-reward-progress-text {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.teacher-reward-stat .teacher-stat-track {
  margin-top: auto;
}

/* Responsive */

@media (max-width: 1180px) {
  .teacher-hero {
    grid-template-columns: 1fr;
  }

  .teacher-hero-stats {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   MOBILE TEACHER VIEW
   A compact app-like controller rather than a squeezed
   version of the projector dashboard.
   ========================================================= */

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background: #eef3f8;
  }

  .top-line {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 3px;
  }

  header {
    position: sticky;
    top: 3px;
    z-index: 99;
    width: 100%;
    height: auto;
    min-height: 0;
    padding:
      calc(9px + env(safe-area-inset-top))
      12px
      10px;
    align-items: stretch;
    border-bottom: 1px solid #dbe4ee;
    box-shadow:
      0 5px 16px rgba(15, 23, 42, 0.08);
  }

  .top-nav {
    width: 100% !important;
    display: grid !important;
    grid-template-columns:
      minmax(0, 1fr)
      auto !important;
    grid-template-areas:
      "logo logo"
      "class menu" !important;
    gap: 9px 10px !important;
    align-items: center !important;
  }

  /*
    Allow the logo and class selector inside brand-row
    to occupy separate positions in the parent grid.
  */
  .brand-row {
    display: contents !important;
  }

  .logo {
    grid-area: logo !important;
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    font-size: 19px !important;
    line-height: 1 !important;
    letter-spacing: -0.6px !important;
  }

  .logo span {
    font-size: inherit !important;
  }

  .class-select-wrap {
    grid-area: class !important;
    width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    margin: 0 !important;
  }

  .class-select-wrap label {
    display: none !important;
  }

  .class-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 8px 36px 8px 13px !important;
    border-radius: 13px !important;
    font-size: 14px !important;
  }

  .class-select-wrap label {
    display: none;
  }

  .class-select {
    width: 100%;
    max-width: 170px;
    min-height: 38px;
    padding: 7px 34px 7px 13px;
    border-radius: 12px;
    font-size: 14px;
  }

  .manage-classes-header-btn {
    display: none !important;
  }

  .nav-actions {
    grid-area: menu !important;
    width: auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    align-self: center !important;
    gap: 0 !important;
    margin: 0 !important;
  }

  /*
    Mobile Teacher View keeps only the essential Menu control.
    Projector-facing and secondary actions remain available
    through the Menu when required.
  */
  #fullScreenBtn,
  #focusModeBtn,
  #liveActivitiesNavBtn,
  #contextHelpBtn,
  .manage-classes-header-btn,
  .attendance-header-btn {
    display: none !important;
  }

  .board-menu-wrap {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    justify-self: end !important;
  }

  #boardMenuButton {
    width: auto !important;
    min-width: 92px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 8px 13px !important;
    border-radius: 13px !important;
    font-size: 12px !important;
    gap: 6px !important;
  }

  body[data-stage="today"]
  .nav-actions
  .class-board-demo-tour-button {
    display: none !important;
  }

  main {
    width: 100%;
    height: auto;
    min-height:
      calc(
        100dvh -
        112px -
        env(safe-area-inset-top)
      );
    padding: 8px;
    overflow: visible;
  }

  .board-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    display: block;
  }

  body[data-stage="today"] .centre-board {
    width: 100%;
    height: auto;
    display: block;
  }

  body[data-stage="today"] .stage-card {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  body[data-stage="today"] .stage-body {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body[data-stage="today"] .today-view-shell {
    width: 100%;
    height: auto !important;
    min-height: 0;
    display: grid;
    grid-template-rows: none !important;
    grid-auto-rows: auto;
    gap: 10px !important;
    overflow: visible !important;
  }

  /*
    The desktop quick-launch toolbar is not useful on a phone.
    Mobile teachers reach tools through the compact Menu.
  */
  body[data-stage="today"] .quick-strip {
    display: none !important;
  }

  .teacher-hero {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
  }

  .teacher-hero-left {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
  }

  .teacher-hero-sun {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 23px;
  }

  .teacher-hero-copy {
    min-width: 0;
  }

  .teacher-hero-copy h2 {
    margin: 0;
    font-size: 23px;
    line-height: 1.02;
    letter-spacing: -0.8px;
    white-space: normal;
  }

  .teacher-hero-copy p {
    width: 100%;
    max-width: 100%;

    margin-top: 5px;

    font-size: 12px;
    line-height: 1.3;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: clip !important;

    overflow-wrap: anywhere;
  }

  .teacher-hero-stats {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .teacher-stat {
    min-width: 0;
    min-height: 104px;
    padding: 11px;
    border-radius: 15px;
  }

  /*
    Task timer and Class reward remain side by side.
  */
  .teacher-task-timer {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    grid-column: auto;

    min-height: 104px;
  }

  .teacher-reward-stat {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    grid-column: auto;

    min-height: 104px;
  }

  .teacher-date-stat {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    grid-column: 1 / -1;

    min-height: 68px;
  }

  .teacher-task-timer-value {
    font-size: 29px;
  }

  .teacher-task-timer-toggle {
    min-height: 32px;
    padding: 6px 12px;
  }

  .teacher-reward-name {
    font-size: 12px;
    white-space: normal;
  }

  .teacher-reward-progress-text {
    font-size: 15px !important;
  }

  .teacher-date-stat {
    min-height: 88px;
  }

  .teacher-hero-date {
    font-size: 12px;
  }

  body[data-stage="today"]
  .today-ready-section {
    width: 100%;

    min-height: 62px;

    display: flex !important;
    align-items: center !important;

    gap: 10px !important;

    padding: 9px 10px !important;

    border-radius: 16px;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    flex-wrap: nowrap !important;

    scrollbar-width: none !important;

    -webkit-overflow-scrolling: touch;
  }

  body[data-stage="today"]
  .today-ready-section::-webkit-scrollbar {
    display: none !important;
  }

  body[data-stage="today"]
  .today-ready-section
  > div:first-child {
    flex: 0 0 auto !important;

    min-width: max-content !important;
  }

  body[data-stage="today"]
  .today-daily-content-card {
    min-width: max-content !important;

    flex: 0 0 auto !important;
  }

  body[data-stage="today"]
  .today-ready-screens-group {
    width: auto !important;

    min-width: max-content !important;

    margin-left: 0 !important;

    display: flex !important;
    align-items: center !important;

    gap: 8px !important;

    flex: 0 0 auto !important;
  }

  body[data-stage="today"]
  .today-ready-title {
    flex: 0 0 auto !important;

    white-space: nowrap !important;
  }

  body[data-stage="today"]
  .today-ready-grid {
    width: auto !important;

    min-width: max-content !important;

    display: flex !important;
    align-items: center !important;

    gap: 7px !important;

    overflow: visible !important;

    flex: 0 0 auto !important;
  }

  body[data-stage="today"]
  .today-ready-screen-option {
    width: auto !important;

    min-width: 145px !important;

    max-width: none !important;

    flex: 0 0 145px !important;
  }

  body[data-stage="today"]
  .today-ready-choose-button {
    flex: 0 0 auto !important;
  }

  body[data-stage="today"] .today-view-grid,
  body.teacher-essentials-mode.essentials-main-count-1[data-stage="today"]
  .today-view-grid,
  body.teacher-essentials-mode.essentials-main-count-2[data-stage="today"]
  .today-view-grid,
  body.teacher-essentials-mode.essentials-main-count-3[data-stage="today"]
  .today-view-grid {
    width: 100% !important;
    min-width: 0 !important;

    height: auto !important;
    min-height: 0 !important;

    display: grid !important;

    grid-template-columns:
      minmax(0, 1fr) !important;

    gap: 10px !important;

    align-items: start !important;
    align-content: start !important;

    overflow: visible !important;
  }

  body[data-stage="today"]
  .today-view-grid > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    align-self: start !important;
  }

  body[data-stage="today"] .today-card {
    width: 100%;
    min-height: 0 !important;
    padding: 13px !important;
    border-radius: 18px !important;
    overflow: visible !important;
  }

  body[data-stage="today"] .today-card-title {
    font-size: 16px !important;
  }

  body[data-stage="today"] .today-next-title {
    font-size: 25px !important;
    margin: 5px 0 8px !important;
  }

  body[data-stage="today"]
  .today-next-text-wrap {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-stage="today"] .today-next-text {
  height: auto !important;

  /*
    Keep the dashboard preview compact.
    Roughly 3 lines of lesson summary remain visible.
    Longer summaries scroll inside this area.
  */
  max-height: 76px !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  padding-right: 8px !important;

  font-size: 14px !important;
  line-height: 1.45 !important;

  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar {
  width: 6px;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar-track {
  background: transparent;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

body[data-stage="today"]
.today-next-text::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

  body[data-stage="today"]
  .today-start-lesson-row,
  body[data-stage="today"]
  .today-card-actions {
    width: 100%;
  }

  body[data-stage="today"]
  .today-start-lesson-row .btn,
  body[data-stage="today"]
  .today-card-actions .btn {
    min-height: 44px;
  }

  .today-open-lesson-mobile {
    display: none;
  }

  body[data-stage="today"]
  .today-start-lesson-btn {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 14px !important;
    border: none !important;
    border-radius: 14px !important;
    background:
      linear-gradient(
        135deg,
        #22c55e,
        #16a34a
      ) !important;
    color: #ffffff !important;
    box-shadow:
      0 7px 18px
      rgba(
        22,
        163,
        74,
        0.22
      ) !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
  }

  body[data-stage="today"]
  .today-start-lesson-btn
  .today-open-lesson-desktop {
    display: none !important;
  }

  body[data-stage="today"]
  .today-start-lesson-btn
  .today-open-lesson-mobile {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
  }

  body[data-stage="today"]
  .today-reminders-card,
  body[data-stage="today"]
  .today-reminders-card.today-action-centre {
    display: grid !important;
    grid-template-rows: auto auto auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body[data-stage="today"]
  .today-action-content,
  body[data-stage="today"]
  .today-reminders-list {
    height: auto !important;
    max-height: 320px !important;
    overflow-y: auto !important;
  }

  body[data-stage="today"]
  .today-reminder-row {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    grid-template-columns:
      32px
      minmax(0, 1fr)
      38px !important;

    gap: 9px !important;

    overflow: hidden !important;
  }

  body[data-stage="today"]
  .today-reminder-content {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-stage="today"]
  .today-reminder-title {
    min-width: 0 !important;

    white-space: normal !important;

    overflow-wrap: anywhere;
  }

  body[data-stage="today"]
  .today-reminder-actions {
    width: 38px !important;
    min-width: 38px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: visible !important;
  }

  body[data-stage="today"]
  .today-bottom-grid {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  body[data-stage="today"]
  .today-resource-panel {
    overflow: visible;
  }

  body[data-stage="today"]
  .today-resource-tabs {
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-stage="today"]
  .today-resource-tabs::-webkit-scrollbar {
    display: none;
  }

  body[data-stage="today"]
  .today-resource-grid,
  body[data-stage="today"]
  .today-pinned-links-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-stage="today"]
  .today-management-grid {
    grid-template-columns: 1fr;
  }

  /* =========================================================
     MOBILE FULL-SCREEN MODALS
     All classroom editors and management panels use the
     complete phone viewport and scroll inside the modal.
     ========================================================= */

  .modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }

  .modal-backdrop.show {
    display: flex !important;
  }

  .modal-backdrop > .modal-card,
  .modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: grid !important;
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto !important;
    overflow: hidden !important;
  }

  .modal-head {
    position: relative !important;
    z-index: 2 !important;
    flex: 0 0 auto !important;
    min-height: 64px !important;
    padding:
      calc(12px + env(safe-area-inset-top))
      14px
      12px !important;
    gap: 10px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
  }

  .modal-head > div {
    min-width: 0 !important;
  }

  .modal-head h2 {
    margin: 0 !important;
    font-size: 19px !important;
    line-height: 1.12 !important;
  }

  .modal-head p {
    margin: 4px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  .modal-head .icon-btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    font-size: 20px !important;
  }

  .modal-body {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 14px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-gutter: auto !important;
  }

  .modal-foot {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    min-height: 62px !important;
    padding:
      10px
      12px
      calc(10px + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    flex-wrap: wrap !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-top: 1px solid #e5e7eb !important;
    box-shadow:
      0 -6px 18px rgba(15, 23, 42, 0.07) !important;
  }

  .modal-foot .btn {
    min-height: 42px !important;
    flex: 1 1 120px !important;
    padding: 8px 12px !important;
    white-space: normal !important;
  }

  /*
    Prevent desktop multi-column modal content from overflowing
    the narrow mobile viewport.
  */
  .modal-body
  .ready-bank-tools,
  .modal-body
  .ready-bank-pinned,
  .modal-body
  .ready-bank-grid,
  .modal-body
  .ready-edit-grid,
  .modal-body
  .ready-expectation-edit-row,
  .modal-body
  .reminder-form-grid,
  .modal-body
  .daily-link-edit-fields,
  .modal-body
  .weekly-duty-row,
  .modal-body
  .timetable-edit-row,
  .modal-body
  .settings-grid,
  .modal-body
  .mystery-settings-grid {
    grid-template-columns: 1fr !important;
  }

  .modal-body input,
  .modal-body textarea,
  .modal-body select,
  .modal-body button {
    max-width: 100% !important;
  }

  .modal-body textarea {
    min-height: 120px !important;
  }
}

@media (max-width: 390px) {
  .logo {
    font-size: 18px !important;
  }

  .class-select {
    max-width: 150px;
    font-size: 13px;
  }

  #boardMenuButton {
    min-width: 84px;
    padding-left: 10px;
    padding-right: 10px;
  }

  /*
    Keep Task timer and Class reward side by side
    even on narrower phones.
  */
  .teacher-hero-stats {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .teacher-stat,
  .teacher-task-timer,
  .teacher-reward-stat {
    min-height: 102px;
    padding: 9px;
  }

  .teacher-task-timer-value {
    font-size: 25px;
  }

  .teacher-task-timer-toggle {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 10px;
  }

  .teacher-reward-name {
    font-size: 11px;
  }

  .teacher-reward-progress-text {
    font-size: 13px !important;
  }

  .teacher-date-stat {
    grid-column: 1 / -1;
  }

  body[data-stage="today"] .today-ready-grid {
    grid-template-columns: 1fr;
  }
}


.manage-classes-header-btn {
  display: none;

  min-height: 36px;
  padding: 8px 12px;
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
  color: #1e3a5f !important;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

body[data-stage="today"] .manage-classes-header-btn {
  display: inline-flex;
}

.manage-classes-header-btn:hover {
  border-color: #93c5fd !important;
  background: #dbeafe !important;
  transform: translateY(-1px);
}



.toolbar-editor-coming-section {
  display: grid;
  gap: 11px;
}

.toolbar-editor-grid + .toolbar-editor-coming-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.toolbar-editor-coming-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-editor-coming-heading span {
  color: #143f3a;
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}

.toolbar-editor-coming-heading small {
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 850;
}

.toolbar-editor-coming {
  cursor: default;
  border-style: dashed;
  border-color: #cbd5e1;
  background:
    linear-gradient(
      145deg,
      #f8fafc,
      #ffffff
    );
  box-shadow: none;
  opacity: 0.8;
}

.toolbar-editor-coming:hover {
  transform: none;
  border-color: #cbd5e1;
  box-shadow: none;
}

.toolbar-editor-coming
.toolbar-editor-choice-icon {
  background: #f1f5f9;
  filter: grayscale(0.2);
}

.toolbar-editor-coming-label {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  margin-top: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 8.5px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.toolbar-editor-coming-clock {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 950;
}

.toolbar-category-tab-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
}

.toolbar-category-tab.active
.toolbar-category-tab-soon {
  background: #ffedd5;
  color: #9a3412;
}

@media (max-width: 700px) {
  .toolbar-editor-coming-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.toolbar-live-reminder {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid #fecaca;
  border-radius: 16px;
  background: #fff7f7;
}

.toolbar-live-reminder-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fee2e2;
  font-size: 18px;
}

.toolbar-live-reminder-copy {
  min-width: 0;
}

.toolbar-live-reminder-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7f1d1d;
  font-size: 12.5px;
  font-weight: 950;
}

.toolbar-live-reminder-title strong {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.5px;
}

.toolbar-live-reminder-copy p {
  margin: 3px 0 0;
  color: #991b1b;
  font-size: 10.5px;
  line-height: 1.3;
  font-weight: 800;
}

.toolbar-live-reminder-button {
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  background: #ffffff;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

.toolbar-live-reminder-button:hover {
  border-color: #ef4444;
  background: #fee2e2;
}

@media (max-width: 700px) {
  .toolbar-live-reminder {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .toolbar-live-reminder-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}


.today-section-label.lesson.is-active {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.today-section-label.lesson.is-active::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}


/* =========================================================
   PRESENT TO CLASS — SMART LESSON HEADER

   Normal teacher mode is untouched.

   Layout:
   Row 1 = full lesson title + fixed presentation status
   Row 2 = lesson information + resources + lesson controls

   This prevents Dashboard / countdown / date being covered
   and never truncates the lesson title with "...".
   ========================================================= */

body.focus-mode[data-stage="task"]
.stage-card {
  padding:
    10px
    16px
    14px !important;

  gap:
    7px !important;
}


/* ---------------------------------------------------------
   MAIN HEADER

   Left:
   full lesson title + lesson controls

   Right:
   countdown + Dashboard + date

   The right side can never be covered by the lesson tools.
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.stage-top {
  grid-template-columns:
    minmax(0, 1fr)
    auto !important;

  align-items:
    start !important;

  gap:
    12px !important;

  padding-bottom:
    7px !important;

  margin-bottom:
    0 !important;

  border-bottom-width:
    1px !important;
}


/* ---------------------------------------------------------
   LEFT SIDE OF HEADER

   Present to Class uses two compact rows internally:
   full title first, controls underneath.

   This keeps the full title readable.
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.task-stage-heading-wrap {
  width:
    100% !important;

  min-width:
    0 !important;

  display:
    grid !important;

  grid-template-columns:
    minmax(0, 1fr) !important;

  gap:
    6px !important;

  align-items:
    start !important;
}


/* ---------------------------------------------------------
   FULL LESSON TITLE

   IMPORTANT:
   no ellipsis
   no clipping
   no hidden title

   Long titles may use two lines if genuinely necessary.
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.task-stage-heading-title {
  width:
    100% !important;

  min-width:
    0 !important;

  max-width:
    none !important;

  display:
    block !important;

  flex:
    none !important;

  font-size:
    clamp(
      25px,
      2.7vw,
      40px
    ) !important;

  line-height:
    1.02 !important;

  letter-spacing:
    -1px !important;

  white-space:
    normal !important;

  overflow:
    visible !important;

  text-overflow:
    clip !important;

  overflow-wrap:
    anywhere !important;
}


/* ---------------------------------------------------------
   SECOND ROW UNDER TITLE

   Contains:
   time
   timer
   helper
   attached tools
   attached links
   Lesson resources
   Edit lesson
   QR
   Expand slides

   It stays on one compact row where possible.
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.task-stage-heading-bottom {
  width:
    100% !important;

  min-width:
    0 !important;

  display:
    flex !important;

  align-items:
    center !important;

  justify-content:
    flex-start !important;

  gap:
    6px !important;

  flex-wrap:
    nowrap !important;

  overflow-x:
    auto !important;

  overflow-y:
    visible !important;

  scrollbar-width:
    none;

  overscroll-behavior-x:
    contain;
}

body.focus-mode[data-stage="task"]
.task-stage-heading-bottom::-webkit-scrollbar {
  display:
    none;
}


/* ---------------------------------------------------------
   TIME / TIMER / HELPER / ATTACHMENTS
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.task-stage-heading-meta {
  width:
    auto !important;

  min-width:
    max-content !important;

  display:
    flex !important;

  align-items:
    center !important;

  gap:
    5px !important;

  flex:
    0 0 auto !important;

  flex-wrap:
    nowrap !important;
}


body.focus-mode[data-stage="task"]
.task-stage-heading-pill {
  min-height:
    25px !important;

  padding:
    4px
    8px !important;

  font-size:
    10px !important;
}


/* ---------------------------------------------------------
   AMY'S ATTACHED LESSON TOOLS + LINKS
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.lesson-attachment-chips {
  display:
    inline-flex !important;

  align-items:
    center !important;

  gap:
    5px !important;

  flex:
    0 0 auto !important;

  flex-wrap:
    nowrap !important;
}


body.focus-mode[data-stage="task"]
.lesson-attachment-chip {
  min-height:
    25px !important;

  padding:
    4px
    8px !important;

  font-size:
    10px !important;

  flex:
    0 0 auto !important;
}


/* ---------------------------------------------------------
   LESSON ACTIONS
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.task-stage-heading-actions {
  width:
    auto !important;

  min-width:
    max-content !important;

  margin-left:
    0 !important;

  flex:
    0 0 auto !important;

  display:
    flex !important;

  align-items:
    center !important;

  justify-content:
    flex-start !important;

  gap:
    5px !important;

  flex-wrap:
    nowrap !important;

  overflow:
    visible !important;
}


body.focus-mode[data-stage="task"]
.task-stage-heading-actions
.btn {
  min-height:
    27px !important;

  height:
    27px !important;

  padding:
    4px
    9px !important;

  font-size:
    10px !important;

  gap:
    4px !important;
}


body.focus-mode[data-stage="task"]
.task-stage-heading-actions
.task-heading-primary {
  padding-left:
    10px !important;

  padding-right:
    10px !important;
}


/* ---------------------------------------------------------
   LESSON RESOURCES DROPDOWN

   Match its size to the other lesson controls.
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.lesson-resources-menu {
  height:
    27px !important;

  flex:
    0 0 auto !important;
}


body.focus-mode[data-stage="task"]
.lesson-resources-menu
> summary {
  min-height:
    27px !important;

  height:
    27px !important;

  padding:
    4px
    9px !important;

  font-size:
    10px !important;
}


/* =========================================================
   PRESENT TO CLASS — LESSON RESOURCES FLOATING POPOVER

   Normal Teacher View keeps its existing dropdown.

   Present to Class uses a body-level floating copy so the
   menu can never be clipped by the lesson header or stage.
   ========================================================= */

body.focus-mode[data-stage="task"]
.lesson-resources-menu-panel {
  z-index:
    500 !important;
}


/*
  Portal wrapper created only while the Present-mode
  Lesson resources menu is open.
*/
.present-lesson-resources-portal {
  position:
    fixed !important;

  z-index:
    12000 !important;

  margin:
    0 !important;

  padding:
    0 !important;

  border:
    0 !important;

  background:
    transparent !important;
}


/*
  Remove the normal absolute positioning because the portal
  itself now controls where the menu appears on screen.
*/
.present-lesson-resources-portal
.lesson-resources-menu-panel {
  position:
    static !important;

  top:
    auto !important;

  right:
    auto !important;

  bottom:
    auto !important;

  left:
    auto !important;

  z-index:
    auto !important;

  width:
    220px !important;

  max-height:
    min(
      420px,
      calc(
        100vh - 24px
      )
    ) !important;

  overflow-y:
    auto !important;

  display:
    grid !important;

  background:
    #ffffff !important;

  border:
    1px solid
    #d1d5db !important;

  border-radius:
    14px !important;

  box-shadow:
    0 18px 42px
    rgba(
      15,
      23,
      42,
      0.24
    ) !important;
}


/* ---------------------------------------------------------
   RIGHT PRESENTATION STATUS

   Countdown + Dashboard + Date are a protected fixed group.

   Lesson controls cannot push underneath or cover them.
   --------------------------------------------------------- */

body.focus-mode[data-stage="task"]
.stage-top
> div:last-child {
  position:
    relative !important;

  z-index:
    20 !important;

  min-width:
    max-content !important;

  flex:
    0 0 auto !important;

  display:
    inline-flex !important;

  align-items:
    center !important;

  justify-content:
    flex-end !important;

  gap:
    6px !important;

  flex-wrap:
    nowrap !important;

  overflow:
    visible !important;

  background:
    transparent;
}


/* Countdown */

body.focus-mode[data-stage="task"]
.stage-progress-pill {
  flex:
    0 0 auto !important;

  min-height:
    34px !important;

  padding:
    7px
    11px !important;

  border-radius:
    13px !important;

  font-size:
    12px !important;

  white-space:
    nowrap !important;
}


/* Dashboard */

body.focus-mode[data-stage="task"]
.stage-dashboard-button {
  flex:
    0 0 auto !important;

  min-width:
    max-content !important;

  min-height:
    34px !important;

  padding:
    7px
    11px !important;

  border-radius:
    13px !important;

  font-size:
    11px !important;

  white-space:
    nowrap !important;
}


/* Date */

body.focus-mode[data-stage="task"]
.date-card {
  flex:
    0 0 auto !important;

  min-width:
    max-content !important;

  min-height:
    34px !important;

  padding:
    7px
    11px !important;

  border-radius:
    13px !important;

  font-size:
    11px !important;

  white-space:
    nowrap !important;
}


/* Birthday, if present */

body.focus-mode[data-stage="task"]
.birthday-alert {
  flex:
    0 0 auto !important;

  min-height:
    34px !important;

  padding:
    7px
    10px !important;

  font-size:
    11px !important;
}


/* ---------------------------------------------------------
   SMALLER WIDTHS

   We still preserve the title.

   The date is the first lower-priority presentation
   item that may move out of view on very small devices.
   --------------------------------------------------------- */

@media (max-width: 1050px) {

  body.focus-mode[data-stage="task"]
  .stage-top {
    gap:
      8px !important;
  }

  body.focus-mode[data-stage="task"]
  .task-stage-heading-title {
    font-size:
      clamp(
        23px,
        2.5vw,
        34px
      ) !important;
  }

  body.focus-mode[data-stage="task"]
  .stage-progress-pill,
  body.focus-mode[data-stage="task"]
  .stage-dashboard-button,
  body.focus-mode[data-stage="task"]
  .date-card {
    padding-left:
      9px !important;

    padding-right:
      9px !important;
  }
}


@media (max-width: 780px) {

  body.focus-mode[data-stage="task"]
  .date-card {
    display:
      none !important;
  }
}


body.focus-mode[data-stage="task"]
.stage-body {
  min-height:
    0 !important;
}


.teacher-hero-copy h2 {
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.teacher-hero-copy h2.teacher-hero-message-changing {
  opacity: 0;
  transform: translateY(4px);
}

@media (prefers-reduced-motion: reduce) {
  .teacher-hero-copy h2 {
    transition: none;
  }
}

.today-lesson-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
}

.today-lesson-edit {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #143f3a;
  font-size: 11.5px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.today-lesson-edit-icon {
  width: 17px;
  min-width: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
}

.today-lesson-edit-label {
  max-width: none;
  opacity: 1;
  overflow: visible;
  font-size: 11.5px;
  line-height: 1;
  font-weight: 950;
}

.today-lesson-edit:hover,
.today-lesson-edit:focus-visible {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow:
    0 5px 12px
    rgba(15, 23, 42, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.today-lesson-edit:active {
  transform: scale(0.96);
}

.today-lesson-head-main,
.today-lesson-head-status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: nowrap;
}

.today-lesson-head-status {
  justify-content: flex-end;
}

.today-lesson-head .today-card-title {
  margin: 0;
  flex: 0 0 auto;
}

.today-lesson-week {
  min-height: 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  padding:
    3px
    7px;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    999px;

  background:
    #f8fafc;

  color:
    #64748b;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;
}

.today-lesson-head .today-next-time {
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.today-lesson-time-left {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  color: #dc2626;
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .today-lesson-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .today-lesson-head-main,
  .today-lesson-head-status {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.toolbar-more-button {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
  box-shadow: none;
}

.toolbar-more-button:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #1e293b;
}

.toolbar-more-icon {
  font-size: 21px !important;
  line-height: 0.7 !important;
  letter-spacing: 2px;
  transform: translateY(-2px);
}



.save-reuse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.save-reuse-option {
  width: 100%;
  min-height: 150px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 18px;
  border: 1px solid #d9fbe8;
  border-radius: 20px;
  background: #f8fffb;
  color: #143f3a;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.save-reuse-option:hover {
  transform: translateY(-2px);
  border-color: #5fdc9a;
  background: #f1fdf6;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.save-reuse-option-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #dcfce7;
  color: #166534;
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.save-reuse-option-content {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.save-reuse-option-content strong {
  color: #143f3a;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 950;
}

.save-reuse-option-content small {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 750;
}

.save-reuse-exclusion-note {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.45;
}

.save-reuse-exclusion-note strong {
  display: block;
  margin-bottom: 3px;
  color: #334155;
}

@media (max-width: 700px) {
  .save-reuse-grid {
    grid-template-columns: 1fr;
  }
}

.timetable-edit-period-button {
  background: #eefbf4;
  border-color: #bbf7d0;
  color: #159957;
}

.timetable-edit-period-button:hover {
  background: #dcfce7;
  border-color: #86efac;
}

#teacherHeroMessage {
  width: 100%;
  max-width: 100%;

  font-family:
    "Nunito",
    Arial,
    Helvetica,
    sans-serif;

  font-size: clamp(15px, 1.15vw, 19px);
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: -0.15px;
  color: rgba(255, 255, 255, 0.88);

  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;

  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  -webkit-box-orient: unset !important;

  overflow-wrap: break-word;
  word-break: normal;
}

.bell-widget-body {
  height: calc(100% - 40px);
  min-height: 0;

  display: grid;
  place-items: center;

  padding: 18px;
  overflow: hidden;
}

.bell-widget-button {
  width: min(210px, 78%);
  aspect-ratio: 1;

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

  border: 4px solid #facc15;
  border-radius: 999px;

  background:
    radial-gradient(
      circle at 34% 26%,
      #ffffff 0 8%,
      #fef9c3 30%,
      #fde68a 58%,
      #fbbf24 100%
    );

  color: #78350f;

  cursor: pointer;

  box-shadow:
    0 18px 34px rgba(180, 83, 9, 0.22),
    0 0 0 9px rgba(250, 204, 21, 0.13),
    inset 0 12px 18px rgba(255, 255, 255, 0.72),
    inset 0 -16px 22px rgba(180, 83, 9, 0.16);

  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.bell-widget-button:hover,
.bell-widget-button:focus-visible {
  transform: translateY(-4px) scale(1.025);

  filter: brightness(1.02);

  box-shadow:
    0 24px 42px rgba(180, 83, 9, 0.28),
    0 0 0 12px rgba(250, 204, 21, 0.16),
    inset 0 12px 18px rgba(255, 255, 255, 0.72),
    inset 0 -16px 22px rgba(180, 83, 9, 0.16);

  outline: none;
}

.bell-widget-button:active {
  transform: scale(0.95);
}

.bell-widget-icon {
  display: inline-block;

  font-size: clamp(
    70px,
    7vw,
    108px
  );

  line-height: 1;

  transform-origin: 50% 12%;

  filter:
    drop-shadow(
      0 10px 8px
      rgba(120, 53, 15, 0.24)
    );
}

.bell-widget-label {
  padding: 6px 12px;

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.68);

  color: #78350f;

  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}

.bell-widget-icon.is-ringing {
  animation:
    bellWidgetRing
    0.7s
    ease-in-out;
}

.bell-widget-button.is-ringing {
  animation:
    bellWidgetButtonPulse
    0.7s
    ease-out;
}

@keyframes bellWidgetRing {
  0% {
    transform: rotate(0deg)
      scale(1);
  }

  14% {
    transform: rotate(-20deg)
      scale(1.08);
  }

  28% {
    transform: rotate(18deg)
      scale(1.1);
  }

  42% {
    transform: rotate(-15deg)
      scale(1.08);
  }

  56% {
    transform: rotate(12deg)
      scale(1.06);
  }

  70% {
    transform: rotate(-7deg)
      scale(1.03);
  }

  84% {
    transform: rotate(4deg)
      scale(1.01);
  }

  100% {
    transform: rotate(0deg)
      scale(1);
  }
}

@keyframes bellWidgetButtonPulse {
  0% {
    box-shadow:
      0 18px 34px
      rgba(180, 83, 9, 0.22),
      0 0 0 9px
      rgba(250, 204, 21, 0.13);
  }

  45% {
    box-shadow:
      0 26px 46px
      rgba(180, 83, 9, 0.32),
      0 0 0 20px
      rgba(250, 204, 21, 0.04);
  }

  100% {
    box-shadow:
      0 18px 34px
      rgba(180, 83, 9, 0.22),
      0 0 0 9px
      rgba(250, 204, 21, 0.13);
  }
}

@media (
  prefers-reduced-motion: reduce
) {
  .bell-widget-icon.is-ringing,
  .bell-widget-button.is-ringing {
    animation: none;
  }
}

/* =========================================================
   KEYBOARD CONTROL FOCUS
   Projector-visible without resembling an error state.
   ========================================================= */

/* =========================================================
   KEYBOARD NAVIGATION SELECTION
   Explicitly applied by the Classboard arrow-key system.
   ========================================================= */

.keyboard-nav-focus {
  position: relative !important;
  z-index: 30 !important;

  outline:
    4px solid #2563eb !important;

  outline-offset:
    4px !important;

  box-shadow:
    0 0 0 8px rgba(37, 99, 235, 0.18),
    0 10px 24px rgba(15, 23, 42, 0.16) !important;
}

/*
  Native dropdowns and text fields need a tighter outline.
*/

select.keyboard-nav-focus,
input.keyboard-nav-focus,
textarea.keyboard-nav-focus {
  outline:
    3px solid #2563eb !important;

  outline-offset:
    2px !important;

  border-color:
    #2563eb !important;

  background-color:
    #eff6ff !important;

  box-shadow:
    0 0 0 5px rgba(37, 99, 235, 0.20) !important;
}

/*
  Make the dropdown arrow area remain visually clear.
*/

select.keyboard-nav-focus {
  color:
    #1e3a8a !important;

  font-weight:
    950 !important;
}

/*
  Custom dropdown triggers built with summary.
*/

summary.keyboard-nav-focus {
  border-color:
    #2563eb !important;

  background:
    #eff6ff !important;

  color:
    #1e3a8a !important;
}

/*
  Keep ordinary browser keyboard focus as a fallback for Tab.
*/

body.focus-mode
.stage-body
:focus-visible:not(.keyboard-nav-focus),

body.focus-mode
.modal-backdrop.show
:focus-visible:not(.keyboard-nav-focus) {
  outline:
    3px solid #2563eb !important;

  outline-offset:
    3px !important;
}

.bell-widget-button {
  position: relative;
}

.bell-widget-shortcut {
  position: absolute;
  top: 8px;
  right: 8px;

  min-width: 24px;
  height: 24px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;

  background: rgba(255, 255, 255, 0.92);
  color: #475569;

  font-size: 10px;
  line-height: 1;
  font-weight: 950;

  box-shadow:
    0 3px 8px rgba(15, 23, 42, 0.08);
}


#widgetTimerToggle {
  position: relative;
}

.timer-widget-shortcut {
  min-width: 22px;
  height: 22px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-left: 7px;
  padding: 0 6px;

  border: 1px solid currentColor;
  border-radius: 7px;

  background: rgba(255, 255, 255, 0.22);
  color: inherit;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;

  opacity: 0.82;
}


/* =========================================================
   LESSON SLIDE ANNOTATION TOOLS
   Temporary pen and laser pointer for Present to Class.
   ========================================================= */

.task-slide-annotation-canvas {
  position: absolute;
  inset: 0;
  z-index: 14;

  width: 100%;
  height: 100%;

  display: none;
  touch-action: none;
  pointer-events: none;
}

body.focus-mode[data-stage="task"]
.task-slide-annotation-canvas,
body.focus-mode[data-stage="readyScreen"]
.task-slide-annotation-canvas,
body.focus-mode[data-stage="video"]
.task-slide-annotation-canvas,
body.focus-mode[data-stage="dailyContent"]
.task-slide-annotation-canvas {
  display: block;
}

.task-slide-annotation-canvas.active {
  pointer-events: auto;
}

.task-slide-annotation-canvas.pen-active {
  cursor: crosshair;
}

.task-slide-annotation-canvas.pointer-active {
  cursor: none;
}

.present-to-class-control-strip {
  position: absolute;
  left: 50%;
  bottom: 2px;
  z-index: 118;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;

  background: rgba(15, 23, 42, 0.86);
  box-shadow:
    0 7px 18px rgba(15, 23, 42, 0.24);

  backdrop-filter: blur(10px);

  pointer-events: auto;
  transform: translateX(-50%);
}

/*
  Presentation controls must never appear
  outside Present to Class.
*/
body:not(.present-to-class-active)
.present-to-class-control-strip {
  display: none !important;
}

/*
  GOOGLE DRIVE / PDF PRESENT MODE

  Google places its own page + zoom controls
  in the bottom centre.

  Move Class Board controls to the lower-left
  instead of stacking another row above them.
*/
/*
  DRIVE / PDF PRESENT TOOLBAR

  JavaScript positions this toolbar relative to
  the actual PDF iframe, not the full viewport.
*/
body.focus-mode.drive-file-present-mode[data-stage="task"]
.present-to-class-control-strip {
  position: fixed !important;

  left: 50% !important;
  top: auto !important;

  right: auto !important;
  bottom: 14px !important;

  transform:
    translateX(-50%) !important;

  width: max-content !important;
  max-width: none !important;

  /*
    Never allow the PDF toolbar to stretch
    vertically with the lesson layout.
  */
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;

  flex: 0 0 auto !important;
  align-self: auto !important;

  padding:
    4px
    6px !important;

  gap:
    4px !important;

  overflow: visible !important;
}

body.focus-mode.drive-file-present-mode[data-stage="task"]
.present-to-class-control-strip
> * {
  flex: 0 0 auto !important;
}

body.focus-mode.drive-file-present-mode[data-stage="task"]
.present-to-class-control-strip
button {
  min-height: 32px !important;
  padding:
    5px
    9px !important;

  font-size:
    10px !important;
}

body.focus-mode.drive-file-present-mode[data-stage="task"]
.present-to-class-control-strip
.present-to-class-control-divider {
  height:
    22px !important;
}



.present-annotation-controls {
  display: none;
  align-items: center;
  gap: 2px;
}

/*
  Compact Present to Class annotation menu.

  Pen, Pointer and Erase drawings live inside
  one Annotate button to save toolbar width.
*/

.present-annotation-menu {
  position: relative;
  flex: 0 0 auto;
}

.present-annotation-menu > summary {
  list-style: none;
}

.present-annotation-menu
> summary::-webkit-details-marker {
  display: none;
}


.present-annotation-menu-trigger {
  min-height: 26px;

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

  padding:
    5px
    9px;

  border:
    1px solid transparent;

  border-radius:
    999px;

  background:
    transparent;

  color:
    #ffffff;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;
}


.present-annotation-menu-trigger:hover,
.present-annotation-menu-trigger:focus-visible,
.present-annotation-menu[open]
.present-annotation-menu-trigger {
  border-color:
    rgba(
      255,
      255,
      255,
      0.36
    );

  background:
    rgba(
      255,
      255,
      255,
      0.14
    );

  outline:
    none;
}


.present-annotation-menu-chevron {
  font-size:
    8px;

  transition:
    transform
    0.15s ease;
}


.present-annotation-menu[open]
.present-annotation-menu-chevron {
  transform:
    rotate(180deg);
}


.present-annotation-menu-panel {
  position:
    absolute;

  left:
    0;

  bottom:
    calc(
      100% +
      9px
    );

  z-index:
    1000;

  width:
    158px;

  display:
    grid;

  gap:
    3px;

  padding:
    6px;

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.24
    );

  border-radius:
    13px;

  background:
    rgba(
      15,
      23,
      42,
      0.96
    );

  box-shadow:
    0
    14px
    32px
    rgba(
      15,
      23,
      42,
      0.32
    );

  backdrop-filter:
    blur(12px);
}


.present-annotation-menu-panel
.task-slide-annotation-button {
  width:
    100%;

  min-height:
    34px;

  justify-content:
    flex-start;

  padding:
    7px
    9px;

  border-radius:
    9px;

  font-size:
    10px;

  text-align:
    left;
}


.present-annotation-menu-panel
.task-slide-annotation-button.active {
  border-color:
    #86efac;

  background:
    #dcfce7;

  color:
    #166534;
}

body.focus-mode[data-stage="task"]
.present-to-class-control-strip.annotation-available
.present-annotation-controls,
body.focus-mode[data-stage="readyScreen"]
.present-to-class-control-strip.annotation-available
.present-annotation-controls,
body.focus-mode[data-stage="video"]
.present-to-class-control-strip.annotation-available
.present-annotation-controls,
body.focus-mode[data-stage="dailyContent"]
.present-to-class-control-strip.annotation-available
.present-annotation-controls {
  display: inline-flex;
}

.present-control-divider {
  width: 1px;
  height: 19px;
  margin: 0 3px;
  background: rgba(255, 255, 255, 0.25);
}

.task-slide-annotation-button {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 999px;

  background: transparent;
  color: #ffffff;

  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;

  cursor: pointer;
}

.task-slide-annotation-button:hover,
.task-slide-annotation-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.task-slide-annotation-button.active {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.task-slide-annotation-button.erase {
  color: #e2e8f0;
}

.task-slide-pointer-icon {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 999px;
  background: #ef4444;
  box-shadow:
    0 0 0 3px rgba(239, 68, 68, 0.22),
    0 0 8px rgba(239, 68, 68, 0.7);
}

.task-slide-laser-dot {
  position: absolute;
  z-index: 16;

  width: 15px;
  height: 15px;

  display: none;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;

  background: #ef4444;

  box-shadow:
    0 0 0 5px rgba(239, 68, 68, 0.26),
    0 0 18px rgba(239, 68, 68, 0.95);

  pointer-events: none;
  transform: translate(-50%, -50%);
}

.task-slide-laser-dot.show {
  display: block;
}

/* =========================================================
   LESSON SLIDES KEYBOARD CONTROL
   Slides only receive arrow keys after a deliberate click.
   ========================================================= */

.task-slides-keyboard-shield {
  position: absolute;
  inset: 0;
  z-index: 12;

  width: 100%;
  height: 100%;

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

  padding: 20px;
  border: 0;
  border-radius: inherit;

  background: rgba(15, 23, 42, 0.18);
  color: #ffffff;

  cursor: pointer;
  text-align: center;

  backdrop-filter: blur(1px);

  transition:
    opacity 0.16s ease,
    background 0.16s ease;
}

body.focus-mode
.task-slides-keyboard-shield {
  display: flex;
}

.task-slides-keyboard-shield:hover {
  background: rgba(15, 23, 42, 0.28);
}

.task-slides-keyboard-shield span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;
  padding: 9px 16px;

  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;

  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;

  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.24);

  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}

.task-slides-keyboard-shield small {
  padding: 5px 9px;
  border-radius: 999px;

  background: rgba(15, 23, 42, 0.68);
  color: rgba(255, 255, 255, 0.9);

  font-size: 10px;
  line-height: 1;
  font-weight: 850;
}

.task-slides-keyboard-shield.inactive {
  display: none !important;
}

.task-slides-keyboard-message {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 13;

  display: none;
  align-items: center;
  justify-content: center;

  max-width: calc(100% - 24px);
  min-height: 28px;
  padding: 6px 11px;

  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;

  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;

  box-shadow:
    0 7px 18px rgba(15, 23, 42, 0.2);

  transform: translateX(-50%);

  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
}

body.focus-mode.drive-file-present-mode[data-stage="task"]
.task-slides-keyboard-message {
  display: none !important;
}

body.focus-mode
.task-slides-keyboard-message.show {
  display: inline-flex;
}


.class-board-whiteboard-remote-floating {
  position: absolute;
  right: 18px;
  bottom: 72px;
  z-index: 120;

  width: min(
    360px,
    calc(100vw - 36px)
  );

  padding: 14px;

  border: 1px solid
    rgba(148, 163, 184, 0.38);
  border-radius: 18px;

  background: rgba(15, 23, 42, 0.98);
  color: #ffffff;

  box-shadow:
    0 22px 54px
    rgba(15, 23, 42, 0.36);

  backdrop-filter: blur(14px);
}

.class-board-whiteboard-remote-floating.hidden {
  display: none !important;
}

.class-board-whiteboard-remote-close {
  position: absolute;
  top: 8px;
  right: 8px;

  width: 28px;
  height: 28px;

  display: grid;
  place-items: center;

  padding: 0;
  border: 1px solid
    rgba(255, 255, 255, 0.16);
  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.08);
  color: #ffffff;

  font-size: 18px;
  line-height: 1;
  font-weight: 900;

  cursor: pointer;
}

.class-board-whiteboard-remote-close:hover {
  border-color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
}

.daily-content-modal-description {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 800;
}

.daily-content-modal-description strong {
  color: #5b21b6;
  font-weight: 950;
}

.daily-content-contributor-credit {
  width: fit-content;
  max-width: 100%;
  margin-top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 7px;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  background: #faf9ff;
  color: #6d28d9;
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 850;
}

.daily-content-contributor-credit strong {
  color: #4c1d95;
  font-weight: 950;
}

.daily-content-contributor-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 999px;
  background: #ede9fe;
  font-size: 12px;
}

@media (max-width: 560px) {
  .daily-content-contributor-credit {
    width: 100%;
    border-radius: 12px;
    align-items: flex-start;
  }
}


    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word {
      display: grid;
      grid-template-rows:
        auto
        minmax(0, 1fr)
        auto
        auto;
      align-items: center;
      justify-items: center;
      gap: clamp(14px, 2vh, 24px);
      padding:
        clamp(34px, 4vh, 52px)
        clamp(42px, 5vw, 82px)
        clamp(40px, 5vh, 66px);
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-stage-card-header {
      align-self: start;
      margin-top: 0;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-stage-card-text {
      align-self: center;
      margin: 0;
      font-size:
        clamp(64px, 8vw, 126px);
      line-height: 0.95;
      letter-spacing: -3px;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-discussion-prompt {
      width: min(760px, 82%);
      margin: 0;
      padding:
        11px
        18px;
      font-size:
        clamp(14px, 1.25vw, 19px);
      line-height: 1.25;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-stage-actions {
      margin-top: -4px;
      padding-bottom: 0;
    }

    .daily-content-stage-grid.count-1
    .daily-content-stage-card.type-word
    .daily-content-stage-action {
      min-height: 40px;
      padding:
        9px
        16px;
      font-size:
        clamp(11px, 0.95vw, 14px);
    }


        .daily-content-setting-checkbox {
      width: 20px;
      height: 20px;
      flex: 0 0 20px;
      accent-color: #16a34a;
      cursor: pointer;
    }


.present-lesson-checklist {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 13px;
  border: 1px solid #d9fbe8;
  border-radius: 15px;
  background: #f8fffb;
}

.present-lesson-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.present-lesson-checklist-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.present-lesson-checklist-head strong {
  color: #143f3a;
  font-size: 12.5px;
  line-height: 1.15;
  font-weight: 950;
}

.present-lesson-checklist-head span {
  color: #64748b;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 800;
}

.present-lesson-checklist-count {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534 !important;
  font-size: 9.5px !important;
  line-height: 1;
  font-weight: 950 !important;
  white-space: nowrap;
}

.present-lesson-checklist-options {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.present-lesson-checklist-option {
  position: relative;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.present-lesson-checklist-option:hover {
  border-color: #86efac;
  background: #f0fdf4;
  transform: translateY(-1px);
}

.present-lesson-checklist-option.selected {
  border-color: #22c55e;
  background: #dcfce7;
  color: #166534;
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.12);
}

.present-lesson-checklist-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.present-lesson-checklist-box {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: transparent;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
}

.present-lesson-checklist-option.selected
.present-lesson-checklist-box {
  border-color: #22c55e;
  background: #22c55e;
  color: #ffffff;
}

.present-lesson-checklist-label {
  font-size: 10.5px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.present-lesson-sequence-preview {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  font-size: 9.5px;
  line-height: 1.35;
  font-weight: 850;
  overflow-wrap: anywhere;
}

  /*
    =========================================================
    DAILY CONTENT — ORGANISED MULTI-CARD LAYOUTS
    =========================================================

    Show one retains its existing presentation layout.

    Multi-card modes use a structured internal grid:
    header
    main content and optional answer
    optional discussion prompt
    fixed action row
  */

  .daily-content-stage-grid:not(.count-1)
  .daily-content-stage-card {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto
      auto;
    align-items: stretch;
    overflow: hidden;
  }

  .daily-content-stage-grid:not(.count-1)
  .daily-content-stage-card-header {
    align-self: start;
    margin: 0;
  }

  .daily-content-stage-grid:not(.count-1)
  .daily-content-stage-card
  > div:nth-child(2) {
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1vh, 13px);
    margin: 0 auto;
  }

  .daily-content-stage-grid:not(.count-1)
  .daily-content-stage-card-text {
    width: 100%;
    max-width: 100%;
    margin: 0;
    text-wrap: balance;
  }

  .daily-content-stage-grid:not(.count-1)
  .daily-content-discussion-prompt {
    align-self: end;
  }

  .daily-content-stage-grid:not(.count-1)
  .daily-content-stage-actions {
    width: 100%;
    min-width: 0;
    align-self: end;
    margin: 0;
  }

  /*
    =========================================================
    TWO CARDS — BALANCED SPLIT SCREEN
    =========================================================
  */

  .daily-content-stage-grid.count-2 {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    grid-template-rows:
      minmax(0, 1fr);
    gap: clamp(18px, 2vw, 28px);
    padding: clamp(22px, 2.4vw, 34px);
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-card {
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto
      auto;
    gap: clamp(14px, 1.8vh, 22px);
    padding:
      clamp(24px, 3vw, 42px);
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-card
  > div:nth-child(2) {
    width: min(100%, 700px);
    justify-content: center;
    gap: clamp(16px, 2vh, 26px);
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-icon {
    width: clamp(46px, 3.8vw, 66px);
    height: clamp(46px, 3.8vw, 66px);
    font-size: clamp(25px, 2.8vw, 42px);
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-card-title {
    font-size:
      clamp(16px, 1.45vw, 25px);
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-card-text {
    font-size:
      clamp(30px, 3.2vw, 56px);
    line-height: 1.06;
    letter-spacing: -1.3px;
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-card.type-word
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child,
  .daily-content-stage-grid.count-2
  .daily-content-stage-card.type-today
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child {
    font-size:
      clamp(38px, 4.4vw, 72px);
    line-height: 0.98;
  }

  .daily-content-stage-grid.count-2
  .daily-content-hidden-answer.revealed {
    width: min(100%, 620px);
    margin: 0 auto !important;
    padding:
      clamp(12px, 1.5vh, 18px)
      clamp(17px, 1.8vw, 26px);
    border-radius: 18px;
    font-size:
      clamp(17px, 1.55vw, 25px) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.3px !important;
  }

  .daily-content-stage-grid.count-2
  .daily-content-discussion-prompt {
    width: min(100%, 650px);
    padding: 10px 15px;
    font-size:
      clamp(12px, 1vw, 16px);
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-actions {
    gap: 7px;
    flex-wrap: nowrap;
  }

  .daily-content-stage-grid.count-2
  .daily-content-stage-action {
    min-height: 32px;
    padding: 6px 11px;
    font-size:
      clamp(9.5px, 0.78vw, 12px);
    white-space: nowrap;
  }

  /*
    =========================================================
    THREE CARDS — FOCUSED COLUMN LAYOUT
    =========================================================
  */

  .daily-content-stage-grid.count-3 {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    grid-template-rows:
      minmax(0, 1fr);
    gap: clamp(16px, 1.7vw, 24px);
    padding: clamp(20px, 2.2vw, 32px);
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-card {
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto;
    gap: clamp(12px, 1.5vh, 19px);
    padding:
      clamp(20px, 2vw, 30px);
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-card
  > div:nth-child(2) {
    justify-content: center;
    gap: clamp(11px, 1.3vh, 17px);
  }

  .daily-content-stage-grid.count-3
  .daily-content-discussion-prompt {
    display: none;
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-icon {
    width: clamp(42px, 3vw, 56px);
    height: clamp(42px, 3vw, 56px);
    font-size: clamp(22px, 2.2vw, 34px);
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-card-title {
    font-size:
      clamp(14px, 1.15vw, 20px);
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-card-text {
    font-size:
      clamp(26px, 2.45vw, 42px);
    line-height: 1.07;
    letter-spacing: -1px;
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-card.type-word
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child,
  .daily-content-stage-grid.count-3
  .daily-content-stage-card.type-today
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child {
    font-size:
      clamp(34px, 3.2vw, 54px);
    line-height: 1;
  }

  .daily-content-stage-grid.count-3
  .daily-content-hidden-answer.revealed {
    width: min(100%, 94%);
    margin: 0 auto !important;
    padding: 10px 13px;
    border-radius: 15px;
    font-size:
      clamp(14px, 1.1vw, 18px) !important;
    line-height: 1.17 !important;
    letter-spacing: -0.2px !important;
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-actions {
    gap: 5px;
    flex-wrap: nowrap;
  }

  .daily-content-stage-grid.count-3
  .daily-content-stage-action {
    min-width: 0;
    min-height: 29px;
    flex: 0 1 auto;
    gap: 3px;
    padding: 5px 8px;
    font-size:
      clamp(8.5px, 0.66vw, 10.5px);
    white-space: nowrap;
  }

  /*
    =========================================================
    FOUR CARDS — BALANCED DASHBOARD
    =========================================================
  */

  .daily-content-stage-grid.count-4 {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    grid-template-rows:
      repeat(2, minmax(0, 1fr));
    gap: clamp(15px, 1.5vw, 21px);
    padding: clamp(18px, 2vw, 28px);
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-card {
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto;
    gap: clamp(8px, 1vh, 13px);
    padding:
      clamp(16px, 1.7vw, 24px);
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-card
  > div:nth-child(2) {
    justify-content: center;
    gap: 9px;
  }

  .daily-content-stage-grid.count-4
  .daily-content-discussion-prompt {
    display: none;
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-icon {
    width: clamp(37px, 2.6vw, 49px);
    height: clamp(37px, 2.6vw, 49px);
    border-radius: 13px;
    font-size:
      clamp(20px, 1.9vw, 29px);
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-card-title {
    font-size:
      clamp(12px, 1vw, 17px);
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-card-text {
    font-size:
      clamp(21px, 2vw, 34px);
    line-height: 1.06;
    letter-spacing: -0.8px;
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-card.type-word
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child,
  .daily-content-stage-grid.count-4
  .daily-content-stage-card.type-today
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child {
    font-size:
      clamp(27px, 2.55vw, 43px);
  }

  .daily-content-stage-grid.count-4
  .daily-content-hidden-answer.revealed {
    width: min(100%, 94%);
    margin: 0 auto !important;
    padding: 8px 11px;
    border-radius: 13px;
    font-size:
      clamp(12px, 0.92vw, 16px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.1px !important;
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-actions {
    gap: 5px;
    flex-wrap: nowrap;
  }

  .daily-content-stage-grid.count-4
  .daily-content-stage-action {
    min-width: 0;
    min-height: 28px;
    flex: 0 1 auto;
    gap: 3px;
    padding: 5px 8px;
    font-size:
      clamp(8.5px, 0.66vw, 10.5px);
    white-space: nowrap;
  }

  /*
    =========================================================
    FIVE AND SIX CARDS — COMPACT GRID
    =========================================================
  */

  .daily-content-stage-grid.count-5,
  .daily-content-stage-grid.count-6 {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    grid-template-rows:
      repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 1.3vw, 18px);
    padding: clamp(16px, 1.8vw, 24px);
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-card,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card {
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto;
    gap: clamp(6px, 0.75vh, 9px);
    padding:
      clamp(12px, 1.2vw, 18px);
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-card
  > div:nth-child(2),
  .daily-content-stage-grid.count-6
  .daily-content-stage-card
  > div:nth-child(2) {
    justify-content: center;
    gap: 7px;
  }

  .daily-content-stage-grid.count-5
  .daily-content-discussion-prompt,
  .daily-content-stage-grid.count-6
  .daily-content-discussion-prompt {
    display: none;
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-icon,
  .daily-content-stage-grid.count-6
  .daily-content-stage-icon {
    width: clamp(31px, 2.15vw, 41px);
    height: clamp(31px, 2.15vw, 41px);
    border-radius: 11px;
    font-size:
      clamp(17px, 1.55vw, 25px);
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-card-header,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card-header {
    gap: 6px;
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-card-title,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card-title {
    font-size:
      clamp(10px, 0.82vw, 14px);
    line-height: 1;
    letter-spacing: 0.3px;
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-card-text,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card-text {
    font-size:
      clamp(17px, 1.55vw, 26px);
    line-height: 1.06;
    letter-spacing: -0.55px;
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-card.type-word
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card.type-word
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child,
  .daily-content-stage-grid.count-5
  .daily-content-stage-card.type-today
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card.type-today
  > div:nth-child(2)
  > .daily-content-stage-card-text:first-child {
    font-size:
      clamp(21px, 1.95vw, 32px);
  }

  .daily-content-stage-grid.count-5
  .daily-content-hidden-answer.revealed,
  .daily-content-stage-grid.count-6
  .daily-content-hidden-answer.revealed {
    width: min(100%, 96%);
    margin: 0 auto !important;
    padding: 7px 9px;
    border-radius: 11px;
    font-size:
      clamp(10px, 0.78vw, 13px) !important;
    line-height: 1.14 !important;
    letter-spacing: 0 !important;
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-actions,
  .daily-content-stage-grid.count-6
  .daily-content-stage-actions {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-action,
  .daily-content-stage-grid.count-6
  .daily-content-stage-action {
    min-width: 0;
    min-height: 26px;
    flex: 0 1 auto;
    gap: 3px;
    padding: 4px 7px;
    font-size:
      clamp(7.5px, 0.58vw, 9.5px);
    white-space: nowrap;
  }

  /*
    Keep answer panels visually subordinate in every
    multi-card layout.
  */

  .daily-content-stage-grid:not(.count-1)
  .daily-content-hidden-answer.revealed {
    border:
      1.5px solid
      color-mix(
        in srgb,
        var(--daily-card-accent) 30%,
        #ffffff
      );
    background:
      color-mix(
        in srgb,
        var(--daily-card-soft) 58%,
        #ffffff
      );
    color:
      var(--daily-card-accent) !important;
    box-shadow:
      inset 0 1px 0
      rgba(255, 255, 255, 0.82);
  }

  /*
    Revealing one answer must not move the action row.
  */

  .daily-content-stage-grid:not(.count-1)
  .daily-content-stage-actions {
    position: relative;
    z-index: 3;
  }

  /*
    Reduce decoration slightly in dense layouts.
  */

  .daily-content-stage-grid.count-4
  .daily-content-stage-card::before,
  .daily-content-stage-grid.count-5
  .daily-content-stage-card::before,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card::before {
    width: 112px;
    height: 112px;
    top: -43px;
    right: -35px;
  }

  .daily-content-stage-grid.count-5
  .daily-content-stage-card::after,
  .daily-content-stage-grid.count-6
  .daily-content-stage-card::after {
    width: 43px;
    height: 7px;
    right: 12px;
    bottom: 11px;
  }


      .class-calm-widget-actions {
      grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;
      gap: 6px;
    }

    .class-calm-toggle-button {
      border-color: #86efac !important;
      background: #eefbf4 !important;
      color: #166534 !important;
    }

    .class-calm-toggle-button.is-running {
      border-color: #fecaca !important;
      background: #fee2e2 !important;
      color: #991b1b !important;
    }

    .class-calm-toggle-button:disabled {
      cursor: wait;
      opacity: 0.72;
    }


    /* =========================================================
   GLOBAL TEACHER REMINDER
   ========================================================= */

.global-teacher-reminder {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 25000;

  width: min(
    370px,
    calc(100vw - 28px)
  );

  display: none;
  gap: 12px;

  padding: 15px;

  border:
    1px solid
    #f5c451;
  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #fffbeb
    );

  color: #1f2937;

  box-shadow:
    0 22px 54px
    rgba(15, 23, 42, 0.24),
    0 0 0 5px
    rgba(251, 191, 36, 0.13);

  overflow: hidden;

  animation:
    globalTeacherReminderEnter
    0.28s
    cubic-bezier(
      0.2,
      0.8,
      0.2,
      1
    )
    both;
}

.global-teacher-reminder.show {
  display: grid;
}

.global-teacher-reminder.show.attention {
  animation:
    globalTeacherReminderEnter
    0.28s
    cubic-bezier(
      0.2,
      0.8,
      0.2,
      1
    )
    both,
    globalTeacherReminderAttention
    0.52s
    ease-in-out
    0.3s
    2;
}

.global-teacher-reminder.is-duty {
  border-color: #86efac;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f0fdf4
    );

  box-shadow:
    0 22px 54px
    rgba(15, 23, 42, 0.24),
    0 0 0 5px
    rgba(34, 197, 94, 0.12);
}


.global-teacher-reminder.is-birthday {
  border-color: #f9a8d4;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #fdf2f8
    );

  box-shadow:
    0 22px 54px
    rgba(15, 23, 42, 0.20),
    0 0 0 5px
    rgba(236, 72, 153, 0.10);
}


.global-teacher-reminder.is-birthday
.global-teacher-reminder-icon {
  background: #fce7f3;
}


.global-teacher-reminder.is-birthday
.global-teacher-reminder-heading strong {
  color: #9d174d;
}


.global-teacher-reminder.is-birthday
.global-teacher-reminder-meta {
  color: #9d174d;
}


.global-teacher-reminder.is-birthday
.global-teacher-reminder-actions {
  display: flex;
}


.global-teacher-reminder.is-birthday
.global-teacher-reminder-button.primary {
  border-color: #db2777;
  background: #db2777;
}

.global-teacher-reminder-top {
  display: grid;
  grid-template-columns:
    38px
    minmax(0, 1fr)
    30px;
  gap: 10px;
  align-items: center;
}

.global-teacher-reminder-icon {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 13px;

  background: #fff3c4;

  font-size: 20px;
  line-height: 1;
}

.global-teacher-reminder.is-duty
.global-teacher-reminder-icon {
  background: #dcfce7;
}

.global-teacher-reminder-heading {
  min-width: 0;

  display: grid;
  gap: 3px;
}

.global-teacher-reminder-heading strong {
  color: #78350f;

  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}

.global-teacher-reminder.is-duty
.global-teacher-reminder-heading strong {
  color: #166534;
}

.global-teacher-reminder-heading span {
  color: #64748b;

  font-size: 10.5px;
  line-height: 1;
  font-weight: 900;
}

.global-teacher-reminder-close {
  width: 30px;
  height: 30px;

  display: grid;
  place-items: center;

  padding: 0;

  border:
    1px solid
    #e5e7eb;
  border-radius: 999px;

  background: #ffffff;
  color: #64748b;

  font-size: 18px;
  line-height: 1;
  font-weight: 900;

  cursor: pointer;
}

.global-teacher-reminder-close:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.global-teacher-reminder-text {
  color: #111827;

  font-size: 18px;
  line-height: 1.2;
  font-weight: 950;

  overflow-wrap: anywhere;
}

.global-teacher-reminder-meta {
  color: #64748b;

  font-size: 12px;
  line-height: 1.3;
  font-weight: 850;
}

.global-teacher-reminder-link {
  width: fit-content;

  color: #2563eb;

  font-size: 11px;
  line-height: 1;
  font-weight: 950;
}

.global-teacher-reminder-link:hover {
  text-decoration: underline;
}

.global-teacher-reminder-actions {
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
}

.global-teacher-reminder-actions
.global-teacher-reminder-button {
  min-width: 0;
  flex: 1 1 0;
  white-space: nowrap;
}

.global-teacher-reminder-button {
  min-height: 38px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 12px;

  border-radius: 999px;

  font-size: 11px;
  line-height: 1;
  font-weight: 950;

  cursor: pointer;
}

.global-teacher-reminder-button.secondary {
  border:
    1px solid
    #d1d5db;

  background: #ffffff;
  color: #475569;
}

.global-teacher-reminder-button.secondary:hover {
  background: #f8fafc;
}

.global-teacher-reminder-button.primary {
  border:
    1px solid
    #143f3a;

  background: #143f3a;
  color: #ffffff;
}

.global-teacher-reminder-button.primary:hover {
  filter: brightness(1.08);
}

/*
  Button display styles must not override the hidden attribute.
  Celebrate is birthday-only, while Snooze and Done are hidden
  during birthday alerts.
*/
.global-teacher-reminder-button[hidden] {
  display: none !important;
}

.global-teacher-reminder-more {
  width: fit-content;
  justify-self: center;

  padding: 3px 6px;

  border: 0;

  background: transparent;
  color: #b45309;

  font-size: 10.5px;
  line-height: 1.1;
  font-weight: 950;

  cursor: pointer;
}

.global-teacher-reminder-more:hover {
  text-decoration: underline;
}

/*
  Never expose private teacher reminders inside the separate
  smart-board or student-facing window.
*/

body.live-student-screen
.global-teacher-reminder,
body[data-live-student-screen="true"]
.global-teacher-reminder {
  display: none !important;
}

/*
  The reminder waits while a modal, welcome screen or guided
  tour is controlling the interface.
*/

body.global-teacher-reminder-paused
.global-teacher-reminder {
  display: none !important;
}

@keyframes globalTeacherReminderEnter {
  from {
    opacity: 0;

    transform:
      translateY(-10px)
      scale(0.97);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }
}

@keyframes globalTeacherReminderAttention {
  0%,
  100% {
    transform:
      translateX(0)
      scale(1);
  }

  20% {
    transform:
      translateX(-7px)
      rotate(-1deg)
      scale(1.015);
  }

  40% {
    transform:
      translateX(7px)
      rotate(1deg)
      scale(1.015);
  }

  60% {
    transform:
      translateX(-4px)
      rotate(-0.5deg)
      scale(1.01);
  }

  80% {
    transform:
      translateX(4px)
      rotate(0.5deg)
      scale(1.01);
  }
}

@media (max-width: 620px) {
  .global-teacher-reminder {
    top: 68px;
    right: 12px;
    left: 12px;

    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-teacher-reminder {
    animation: none;
  }
}

  .live-student-controller-focus {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 0 9px !important;
    overflow: hidden;
    white-space: nowrap;
    transition:
      width 0.2s ease,
      min-width 0.2s ease,
      max-width 0.2s ease,
      gap 0.2s ease,
      transform 0.15s ease,
      background 0.15s ease,
      border-color 0.15s ease;
  }

  .live-student-controller-focus-icon {
    width: 18px;
    min-width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
  }

  .live-student-controller-focus-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 10px;
    line-height: 1;
    font-weight: 950;
    transition:
      max-width 0.2s ease,
      opacity 0.14s ease;
  }

  .live-student-controller-focus:hover,
  .live-student-controller-focus:focus-visible {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    gap: 7px;
    outline: none;
    transform: translateY(-1px);
  }

  .live-student-controller-focus:hover
  .live-student-controller-focus-label,
  .live-student-controller-focus:focus-visible
  .live-student-controller-focus-label {
    max-width: 158px;
    opacity: 1;
  }

  .live-student-controller-focus:active {
    transform: scale(0.96);
  }


  .present-lesson-feedback-credit {
    width: fit-content;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid #fde68a;
    border-radius: 999px;
    background: #fffbeb;
    color: #92400e;
    font-size: 10.5px;
    line-height: 1;
    font-weight: 900;
  }

  .present-lesson-feedback-credit
  span:first-child {
    font-size: 13px;
    line-height: 1;
  }


  /*
    Compact desktop Class Board header.

    Keeps all existing controls and hover labels,
    but gives the classroom workspace more height.
  */

  @media (min-width: 1221px) {
    header {
      height: 48px;
      padding: 5px 10px;
    }

    main {
      height:
        calc(
          100vh - 52px
        );
    }

    .top-nav {
      gap: 8px;
    }

    .brand-row {
      gap: 8px;
    }

    .logo {
      font-size: 20px;
      letter-spacing: -0.8px;
    }

    .class-select-wrap {
      gap: 5px;
    }

    .class-select {
      padding: 6px 10px;
      font-size: 12px;
    }

    .nav-actions {
      gap: 6px;
    }

    .nav-primary-btn {
      min-height: 34px;
      padding: 7px 11px;
      font-size: 12px;
    }

    .compact-header-action {
      width: 36px;
      min-width: 36px;
      max-width: 36px;
      min-height: 36px;
      padding: 0 9px;
    }

    .compact-header-action-icon {
      width: 18px;
      min-width: 18px;
      height: 18px;
      font-size: 15px;
    }

    .compact-header-action-label {
      font-size: 11px;
    }

    .live-activities-button {
      width: 44px;
      min-width: 44px;
      max-width: 44px;
      min-height: 36px;
      padding: 0 5px;
    }

    .live-activities-status {
      width: 34px;
      min-width: 34px;
      height: 18px;
      font-size: 7.5px;
    }

    .board-menu-trigger {
      width: 36px;
      min-width: 36px;
      max-width: 36px;
    }
  }


  .class-board-feedback-ambassador-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid #f2c94c;
  border-radius: 15px;
  background:
    linear-gradient(
      135deg,
      #fffdf3,
      #fff7d6
    );
  color: #4b3710;
  cursor: pointer;
  box-shadow:
    0 5px 14px rgba(180, 128, 0, 0.08);
}

.class-board-feedback-ambassador-option:hover {
  border-color: #e5ad16;
  background:
    linear-gradient(
      135deg,
      #fffbea,
      #ffefb3
    );
}

.class-board-feedback-ambassador-option input {
  width: 19px;
  height: 19px;
  margin: 3px 0 0;
  accent-color: #d99a00;
}

.class-board-feedback-ambassador-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.class-board-feedback-ambassador-badge {
  width: fit-content;
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f6c94c;
  color: #513900;
  font-size: 8.5px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.class-board-feedback-ambassador-option strong {
  color: #4b3710;
  font-size: 14px;
  line-height: 1.18;
  font-weight: 950;
}

.class-board-feedback-ambassador-option small {
  color: #735b24;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 750;
}

.class-board-feedback-ambassador-benefit {
  color: #7a5700;
  font-size: 10.5px;
  line-height: 1.3;
  font-weight: 950;
}

.class-board-feedback-ambassador-choice {
  margin-top: 2px;
  color: #4b3710;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 900;
}

.class-board-feedback-consent-note {
  margin: 0;
  padding: 9px 11px;
  border-radius: 11px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 750;
}

/* =========================================================
   MOBILE CLASS BOARD HEADER
   Logo, class selector and Menu only.
   ========================================================= */

@media (max-width: 760px) {
  header {
    position: sticky !important;
    top: 3px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding:
      calc(9px + env(safe-area-inset-top))
      12px
      10px !important;
  }

  .top-nav {
    width: 100% !important;
    display: grid !important;
    grid-template-columns:
      minmax(0, 1fr)
      auto !important;
    grid-template-areas:
      "logo logo"
      "class menu" !important;
    gap: 9px 10px !important;
    align-items: center !important;
  }

  .brand-row {
    display: contents !important;
  }

  .logo {
    grid-area: logo !important;
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    font-size: 19px !important;
    line-height: 1 !important;
    letter-spacing: -0.6px !important;
  }

  .class-select-wrap {
    grid-area: class !important;
    width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    margin: 0 !important;
  }

  .class-select-wrap label,
  .manage-classes-header-btn,
  .attendance-header-btn {
    display: none !important;
  }

  .class-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 38px 8px 13px !important;
    border-radius: 13px !important;
    font-size: 14px !important;
  }

  .nav-actions {
    grid-area: menu !important;
    width: auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0 !important;
  }

  .nav-actions > * {
    display: none !important;
  }

  .nav-actions > .board-menu-wrap {
    display: block !important;
  }

  .present-lesson-launch-group,
  .present-to-class-btn,
  .present-lesson-setup-btn,
  #focusModeBtn,
  #presentLessonSetupBtn {
    display: none !important;
  }

  .board-menu-wrap {
    position: relative !important;
    width: auto !important;
    flex: 0 0 auto !important;
  }

  .board-menu-trigger {
    width: auto !important;
    min-width: 92px !important;
    max-width: none !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 9px 14px !important;
    border-radius: 13px !important;
  }

  .board-menu-trigger
  .compact-header-action-label {
    max-width: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    font-size: 13px !important;
  }

  .board-menu-trigger
  .compact-header-action-icon {
    width: auto !important;
    min-width: 0 !important;
    font-size: 17px !important;
  }

  .today-ready-screens-group {
    display: grid !important;
    grid-template-columns:
      minmax(0, 1fr)
      auto !important;
    grid-template-areas:
      "title manage"
      "screens screens" !important;
    gap: 9px 10px !important;
    align-items: center !important;
  }

  .today-ready-title {
    grid-area: title !important;
    margin: 0 !important;
    min-width: 0 !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
  }

  .today-ready-grid {
    grid-area: screens !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .today-ready-choose-button {
    grid-area: manage !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    white-space: nowrap !important;
    justify-self: end !important;
  }

  .today-ready-choose-label {
    display: inline !important;
  }

  .today-daily-content-actions
  .today-daily-content-action:last-child {
    display: none !important;
  }
}

/* Keep Manage classes and Edit timetable permanently expanded */
@media (min-width: 761px) {
  .class-select-wrap .manage-classes-header-btn,
  .class-select-wrap
  button[aria-label="Edit weekly timetable"] {
    width: 132px !important;
    min-width: 132px !important;
    max-width: 132px !important;
    padding-left: 13px !important;
    padding-right: 13px !important;
    gap: 7px !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    justify-content: flex-start !important;
  }

  .class-select-wrap
  .manage-classes-header-btn
  .compact-header-action-label,
  .class-select-wrap
  button[aria-label="Edit weekly timetable"]
  .compact-header-action-label {
    display: inline-block !important;
    max-width: 92px !important;
    width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    white-space: nowrap !important;
  }
}


/* Dashboard cards stay neutral */
.essentials-preference-card-dashboard {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

.essentials-preference-card-dashboard:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}


/* Today bar cards visually match the green Today bar */
.essentials-preference-card-today {
  min-height: 102px !important;
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
  box-shadow:
    0 3px 9px rgba(22, 101, 52, 0.045) !important;
}

.essentials-preference-card-today:hover {
  border-color: #4ade80 !important;
  background: #dcfce7 !important;
}


/* A checked Today-bar choice gets a stronger selected state */
.essentials-preference-card-today:has(input:checked) {
  border-color: #4ade80 !important;
  background: #dcfce7 !important;
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.08),
    0 5px 12px rgba(22, 101, 52, 0.07) !important;
}


/* Unchecked / disabled Today option stays obviously available but inactive */
.essentials-preference-card-today:has(input:disabled:not(:checked)) {
  opacity: 0.58;
  background: #f8fafc !important;
  border-color: #e5e7eb !important;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .essentials-preference-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  .essentials-preference-grid {
    grid-template-columns:
      1fr !important;
  }
}


/* =========================================================
   ESSENTIALS COLLAPSIBLE SECTIONS
   ========================================================= */

.essentials-customise-section > summary::-webkit-details-marker {
  display: none;
}

.essentials-customise-section > summary::marker {
  content: "";
}

.essentials-customise-section > summary:hover {
  filter: brightness(0.985);
}

.essentials-customise-section
.essentials-section-chevron {
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.essentials-customise-section[open]
.essentials-section-chevron {
  transform: rotate(90deg);
}


/* Stronger distinction between the two sections */

.essentials-today-section > summary {
  background: #f0fdf4;
}

.essentials-dashboard-section > summary {
  background: #f8fafc;
}


/* Divider appears only while expanded */

.essentials-customise-section[open] > summary {
  border-bottom: 1px solid rgba(203, 213, 225, 0.55);
  margin-bottom: 12px;
}


/* =========================================================
   ESSENTIALS — FOCUSED TWO-CARD WORKSPACE
   Keep the whole dashboard inside the space above the toolbar.
   ========================================================= */

body.teacher-essentials-mode[data-stage="today"]
.stage-card {
  height: 100% !important;
  min-height: 0 !important;
  align-self: stretch !important;

  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;

  overflow: hidden !important;
}

body.teacher-essentials-mode[data-stage="today"]
.stage-body {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.teacher-essentials-mode[data-stage="today"]
.today-view-shell {
  height: 100% !important;
  min-height: 0 !important;

  grid-template-rows:
    auto
    auto
    auto
    minmax(0, 1fr)
    auto !important;

  align-content: stretch !important;
  overflow: hidden !important;
}

body.teacher-essentials-mode[data-stage="today"]
.today-view-grid {
  min-height: 0 !important;
  height: 100% !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid {
  grid-template-columns:
    minmax(0, 1.4fr)
    minmax(360px, 0.95fr) !important;

  gap: 14px !important;
}

body.teacher-essentials-mode.essentials-main-count-2
.today-view-grid > * {
  min-height: 0 !important;
  height: 100% !important;
}

body.teacher-essentials-mode[data-stage="today"]
.today-bottom-grid {
  flex: 0 0 auto !important;
  min-height: 96px !important;
  max-height: 112px !important;
  overflow: hidden !important;
}

body.teacher-essentials-mode[data-stage="today"]
.today-resource-panel {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.teacher-essentials-customise-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 7px 11px;

  border: 1px solid #bbf7d0;
  border-radius: 999px;

  background: #eefbf4;
  color: #166534;

  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.teacher-essentials-customise-button:hover,
.teacher-essentials-customise-button:focus-visible {
  border-color: #86efac;
  background: #dcfce7;
  box-shadow:
    0 3px 8px rgba(22, 101, 52, 0.08);

  outline: none;
  transform: translateY(-1px);
}

.teacher-essentials-customise-button:active {
  transform: scale(0.97);
}

.classboard-week-navigator {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 5px;
  border: 1px solid #d9fbe8;
  border-radius: 999px;
  background: #eefbf4;
  color: #143f3a;
}

.classboard-week-navigator[hidden] {
  display: none !important;
}

.classboard-week-nav-button {
  width: 25px;
  height: 25px;
  min-width: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #143f3a;
  font-size: 17px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

.classboard-week-nav-button:hover:not(:disabled) {
  background: #dcfce7;
}

.classboard-week-nav-button:active:not(:disabled) {
  transform: scale(0.92);
}

.classboard-week-nav-button:disabled {
  opacity: 0.28;
  cursor: default;
}

.classboard-week-label {
  min-width: 25px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 950;
}

.timetable-panel-actions
.classboard-week-navigator {
  min-height: 29px;
  padding: 2px 4px;
  gap: 2px;
}

.timetable-panel-actions
.classboard-week-nav-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  font-size: 15px;
}

.timetable-panel-actions
.classboard-week-label {
  min-width: 22px;
  font-size: 10px;
}

header .edit-timetable-header-btn,
header .timetable-stage-header-btn {
  width: auto !important;
  min-width: 118px !important;
  max-width: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  padding: 0 12px !important;
}

header .edit-timetable-header-btn
.compact-header-action-label,
header .timetable-stage-header-btn
.compact-header-action-label {
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

.student-instruction-one-step {
  width: 100%;
  display: grid;
  grid-template-rows:
    auto
    minmax(0, 1fr);
  gap: 14px;
  outline: none;
}

.student-instruction-navigation {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns:
    54px
    minmax(0, 1fr)
    54px;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  background: #f8fafc;
}

.student-instruction-progress {
  justify-self: center;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  background: #23436c;
  color: #ffffff;
  font-size: clamp(14px, 1.35vw, 19px);
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

/* =========================================================
   CURRENT STEP ATTACHMENTS

   Teacher View:
   keep attachments with the lesson text.

   Present to Class:
   move the current step's tools and links beside
   the Step X of Y indicator so they are always visible.
   ========================================================= */

.student-instruction-navigation-centre {
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;
}


/*
  Hidden in normal Teacher View.
*/
.student-instruction-nav-attachments {
  display: none;
}


.student-instruction-copy-attachments {
  display: block;
}


/*
  Present to Class:
  show attachments beside Step X of Y.
*/
body.focus-mode[data-stage="task"]
.student-instruction-nav-attachments,
body.fullscreen-active[data-stage="task"]
.student-instruction-nav-attachments {
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 6px;

  flex-wrap: wrap;
}


/*
  Do not repeat the same attachments lower down
  inside the instruction card while presenting.
*/
body.focus-mode[data-stage="task"]
.student-instruction-copy-attachments,
body.fullscreen-active[data-stage="task"]
.student-instruction-copy-attachments {
  display: none !important;
}


/*
  Slightly stronger chips in projector mode
  so they remain obvious next to Step X of Y.
*/
body.focus-mode[data-stage="task"]
.student-instruction-nav-attachments
.lesson-attachment-chip,
body.fullscreen-active[data-stage="task"]
.student-instruction-nav-attachments
.lesson-attachment-chip {
  min-height: 34px;

  padding:
    7px
    11px;

  font-size:
    11px;

  box-shadow:
    0 3px 8px
    rgba(
      15,
      23,
      42,
      0.07
    );
}


/*
  If there are several links, allow the centre section
  to wrap rather than pushing the navigation arrows away.
*/
@media (max-width: 900px) {
  body.focus-mode[data-stage="task"]
  .student-instruction-navigation-centre,
  body.fullscreen-active[data-stage="task"]
  .student-instruction-navigation-centre {
    flex-wrap: wrap;
    gap: 5px;
  }
}

.student-instruction-nav-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #23436c;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

.student-instruction-nav-button.next {
  justify-self: end;
}

.student-instruction-nav-button:hover:not(:disabled),
.student-instruction-nav-button:focus-visible:not(:disabled) {
  background: #e8f1ff;
  outline: none;
}

.student-instruction-nav-button:disabled {
  opacity: 0.22;
  cursor: default;
}

.student-instruction-focus-card {
  width: 100%;
  min-height: 190px;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr);
  gap: 0;
  align-items: center;
  padding: clamp(24px, 3vw, 42px);
  border: 2px solid #23436c;
  border-radius: 24px;
  background:
    linear-gradient(
      135deg,
      #f1fff8,
      #ffffff 42%
    );
}

.student-instruction-step-number {
  display: none !important;
}

body.focus-mode
.student-instruction-focus-card
.student-instruction-step-number,
body.fullscreen-active
.student-instruction-focus-card
.student-instruction-step-number {
  display: none;
}

body.focus-mode
.student-instruction-focus-card,
body.fullscreen-active
.student-instruction-focus-card {
  grid-template-columns:
    minmax(0, 1fr);
  gap: 0;
}

body.focus-mode
.student-instruction-focus-card
.student-instruction-step-copy,
body.fullscreen-active
.student-instruction-focus-card
.student-instruction-step-copy {
  width: 100%;
  min-width: 0;
}

.student-instruction-step-copy {
  min-width: 0;
}

.student-instruction-step-title {
  margin-bottom: 10px;
  color: #23436c;
  font-size: clamp(27px, 3vw, 44px);
  line-height: 1.05;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.student-instruction-step-text {
  color: #334155;
  font-size: clamp(22px, 2.35vw, 36px);
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .student-instruction-focus-card {
    grid-template-columns:
      64px
      minmax(0, 1fr);
    gap: 14px;
    padding: 20px;
  }

  .student-instruction-step-number {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    font-size: 23px;
  }

  body.focus-mode
  .student-instruction-focus-card,
  body.fullscreen-active
  .student-instruction-focus-card {
    grid-template-columns:
      minmax(0, 1fr);
    gap: 0;
  }
}

/* =========================================================
   ROUTINE + TASK
   ========================================================= */

.routine-task-layout {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  min-width: 0;
}

.routine-task-layout.has-task {
  display: grid;
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(270px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.routine-task-card {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;

  display: flex;
  flex-direction: column;

  overflow: hidden;
  padding: 20px;
  border: 2px solid
    color-mix(
      in srgb,
      var(--board-accent) 48%,
      #d1d5db
    );
  border-radius: 20px;
  background:
    linear-gradient(
      145deg,
      #ffffff,
      color-mix(
        in srgb,
        var(--board-accent) 8%,
        #ffffff
      )
    );
  box-shadow:
    0 9px 22px
    rgba(15, 23, 42, 0.08);
}

.routine-task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.routine-task-card-label {
  margin-bottom: 5px;
  color: var(--board-accent-2);
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.8px;
}

.routine-task-card-title {
  color: var(--board-ink);
  font-size: clamp(18px, 1.7vw, 25px);
  line-height: 1.12;
  font-weight: 950;
}

.routine-task-card-text {
  flex: 1 1 auto;
  min-height: 0;

  display: block;

  color: #111827;

  font-size: 30px;
  line-height: 1.22;
  font-weight: 900;

  overflow-y: auto;
  overflow-x: hidden;

  overscroll-behavior: contain;
  scrollbar-gutter: stable;

  overflow-wrap: anywhere;
  word-break: normal;

  padding-right: 4px;
}

#routineTaskModal.modal-backdrop.show {
  z-index: 1000100 !important;
}

#routineTaskModal.modal-backdrop.show
.modal-card {
  position: relative;
  z-index: 1000101 !important;
}

@media (max-width: 820px) {
  .routine-task-layout.has-task {
    grid-template-columns: 1fr;
  }

  .routine-task-card {
    min-height: auto;
  }
}
.specialist-timetable-mode-row {
  width: 100%;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  align-items: center;
  margin-bottom: 12px;
}


/* =========================================================
   SIDE STUDENT INSTRUCTIONS — SCROLLABLE

   Used when instructions share the screen with
   Slides / Video / lesson tools.
   ========================================================= */

.task-slides-instruction-panel {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;

  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.task-slides-instruction-panel
.instruction-formatted {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/*
  Do not let the instruction card itself consume
  an artificial 100% height in the narrow side panel.
*/
.task-slides-instruction-panel
.student-instruction-one-step {
  height: auto !important;
  min-height: 0 !important;
}

.task-slides-instruction-panel
.student-instruction-focus-card {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow: visible !important;
}


/* Slim scrollbar */
.task-slides-instruction-panel::-webkit-scrollbar {
  width: 7px;
}

.task-slides-instruction-panel::-webkit-scrollbar-track {
  background: transparent;
}

.task-slides-instruction-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.task-slides-instruction-panel::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.task-slides-instruction-panel {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}


.present-toolbar-tools-picker {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  flex: 0 0 auto;
}

.present-toolbar-tools-picker
.clean-focus-tool-picker-menu {
  left: 50%;
  bottom:
    calc(
      100% +
      9px
    );

  transform:
    translateX(-50%);
}

/*
  Reserve a smaller safe bottom area in Present mode.
*/
body.present-to-class-active .focus-mode-stage,
body.present-to-class-active .present-stage,
body.present-to-class-active .task-stage,
body.present-to-class-active .daily-content-stage,
body.present-to-class-active .clean-focus-stage-shell,
body.present-to-class-active .clean-focus-stage-body {
  padding-bottom: 58px !important;
  box-sizing: border-box;
}

/*
  Ultra-compact floating Present toolbar.
*/
body.present-to-class-active .present-to-class-control-strip {
  min-height: 32px !important;
  height: 32px !important;
  max-height: 32px !important;

  padding: 2px 5px !important;
  gap: 3px !important;

  border-radius: 18px !important;

  bottom: 3px !important;
}

/*
  Make each control much shorter.
*/
body.present-to-class-active .present-to-class-control-strip > button,
body.present-to-class-active .present-to-class-control-strip > details > summary,
body.present-to-class-active .present-toolbar-tools-picker .clean-focus-tool-picker-button {
  min-height: 26px !important;
  height: 26px !important;
  max-height: 26px !important;

  padding: 0 8px !important;

  border-radius: 14px !important;

  font-size: 9.5px !important;
  line-height: 1 !important;
}

/*
  Keep Return compact too.
*/
body.present-to-class-active .present-return-trigger {
  min-height: 26px !important;
  height: 26px !important;
  max-height: 26px !important;

  padding: 0 8px !important;

  font-size: 9px !important;
  line-height: 1 !important;
}

/*
  Reduce internal spacing.
*/
body.present-to-class-active .present-to-class-control-strip > details,
body.present-to-class-active .present-toolbar-tools-picker {
  margin: 0 !important;
}

/*
  Smaller icons.
*/
body.present-to-class-active .present-to-class-control-strip svg,
body.present-to-class-active .present-to-class-control-strip .icon,
body.present-to-class-active .present-to-class-control-strip img {
  width: 11px !important;
  height: 11px !important;
}

/*
  Keep text compact.
*/
body.present-to-class-active .present-to-class-control-strip strong,
body.present-to-class-active .present-to-class-control-strip span,
body.present-to-class-active .present-to-class-control-strip small {
  font-size: 9.5px !important;
  line-height: 1 !important;
}

/* =========================================================
   ROUTINE SIDE CONTENT
   Daily Task OR Presentation
   ========================================================= */

.routine-task-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;

  display: grid;
  gap: 16px;

  align-items: stretch;

  overflow: hidden;
}


/*
  No side content.
*/
.routine-task-layout.routine-side-none {
  grid-template-columns:
    minmax(0, 900px);

  justify-content: center;
}


/*
  Existing Daily Task balance.
*/
.routine-task-layout.routine-side-task {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(260px, 0.42fr);
}


/*
  Normal Teacher view with presentation.

  Use the full available Routine width.
*/
body:not(.focus-mode)
.routine-task-layout.routine-side-presentation {
  width:
    100%;

  max-width:
    none;

  margin:
    0;

  grid-template-columns:
    minmax(360px, 0.82fr)
    minmax(500px, 1.18fr);

  gap:
    16px;
}


/*
  Normal Teacher view with timetable hidden.

  Give the Routine steps more of the newly
  available horizontal space.
*/
body:not(.focus-mode).left-rail-collapsed
.routine-task-layout.routine-side-presentation {
  grid-template-columns:
    minmax(500px, 0.98fr)
    minmax(500px, 1.02fr);

  gap:
    16px;
}


/*
  Present to Class with timetable visible.

  Routine can use either the "steps" or "routines"
  stage name, so support both.
*/
body.focus-mode[data-stage="steps"]:not(
  .left-rail-collapsed
)
.routine-task-layout.routine-side-presentation,
body.focus-mode[data-stage="routines"]:not(
  .left-rail-collapsed
)
.routine-task-layout.routine-side-presentation,
body.present-to-class-active[data-stage="steps"]:not(
  .left-rail-collapsed
)
.routine-task-layout.routine-side-presentation,
body.present-to-class-active[data-stage="routines"]:not(
  .left-rail-collapsed
)
.routine-task-layout.routine-side-presentation,
body.fullscreen-active[data-stage="steps"]:not(
  .left-rail-collapsed
)
.routine-task-layout.routine-side-presentation,
body.fullscreen-active[data-stage="routines"]:not(
  .left-rail-collapsed
)
.routine-task-layout.routine-side-presentation {
  width:
    100% !important;

  max-width:
    none !important;

  margin:
    0 !important;

  grid-template-columns:
    minmax(500px, 0.95fr)
    minmax(520px, 1.05fr) !important;

  gap:
    18px !important;
}


/*
  Present to Class with timetable hidden.

  Use substantially more of the available classroom width.
*/
body.focus-mode.left-rail-collapsed[data-stage="steps"]
.routine-task-layout.routine-side-presentation,
body.focus-mode.left-rail-collapsed[data-stage="routines"]
.routine-task-layout.routine-side-presentation,
body.present-to-class-active.left-rail-collapsed[data-stage="steps"]
.routine-task-layout.routine-side-presentation,
body.present-to-class-active.left-rail-collapsed[data-stage="routines"]
.routine-task-layout.routine-side-presentation,
body.fullscreen-active.left-rail-collapsed[data-stage="steps"]
.routine-task-layout.routine-side-presentation,
body.fullscreen-active.left-rail-collapsed[data-stage="routines"]
.routine-task-layout.routine-side-presentation {
  width:
    100% !important;

  max-width:
    none !important;

  margin:
    0 !important;

  grid-template-columns:
    minmax(620px, 1.08fr)
    minmax(560px, 0.92fr) !important;

  gap:
    18px !important;
}


/*
  Routine step list is always the scrollable area.

  This applies to:
  - Show All Steps
  - Daily Task beside Routine
  - Presentation beside Routine
  - normal teacher view
  - Present to Class
  - fullscreen
*/
.routine-main-steps {
  min-height:
    0 !important;

  height:
    100% !important;

  max-height:
    100% !important;

  display:
    grid !important;

  grid-auto-rows:
    max-content !important;

  align-content:
    start !important;

  gap:
    8px !important;

  overflow-y:
    auto !important;

  overflow-x:
    hidden !important;

  overscroll-behavior:
    contain;

  scrollbar-gutter:
    stable;

  padding-right:
    6px !important;

  padding-bottom:
    14px !important;

  -webkit-overflow-scrolling:
    touch;
}

.routine-side-presentation
.fun-step-row {
  min-height: 58px !important;
  height: auto !important;
  max-height: none !important;

  padding-top: 8px !important;
  padding-bottom: 8px !important;

  align-items: center !important;

  overflow: visible !important;
}

.routine-side-presentation
.fun-step-row p {
  min-width: 0;
  height: auto !important;
  min-height: 0;
  max-height: none !important;

  margin: 0 !important;

  font-size:
    clamp(
      13px,
      1.05vw,
      17px
    ) !important;

  line-height:
    1.25 !important;

  white-space: normal !important;

  overflow: visible !important;

  text-overflow: clip !important;

  overflow-wrap: break-word;
  word-break: normal;
}


/*
  Presentation card.
*/
.routine-presentation-card {
  min-width: 0;
  width: 100%;

  display: grid;

  grid-template-rows:
    auto
    minmax(0, 1fr);

  gap: 8px;

  padding: 10px;

  border:
    1px solid
    #bfdbfe;

  border-radius:
    18px;

  background:
    #ffffff;

  box-shadow:
    0 10px 24px
    rgba(
      15,
      23,
      42,
      0.08
    );
}


/*
  Presentation heading.
*/
.routine-presentation-header {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 8px;
}


.routine-presentation-label {
  color:
    #2563eb;

  font-size:
    10px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.6px;
}


/*
  Compact Routine presentation area.

  Keeps the presentation large enough to read
  without allowing portrait / paper-sized content
  to push Routine steps off screen.
*/
.routine-presentation-frame-wrap {
  position: relative;

  width: 100%;

  height:
    clamp(
      220px,
      42vh,
      360px
    );

  min-height:
    220px;

  max-height:
    360px;

  overflow:
    hidden;

  border:
    1px solid
    #dbeafe;

  border-radius:
    13px;

  background:
    #f8fafc;
}


.routine-presentation-frame {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  border: 0;

  background:
    #ffffff;
}


.routine-presentation-image {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  display: block;

  object-fit: contain;
  object-position: center;

  background:
    #ffffff;
}


/*
  Empty presentation state.
*/
.routine-presentation-card.empty {
  min-height:
    300px;
}


/*
  Smaller screens stack the two sections.
*/
@media (
  max-width:
    1000px
) {
  .routine-task-layout.routine-side-task,
  .routine-task-layout.routine-side-presentation {
    grid-template-columns:
      1fr;
  }

  .routine-presentation-frame-wrap {
    min-height:
      240px;
  }
}

/* =========================================================
   TIMETABLE HEADER + SCHEDULE PATTERN
   ========================================================= */

.timetable-editor-header {
  align-items: center;
}

.timetable-editor-header-main {
  min-width: 0;
  flex: 1 1 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 22px;
}

.timetable-editor-header-copy {
  min-width: 0;
  flex: 1 1 auto;

  display: grid;
  gap: 5px;
}

.timetable-editor-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.timetable-editor-header-copy h2 {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.timetable-editor-header-copy p {
  margin: 0;

  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;

  white-space: nowrap;
}

/* =========================================================
   TRACKEDU AI BRANDING
   Visible product-level AI identity for Class Board
   ========================================================= */

.classboard-ai-brand {
  position: relative;

  display: inline-flex;
  align-items: center;

  gap: 5px;

  min-height: 25px;

  padding:
    4px
    9px;

  flex:
    0 0 auto;

  overflow: hidden;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.24
    );

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #f5f3ff 0%,
      #eef2ff 38%,
      #ecfeff 70%,
      #faf5ff 100%
    );

  color:
    #4338ca;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.25px;

  white-space:
    nowrap;

  box-shadow:
    0 3px 10px
    rgba(
      99,
      102,
      241,
      0.10
    );

  cursor:
    default;
}


.classboard-ai-brand::before {
  content: "";

  position: absolute;

  width:
    38px;

  height:
    70px;

  top:
    -24px;

  left:
    -50px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(
        255,
        255,
        255,
        0.82
      ),
      transparent
    );

  transform:
    rotate(
      18deg
    );

  animation:
    classboardAiBrandShimmer
    5s
    ease-in-out
    infinite;

  pointer-events:
    none;
}


.classboard-ai-brand-mark {
  position: relative;

  z-index: 2;

  display: inline-grid;

  width:
    17px;

  height:
    17px;

  place-items:
    center;

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #4f46e5,
      #7c3aed,
      #0891b2
    );

  color:
    #ffffff;

  font-size:
    10px;

  line-height:
    1;

  box-shadow:
    0 2px 7px
    rgba(
      79,
      70,
      229,
      0.28
    );

  animation:
    classboardAiBrandPulse
    2.6s
    ease-in-out
    infinite;
}


.classboard-ai-brand-copy {
  position: relative;

  z-index: 2;

  display: inline-flex;

  align-items:
    baseline;

  gap:
    3px;
}


.classboard-ai-brand-copy strong {
  color:
    #312e81;

  font-weight:
    950;
}


.classboard-ai-brand-copy span {
  color:
    #6366f1;

  font-weight:
    950;
}


@keyframes classboardAiBrandShimmer {
  0%,
  70% {
    left:
      -50px;
  }

  100% {
    left:
      calc(
        100% + 25px
      );
  }
}


@keyframes classboardAiBrandPulse {
  0%,
  100% {
    transform:
      scale(
        0.94
      );

    box-shadow:
      0 2px 7px
      rgba(
        79,
        70,
        229,
        0.22
      );
  }

  50% {
    transform:
      scale(
        1.08
      );

    box-shadow:
      0 3px 12px
      rgba(
        124,
        58,
        237,
        0.38
      );
  }
}


@media (
  max-width:
  760px
) {
  .classboard-ai-brand-copy
  strong {
    display:
      none;
  }

  .classboard-ai-brand {
    padding:
      4px
      7px;
  }
}


@media (
  prefers-reduced-motion:
  reduce
) {
  .classboard-ai-brand::before,
  .classboard-ai-brand-mark {
    animation:
      none;
  }
}

/* =========================================================
   DAILY TEACHERTOOLS AI BRAND MARK
   ========================================================= */

.daily-tools-ai-mark {
  position: relative;

  display: inline-flex;
  align-items: center;

  gap: 3px;

  min-height: 21px;

  margin-left: 7px;

  padding:
    4px
    7px;

  overflow: hidden;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.26
    );

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #eef2ff 0%,
      #f5f3ff 42%,
      #ecfeff 100%
    );

  color:
    #4f46e5;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.35px;

  box-shadow:
    0 2px 8px
    rgba(
      79,
      70,
      229,
      0.12
    );
}


.daily-tools-ai-mark::before {
  content: "";

  position: absolute;

  width:
    35px;

  height:
    50px;

  top:
    -15px;

  left:
    -45px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(
        255,
        255,
        255,
        0.9
      ),
      transparent
    );

  transform:
    rotate(
      18deg
    );

  animation:
    dailyToolsAiShimmer
    4.5s
    ease-in-out
    infinite;

  pointer-events:
    none;
}


.daily-tools-ai-star {
  position: relative;

  z-index: 2;

  color:
    #7c3aed;

  font-size:
    12px;

  animation:
    dailyToolsAiSpark
    2.1s
    ease-in-out
    infinite;
}


@keyframes dailyToolsAiShimmer {
  0%,
  68% {
    left:
      -45px;
  }

  100% {
    left:
      calc(
        100% + 20px
      );
  }
}


@keyframes dailyToolsAiSpark {
  0%,
  100% {
    transform:
      scale(
        0.85
      )
      rotate(
        -6deg
      );

    opacity:
      0.7;
  }

  50% {
    transform:
      scale(
        1.2
      )
      rotate(
        8deg
      );

    opacity:
      1;
  }
}


@media (
  prefers-reduced-motion:
  reduce
) {
  .daily-tools-ai-mark::before,
  .daily-tools-ai-star {
    animation:
      none;
  }
}

.timetable-header-smart-import {
  position: relative;

  min-height: 36px;
  padding: 8px 15px;

  flex: 0 0 auto;

  overflow: hidden;

  border:
    1px solid
    rgba(
      124,
      58,
      237,
      0.28
    ) !important;

  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      #f5f3ff 0%,
      #eef2ff 34%,
      #ecfeff 68%,
      #fdf4ff 100%
    ) !important;

  color: #4338ca !important;

  font-weight: 950;

  box-shadow:
    0 3px 10px
    rgba(
      99,
      102,
      241,
      0.12
    ),
    inset 0 1px 0
    rgba(
      255,
      255,
      255,
      0.9
    );

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
}


.timetable-header-smart-import::before {
  content: "";

  position: absolute;

  width: 70px;
  height: 120px;

  top: -45px;
  left: -85px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(
        255,
        255,
        255,
        0.78
      ),
      transparent
    );

  transform:
    rotate(18deg);

  animation:
    timetableAiButtonShimmer
    4.5s
    ease-in-out
    infinite;

  pointer-events: none;
}


.timetable-header-smart-import::after {
  content: "✦";

  margin-left: 2px;

  color: #7c3aed;

  font-size: 11px;

  animation:
    timetableAiSparkle
    2s
    ease-in-out
    infinite;
}


.timetable-header-smart-import:hover {
  transform:
    translateY(-2px)
    scale(1.02);

  border-color:
    rgba(
      99,
      102,
      241,
      0.55
    ) !important;

  background:
    linear-gradient(
      135deg,
      #ede9fe 0%,
      #e0e7ff 34%,
      #cffafe 68%,
      #fae8ff 100%
    ) !important;

  box-shadow:
    0 8px 20px
    rgba(
      99,
      102,
      241,
      0.2
    );

  filter:
    brightness(1.02);
}


.timetable-header-smart-import:active {
  transform:
    translateY(0)
    scale(0.97) !important;
}


@keyframes timetableAiButtonShimmer {
  0%,
  65% {
    left: -85px;
  }

  100% {
    left: calc(100% + 40px);
  }
}


@keyframes timetableAiSparkle {
  0%,
  100% {
    opacity: 0.5;

    transform:
      scale(0.85)
      rotate(0deg);
  }

  50% {
    opacity: 1;

    transform:
      scale(1.2)
      rotate(18deg);
  }
}


@media (
  prefers-reduced-motion:
  reduce
) {
  .timetable-header-smart-import::before,
  .timetable-header-smart-import::after {
    animation: none;
  }
}


/* =========================================================
   TRACKEDU AI EXPERIENCE
   ========================================================= */

.trackedu-ai-button {
  position: relative;
  isolation: isolate;

  min-height: 44px;
  padding: 10px 20px;

  overflow: hidden;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.42
    ) !important;

  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      #312e81 0%,
      #4f46e5 36%,
      #7c3aed 68%,
      #0891b2 100%
    ) !important;

  color: #ffffff !important;

  font-size: 13px;
  font-weight: 950;

  box-shadow:
    0 8px 22px
    rgba(
      79,
      70,
      229,
      0.24
    ),
    0 0 0 1px
    rgba(
      255,
      255,
      255,
      0.08
    )
    inset;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.trackedu-ai-button::before {
  content: "";

  position: absolute;
  inset: -80% -30%;

  z-index: -1;

  background:
    conic-gradient(
      from 0deg,
      transparent,
      rgba(
        255,
        255,
        255,
        0.32
      ),
      transparent 24%
    );

  animation:
    trackeduAiButtonOrbit
    5s
    linear
    infinite;
}

.trackedu-ai-button:hover {
  transform:
    translateY(-2px)
    scale(1.02);

  filter:
    brightness(1.08);

  box-shadow:
    0 13px 30px
    rgba(
      79,
      70,
      229,
      0.32
    ),
    0 0 24px
    rgba(
      34,
      211,
      238,
      0.16
    );
}

.trackedu-ai-button:active {
  transform:
    translateY(0)
    scale(0.97) !important;
}

.trackedu-ai-button:disabled {
  opacity: 1;
  cursor: wait;

  filter:
    saturate(0.9);
}

.trackedu-ai-button-mark {
  display: inline-grid;

  width: 23px;
  height: 23px;

  place-items: center;

  margin-right: 4px;

  border-radius: 999px;

  background:
    rgba(
      255,
      255,
      255,
      0.14
    );

  box-shadow:
    inset 0 0 0 1px
    rgba(
      255,
      255,
      255,
      0.18
    );

  font-size: 15px;
  line-height: 1;
}

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


/* AI import modal */

#smartTimetableImportModal
.smart-timetable-ai-card {
  width:
    min(
      820px,
      calc(
        100vw - 24px
      )
    );

  overflow: hidden;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.16
    );

  box-shadow:
    0 30px 80px
    rgba(
      30,
      41,
      59,
      0.22
    );
}

.smart-timetable-ai-hero {
  position: relative;
  overflow: hidden;

  display: grid;
  justify-items: center;

  padding:
    24px
    24px
    20px;

  text-align: center;

  background:
    radial-gradient(
      circle at 50% -20%,
      rgba(
        129,
        140,
        248,
        0.24
      ),
      transparent 52%
    ),
    linear-gradient(
      180deg,
      #fafaff 0%,
      #ffffff 100%
    );
}

.smart-timetable-ai-hero::before,
.smart-timetable-ai-hero::after {
  content: "";

  position: absolute;

  width: 210px;
  height: 210px;

  border-radius: 999px;

  filter:
    blur(70px);

  opacity: 0.24;

  pointer-events: none;
}

.smart-timetable-ai-hero::before {
  top: -100px;
  left: 8%;

  background:
    #8b5cf6;
}

.smart-timetable-ai-hero::after {
  top: -90px;
  right: 7%;

  background:
    #22d3ee;
}

.smart-timetable-ai-brand {
  position: relative;
  z-index: 2;

  display: inline-flex;
  align-items: center;

  gap: 7px;

  margin-bottom: 5px;

  color: #6366f1;

  font-size: 10px;
  line-height: 1;
  font-weight: 950;

  letter-spacing: 1.4px;

  text-transform: uppercase;
}

.smart-timetable-ai-hero h2 {
  position: relative;
  z-index: 2;

  margin: 5px 0 7px;

  color: #172033;

  font-size: 25px;
  line-height: 1.08;
  font-weight: 950;

  letter-spacing: -0.7px;
}

.smart-timetable-ai-hero p {
  position: relative;
  z-index: 2;

  max-width: 610px;

  margin: 0;

  color: #64748b;

  font-size: 12px;
  line-height: 1.5;
  font-weight: 800;
}


/* Reusable TrackEDU AI orb */

.trackedu-ai-orb {
  position: relative;

  width: 88px;
  height: 88px;

  display: grid;
  place-items: center;

  margin-bottom: 10px;

  border-radius: 999px;
}

.trackedu-ai-orb::before {
  content: "";

  position: absolute;
  inset: 5px;

  border-radius: inherit;

  background:
    conic-gradient(
      from 45deg,
      #22d3ee,
      #6366f1,
      #a855f7,
      #ec4899,
      #6366f1,
      #22d3ee
    );

  filter:
    blur(1px);

  animation:
    trackeduAiOrbRotate
    7s
    linear
    infinite;
}

.trackedu-ai-orb::after {
  content: "";

  position: absolute;
  inset: 10px;

  border-radius: inherit;

  background:
    radial-gradient(
      circle at 40% 32%,
      #ffffff 0%,
      #f8faff 36%,
      #e0e7ff 100%
    );

  box-shadow:
    0 8px 30px
    rgba(
      99,
      102,
      241,
      0.28
    ),
    0 0 45px
    rgba(
      34,
      211,
      238,
      0.20
    );
}

.trackedu-ai-orb-star {
  position: relative;
  z-index: 3;

  color: #4f46e5;

  font-size: 38px;
  line-height: 1;

  text-shadow:
    0 4px 16px
    rgba(
      124,
      58,
      237,
      0.32
    );

  animation:
    trackeduAiStarPulse
    2.2s
    ease-in-out
    infinite;
}

.trackedu-ai-orb-ring {
  position: absolute;
  inset: -7px;

  border:
    1px solid
    rgba(
      99,
      102,
      241,
      0.18
    );

  border-radius: inherit;

  animation:
    trackeduAiRingPulse
    2.8s
    ease-out
    infinite;
}

.trackedu-ai-orb-ring:nth-child(2) {
  inset: -15px;

  animation-delay:
    0.7s;
}


/* Normal import form */

.smart-timetable-input-stage {
  display: grid;
  gap: 14px;

  padding: 18px;
}

.smart-timetable-source-intro {
  display: flex;
  align-items: center;

  gap: 11px;

  padding:
    11px
    13px;

  border:
    1px solid
    #e0e7ff;

  border-radius:
    14px;

  background:
    linear-gradient(
      135deg,
      #f8faff,
      #f0fdfa
    );
}

.smart-timetable-source-intro-icon {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  flex:
    0 0 36px;

  border-radius:
    11px;

  background:
    linear-gradient(
      135deg,
      #ede9fe,
      #cffafe
    );

  color:
    #4f46e5;

  font-size:
    19px;
}

.smart-timetable-source-intro-copy {
  min-width: 0;
}

.smart-timetable-source-intro-copy strong {
  display: block;

  color: #172033;

  font-size: 12px;
  font-weight: 950;
}

.smart-timetable-source-intro-copy span {
  display: block;

  margin-top: 2px;

  color: #64748b;

  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 800;
}

.smart-timetable-source-options {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 10px;
}

.smart-timetable-source-card {
  min-height: 98px !important;

  display: grid !important;
  place-items: center;

  gap: 5px !important;

  padding: 13px !important;

  border:
    1px solid
    #e2e8f0 !important;

  border-radius:
    16px !important;

  background:
    #ffffff !important;

  color:
    #172033 !important;

  box-shadow:
    0 4px 14px
    rgba(
      15,
      23,
      42,
      0.04
    );

  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease !important;
}

.smart-timetable-source-card:hover {
  transform:
    translateY(-2px);

  border-color:
    #a5b4fc !important;

  box-shadow:
    0 10px 24px
    rgba(
      79,
      70,
      229,
      0.10
    );
}

.smart-timetable-source-icon {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius:
    12px;

  background:
    linear-gradient(
      135deg,
      #eef2ff,
      #ecfeff
    );

  font-size:
    20px;
}


/* Large analysing experience */

.smart-timetable-ai-stage {
  display: none;

  min-height: 430px;

  padding:
    34px
    24px
    28px;

  place-items: center;

  text-align: center;

  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(
        99,
        102,
        241,
        0.11
      ),
      transparent 42%
    ),
    #ffffff;
}

.smart-timetable-ai-stage-inner {
  width: 100%;
  max-width: 590px;

  display: grid;
  justify-items: center;
}

.smart-timetable-ai-stage
.trackedu-ai-orb {
  width: 116px;
  height: 116px;

  margin-bottom: 28px;

  animation:
    trackeduAiOrbFloat
    3s
    ease-in-out
    infinite;
}

.smart-timetable-ai-stage
.trackedu-ai-orb-star {
  font-size: 48px;
}

.smart-timetable-ai-thinking-label {
  margin-bottom: 7px;

  color: #6366f1;

  font-size: 10px;
  font-weight: 950;

  letter-spacing: 1.4px;

  text-transform: uppercase;
}

#smartTimetableAiProgressTitle {
  margin: 0;

  color: #172033;

  font-size: 24px;
  line-height: 1.12;
  font-weight: 950;

  letter-spacing: -0.55px;
}

#smartTimetableAiProgressDetail {
  max-width: 500px;

  margin:
    8px
    0
    23px;

  color: #64748b;

  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
}

.smart-timetable-ai-activity {
  width: 100%;

  display: grid;

  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );

  gap: 7px;

  margin-top: 7px;
}

.smart-timetable-ai-activity-step {
  min-width: 0;

  padding:
    9px
    5px;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    12px;

  background:
    #f8fafc;

  color:
    #94a3b8;

  font-size:
    9px;
  line-height:
    1.15;

  font-weight:
    900;

  transition:
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}

.smart-timetable-ai-activity-step.active {
  border-color:
    #a5b4fc;

  background:
    #eef2ff;

  color:
    #4338ca;

  transform:
    translateY(-2px);
}

.smart-timetable-ai-activity-step.complete {
  border-color:
    #bbf7d0;

  background:
    #f0fdf4;

  color:
    #166534;
}

.smart-timetable-ai-progress {
  width: 100%;

  height: 6px;

  margin-top: 22px;

  overflow: hidden;

  border-radius:
    999px;

  background:
    #eef2ff;
}

.smart-timetable-ai-progress-bar {
  width: 34%;
  height: 100%;

  border-radius:
    inherit;

  background:
    linear-gradient(
      90deg,
      #22d3ee,
      #6366f1,
      #a855f7
    );

  animation:
    trackeduAiProgressSweep
    1.7s
    ease-in-out
    infinite;
}


/*
 * While AI is analysing, the ordinary form
 * disappears and the AI workspace takes over.
 */
.smart-timetable-ai-card.is-ai-analysing
.smart-timetable-input-stage {
  display: none;
}

.smart-timetable-ai-card.is-ai-analysing
.smart-timetable-ai-stage {
  display: grid;
}

.smart-timetable-ai-card.is-ai-analysing
.smart-timetable-ai-hero {
  display: none;
}

.smart-timetable-ai-card.is-ai-analysing
.modal-foot {
  justify-content: center;

  border-top:
    1px solid
    #eef2ff;

  background:
    #fafaff;
}

.smart-timetable-ai-card.is-ai-analysing
.modal-foot
.btn-light {
  display: none;
}


/* Existing status is now for errors / questions / results */

#smartTimetableImportStatus {
  padding: 12px 14px;

  border-radius: 13px;

  font-size: 11px;
  line-height: 1.45;
  font-weight: 850;
}


/* Animation */

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

@keyframes trackeduAiStarPulse {
  0%,
  100% {
    transform:
      scale(0.9)
      rotate(-5deg);

    opacity: 0.78;
  }

  50% {
    transform:
      scale(1.12)
      rotate(7deg);

    opacity: 1;
  }
}

@keyframes trackeduAiRingPulse {
  0% {
    transform:
      scale(0.86);

    opacity: 0;
  }

  35% {
    opacity: 0.5;
  }

  100% {
    transform:
      scale(1.12);

    opacity: 0;
  }
}

@keyframes trackeduAiOrbFloat {
  0%,
  100% {
    transform:
      translateY(0);
  }

  50% {
    transform:
      translateY(-7px);
  }
}

@keyframes trackeduAiProgressSweep {
  0% {
    transform:
      translateX(-110%);
  }

  100% {
    transform:
      translateX(310%);
  }
}

@media (
  max-width:
  620px
) {
  .smart-timetable-source-options {
    grid-template-columns:
      1fr;
  }

  .smart-timetable-ai-activity {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }

  .smart-timetable-ai-stage {
    min-height:
      390px;

    padding:
      26px
      16px;
  }
}

@media (
  prefers-reduced-motion:
  reduce
) {
  .trackedu-ai-button::before,
  .trackedu-ai-orb::before,
  .trackedu-ai-orb-star,
  .trackedu-ai-orb-ring,
  .smart-timetable-ai-stage
  .trackedu-ai-orb,
  .smart-timetable-ai-progress-bar {
    animation:
      none !important;
  }
}


.timetable-schedule-pattern {
  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;

  gap: 4px;

  padding: 4px;

  border: 1px solid #d9fbe8;
  border-radius: 999px;

  background: #f1fdf6;
}


.timetable-schedule-pattern-button {
  min-height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 6px;

  padding: 7px 11px;

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

  background: transparent;
  color: #64748b;

  font-size: 10.5px;
  line-height: 1;
  font-weight: 950;

  white-space: nowrap;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}


.timetable-schedule-pattern-button:hover {
  background: #ffffff;
  color: #143f3a;
}


#timetableSchedulePatternControl
.timetable-schedule-pattern-button.active {
  border-color: #f59e0b !important;
  background: #fff7ed !important;
  color: #c2410c !important;

  box-shadow:
    0 2px 6px
    rgba(
      245,
      158,
      11,
      0.16
    ) !important;
}

#timetableSchedulePatternControl
.timetable-schedule-pattern-button.active:hover {
  border-color: #f59e0b !important;
  background: #fff7ed !important;
  color: #c2410c !important;
}

.smart-timetable-ai-progress {
  width: 100%;
  height: 7px;

  margin-top: 10px;

  overflow: hidden;

  border-radius: 999px;

  background: rgba(
    245,
    158,
    11,
    0.16
  );
}

.smart-timetable-ai-progress-bar {
  width: 38%;
  height: 100%;

  border-radius: 999px;

  background: #f59e0b;

  animation:
    smartTimetableAiProgress
    1.35s
    ease-in-out
    infinite;
}

@keyframes smartTimetableAiProgress {
  0% {
    transform:
      translateX(-110%);
  }

  50% {
    transform:
      translateX(85%);
  }

  100% {
    transform:
      translateX(265%);
  }
}

.timetable-schedule-pattern-button:active {
  transform: scale(0.97);
}


.timetable-schedule-pattern-radio {
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}


@media (max-width: 900px) {
  .timetable-editor-header-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .timetable-schedule-pattern {
    width: 100%;
  }

  .timetable-schedule-pattern-button {
    flex: 1;
  }
}

.timetable-more-menu {
  position: relative;
  flex: 0 0 auto;
}

.timetable-more-menu > summary {
  list-style: none;
}

.timetable-more-menu > summary::-webkit-details-marker {
  display: none;
}

.timetable-more-menu-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);

  width: 220px;
  padding: 6px;

  border: 1px solid #dbe3e8;
  border-radius: 14px;

  background: #ffffff;

  box-shadow:
    0 14px 35px
    rgba(15, 23, 42, 0.16);

  z-index: 1000;
}

.timetable-more-menu-item {
  width: 100%;
  min-height: 40px;

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

  padding: 9px 11px;

  border: 0;
  border-radius: 10px;

  background: transparent;
  color: #143f3a;

  font: inherit;
  font-size: 12px;
  font-weight: 900;

  text-align: left;
  cursor: pointer;
}

.timetable-more-menu-item:hover {
  background: #f1fdf6;
}

.timetable-more-menu-item.danger {
  color: #b91c1c;
}

.timetable-more-menu-item.danger:hover {
  background: #fff1f2;
}

/* =========================================================
   ASK AI — CONFIRMATION MODAL
   ========================================================= */

.ask-ai-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200000 !important;

  display: grid;
  place-items: center;

  padding: 18px;

  background:
    rgba(
      15,
      23,
      42,
      0.34
    );

  backdrop-filter:
    blur(9px);
}


.ask-ai-confirm-card {
  position: relative;

  width:
    min(
      520px,
      calc(
        100vw -
        28px
      )
    );

  max-height:
    min(
      620px,
      calc(
        100vh -
        48px
      )
    );

  display: grid;

  grid-template-rows:
    auto
    minmax(
      0,
      1fr
    )
    auto;

  gap: 16px;

  padding: 20px;

  overflow: hidden;

  border:
    1px solid
    rgba(
      148,
      163,
      184,
      0.30
    );

  border-radius: 24px;

  background:
    linear-gradient(
      145deg,
      rgba(
        255,
        255,
        255,
        0.99
      ),
      rgba(
        248,
        250,
        252,
        0.98
      )
    );

  box-shadow:
    0 28px 80px
    rgba(
      15,
      23,
      42,
      0.28
    ),
    0 10px 30px
    rgba(
      99,
      102,
      241,
      0.12
    );

  animation:
    askAiConfirmIn
    0.2s
    cubic-bezier(
      0.2,
      0.8,
      0.2,
      1
    );
}


.ask-ai-confirm-card::before {
  content: "";

  position: absolute;
  top: 0;
  right: 34px;
  left: 34px;

  height: 3px;

  border-radius:
    0 0 999px 999px;

  background:
    linear-gradient(
      90deg,
      #4285f4,
      #8b5cf6,
      #ec4899,
      #f59e0b
    );
}


.ask-ai-confirm-icon {
  width: 46px;
  height: 46px;

  display: grid;
  place-items: center;

  border-radius: 16px;

  background:
    linear-gradient(
      135deg,
      #4285f4,
      #7c3aed,
      #ec4899
    );

  color: #ffffff;

  font-size: 20px;
  font-weight: 950;

  box-shadow:
    0 9px 22px
    rgba(
      99,
      102,
      241,
      0.24
    );
}


.ask-ai-confirm-copy {
  min-height: 0;

  display: grid;

  grid-template-rows:
    auto
    auto
    minmax(
      0,
      1fr
    );

  gap: 6px;

  overflow: hidden;
}


.ask-ai-confirm-eyebrow {
  color: #6d28d9;

  font-size: 10px;
  line-height: 1;
  font-weight: 950;

  letter-spacing: 0.7px;
  text-transform: uppercase;
}


.ask-ai-confirm-copy h3 {
  margin: 0;

  color: #111827;

  font-size: 22px;
  line-height: 1.1;
  font-weight: 950;

  letter-spacing: -0.5px;
}


.ask-ai-confirm-copy p {
  min-height: 0;

  max-height:
    390px;

  margin: 0;

  padding:
    12px
    13px;

  overflow-y: auto;
  overflow-x: hidden;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    13px;

  background:
    #f8fafc;

  color:
    #475569;

  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;

  white-space:
    pre-wrap;

  overscroll-behavior:
    contain;

  scrollbar-gutter:
    stable;
}


.ask-ai-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;

  flex-wrap: wrap;
}


.ask-ai-confirm-button {
  min-height: 40px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  padding:
    8px 15px;

  border-radius: 999px;

  font-size: 12px;
  line-height: 1;
  font-weight: 950;

  cursor: pointer;
}


.ask-ai-confirm-button.secondary {
  border:
    1px solid
    #dbe3ee;

  background: #ffffff;

  color: #475569;
}


.ask-ai-confirm-button.secondary:hover {
  background: #f8fafc;

  border-color: #cbd5e1;
}


.ask-ai-confirm-button.primary {
  border: 0;

  background:
    linear-gradient(
      135deg,
      #4285f4,
      #7c3aed,
      #ec4899
    );

  color: #ffffff;

  box-shadow:
    0 8px 18px
    rgba(
      99,
      102,
      241,
      0.22
    );
}


.ask-ai-confirm-button.primary:hover {
  filter: brightness(1.05);

  transform:
    translateY(-1px);
}


@keyframes askAiConfirmIn {
  from {
    opacity: 0;

    transform:
      translateY(10px)
      scale(0.97);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }
}

.class-timetable-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.class-timetable-footer-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.class-timetable-save-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 700px) {
  .class-timetable-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .class-timetable-footer-primary {
    width: 100%;
  }

  .class-timetable-footer-primary
  .btn {
    flex: 1;
  }

  .class-timetable-save-actions {
    width: 100%;
  }

  .class-timetable-save-actions
  .btn {
    flex: 1;
  }
}

@keyframes trackEduAiWorkingPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 8px 20px rgba(124,58,237,0.28);
  }

  50% {
    transform: scale(1.07);
    box-shadow:
      0 10px 30px rgba(124,58,237,0.42);
  }
}

.track-edu-ai-working-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #7c3aed;
  animation:
    trackEduAiWorkingDot
    1s
    ease-in-out
    infinite;
}

.track-edu-ai-working-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.track-edu-ai-working-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes trackEduAiWorkingDot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

/* =========================================================
   EXIT MISSION — KID-FRIENDLY QUESTION DISPLAY
   ========================================================= */

.mission-hero-card-exit {
  grid-template-columns:
    minmax(0, 1fr);

  padding:
    clamp(
      20px,
      2.6vw,
      34px
    );

  align-items:
    stretch;

  min-height:
    320px;

  background:
    radial-gradient(
      circle at 12% 12%,
      rgba(
        255,
        255,
        255,
        0.96
      ),
      transparent 24%
    ),
    radial-gradient(
      circle at 88% 14%,
      rgba(
        255,
        235,
        170,
        0.72
      ),
      transparent 22%
    ),
    linear-gradient(
      135deg,
      #7ce7c3 0%,
      #47d6cb 36%,
      #5b8cff 100%
    );

  border:
    3px solid
    rgba(
      255,
      255,
      255,
      0.40
    );

  box-shadow:
    0 24px 48px
    rgba(
      25,
      62,
      111,
      0.18
    );
}


.mission-hero-card-exit::after {
  display: none;
}


.mission-hero-card-exit
.mission-copy {
  width:
    100%;

  min-width:
    0;

  display:
    grid;

  gap:
    18px;
}


.mission-exit-layout {
  width:
    100%;

  display:
    grid;

  gap:
    18px;
}


.mission-exit-prompt {
  justify-self:
    start;

  display:
    inline-flex;

  align-items:
    center;

  gap:
    10px;

  padding:
    10px 16px;

  border-radius:
    999px;

  background:
    rgba(
      255,
      255,
      255,
      0.92
    );

  color:
    #114b4a;

  font-weight:
    950;

  line-height:
    1.12;

  box-shadow:
    0 10px 20px
    rgba(
      25,
      62,
      111,
      0.10
    );
}


.mission-exit-prompt-mark {
  width:
    32px;

  height:
    32px;

  border-radius:
    50%;

  display:
    inline-grid;

  place-items:
    center;

  background:
    linear-gradient(
      135deg,
      #ffb703,
      #ff7b54
    );

  color:
    #ffffff;

  font-size:
    16px;

  box-shadow:
    0 8px 16px
    rgba(
      255,
      123,
      84,
      0.28
    );
}


.mission-exit-question-grid {
  display:
    grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(
        250px,
        1fr
      )
    );

  gap:
    16px;

  align-items:
    stretch;
}


.mission-exit-question-card {
  background:
    rgba(
      255,
      255,
      255,
      0.96
    );

  border:
    2px solid
    rgba(
      17,
      75,
      74,
      0.08
    );

  border-radius:
    24px;

  padding:
    18px;

  display:
    grid;

  gap:
    14px;

  color:
    #123f44;

  box-shadow:
    0 10px 20px
    rgba(
      19,
      68,
      104,
      0.08
    );
}


.mission-exit-question-head {
  display:
    flex;

  align-items:
    flex-start;

  gap:
    12px;
}


.mission-exit-question-number {
  flex:
    0 0 auto;

  width:
    42px;

  height:
    42px;

  border-radius:
    16px;

  display:
    grid;

  place-items:
    center;

  background:
    linear-gradient(
      135deg,
      #ffb703,
      #ff7b54
    );

  color:
    #ffffff;

  font-size:
    22px;

  font-weight:
    950;

  box-shadow:
    0 10px 18px
    rgba(
      255,
      123,
      84,
      0.24
    );
}


.mission-exit-question-title {
  margin:
    0;

  color:
    #143c44;

  font-weight:
    950;

  line-height:
    1.18;

  letter-spacing:
    -0.4px;
}


.mission-exit-options {
  display:
    grid;

  gap:
    10px;
}


.mission-exit-option {
  display:
    grid;

  grid-template-columns:
    36px minmax(0, 1fr);

  gap:
    10px;

  align-items:
    start;

  padding:
    10px 12px;

  border-radius:
    16px;

  background:
    #eefcf8;

  border:
    1px solid
    rgba(
      17,
      75,
      74,
      0.08
    );
}


.mission-exit-option-label {
  width:
    32px;

  height:
    32px;

  border-radius:
    12px;

  display:
    grid;

  place-items:
    center;

  background:
    #ffffff;

  color:
    #0f6360;

  font-size:
    18px;

  font-weight:
    950;

  box-shadow:
    0 6px 12px
    rgba(
      19,
      68,
      104,
      0.08
    );
}


.mission-exit-option-text {
  color:
    #174e4c;

  font-weight:
    850;

  line-height:
    1.24;
}


.mission-exit-ready-note {
  padding:
    12px 14px;

  border-radius:
    18px;

  background:
    rgba(
      255,
      255,
      255,
      0.88
    );

  color:
    #114b4a;

  font-weight:
    900;

  line-height:
    1.3;
}


.mission-exit-fallback
.mission-question {
  width:
    100%;

  max-width:
    none;

  margin:
    0;

  color:
    #103d43;

  white-space:
    pre-line;

  overflow-wrap:
    normal;

  word-break:
    normal;
}


.mission-exit-density-short
.mission-exit-prompt {
  font-size:
    clamp(
      16px,
      1.55vw,
      23px
    );
}


.mission-exit-density-medium
.mission-exit-prompt {
  font-size:
    clamp(
      15px,
      1.35vw,
      21px
    );
}


.mission-exit-density-long
.mission-exit-prompt {
  font-size:
    clamp(
      14px,
      1.15vw,
      19px
    );
}


.mission-exit-density-short
.mission-exit-question-title {
  font-size:
    clamp(
      22px,
      2vw,
      29px
    );
}


.mission-exit-density-medium
.mission-exit-question-title {
  font-size:
    clamp(
      19px,
      1.65vw,
      24px
    );
}


.mission-exit-density-long
.mission-exit-question-title {
  font-size:
    clamp(
      17px,
      1.35vw,
      21px
    );
}


.mission-exit-density-short
.mission-exit-option-text {
  font-size:
    clamp(
      18px,
      1.5vw,
      22px
    );
}


.mission-exit-density-medium
.mission-exit-option-text {
  font-size:
    clamp(
      16px,
      1.25vw,
      19px
    );
}


.mission-exit-density-long
.mission-exit-option-text {
  font-size:
    clamp(
      15px,
      1.1vw,
      17px
    );
}


.mission-exit-density-short
.mission-question {
  font-size:
    clamp(
      26px,
      2.4vw,
      38px
    );

  line-height:
    1.14;

  letter-spacing:
    -0.8px;
}


.mission-exit-density-medium
.mission-question {
  font-size:
    clamp(
      22px,
      2vw,
      31px
    );

  line-height:
    1.16;

  letter-spacing:
    -0.6px;
}


.mission-exit-density-long
.mission-question {
  font-size:
    clamp(
      18px,
      1.5vw,
      24px
    );

  line-height:
    1.18;

  letter-spacing:
    -0.4px;
}

.student-instruction-step-text-wrap {
  position:
    relative;

  width:
    100%;

  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    12px;
}


.student-instruction-step-text-wrap
.student-instruction-step-text {
  min-width:
    0;

  flex:
    1 1 auto;
}


.student-instruction-read-button {
  width:
    30px;

  min-width:
    30px;

  height:
    30px;

  flex:
    0 0 30px;

  display:
    inline-grid;

  place-items:
    center;

  padding:
    0;

  border:
    1px solid
    #bfdbfe;

  border-radius:
    999px;

  background:
    #eff6ff;

  color:
    #1d4ed8;

  font-size:
    14px;

  line-height:
    1;

  cursor:
    pointer;

  box-shadow:
    0 3px 8px
    rgba(
      59,
      130,
      246,
      0.10
    );

  transition:
    transform
    0.15s ease,
    background
    0.15s ease,
    border-color
    0.15s ease,
    box-shadow
    0.15s ease;
}


.student-instruction-read-button:hover,
.student-instruction-read-button:focus-visible {
  border-color:
    #60a5fa;

  background:
    #dbeafe;

  box-shadow:
    0 7px 16px
    rgba(
      59,
      130,
      246,
      0.20
    );

  transform:
    scale(
      1.06
    );

  outline:
    none;
}


.student-instruction-read-button:active {
  transform:
    scale(
      0.94
    );
}


/*
  Keep it large enough to see from the teacher's
  position during Present to Class.
*/
body.focus-mode
.student-instruction-read-button,
body.fullscreen-active
.student-instruction-read-button {
  width:
    34px;

  min-width:
    34px;

  height:
    34px;

  flex-basis:
    34px;

  font-size:
    16px;
}


/* =========================================================
   SMART LONG INSTRUCTION LAYOUT
   ========================================================= */

/*
  Long groups of short lines use the available width
  rather than becoming one very tall narrow column.
*/
.student-instruction-step-text.smart-instruction-list {
  display:
    grid;

  grid-template-columns:
    repeat(
      2,
      minmax(
        0,
        1fr
      )
    );

  column-gap:
    clamp(
      28px,
      5vw,
      70px
    );

  row-gap:
    0;
}


/*
  Each plain instruction line is already rendered
  as a paragraph by formatStudentInstructions().
*/
.student-instruction-step-text.smart-instruction-list
> p {
  margin:
    0 0
    0.48em;

  break-inside:
    avoid;
}


/*
  Lists written with bullets or numbering should
  remain normal lists rather than being split.
*/
.student-instruction-step-text.smart-instruction-list
> ul,
.student-instruction-step-text.smart-instruction-list
> ol {
  grid-column:
    1 / -1;
}


/*
  Blank separators and any longer structured content
  can span the full width.
*/
.student-instruction-step-text.smart-instruction-list
> .instruction-spacer {
  grid-column:
    1 / -1;
}


/*
  Slides / image / PDF sidebar is deliberately narrow.

  Keep long content single-column there and let the
  sidebar use its existing vertical scrolling.
*/
.task-slides-instruction-panel
.student-instruction-step-text.smart-instruction-list {
  display:
    block;
}


.task-slides-instruction-panel
.student-instruction-step-text.smart-instruction-list
> p {
  margin:
    0 0
    0.65em;
}

body.focus-mode[data-stage="task"]
.student-instruction-one-step
.student-instruction-step-text.smart-instruction-list,
body.fullscreen-active[data-stage="task"]
.student-instruction-one-step
.student-instruction-step-text.smart-instruction-list {
  grid-template-columns:
    repeat(
      3,
      minmax(
        0,
        1fr
      )
    );

  text-align:
    left;
}


/*
  Never apply projector columns inside the Slides sidebar.
*/
body.focus-mode[data-stage="task"]
.task-slides-instruction-panel
.student-instruction-step-text.smart-instruction-list,
body.fullscreen-active[data-stage="task"]
.task-slides-instruction-panel
.student-instruction-step-text.smart-instruction-list {
  display:
    block;

  text-align:
    left;
}

/* =========================================================
   LESSON COPY MENU
   ========================================================= */

.lesson-copy-menu {
  position: relative;
  flex: 0 0 auto;
}

.lesson-copy-menu > summary {
  list-style: none;
}

.lesson-copy-menu > summary::-webkit-details-marker {
  display: none;
}

.lesson-copy-menu > summary::after {
  content: "▾";
  margin-left: 2px;
  font-size: 9px;
  transition: transform 0.15s ease;
}

.lesson-copy-menu[open]
> summary::after {
  transform: rotate(180deg);
}

.lesson-copy-menu-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);

  z-index: 10000;

  width: 310px;
  max-width: calc(100vw - 24px);

  display: grid;
  gap: 4px;

  padding: 7px;

  border: 1px solid #dbe3e8;
  border-radius: 14px;

  background: #ffffff;

  box-shadow:
    0 18px 42px
    rgba(15, 23, 42, 0.20);
}

.lesson-copy-menu-popover button {
  width: 100%;
  min-height: 40px;

  display: grid;
  grid-template-columns:
    24px
    minmax(0, 1fr);

  align-items: center;
  gap: 8px;

  padding: 8px 10px;

  border: 0;
  border-radius: 10px;

  background: transparent;
  color: #143f3a;

  font-size: 11px;
  line-height: 1.15;
  font-weight: 900;

  text-align: left;
  cursor: pointer;
}

.lesson-copy-menu-popover button:hover,
.lesson-copy-menu-popover button:focus-visible {
  background: #eefbf4;
  outline: none;
}

.lesson-copy-menu-popover button strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 900;
}

.lesson-copy-menu-popover button small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 700;
}

/* =========================================================
   BIRTHDAY SPOTLIGHT
   ========================================================= */

.birthday-spotlight[hidden] {
  display:
    none !important;
}


.birthday-spotlight {
  position:
    fixed;

  inset:
    0;

  z-index:
    1200000;

  display:
    grid;

  place-items:
    center;

  padding:
    8px;

  overflow-y:
    auto;
}


.birthday-spotlight-backdrop {
  position:
    absolute;

  inset:
    0;

  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(
        250,
        204,
        21,
        0.28
      ),
      transparent 34%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(
        236,
        72,
        153,
        0.22
      ),
      transparent 34%
    ),
    radial-gradient(
      circle at 50% 90%,
      rgba(
        99,
        102,
        241,
        0.25
      ),
      transparent 38%
    ),
    linear-gradient(
      145deg,
      #1e1b4b,
      #312e81,
      #701a75
    );

  backdrop-filter:
    blur(
      12px
    );
}


.birthday-spotlight-effects {
  position:
    absolute;

  inset:
    0;

  z-index:
    6;

  overflow:
    hidden;

  pointer-events:
    none;
}


.birthday-spotlight-effect-item {
  position:
    absolute;

  bottom:
    -80px;

  display:
    block;

  font-size:
    clamp(
      26px,
      4vw,
      56px
    );

  line-height:
    1;

  opacity:
    0;

  animation:
    birthdaySpotlightFloat
    var(
      --birthday-duration,
      6s
    )
    linear
    forwards;
}


@keyframes birthdaySpotlightFloat {
  0% {
    opacity:
      0;

    transform:
      translateY(
        0
      )
      rotate(
        0deg
      )
      scale(
        0.7
      );
  }

  12% {
    opacity:
      1;
  }

  85% {
    opacity:
      1;
  }

  100% {
    opacity:
      0;

    transform:
      translateY(
        -115vh
      )
      rotate(
        360deg
      )
      scale(
        1.2
      );
  }
}


.birthday-spotlight-content {
  position:
    relative;

  z-index:
    2;

  width:
    calc(
      100vw -
      24px
    );

  max-width:
    none;

  height:
    min(
      860px,
      calc(
        100vh -
        24px
      )
    );

  min-height:
    0;

  display:
    grid;

  place-items:
    center;

  padding:
    22px
    34px;

  overflow:
    hidden;

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.30
    );

  border-radius:
    34px;

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

  box-shadow:
    0
    32px
    100px
    rgba(
      15,
      23,
      42,
      0.40
    );

  overflow:
    hidden;
}


.birthday-spotlight-close {
  position:
    absolute;

  top:
    15px;

  right:
    15px;

  z-index:
    10;

  width:
    42px;

  height:
    42px;

  display:
    grid;

  place-items:
    center;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    999px;

  background:
    #ffffff;

  color:
    #64748b;

  font-size:
    22px;

  font-weight:
    900;

  cursor:
    pointer;
}


.birthday-spotlight-close:hover,
.birthday-spotlight-close:focus-visible {
  background:
    #f8fafc;

  color:
    #111827;

  outline:
    none;
}


/* =========================================================
   SETUP
   ========================================================= */

.birthday-spotlight-setup {
  width:
    min(
      900px,
      100%
    );

  display:
    grid;

  gap:
    14px;
}


.birthday-spotlight-setup[hidden] {
  display:
    none !important;
}


.birthday-spotlight-setup-badge {
  width:
    fit-content;

  display:
    inline-flex;

  align-items:
    center;

  padding:
    7px
    11px;

  border-radius:
    999px;

  background:
    #fff7ed;

  color:
    #c2410c;

  font-size:
    11px;

  font-weight:
    950;

  letter-spacing:
    0.3px;
}


.birthday-spotlight-setup h2 {
  margin:
    0;

  color:
    #312e81;

  font-size:
    clamp(
      28px,
      4vw,
      42px
    );

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    -1px;
}


.birthday-spotlight-setup-copy {
  margin:
    -10px
    0
    0;

  color:
    #64748b;

  font-size:
    13px;

  line-height:
    1.45;

  font-weight:
    800;
}


.birthday-spotlight-setup-grid {
  display:
    grid;

  grid-template-columns:
    repeat(
      2,
      minmax(
        0,
        1fr
      )
    );

  gap:
    14px;
}


.birthday-spotlight-setup-card {
  min-width:
    0;

  display:
    grid;

  align-content:
    start;

  gap:
    9px;

  padding:
    14px;

  border:
    1px solid
    #e2e8f0;

  border-radius:
    20px;

  background:
    #f8fafc;
}


.birthday-spotlight-setup-card-title {
  color:
    #312e81;

  font-size:
    14px;

  line-height:
    1.15;

  font-weight:
    950;
}


.birthday-spotlight-setup-card p {
  margin:
    -5px
    0
    0;

  color:
    #64748b;

  font-size:
    11px;

  line-height:
    1.4;

  font-weight:
    800;
}


.birthday-spotlight-photo-setup {
  display:
    flex;

  align-items:
    center;

  gap:
    14px;
}


.birthday-spotlight-photo-preview {
  width:
    82px;

  height:
    82px;

  flex:
    0 0
    82px;

  display:
    grid;

  place-items:
    center;

  overflow:
    hidden;

  border:
    4px solid
    #ffffff;

  border-radius:
    24px;

  background:
    linear-gradient(
      145deg,
      #fef3c7,
      #fce7f3
    );

  color:
    #78350f;

  font-size:
    38px;

  box-shadow:
    0
    8px
    20px
    rgba(
      15,
      23,
      42,
      0.10
    );
}


.birthday-spotlight-photo-preview img {
  width:
    100%;

  height:
    100%;

  object-fit:
    cover;
}


.birthday-spotlight-photo-controls {
  display:
    grid;

  gap:
    7px;
}


.birthday-spotlight-upload-button,
.birthday-spotlight-remove-photo {
  min-height:
    36px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  padding:
    7px
    11px;

  border:
    1px solid
    #d1d5db;

  border-radius:
    999px;

  background:
    #ffffff;

  color:
    #312e81;

  font-size:
    10px;

  font-weight:
    900;

  cursor:
    pointer;
}


.birthday-spotlight-remove-photo {
  color:
    #b91c1c;
}


.birthday-spotlight-privacy-note {
  padding:
    8px
    10px;

  border-radius:
    10px;

  background:
    #eefbf4;

  color:
    #166534;

  font-size:
    9px;

  line-height:
    1.35;

  font-weight:
    850;
}


.birthday-spotlight-field {
  display:
    grid;

  gap:
    5px;
}


.birthday-spotlight-field > span {
  color:
    #475569;

  font-size:
    9px;

  font-weight:
    900;

  text-transform:
    uppercase;

  letter-spacing:
    0.45px;
}


.birthday-spotlight-field input,
.birthday-spotlight-field select {
  width:
    100%;

  min-height:
    38px;

  padding:
    8px
    10px;

  border:
    1px solid
    #d1d5db;

  border-radius:
    11px;

  background:
    #ffffff;

  color:
    #111827;

  font-size:
    12px;

  font-weight:
    800;

  outline:
    none;
}


.birthday-spotlight-field input:focus,
.birthday-spotlight-field select:focus {
  border-color:
    #a78bfa;

  box-shadow:
    0
    0
    0
    3px
    rgba(
      139,
      92,
      246,
      0.10
    );
}


.birthday-spotlight-answer-inputs {
  display:
    grid;

  grid-template-columns:
    repeat(
      2,
      minmax(
        0,
        1fr
      )
    );

  gap:
    8px;
}


.birthday-spotlight-theme-section {
  display:
    grid;

  gap:
    10px;
}


.birthday-spotlight-theme-options {
  display:
    grid;

  grid-template-columns:
    repeat(
      3,
      minmax(
        0,
        1fr
      )
    );

  gap:
    10px;
}


.birthday-spotlight-theme-option {
  min-height:
    72px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    9px;

  padding:
    11px;

  border:
    2px solid
    #e2e8f0;

  border-radius:
    17px;

  background:
    #ffffff;

  color:
    #475569;

  cursor:
    pointer;

  transition:
    transform
    0.15s ease,
    border-color
    0.15s ease,
    background
    0.15s ease;
}


.birthday-spotlight-theme-option > span {
  font-size:
    26px;
}


.birthday-spotlight-theme-option strong {
  font-size:
    11px;

  font-weight:
    950;
}


.birthday-spotlight-theme-option:hover,
.birthday-spotlight-theme-option:focus-visible {
  border-color:
    #c4b5fd;

  transform:
    translateY(
      -2px
    );

  outline:
    none;
}


.birthday-spotlight-theme-option.active {
  border-color:
    #8b5cf6;

  background:
    #f5f3ff;

  color:
    #5b21b6;
}


.birthday-spotlight-setup-footer {
  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    12px;

  flex-wrap:
    wrap;
}


.birthday-spotlight-sound-option {
  display:
    inline-flex;

  align-items:
    center;

  gap:
    7px;

  color:
    #475569;

  font-size:
    11px;

  font-weight:
    900;

  cursor:
    pointer;
}


.birthday-spotlight-start {
  min-height:
    48px;

  padding:
    10px
    20px;

  border:
    0;

  border-radius:
    999px;

  background:
    linear-gradient(
      135deg,
      #7c3aed,
      #ec4899,
      #f59e0b
    );

  color:
    #ffffff;

  font-size:
    13px;

  font-weight:
    950;

  cursor:
    pointer;

  box-shadow:
    0
    10px
    24px
    rgba(
      124,
      58,
      237,
      0.24
    );

  transition:
    transform
    0.15s ease,
    box-shadow
    0.15s ease;
}


.birthday-spotlight-start:hover,
.birthday-spotlight-start:focus-visible {
  transform:
    translateY(
      -2px
    );

  box-shadow:
    0
    14px
    30px
    rgba(
      124,
      58,
      237,
      0.30
    );

  outline:
    none;
}


.birthday-spotlight-start:active {
  transform:
    scale(
      0.97
    );
}


/* =========================================================
   COUNTDOWN
   ========================================================= */

.birthday-spotlight-countdown[hidden] {
  display:
    none !important;
}


.birthday-spotlight-countdown {
  position:
    relative;

  z-index:
    3;

  color:
    #312e81;

  font-size:
    clamp(
      110px,
      24vw,
      260px
    );

  line-height:
    0.85;

  font-weight:
    950;

  text-align:
    center;

  text-shadow:
    0
    12px
    40px
    rgba(
      99,
      102,
      241,
      0.20
    );

  animation:
    birthdayCountdownPop
    0.65s ease;
}


@keyframes birthdayCountdownPop {
  0% {
    opacity:
      0;

    transform:
      scale(
        0.35
      );
  }

  65% {
    opacity:
      1;

    transform:
      scale(
        1.15
      );
  }

  100% {
    transform:
      scale(
        1
      );
  }
}


/* =========================================================
   MAIN CELEBRATION
   ========================================================= */

.birthday-spotlight-main {
  width:
    100%;

  max-width:
    none;

  max-height:
    calc(
      100vh -
      110px
    );

  display:
    grid;

  justify-items:
    center;

  align-content:
    center;

  gap:
    8px;

  padding:
    8px
    0;

  text-align:
    center;

  overflow:
    hidden;

  animation:
    birthdaySpotlightReveal
    0.7s
    cubic-bezier(
      0.2,
      0.9,
      0.25,
      1.25
    );
}


.birthday-spotlight-main[hidden] {
  display:
    none !important;
}


.birthday-spotlight-main[hidden] {
  display:
    none !important;
}


@keyframes birthdaySpotlightReveal {
  from {
    opacity:
      0;

    transform:
      scale(
        0.72
      )
      translateY(
        28px
      );
  }

  to {
    opacity:
      1;

    transform:
      scale(
        1
      )
      translateY(
        0
      );
  }
}


.birthday-spotlight-kicker {
  padding:
    7px
    12px;

  border-radius:
    999px;

  background:
    #fff7ed;

  color:
    #c2410c;

  font-size:
    10px;

  font-weight:
    950;

  letter-spacing:
    0.8px;
}


.birthday-spotlight-photo-wrap {
  width:
    clamp(
      105px,
      12vw,
      150px
    );

  aspect-ratio:
    1;

  display:
    grid;

  place-items:
    center;

  padding:
    7px;

  border-radius:
    32px;

  background:
    linear-gradient(
      135deg,
      #facc15,
      #fb7185,
      #a78bfa
    );

  box-shadow:
    0
    18px
    45px
    rgba(
      88,
      28,
      135,
      0.25
    );

  transform:
    rotate(
      -2deg
    );
}


.birthday-spotlight-initial,
.birthday-spotlight-photo {
  grid-area:
    1 / 1;

  width:
    100%;

  height:
    100%;

  border-radius:
    26px;

  background:
    #ffffff;
}


.birthday-spotlight-initial {
  display:
    grid;

  place-items:
    center;

  color:
    #7c3aed;

  font-size:
    clamp(
      48px,
      8vw,
      92px
    );

  font-weight:
    950;
}


.birthday-spotlight-photo {
  object-fit:
    cover;
}


.birthday-spotlight-photo[hidden],
.birthday-spotlight-initial[hidden] {
  display:
    none !important;
}


.birthday-spotlight-small {
  margin-top:
    5px;

  color:
    #64748b;

  font-size:
    11px;

  font-weight:
    950;

  letter-spacing:
    2px;
}


.birthday-spotlight-name {
  margin:
    0;

  max-width:
    900px;

  background:
    linear-gradient(
      90deg,
      #7c3aed,
      #ec4899,
      #f59e0b
    );

  -webkit-background-clip:
    text;

  background-clip:
    text;

  color:
    transparent;

  font-size:
    clamp(
      42px,
      6vw,
      72px
    );

  line-height:
    0.92;

  font-weight:
    950;

  letter-spacing:
    -2px;

  text-wrap:
    balance;
}


.birthday-spotlight-message {
  color:
    #475569;

  font-size:
    clamp(
      16px,
      2vw,
      23px
    );

  font-weight:
    900;
}


.birthday-spotlight-question-area {
  width:
    min(
      760px,
      100%
    );

  display:
    grid;

  justify-items:
    center;

  gap:
    8px;

  margin-top:
    4px;

  padding:
    14px;

  border:
    1px solid
    #ddd6fe;

  border-radius:
    18px;

  background:
    linear-gradient(
      145deg,
      #faf5ff,
      #fff7ed
    );
}


.birthday-spotlight-question-area[hidden] {
  display:
    none !important;
}


.birthday-spotlight-secret-label {
  color:
    #7c3aed;

  font-size:
    11px;

  font-weight:
    950;

  letter-spacing:
    1px;
}


.birthday-spotlight-secret-intro {
  color:
    #64748b;

  font-size:
    11px;

  font-weight:
    850;
}


.birthday-spotlight-question {
  color:
    #312e81;

  font-size:
    clamp(
      20px,
      3vw,
      30px
    );

  line-height:
    1.15;

  font-weight:
    950;
}


.birthday-spotlight-answers {
  width:
    100%;

  display:
    grid;

  grid-template-columns:
    repeat(
      2,
      minmax(
        0,
        1fr
      )
    );

  gap:
    9px;
}


.birthday-spotlight-answer {
  min-height:
    42px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    8px;

  padding:
    7px
    10px;

  border:
    2px solid
    #e2e8f0;

  border-radius:
    16px;

  background:
    #ffffff;

  color:
    #334155;

  font-size:
    14px;

  font-weight:
    950;
}


.birthday-spotlight-answer.correct {
  border-color:
    #4ade80;

  background:
    #dcfce7;

  color:
    #166534;

  transform:
    scale(
      1.04
    );
}


.birthday-spotlight-answer.dimmed {
  opacity:
    0.42;
}


.birthday-spotlight-reveal {
  min-height:
    42px;

  padding:
    8px
    15px;

  border:
    0;

  border-radius:
    999px;

  background:
    #7c3aed;

  color:
    #ffffff;

  font-size:
    11px;

  font-weight:
    950;

  cursor:
    pointer;
}


.birthday-spotlight-answer-reveal {
  padding:
    10px
    14px;

  border-radius:
    14px;

  background:
    #dcfce7;

  color:
    #166534;

  font-size:
    clamp(
      18px,
      3vw,
      28px
    );

  font-weight:
    950;

  animation:
    birthdayAnswerPop
    0.45s ease;
}


@keyframes birthdayAnswerPop {
  from {
    opacity:
      0;

    transform:
      scale(
        0.6
      );
  }

  to {
    opacity:
      1;

    transform:
      scale(
        1
      );
  }
}


.birthday-spotlight-actions {
  display:
    flex;

  justify-content:
    center;

  gap:
    8px;

  flex-wrap:
    wrap;

  margin-top:
    5px;
}


.birthday-spotlight-again,
.birthday-spotlight-edit,
.birthday-spotlight-finish {
  min-height:
    40px;

  padding:
    8px
    14px;

  border-radius:
    999px;

  font-size:
    10px;

  font-weight:
    950;

  cursor:
    pointer;
}

.birthday-spotlight-edit {
  border:
    1px solid
    #ddd6fe;

  background:
    #f5f3ff;

  color:
    #6d28d9;
}


.birthday-spotlight-edit:hover,
.birthday-spotlight-edit:focus-visible {
  border-color:
    #a78bfa;

  background:
    #ede9fe;

  outline:
    none;

  transform:
    translateY(
      -1px
    );
}


.birthday-spotlight-again {
  border:
    1px solid
    #fbbf24;

  background:
    #fef3c7;

  color:
    #92400e;
}


.birthday-spotlight-finish {
  border:
    1px solid
    #d1d5db;

  background:
    #ffffff;

  color:
    #475569;
}


/* Theme variations */

.birthday-spotlight.theme-balloons
.birthday-spotlight-backdrop {
  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(
        34,
        197,
        94,
        0.25
      ),
      transparent 35%
    ),
    radial-gradient(
      circle at 85% 20%,
      rgba(
        59,
        130,
        246,
        0.30
      ),
      transparent 35%
    ),
    linear-gradient(
      145deg,
      #172554,
      #164e63,
      #14532d
    );
}


.birthday-spotlight.theme-stars
.birthday-spotlight-backdrop {
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(
        250,
        204,
        21,
        0.26
      ),
      transparent 35%
    ),
    linear-gradient(
      145deg,
      #020617,
      #172554,
      #312e81
    );
}


@media (
  max-width:
  720px
) {
  .birthday-spotlight {
    padding:
      10px;
  }


  .birthday-spotlight-content {
    min-height:
      auto;

    padding:
      54px
      16px
      20px;

    border-radius:
      24px;
  }


  .birthday-spotlight-setup-grid,
  .birthday-spotlight-theme-options,
  .birthday-spotlight-answer-inputs {
    grid-template-columns:
      1fr;
  }


  .birthday-spotlight-answers {
    grid-template-columns:
      1fr;
  }


  .birthday-spotlight-name {
    letter-spacing:
      -1.5px;
  }
}


@media (
  prefers-reduced-motion:
  reduce
) {
  .birthday-spotlight-effect-item,
  .birthday-spotlight-main,
  .birthday-spotlight-countdown,
  .birthday-spotlight-answer-reveal {
    animation:
      none !important;
  }
}

/* =========================================================
   BIRTHDAY CORNER — COMPACT HUB
   ========================================================= */

.birthday-hub {
  width:
    100%;

  height:
    100%;

  min-height:
    0;

  display:
    grid;

  grid-template-rows:
    minmax(
      0,
      1fr
    )
    auto;

  gap:
    12px;

  overflow:
    hidden;
}

/* Selected birthday: compact layout */
.birthday-hub:has(> .birthday-hub-focused) {
  grid-template-rows:
    auto
    auto !important;

  align-content:
    start !important;

  overflow-y:
    auto !important;

  overflow-x:
    hidden !important;
}

.birthday-hub-focused {
  align-content:
    start !important;

  align-self:
    start !important;

  grid-auto-rows:
    max-content !important;
}

.birthday-hub-focused .birthday-hub-list {
  align-content:
    start !important;

  grid-auto-rows:
    max-content !important;
}

.birthday-hub-focused .birthday-hub-person {
  min-height:
    72px !important;

  height:
    auto !important;

  align-self:
    start !important;
}


.birthday-hub-grid {
  min-height:
    0;

  display:
    grid;

  grid-template-columns:
    minmax(
      0,
      1fr
    )
    minmax(
      0,
      1fr
    );

  gap:
    12px;

  align-items:
    start;
}


.birthday-hub-panel {
  min-width:
    0;

  display:
    grid;

  align-content:
    start;

  gap:
    10px;

  padding:
    15px;

  border:
    1px solid
    #dbe3e8;

  border-radius:
    20px;

  background:
    #ffffff;

  box-shadow:
    0
    6px
    16px
    rgba(
      15,
      23,
      42,
      0.035
    );
}


.birthday-hub-today {
  border-color:
    #fde68a;

  background:
    linear-gradient(
      145deg,
      #fffdf5,
      #ffffff
    );
}


.birthday-hub-panel-head {
  min-height:
    42px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    10px;
}


.birthday-hub-panel-head
> div {
  min-width:
    0;
}


.birthday-hub-eyebrow {
  display:
    block;

  margin-bottom:
    4px;

  color:
    #7c3aed;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.75px;
}


.birthday-hub-panel-head
h3 {
  margin:
    0;

  color:
    #143f3a;

  font-size:
    18px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    -0.3px;
}


.birthday-hub-count {
  min-width:
    30px;

  height:
    30px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  flex:
    0
    0
    auto;

  padding:
    0
    8px;

  border-radius:
    999px;

  background:
    #f5f3ff;

  color:
    #6d28d9;

  font-size:
    11px;

  font-weight:
    950;
}


.birthday-hub-count-today {
  background:
    #fff7ed;

  color:
    #c2410c;
}


.birthday-hub-list {
  min-height:
    0;

  display:
    grid;

  gap:
    7px;
}


.birthday-hub-upcoming-list {
  max-height:
    390px;

  overflow-y:
    auto;

  padding-right:
    3px;

  scrollbar-gutter:
    stable;
}


.birthday-hub-person {
  min-width:
    0;

  min-height:
    72px;

  display:
    grid;

  grid-template-columns:
    42px
    minmax(
      0,
      1fr
    )
    auto;

  align-items:
    center;

  gap:
    10px;

  padding:
    10px;

  border:
    1px solid
    #e5e7eb;

  border-radius:
    14px;

  background:
    #f8fafc;
}


.birthday-hub-person-today {
  border-color:
    #fde68a;

  background:
    #ffffff;
}


.birthday-hub-avatar {
  width:
    42px;

  height:
    42px;

  display:
    grid;

  place-items:
    center;

  border-radius:
    13px;

  background:
    #fff7ed;

  font-size:
    21px;
}


.birthday-hub-person-copy {
  min-width:
    0;

  display:
    grid;

  gap:
    2px;
}


.birthday-hub-person-copy
strong {
  min-width:
    0;

  overflow:
    hidden;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;

  color:
    #111827;

  font-size:
    13px;

  line-height:
    1.1;

  font-weight:
    950;
}


.birthday-hub-person-copy
> span {
  color:
    #64748b;

  font-size:
    9.5px;

  line-height:
    1;

  font-weight:
    850;
}


.birthday-hub-person-copy
small {
  width:
    fit-content;

  margin-top:
    2px;

  padding:
    3px
    7px;

  border-radius:
    999px;

  background:
    #f1f5f9;

  color:
    #64748b;

  font-size:
    8.5px;

  line-height:
    1;

  font-weight:
    900;

  white-space:
    nowrap;
}


.birthday-hub-person-copy
small.birthday-hub-ready {
  background:
    #dcfce7;

  color:
    #166534;
}


.birthday-hub-person-actions {
  display:
    flex;

  align-items:
    center;

  justify-content:
    flex-end;

  gap:
    6px;

  flex:
    0
    0
    auto;
}


.birthday-hub-celebrate,
.birthday-hub-prepare,
.birthday-hub-manage-class {
  min-height:
    34px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    5px;

  padding:
    7px
    11px;

  border-radius:
    999px;

  font-size:
    9.5px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;

  transition:
    transform
    0.14s ease,
    background
    0.14s ease,
    border-color
    0.14s ease;
}


.birthday-hub-celebrate {
  border:
    1px solid
    #fbbf24;

  background:
    #f59e0b;

  color:
    #ffffff;
}


.birthday-hub-celebrate:hover,
.birthday-hub-celebrate:focus-visible {
  background:
    #d97706;

  outline:
    none;

  transform:
    translateY(
      -1px
    );
}


.birthday-hub-prepare {
  border:
    1px solid
    #ddd6fe;

  background:
    #ffffff;

  color:
    #6d28d9;
}


.birthday-hub-prepare:hover,
.birthday-hub-prepare:focus-visible {
  border-color:
    #a78bfa;

  background:
    #f5f3ff;

  outline:
    none;

  transform:
    translateY(
      -1px
    );
}


.birthday-hub-empty {
  min-height:
    88px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    11px;

  padding:
    14px;

  border:
    1px dashed
    #cbd5e1;

  border-radius:
    14px;

  background:
    #f8fafc;

  color:
    #64748b;
}


.birthday-hub-empty
> span {
  width:
    36px;

  height:
    36px;

  display:
    grid;

  place-items:
    center;

  flex:
    0
    0
    36px;

  border-radius:
    12px;

  background:
    #ffffff;

  font-size:
    18px;
}


.birthday-hub-empty
> div {
  display:
    grid;

  gap:
    3px;
}


.birthday-hub-empty
strong {
  color:
    #475569;

  font-size:
    11px;

  font-weight:
    950;
}


.birthday-hub-empty
small {
  color:
    #94a3b8;

  font-size:
    9.5px;

  line-height:
    1.25;

  font-weight:
    800;
}


.birthday-hub-empty-today {
  background:
    #fffdf7;

  border-color:
    #fde68a;
}


.birthday-hub-footer {
  min-height:
    58px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    12px;

  padding:
    9px
    13px;

  border:
    1px solid
    #dbe3e8;

  border-radius:
    16px;

  background:
    #ffffff;
}


.birthday-hub-footer-stat {
  display:
    flex;

  align-items:
    center;

  gap:
    9px;
}


.birthday-hub-footer-stat
> span {
  width:
    36px;

  height:
    36px;

  display:
    grid;

  place-items:
    center;

  border-radius:
    11px;

  background:
    #fff7ed;

  font-size:
    17px;
}


.birthday-hub-footer-stat
> div {
  display:
    grid;

  gap:
    2px;
}


.birthday-hub-footer-stat
small {
  color:
    #94a3b8;

  font-size:
    8px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.6px;
}


.birthday-hub-footer-stat
strong {
  color:
    #143f3a;

  font-size:
    12px;

  line-height:
    1;

  font-weight:
    950;
}


.birthday-hub-manage-class {
  border:
    1px solid
    #bfdbfe;

  background:
    #eff6ff;

  color:
    #1d4ed8;
}


.birthday-hub-manage-class:hover,
.birthday-hub-manage-class:focus-visible {
  border-color:
    #93c5fd;

  background:
    #dbeafe;

  outline:
    none;
}


@media (
  max-width:
  850px
) {
  .birthday-hub {
    overflow-y:
      auto;
  }


  .birthday-hub-grid {
    grid-template-columns:
      1fr;
  }


  .birthday-hub-upcoming-list {
    max-height:
      none;
  }
}


@media (
  max-width:
  620px
) {
  .birthday-hub-person {
    grid-template-columns:
      40px
      minmax(
        0,
        1fr
      );
  }


  .birthday-hub-person-actions {
    grid-column:
      1 / -1;

    justify-content:
      flex-start;
  }


  .birthday-hub-footer {
    align-items:
      stretch;

    flex-direction:
      column;
  }


  .birthday-hub-manage-class {
    width:
      100%;
  }
}




/* =========================================================
   BIRTHDAY SPOTLIGHT
   FINAL PROJECTOR FIT
   ========================================================= */

/*
 * When the celebration is showing,
 * use the available window height properly.
 */
.birthday-spotlight-content:has(
  .birthday-spotlight-main:not([hidden])
) {
  height:
    calc(
      100vh -
      44px
    ) !important;

  max-height:
    calc(
      100vh -
      44px
    ) !important;

  padding:
    18px
    30px
    22px !important;

  overflow-y:
    auto !important;

  overflow-x:
    hidden !important;

  align-items:
    start !important;
}


/*
 * Do not create a second scrolling box
 * inside the celebration.
 */
.birthday-spotlight-main:not([hidden]) {
  width:
    100% !important;

  max-width:
    none !important;

  max-height:
    none !important;

  overflow:
    visible !important;

  padding:
    0
    0
    18px !important;

  gap:
    5px !important;
}


/*
 * Slightly reduce the birthday portrait.
 */
.birthday-spotlight-photo-wrap {
  width:
    clamp(
      100px,
      10vh,
      128px
    ) !important;

  border-radius:
    27px !important;

  padding:
    6px !important;
}


.birthday-spotlight-photo,
.birthday-spotlight-initial {
  border-radius:
    22px !important;
}


/*
 * Tighten the space around the main heading.
 */
.birthday-spotlight-small {
  margin-top:
    2px !important;
}


.birthday-spotlight-name {
  margin:
    1px
    0
    0 !important;

  font-size:
    clamp(
      46px,
      5.3vw,
      76px
    ) !important;

  line-height:
    0.94 !important;
}


.birthday-spotlight-message {
  margin:
    3px
    0
    6px !important;
}


/*
 * Make the secret feel substantial
 * without consuming half the screen.
 */
.birthday-spotlight-question-area:not([hidden]) {
  margin-top:
    7px !important;

  padding:
    16px
    20px
    18px !important;

  gap:
    5px !important;
}


.birthday-spotlight-secret-intro {
  margin:
    1px
    0
    3px !important;
}


.birthday-spotlight-question {
  margin:
    3px
    0
    8px !important;

  font-size:
    clamp(
      24px,
      2.25vw,
      34px
    ) !important;
}


.birthday-spotlight-answers {
  gap:
    8px !important;
}


.birthday-spotlight-answer,
[data-birthday-answer-index] {
  min-height:
    56px !important;

  padding:
    9px
    14px !important;
}


.birthday-spotlight-reveal {
  min-height:
    43px !important;

  margin-top:
    8px !important;

  padding:
    8px
    18px !important;
}


/*
 * Especially important on laptops
 * such as the one in your screenshot.
 */
@media (
  max-height:
  850px
) and (
  min-width:
  701px
) {
  .birthday-spotlight-content:has(
    .birthday-spotlight-main:not([hidden])
  ) {
    height:
      calc(
        100vh -
        24px
      ) !important;

    max-height:
      calc(
        100vh -
        24px
      ) !important;

    padding:
      14px
      26px
      18px !important;
  }


  .birthday-spotlight-photo-wrap {
    width:
      92px !important;
  }


  .birthday-spotlight-name {
    font-size:
      clamp(
        42px,
        4.8vw,
        66px
      ) !important;
  }


  .birthday-spotlight-message {
    font-size:
      17px !important;
  }


  .birthday-spotlight-question-area:not([hidden]) {
    padding:
      13px
      17px
      15px !important;
  }


  .birthday-spotlight-answer,
  [data-birthday-answer-index] {
    min-height:
      50px !important;
  }
}



/* =========================================================
   BIRTHDAY SPOTLIGHT
   CLEAN TWO-COLUMN CELEBRATION
   ========================================================= */

.birthday-spotlight-content:has(
  .birthday-spotlight-main:not([hidden])
) {
  width:
    calc(
      100vw -
      16px
    ) !important;

  height:
    calc(
      100vh -
      24px
    ) !important;

  max-width:
    none !important;

  max-height:
    calc(
      100vh -
      24px
    ) !important;

  padding:
    0 !important;

  overflow:
    hidden !important;

  place-items:
    stretch !important;

  background:
    transparent !important;

  border:
    0 !important;

  border-radius:
    0 !important;

  box-shadow:
    none !important;
}


.birthday-spotlight-main:not([hidden]) {
  width:
    100% !important;

  height:
    100% !important;

  max-width:
    none !important;

  max-height:
    none !important;

  padding:
    0 !important;

  overflow:
    hidden !important;

  display:
    block !important;
}


/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.birthday-spotlight-celebration-layout {
  width:
    100%;

  height:
    100%;

  min-height:
    0;

  display:
    grid;

  grid-template-columns:
    minmax(
      0,
      2.15fr
    )
    minmax(
      340px,
      0.72fr
    );

  gap:
    26px;
}


/* =========================================================
   LEFT CELEBRATION AREA
   ========================================================= */

.birthday-spotlight-celebration-main {
  min-width:
    0;

  min-height:
    0;

  display:
    flex;

  flex-direction:
    column;

  gap:
    20px;

  padding:
    18px
    40px
    18px
    28px;

  overflow-y:
    auto;

  border:
    0 !important;

  border-radius:
    0 !important;

  background:
    transparent !important;

  box-shadow:
    none !important;
}


/* ---------- Birthday hero ---------- */

.birthday-spotlight-hero-row {
  width:
    100%;

  display:
    grid;

  grid-template-columns:
    auto
    minmax(
      0,
      1fr
    );

  gap:
    20px;

  align-items:
    center;
}


.birthday-spotlight-photo-wrap {
  width:
    clamp(
      170px,
      14vw,
      230px
    ) !important;

  margin:
    0 !important;

  flex:
    0 0
    auto;
}


.birthday-spotlight-hero-copy {
  min-width:
    0;

  display:
    flex;

  flex-direction:
    column;

  align-items:
    flex-start;

  justify-content:
    center;

  gap:
    6px;
}


.birthday-spotlight-kicker {
  margin:
    0 !important;
}


.birthday-spotlight-small {
  margin:
    5px
    0
    0 !important;

  text-align:
    left !important;
}


.birthday-spotlight-name {
  width:
    100%;

  max-width:
    none !important;

  margin:
    2px
    0
    0 !important;

  font-size:
    clamp(
      50px,
      5.3vw,
      82px
    ) !important;

  line-height:
    .93 !important;

  letter-spacing:
    -3px !important;

  text-align:
    left !important;

  text-wrap:
    balance;
}


.birthday-spotlight-message {
  margin:
    6px
    0
    0 !important;

  text-align:
    left !important;
}


/* =========================================================
   BIRTHDAY SECRET
   No outer card around the whole section.
   ========================================================= */

.birthday-spotlight-question-area:not([hidden]) {
  width:
    100% !important;

  max-width:
    none !important;

  margin:
    0 !important;

  padding:
    6px
    0
    0 !important;

  display:
    flex !important;

  flex-direction:
    column !important;

  align-items:
    stretch !important;

  gap:
    8px !important;

  border:
    0 !important;

  border-radius:
    0 !important;

  background:
    transparent !important;

  box-shadow:
    none !important;

  backdrop-filter:
    none !important;
}


.birthday-spotlight-secret-label {
  color:
    #7c3aed !important;

  font-size:
    15px !important;

  line-height:
    1 !important;

  font-weight:
    950 !important;

  letter-spacing:
    .8px !important;

  text-align:
    left !important;
}


.birthday-spotlight-secret-intro {
  margin:
    0 !important;

  color:
    #64748b !important;

  font-size:
    13px !important;

  font-weight:
    850 !important;

  text-align:
    left !important;
}


.birthday-spotlight-question {
  margin:
    9px
    0
    12px !important;

  color:
    #312e81 !important;

  font-size:
    clamp(
      28px,
      2.7vw,
      42px
    ) !important;

  line-height:
    1.05 !important;

  text-align:
    left !important;
}


.birthday-spotlight-answers {
  width:
    100%;

  display:
    grid !important;

  grid-template-columns:
    repeat(
      2,
      minmax(
        0,
        1fr
      )
    ) !important;

  gap:
    12px !important;
}


.birthday-spotlight-answer,
[data-birthday-answer-index] {
  min-height:
    72px !important;

  display:
    flex !important;

  align-items:
    center !important;

  justify-content:
    flex-start !important;

  gap:
    10px !important;

  padding:
    15px
    20px !important;

  border:
    2px solid
    #e5e7eb !important;

  border-radius:
    18px !important;

  background:
    #ffffff !important;

  color:
    #172554 !important;

  font-size:
    clamp(
      18px,
      1.7vw,
      23px
    ) !important;

  line-height:
    1.1 !important;

  font-weight:
    950 !important;

  text-align:
    left !important;

  box-shadow:
    0
    5px
    14px
    rgba(
      15,
      23,
      42,
      .06
    ) !important;

  transition:
    transform
    .25s ease,
    opacity
    .25s ease,
    border-color
    .25s ease,
    background
    .25s ease;
}


.birthday-spotlight-answer.correct,
[data-birthday-answer-index].correct {
  border-color:
    #22c55e !important;

  background:
    #dcfce7 !important;

  color:
    #166534 !important;

  transform:
    scale(
      1.025
    ) !important;

  box-shadow:
    0
    0
    0
    4px
    rgba(
      34,
      197,
      94,
      .12
    ) !important;
}


.birthday-spotlight-answer.dimmed,
[data-birthday-answer-index].dimmed {
  opacity:
    .28 !important;

  transform:
    scale(
      .98
    ) !important;
}


/*
 * We no longer need a second giant green
 * answer card underneath the choices.
 */
.birthday-spotlight-answer-reveal {
  display:
    none !important;
}


/* =========================================================
   RIGHT CONTROL RAIL
   ========================================================= */

.birthday-spotlight-side-panel {
  min-width:
    0;

  min-height:
    0;

  display:
    flex;

  flex-direction:
    column;

  gap:
    18px;

  padding:
    12px
    14px
    10px
    30px;

  overflow-y:
    auto;

  border:
    0 !important;

  border-left:
    1px solid
    rgba(
      148,
      163,
      184,
      0.28
    ) !important;

  border-radius:
    0 !important;

  background:
    transparent !important;

  box-shadow:
    none !important;
}


/* ---------- Right heading ---------- */

.birthday-spotlight-side-heading {
  display:
    none !important;
}


/* ---------- Secret reveal control ---------- */

.birthday-spotlight-side-section {
  padding:
    0
    0
    18px !important;

  border:
    0 !important;

  border-bottom:
    1px solid
    #e5e7eb !important;

  border-radius:
    0 !important;

  background:
    transparent !important;
}


.birthday-spotlight-side-label {
  margin:
    0
    0
    10px !important;

  color:
    #7c3aed !important;

  font-size:
    10px !important;

  line-height:
    1 !important;

  font-weight:
    950 !important;

  letter-spacing:
    .8px !important;

  text-transform:
    uppercase;
}


.birthday-spotlight-reveal {
  width:
    100% !important;

  min-height:
    50px !important;

  margin:
    0 !important;

  padding:
    10px
    15px !important;

  border:
    0 !important;

  border-radius:
    14px !important;

  background:
    linear-gradient(
      135deg,
      #fbbf24,
      #f97316
    ) !important;

  color:
    #5b2503 !important;

  font-size:
    14px !important;

  font-weight:
    950 !important;

  box-shadow:
    0
    7px
    18px
    rgba(
      249,
      115,
      22,
      .18
    ) !important;
}


.birthday-spotlight-drumroll:not([hidden]) {
  margin:
    14px
    0
    0 !important;

  font-size:
    30px !important;

  letter-spacing:
    2px !important;

  text-align:
    center;
}


/* =========================================================
   CAKE FINALE
   One simple warm section, not cards inside cards.
   ========================================================= */

.birthday-spotlight-finale:not([hidden]) {
  width:
    100% !important;

  max-width:
    none !important;

  margin:
    0 !important;

  padding:
    0
    0
    20px !important;

  display:
    flex !important;

  flex-direction:
    column !important;

  align-items:
    center !important;

  gap:
    5px !important;

  border:
    0 !important;

  border-bottom:
    1px solid
    #e5e7eb !important;

  border-radius:
    0 !important;

  background:
    transparent !important;

  box-shadow:
    none !important;

  backdrop-filter:
    none !important;

  text-align:
    center !important;
}


.birthday-spotlight-finale-kicker {
  margin:
    0;

  color:
    #b45309 !important;

  font-size:
    9px !important;

  line-height:
    1 !important;

  font-weight:
    950 !important;

  letter-spacing:
    .8px !important;
}


.birthday-spotlight-finale-title {
  margin:
    4px
    0
    12px !important;

  color:
    #7c2d12 !important;

  font-size:
    clamp(
      26px,
      2.2vw,
      34px
    ) !important;

  line-height:
    1.02 !important;

  font-weight:
    950 !important;
}


/*
 * Cake itself is the interaction.
 * Remove the white card around it.
 */
.birthday-spotlight-cake-button {
  width:
    100% !important;

  min-width:
    0 !important;

  margin:
    0 !important;

  padding:
    8px
    4px
    5px !important;

  display:
    flex !important;

  flex-direction:
    column !important;

  align-items:
    center !important;

  gap:
    3px !important;

  border:
    0 !important;

  border-radius:
    0 !important;

  background:
    transparent !important;

  box-shadow:
    none !important;

  cursor:
    pointer;
}


.birthday-spotlight-candles {
  min-height:
    0 !important;

  font-size:
    22px !important;
}


.birthday-spotlight-cake {
  font-size:
    84px !important;

  line-height:
    .95 !important;
}


.birthday-spotlight-cake-action {
  margin-top:
    6px;

  color:
    #9a3412 !important;

  font-size:
    11px !important;

  line-height:
    1.2 !important;

  font-weight:
    950 !important;
}


/* =========================================================
   TEACHER ACTIONS
   ========================================================= */

.birthday-spotlight-actions {
  width:
    100%;

  margin:
    auto
    0
    0 !important;

  padding:
    18px
    0
    0;

  display:
    grid !important;

  grid-template-columns:
    1fr !important;

  gap:
    8px !important;

  border-top:
    1px solid
    #e5e7eb;
}


.birthday-spotlight-again,
.birthday-spotlight-edit,
.birthday-spotlight-finish {
  width:
    100% !important;

  min-height:
    43px !important;

  margin:
    0 !important;

  padding:
    9px
    12px !important;

  display:
    flex;

  align-items:
    center;

  justify-content:
    flex-start !important;

  gap:
    7px;

  border-radius:
    12px !important;

  font-size:
    11px !important;

  text-align:
    left !important;

  box-shadow:
    none !important;
}


.birthday-spotlight-again {
  border:
    1px solid
    #fde68a !important;

  background:
    #fffbeb !important;

  color:
    #92400e !important;
}


.birthday-spotlight-edit {
  border:
    1px solid
    #ddd6fe !important;

  background:
    #faf9ff !important;

  color:
    #6d28d9 !important;
}


.birthday-spotlight-finish {
  border:
    1px solid
    #e2e8f0 !important;

  background:
    #ffffff !important;

  color:
    #475569 !important;
}


/* =========================================================
   SHORT LAPTOP / PROJECTOR HEIGHTS
   ========================================================= */

@media (
  max-height:
  820px
) and (
  min-width:
  801px
) {
  .birthday-spotlight-content:has(
    .birthday-spotlight-main:not([hidden])
  ) {
    padding:
      16px !important;
  }


  .birthday-spotlight-celebration-layout {
    gap:
      22px;
  }


  .birthday-spotlight-celebration-main {
    gap:
      16px;

    padding:
      10px
      20px
      10px
      8px;
  }


  .birthday-spotlight-photo-wrap {
    width:
      125px !important;
  }


  .birthday-spotlight-name {
    font-size:
      clamp(
        44px,
        4.7vw,
        68px
      ) !important;
  }


  .birthday-spotlight-answer,
  [data-birthday-answer-index] {
    min-height:
      58px !important;
  }


  .birthday-spotlight-side-panel {
    gap:
      13px;

    padding-left:
      22px;
  }


  .birthday-spotlight-cake {
    font-size:
      68px !important;
  }
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (
  max-width:
  800px
) {
  .birthday-spotlight-content:has(
    .birthday-spotlight-main:not([hidden])
  ) {
    overflow-y:
      auto !important;
  }


  .birthday-spotlight-main:not([hidden]) {
    height:
      auto !important;

    overflow:
      visible !important;
  }


  .birthday-spotlight-celebration-layout {
    height:
      auto;

    grid-template-columns:
      1fr;

    gap:
      20px;
  }


  .birthday-spotlight-celebration-main {
    overflow:
      visible;

    padding:
      10px;
  }


  .birthday-spotlight-hero-row {
    grid-template-columns:
      1fr;

    justify-items:
      center;
  }


  .birthday-spotlight-hero-copy {
    align-items:
      center;
  }


  .birthday-spotlight-name,
  .birthday-spotlight-message,
  .birthday-spotlight-small {
    text-align:
      center !important;
  }


  .birthday-spotlight-name {
    font-size:
      clamp(
        42px,
        12vw,
        66px
      ) !important;
  }


  .birthday-spotlight-question,
  .birthday-spotlight-secret-label,
  .birthday-spotlight-secret-intro {
    text-align:
      center !important;
  }


  .birthday-spotlight-answers {
    grid-template-columns:
      1fr !important;
  }


  .birthday-spotlight-side-panel {
    overflow:
      visible;

    padding:
      20px
      10px
      10px;

    border-left:
      0 !important;

    border-top:
      1px solid
      #e5e7eb !important;
  }
}


/* =========================================================
   BIRTHDAY SPOTLIGHT — FINAL HERO SPACING
   ========================================================= */

/*
 * Give the birthday greeting its own proper hero area.
 */
.birthday-spotlight-hero-row {
  min-height:
    310px;

  align-items:
    center !important;

  gap:
    28px !important;
}


/*
 * Treat the text as one organised celebration block.
 */
.birthday-spotlight-hero-copy {
  min-width:
    0;

  display:
    flex !important;

  flex-direction:
    column !important;

  align-items:
    center !important;

  justify-content:
    center !important;

  gap:
    0 !important;

  text-align:
    center !important;
}


/*
 * Small Birthday Spotlight badge.
 */
.birthday-spotlight-kicker {
  margin:
    0
    0
    9px !important;
}


/*
 * TODAY WE CELEBRATE
 */
.birthday-spotlight-small {
  margin:
    0
    0
    13px !important;

  text-align:
    center !important;

  font-size:
    12px !important;

  letter-spacing:
    2px !important;
}


/*
 * Happy Birthday, Alice!
 */
.birthday-spotlight-name {
  width:
    100% !important;

  max-width:
    900px !important;

  margin:
    0 !important;

  font-size:
    clamp(
      56px,
      5.8vw,
      88px
    ) !important;

  line-height:
    0.92 !important;

  text-align:
    center !important;

  text-wrap:
    balance;
}


/*
 * Have an amazing day!
 */
.birthday-spotlight-message {
  margin:
    18px
    0
    0 !important;

  font-size:
    clamp(
      20px,
      1.8vw,
      28px
    ) !important;

  line-height:
    1.15 !important;

  text-align:
    center !important;
}


/*
 * Create a proper visual pause before Birthday Secret.
 */
.birthday-spotlight-question-area:not([hidden]) {
  margin-top:
    90px !important;
}


.birthday-spotlight-cake-button.candles-out {
  cursor:
    pointer;
}


.birthday-spotlight-cake-button.candles-out:hover {
  transform:
    translateY(
      -2px
    )
    scale(
      1.02
    );

  box-shadow:
    0
    10px
    24px
    rgba(
      245,
      158,
      11,
      0.16
    );
}



/* =========================================================
   BIRTHDAY SPOTLIGHT — BIG WISH FINALE
   ========================================================= */

/*
 * Let the wish experience occupy the empty middle
 * of the right-hand Birthday Secret panel.
 */
.birthday-spotlight-finale:not([hidden]) {
  position:
    relative;

  width:
    100% !important;

  max-width:
    none !important;

  min-height:
    430px !important;

  flex:
    1 1 auto !important;

  margin:
    0 !important;

  padding:
    30px
    18px
    28px !important;

  display:
    flex !important;

  flex-direction:
    column !important;

  align-items:
    center !important;

  justify-content:
    center !important;

  gap:
    12px !important;

  overflow:
    hidden;

  border:
    1px solid
    #fde68a !important;

  border-radius:
    28px !important;

  background:
    radial-gradient(
      circle at 50% 52%,
      rgba(
        251,
        191,
        36,
        0.16
      ),
      transparent 42%
    ),
    linear-gradient(
      160deg,
      #fffdf7,
      #fff7ed
    ) !important;

  box-shadow:
    0
    16px
    36px
    rgba(
      146,
      64,
      14,
      0.08
    ) !important;

  text-align:
    center !important;
}


/*
 * Decorative party glow.
 */
.birthday-spotlight-finale:not([hidden])::before {
  content:
    "✨";

  position:
    absolute;

  top:
    26px;

  left:
    24px;

  color:
    #fbbf24;

  font-size:
    26px;

  opacity:
    0.8;

  pointer-events:
    none;

  animation:
    birthdayWishTwinkle
    1.8s
    ease-in-out
    infinite;
}


.birthday-spotlight-finale:not([hidden])::after {
  content:
    "✨";

  position:
    absolute;

  right:
    24px;

  bottom:
    28px;

  color:
    #f59e0b;

  font-size:
    30px;

  opacity:
    0.72;

  pointer-events:
    none;

  animation:
    birthdayWishTwinkle
    1.8s
    ease-in-out
    0.6s
    infinite;
}


@keyframes birthdayWishTwinkle {
  0%,
  100% {
    opacity:
      0.35;

    transform:
      rotate(
        -8deg
      )
      scale(
        0.85
      );
  }

  50% {
    opacity:
      1;

    transform:
      rotate(
        8deg
      )
      scale(
        1.15
      );
  }
}


/*
 * ONE LAST THING...
 */
.birthday-spotlight-finale-kicker {
  margin:
    0
    0
    2px !important;

  color:
    #b45309 !important;

  font-size:
    11px !important;

  line-height:
    1 !important;

  font-weight:
    950 !important;

  letter-spacing:
    1.3px !important;

  text-transform:
    uppercase;
}


/*
 * Make a birthday wish!
 */
.birthday-spotlight-finale-title {
  width:
    100%;

  max-width:
    340px;

  margin:
    0
    auto
    8px !important;

  color:
    #7c2d12 !important;

  font-size:
    clamp(
      38px,
      3.4vw,
      52px
    ) !important;

  line-height:
    0.96 !important;

  font-weight:
    950 !important;

  letter-spacing:
    -1.4px;

  text-wrap:
    balance;
}


/*
 * Make the entire interaction feel like
 * one large inviting birthday button.
 */
.birthday-spotlight-cake-button {
  position:
    relative;

  width:
    100% !important;

  min-height:
    245px !important;

  margin:
    8px
    0
    0 !important;

  padding:
    22px
    14px
    18px !important;

  display:
    flex !important;

  flex-direction:
    column !important;

  align-items:
    center !important;

  justify-content:
    center !important;

  gap:
    7px !important;

  border:
    2px solid
    #fed7aa !important;

  border-radius:
    24px !important;

  background:
    rgba(
      255,
      255,
      255,
      0.82
    ) !important;

  box-shadow:
    0
    10px
    24px
    rgba(
      154,
      52,
      18,
      0.08
    ) !important;

  cursor:
    pointer !important;

  transition:
    transform
    0.18s
    ease,
    border-color
    0.18s
    ease,
    box-shadow
    0.18s
    ease,
    background
    0.18s
    ease;
}


.birthday-spotlight-cake-button:hover,
.birthday-spotlight-cake-button:focus-visible {
  border-color:
    #fb923c !important;

  background:
    #ffffff !important;

  box-shadow:
    0
    16px
    34px
    rgba(
      234,
      88,
      12,
      0.14
    ) !important;

  outline:
    none;

  transform:
    translateY(
      -3px
    )
    scale(
      1.015
    );
}


/*
 * Candles become a visible part of the game.
 */
.birthday-spotlight-candles {
  min-height:
    34px !important;

  font-size:
    30px !important;

  line-height:
    1 !important;

  letter-spacing:
    7px;

  animation:
    birthdayCandleFlicker
    1.1s
    ease-in-out
    infinite;
}


@keyframes birthdayCandleFlicker {
  0%,
  100% {
    transform:
      translateY(
        0
      )
      scale(
        1
      );

    filter:
      brightness(
        1
      );
  }

  50% {
    transform:
      translateY(
        -2px
      )
      scale(
        1.04
      );

    filter:
      brightness(
        1.12
      );
  }
}


/*
 * Big cake, suitable for a classroom display.
 */
.birthday-spotlight-cake {
  font-size:
    clamp(
      112px,
      8vw,
      150px
    ) !important;

  line-height:
    0.9 !important;

  filter:
    drop-shadow(
      0
      12px
      14px
      rgba(
        124,
        45,
        18,
        0.14
      )
    );

  transition:
    transform
    0.18s
    ease;
}


.birthday-spotlight-cake-button:hover
.birthday-spotlight-cake {
  transform:
    translateY(
      -4px
    )
    rotate(
      -2deg
    )
    scale(
      1.06
    );
}


/*
 * Main classroom instruction.
 */
.birthday-spotlight-cake-action {
  margin-top:
    10px !important;

  color:
    #9a3412 !important;

  font-size:
    15px !important;

  line-height:
    1.2 !important;

  font-weight:
    950 !important;
}


/*
 * Add a playful countdown hint before
 * the candles have been blown out.
 */
.birthday-spotlight-cake-button:not(.candles-out)::after {
  content:
    "✨ Everyone together... 3, 2, 1! ✨";

  display:
    block;

  margin-top:
    6px;

  color:
    #b45309;

  font-size:
    11px;

  line-height:
    1.2;

  font-weight:
    900;
}


/*
 * After blowing out the candles, make it
 * obvious the teacher can click again.
 */
.birthday-spotlight-cake-button.candles-out::after {
  content:
    "🎉 Tap again to celebrate!";

  display:
    block;

  margin-top:
    7px;

  color:
    #7c3aed;

  font-size:
    12px;

  line-height:
    1.2;

  font-weight:
    950;
}


.birthday-spotlight-cake-button.candles-out
.birthday-spotlight-candles {
  animation:
    none;

  letter-spacing:
    3px;
}


/*
 * Keep teacher controls clearly separate
 * underneath the celebration experience.
 */
.birthday-spotlight-actions {
  flex:
    0 0
    auto !important;

  margin-top:
    0 !important;
}


/*
 * Shorter laptop screens.
 */
@media (
  max-height:
  820px
) {
  .birthday-spotlight-finale:not([hidden]) {
    min-height:
      340px !important;

    padding:
      20px
      14px !important;
  }


  .birthday-spotlight-finale-title {
    font-size:
      clamp(
        32px,
        3vw,
        42px
      ) !important;
  }


  .birthday-spotlight-cake-button {
    min-height:
      205px !important;
  }


  .birthday-spotlight-cake {
    font-size:
      105px !important;
  }
}


/* =========================================================
   BIRTHDAY SPOTLIGHT — WIDE PREPARATION LAYOUT
   ========================================================= */

.birthday-spotlight-setup {
  width:
    min(
      1320px,
      calc(
        100vw -
        90px
      )
    ) !important;

  max-width:
    none !important;

  gap:
    20px !important;
}


/* ---------------------------------------------------------
   Heading area
   --------------------------------------------------------- */

.birthday-spotlight-setup h2 {
  font-size:
    clamp(
      34px,
      3.4vw,
      50px
    ) !important;

  line-height:
    1.02 !important;

  letter-spacing:
    -1.4px !important;
}


.birthday-spotlight-setup-copy {
  margin:
    -8px
    0
    0 !important;

  font-size:
    14px !important;

  line-height:
    1.4 !important;
}


/* ---------------------------------------------------------
   Main preparation cards
   Photo 40% / Birthday Secret 60%
   --------------------------------------------------------- */

.birthday-spotlight-setup-grid {
  width:
    100%;

  grid-template-columns:
    minmax(
      360px,
      0.82fr
    )
    minmax(
      0,
      1.18fr
    ) !important;

  gap:
    22px !important;

  align-items:
    stretch;
}


.birthday-spotlight-setup-card {
  min-height:
    360px;

  gap:
    14px !important;

  padding:
    22px !important;

  border-radius:
    24px !important;
}


.birthday-spotlight-setup-card-title {
  font-size:
    17px !important;

  line-height:
    1.15 !important;
}


.birthday-spotlight-setup-card p {
  margin:
    -7px
    0
    2px !important;

  font-size:
    12px !important;

  line-height:
    1.4 !important;
}


/* ---------------------------------------------------------
   Birthday photo
   --------------------------------------------------------- */

.birthday-spotlight-photo-setup {
  align-items:
    center !important;

  gap:
    22px !important;

  margin-top:
    4px;
}


.birthday-spotlight-photo-preview {
  width:
    155px !important;

  height:
    155px !important;

  flex:
    0 0
    155px !important;

  border:
    6px solid
    #ffffff !important;

  border-radius:
    34px !important;

  font-size:
    64px !important;

  box-shadow:
    0
    14px
    30px
    rgba(
      15,
      23,
      42,
      0.12
    ) !important;
}


.birthday-spotlight-photo-controls {
  flex:
    1 1 auto;

  gap:
    10px !important;
}


.birthday-spotlight-upload-button,
.birthday-spotlight-remove-photo {
  width:
    100%;

  min-height:
    44px !important;

  padding:
    9px
    15px !important;

  font-size:
    11px !important;
}


.birthday-spotlight-privacy-note {
  margin-top:
    6px;

  padding:
    12px
    14px !important;

  border-radius:
    13px !important;

  font-size:
    10.5px !important;

  line-height:
    1.42 !important;
}


/* ---------------------------------------------------------
   Birthday Secret form
   --------------------------------------------------------- */

.birthday-spotlight-field {
  gap:
    6px !important;
}


.birthday-spotlight-field > span {
  font-size:
    9.5px !important;

  letter-spacing:
    0.55px !important;
}


.birthday-spotlight-field input,
.birthday-spotlight-field select {
  min-height:
    46px !important;

  padding:
    10px
    13px !important;

  border-radius:
    12px !important;

  font-size:
    13px !important;
}


.birthday-spotlight-answer-inputs {
  gap:
    12px !important;

  row-gap:
    14px !important;
}


/* ---------------------------------------------------------
   Celebration chooser
   --------------------------------------------------------- */

.birthday-spotlight-theme-section {
  width:
    100%;

  gap:
    12px !important;
}


.birthday-spotlight-theme-section
.birthday-spotlight-setup-card-title {
  font-size:
    17px !important;
}


.birthday-spotlight-theme-options {
  gap:
    14px !important;
}


.birthday-spotlight-theme-option {
  min-height:
    88px !important;

  gap:
    12px !important;

  padding:
    14px
    18px !important;

  border-radius:
    20px !important;
}


.birthday-spotlight-theme-option > span {
  font-size:
    32px !important;
}


.birthday-spotlight-theme-option strong {
  font-size:
    12px !important;
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.birthday-spotlight-setup-footer {
  width:
    100%;

  min-height:
    62px;

  padding-top:
    2px;

  align-items:
    center !important;

  gap:
    18px !important;
}


.birthday-spotlight-sound-option {
  font-size:
    12px !important;
}


.birthday-spotlight-start {
  min-height:
    54px !important;

  padding:
    12px
    26px !important;

  font-size:
    13px !important;
}


/* ---------------------------------------------------------
   Smaller laptop screens
   --------------------------------------------------------- */

@media (
  max-width:
  1100px
) {
  .birthday-spotlight-setup {
    width:
      calc(
        100vw -
        50px
      ) !important;
  }


  .birthday-spotlight-setup-grid {
    grid-template-columns:
      minmax(
        300px,
        0.9fr
      )
      minmax(
        0,
        1.1fr
      ) !important;
  }


  .birthday-spotlight-photo-preview {
    width:
      125px !important;

    height:
      125px !important;

    flex-basis:
      125px !important;
  }
}


@media (
  max-width:
  760px
) {
  .birthday-spotlight-setup {
    width:
      100% !important;
  }


  .birthday-spotlight-setup-grid {
    grid-template-columns:
      1fr !important;
  }


  .birthday-spotlight-setup-card {
    min-height:
      0;
  }


  .birthday-spotlight-theme-options {
    grid-template-columns:
      1fr !important;
  }
}


.teacher-welcome-heading-row {
  width:
    100%;

  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    20px;
}


.teacher-welcome-heading-main {
  min-width:
    0;

  display:
    flex;

  align-items:
    center;

  gap:
    18px;
}


.teacher-welcome-heading-main
.teacher-welcome-icon {
  flex:
    0
    0
    auto;
}


.teacher-welcome-heading-main
h2 {
  min-width:
    0;

  margin:
    0;
}


.teacher-welcome-install-button {
  flex:
    0
    0
    auto;

  min-height:
    44px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    7px;

  padding:
    9px
    17px;

  border:
    1px solid
    #bbf7d0;

  border-radius:
    999px;

  background:
    #f0fdf4;

  color:
    #166534;

  font:
    inherit;

  font-size:
    12px;

  line-height:
    1;

  font-weight:
    950;

  white-space:
    nowrap;

  cursor:
    pointer;

  box-shadow:
    0
    5px
    14px
    rgba(
      22,
      101,
      52,
      0.08
    );

  transition:
    transform
    0.15s ease,
    background
    0.15s ease,
    border-color
    0.15s ease;
}


.teacher-welcome-install-button:hover,
.teacher-welcome-install-button:focus-visible {
  border-color:
    #86efac;

  background:
    #dcfce7;

  outline:
    none;

  transform:
    translateY(
      -1px
    );
}


.teacher-welcome-install-button:active {
  transform:
    scale(
      0.97
    );
}


.teacher-welcome-install-button[hidden] {
  display:
    none !important;
}


/* =========================================================
   WELCOME — CLASS BOARD VIDEO
   ========================================================= */

.teacher-welcome-video {
  width:
    100%;

  display:
    grid;

    grid-template-columns:
    minmax(
      320px,
      1.15fr
    )
    minmax(
      220px,
      0.85fr
    );

  align-items:
    center;

  gap:
    18px;

  margin:
    -4px
    0
    20px;

  padding:
    10px;

  border:
    1px solid
    #d9fbe8;

  border-radius:
    20px;

  background:
    linear-gradient(
      135deg,
      #f8fffb,
      #f1fdf6
    );

  box-shadow:
    0
    8px
    22px
    rgba(
      15,
      23,
      42,
      0.045
    );
}


.teacher-welcome-video-frame {
  position:
    relative;

  width:
    100%;

  aspect-ratio:
    16 / 9;

  overflow:
    hidden;

  border-radius:
    14px;

  background:
    #0f172a;

  box-shadow:
    0
    8px
    18px
    rgba(
      15,
      23,
      42,
      0.13
    );
}


.teacher-welcome-video-frame
iframe {
  position:
    absolute;

  inset:
    0;

  width:
    100%;

  height:
    100%;

  border:
    0;
}


.teacher-welcome-video-copy {
  min-width:
    0;

  display:
    grid;

  align-content:
    center;

  gap:
    6px;

  padding:
    4px
    10px
    4px
    0;
}


.teacher-welcome-video-kicker {
  color:
    #159957;

  font-size:
    9px;

  line-height:
    1;

  font-weight:
    950;

  letter-spacing:
    0.75px;
}


.teacher-welcome-video-copy
strong {
  color:
    #143f3a;

  font-size:
    18px;

  line-height:
    1.12;

  font-weight:
    950;

  letter-spacing:
    -0.35px;
}


.teacher-welcome-video-copy
small {
  color:
    #64748b;

  font-size:
    11.5px;

  line-height:
    1.4;

  font-weight:
    800;
}


@media (max-width: 700px) {

  .teacher-welcome-heading-row {
    align-items:
      flex-start;
  }


  .teacher-welcome-heading-main {
    gap:
      12px;
  }


  .teacher-welcome-install-button {
    min-height:
      40px;

    padding:
      8px
      13px;
  }


  .teacher-welcome-video {
    grid-template-columns:
      1fr;

    gap:
      11px;

    padding:
      9px;

    margin-bottom:
      17px;
  }


  .teacher-welcome-video-copy {
    padding:
      2px
      5px
      6px;
  }


  .teacher-welcome-video-copy
  strong {
    font-size:
      16px;
  }

}

/* Compact collapsed widgets sidebar */
/* Never override the Today dashboard layout */
@media (min-width: 901px) {
  body:not([data-stage="today"]).right-rail-collapsed .board-shell {
    grid-template-columns: 250px minmax(0, 1fr) 38px !important;
  }

  body:not([data-stage="today"]).left-rail-collapsed.right-rail-collapsed .board-shell {
    grid-template-columns: 38px minmax(0, 1fr) 38px !important;
  }

  body.right-rail-collapsed .right-rail {
    min-width: 0 !important;
    width: 38px !important;
  }

  body.right-rail-collapsed
  .right-rail-collapsed-controls
  .rail-visibility-button {
    width: 100%;
    padding: 6px 2px;
    font-size: 15px;
  }
}

