body.scan-kiosk-page {
      margin: 0;
      font-family: var(--brand-font-family, 'Poppins', Arial, sans-serif);
      display: flex;
      flex-direction: column;
      height: 100vh;
      min-height: 100vh;
      overflow: hidden;
      background: var(--brand-page-bg, #f4f9fc);
    }

    .header {
      background: #ffffff;
      padding: 15px clamp(14px, 2vw, 28px);
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: clamp(10px, 2vw, 20px);
      border-bottom: 3px solid var(--brand-primary, #29abe2);
      box-shadow: 0 4px 18px rgba(18, 90, 130, 0.08);
      z-index: 2;
    }

    .header .logo-title {
      display: flex;
      align-items: center;
      gap: clamp(10px, 2vw, 24px);
      min-width: 0;
    }

    .header > a {
      margin-left: auto;
      flex-shrink: 0;
      color: var(--brand-primary-darker, #125a82);
      font-weight: 600;
      font-size: 0.875rem;
      text-decoration: none;
    }

    .header > a:hover {
      color: var(--brand-primary, #29abe2);
    }

    .header img {
      width: clamp(240px, 28vw, 360px);
      height: auto;
      max-width: min(360px, 70vw);
      margin-left: 0;
      object-fit: contain;
      justify-self: start;
    }

    .header .system-title {
      min-width: 0;
      font-size: clamp(16px, 2.2vw, 30px);
      font-weight: 700;
      color: var(--brand-primary-darker, #125a82);
      text-transform: uppercase;
      letter-spacing: 1px;
      font-family: 'Poppins', sans-serif;
      text-align: right;
      padding-right: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .footer1{
      background: var(--brand-footer-bg, #125a82);
      padding: 10px 20px;
      display: flex;
      align-items: center;
      position: relative;   /* so child absolute positioning is relative to this */
      overflow: hidden; /* hides overflow */

    }
    .footer1 .footer-logo{
      display: flex;
      align-items: center;
      gap: 15px;
      width: 100%;
      justify-content: space-between;

    }
    .marquee-container {
      width: 100%;
      overflow: hidden;
      background-color: var(--brand-footer-bg, #125a82);
      color: #ffffff;
      border-top: 2px solid var(--brand-primary, #29abe2);
      padding: 15px 0;
      box-sizing: border-box;
    }

    .marquee {
      display: inline-block;
      white-space: nowrap;
      padding-left: 100%;
      animation: scan-marquee-scroll 15s linear infinite;
      font-family: 'Poppins', sans-serif;
      font-weight: 700;
      font-size: 24px;
      color: #ffffff;
    }

    @keyframes scan-marquee-scroll {
      0% { transform: translateX(0%); }
      100% { transform: translateX(-100%); }
    }

    .footer1 .footer-title{
      font-size: 30px;
      font-weight: bold;
      color: #ffffff;
      text-transform: uppercase;
      letter-spacing: 2px;
      font-family: 'Poppins', sans-serif;
      left: 100%;           /* start fully off the right edge */
      white-space: nowrap; /* keep text on one line */
      display: inline-block;
      /* Start off-screen to the left */
      transform: translateX(100%);
      /* Animate continuously */
      animation: scrollMarquee 15s linear infinite;

    }
    @keyframes scrollMarquee {
      0% {
        transform: translateX(0);
      }
      100% {
        transform: translateX(370%);
      }
    }
    .home-button {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      padding: 9px 18px;
      border: 0;
      border-radius: 8px;
      background-color: var(--brand-primary-darker, #125a82);
      color: #ffffff;
      cursor: pointer;
      font-family: var(--brand-font-family, 'Poppins', Arial, sans-serif);
      font-size: 0.9rem;
      font-weight: 700;
      text-decoration: none;
      white-space: nowrap;
      box-shadow: 0 8px 18px rgba(18, 90, 130, 0.16);
      transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

    .home-button:hover {
      background-color: var(--brand-button-hover-bg, #1a8fc4);
      color: var(--brand-button-hover-text, #ffffff);
      transform: translateY(-1px);
    }

    .home-button:focus-visible {
      outline: 3px solid rgba(41, 171, 226, 0.35);
      outline-offset: 2px;
    }

    .main {
      display: flex;
      flex: 1;
      min-height: 0;
    }

    .sidebar {
      width: clamp(300px, 28vw, 380px);
      background: linear-gradient(180deg, var(--brand-primary, #29abe2) 0%, var(--brand-primary-dark, #1a8fc4) 100%);
      color: #ffffff;
      padding: clamp(18px, 2vw, 28px);
      display: flex;
      flex-direction: column;
      align-items: center;
      box-shadow: 8px 0 28px rgba(18, 90, 130, 0.16);
      z-index: 1;
    }
    .name-box{
      width: 100%;
      min-height: 10rem;
      margin-top: clamp(18px, 3vh, 32px);
      background: #ffffff;
      border-radius: 18px;
      padding: 22px 18px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      box-shadow: 0 16px 34px rgba(18, 90, 130, 0.18);
    }

    .sidebar .name-box .label,
    .sidebar .name-box .timestamp {
      color: #64748b;
    }

    .name-box--example {
      opacity: 0.8;
    }

    .name-box--example .status-button {
      background: #64748b;
    }
    .date {
      font-size: 16px;
      margin-bottom: 5px;
      color: rgba(255, 255, 255, 0.95);
    }

    .time {
      font-size: clamp(28px, 3vw, 42px);
      font-weight: bold;
      color: #ffffff;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
      margin-bottom: 20px;
    }

    .profile-pic {
      width: clamp(160px, 16vw, 220px);
      height: clamp(160px, 16vw, 220px);
      border-radius: 20px;
      background-color: #ffffff;
      overflow: hidden;
      margin-bottom: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      border: 6px solid rgba(255, 255, 255, 0.55);
      box-shadow: 0 16px 34px rgba(18, 90, 130, 0.22);
    }

    .profile-pic img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .student-name {
          color: #1e293b;
          font-weight: bold;
          font-size: clamp(1.3rem, 2.4vw, 2rem);
          word-wrap: break-word;
          overflow-wrap: break-word;
          text-align: center;
          white-space: normal; /* Allows line breaking */
          max-width: 100%;     /* Prevents overflow */
    }

    .label {
      font-size: 14px;
      color: #cbd5e1;
      margin-bottom: 15px;
    }
    .timestamp{
      font-size: 14px;
      color: #cbd5e1;
      margin-top: 15px;
    }

    .status-button {
      width: min(100%, 260px);
      font-size: clamp(1rem, 2vw, 1.55rem);
      background: var(--brand-primary-darker, #125a82);
      color: #ffffff;
      padding: 9px 18px;
      border-radius: 25px;
      font-weight: bold;
      text-align: center;
      min-height: 28px;
    }

    .status-button.status-out {
      background: #dc2626;
    }

    .right-content {
      flex: 1;
      background: linear-gradient(135deg, #e8f4fc 0%, #f4f9fc 50%, #dceef8 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 0;
      padding: clamp(16px, 3vw, 42px);
    }
    .right-content video,
    .right-content iframe {
      max-width: min(92%, 1180px);
      max-height: 78vh;
      border: 3px solid var(--brand-primary, #29abe2);
      border-radius: 18px;
      box-shadow: 0 8px 32px rgba(41, 171, 226, 0.25);
      background: #ffffff;
    }

    .scan-animation {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      
      border-radius: 8px;
      
  
      overflow: hidden;
    }

    /* The moving scan line */
    .scan-animation::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 4px;
      background: var(--brand-primary, #29abe2);
      box-shadow: 0 0 8px rgba(41, 171, 226, 0.8);
      animation: scanline 4s linear infinite;
    }


    /* Scan line animation */
    @keyframes scanline {
      0% {
        top: 0;
      }
      50% {
        top: calc(100% - 4px);
      }
      100% {
        top: 0;
      }
    }
    .ads-vid{
      width: 100%;
      height: auto;
      border-radius: 8px;
      pointer-events: none;
    }
    
    /* ===== SECTION MODAL CARD GRID ===== */
    
    .section-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      justify-content: center;
      align-items: center;
      z-index: 9999;
      backdrop-filter: blur(4px);
    }
    
    .modal-content {
      background: #ffffff;
      padding: 40px;
      width: min(920px, 95vw);
      max-width: 95%;
      max-height: 90vh;
      border-radius: 20px !important;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      text-align: center;
      animation: modalPop 0.25s ease;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .section-picker-modal h2 {
      flex-shrink: 0;
    }
    
    @keyframes modalPop {
      from { transform: scale(0.9); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }
    
    .modal-content h2 {
      font-family: 'Poppins', sans-serif;
      font-weight: 700;
      margin-bottom: 30px;
      font-size: 26px;
      color: var(--brand-primary-darker, #125a82);
      letter-spacing: 1px;
    }
    
    .section-buttons {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 16px;
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      padding: 4px 2px 8px;
      align-content: start;
    }

    .section-buttons[data-count="1"],
    .section-buttons[data-count="2"] {
      grid-template-columns: repeat(2, 1fr);
    }

    .section-buttons[data-count="3"],
    .section-buttons[data-count="4"] {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (min-width: 640px) {
      .section-buttons[data-count="5"],
      .section-buttons[data-count="6"],
      .section-buttons[data-count="7"],
      .section-buttons[data-count="8"] {
        grid-template-columns: repeat(4, 1fr);
      }
    }

    .section-empty-msg {
      grid-column: 1 / -1;
      margin: 0;
      padding: 1rem;
      color: #64748b;
      font-size: 15px;
    }
    
    /* CARD STYLE */
    .section-buttons button {
      padding: clamp(14px, 2.5vw, 28px) 12px;
      min-height: 72px;
      border-radius: 18px !important;
      border: none;
      font-weight: 600;
      font-size: clamp(13px, 1.4vw, 16px);
      line-height: 1.25;
      font-family: 'Poppins', sans-serif;
      cursor: pointer;
      background: linear-gradient(135deg, var(--brand-button-bg, #29abe2), var(--brand-primary-dark, #1a8fc4));
      color: white;
      transition: all 0.25s ease;
      box-shadow: 0 8px 20px rgba(0,0,0,0.15);
      word-break: break-word;
      hyphens: auto;
    }
    
    /* Hover effect */
    .section-buttons button:hover {
      transform: translateY(-6px);
      box-shadow: 0 12px 25px rgba(41, 171, 226, 0.35);
      background: linear-gradient(135deg, var(--brand-primary-dark, #1a8fc4), var(--brand-primary-darker, #125a82));
      color: #ffffff;
    }
    
    /* Click effect */
    .section-buttons button:active {
      transform: scale(0.96);
    }
    
    /* ===== FEEDBACK MODAL ===== */
    
    .feedback-card {
      width: 800px;
      max-width: 95%;
      border-radius: 20px !important;
    }
    
    .feedback-options {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 20px;
      margin: 30px 0;
    }
    
    .feedback-options button {
      background: #f8fafc;
      border: 3px solid transparent;
      padding: 25px 10px;
      border-radius: 20px !important;
      font-size: 35px;
      cursor: pointer;
      transition: 0.25s ease;
      display: flex;
      flex-direction: column;
      align-items: center;
      font-family: 'Poppins', sans-serif;
      font-weight: 600;
    }
    
    .feedback-options button span {
      font-size: 14px;
      margin-top: 10px;
    }
    
    .feedback-options button:hover {
      transform: translateY(-5px);
      border-color: var(--brand-button-bg, #29abe2);
      background: #e3f4fc;
    }
    
    .decline-btn {
      background: #e2e8f0;
      border: none;
      padding: 10px 20px;
      border-radius: 10px !important;
      cursor: pointer;
      font-family: 'Poppins', sans-serif;
      font-weight: 600;
    }

    .decline-btn:hover {
      background: #cbd5e1;
    }

    @media (max-width: 768px) {
      .feedback-options {
        grid-template-columns: repeat(2, 1fr);
      }
      .feedback-card {
        width: 95%;
        padding: 24px 16px;
      }
      .modal-content h2 {
        font-size: 20px;
      }
    }
    
    * {
      box-sizing: border-box;
    }
@media(max-width: 1280px){
    .header img {
        width: clamp(220px, 30vw, 320px);
        height: auto;
    }
}
@media(max-width: 1024px){
    .header img{
        width: clamp(180px, 30vw, 260px);
        height: auto;
    }
    .header .system-title{
        font-size: 25px;
    }
    
    .profile-pic{
        width: 160px;
        height: 160px;
    }
}
@media(max-width: 768px){
    body.scan-kiosk-page {
        overflow: auto;
    }
    .header .logo-title {
        flex-wrap: wrap;
    }
    .header img{
        width: clamp(150px, 42vw, 220px);
        height: auto;
    }
    .header{
        text-align: left;
    }
    .header .system-title{
        justify-self: end;
        font-size: clamp(14px, 4vw, 22px);
    }
    .home-button {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(100%, 220px);
    }
    .main{
        flex-direction: column;
    }
    .sidebar{
        width: 100%;
        min-height: auto;
    }
    .profile-pic{
        width: 140px;
        height: 140px;
    }
    .ads-vid{
        width: 100%;
        height: auto;
        position: relative;
    }
}
@media(max-width: 398px){
    .main{
        display: flex;
    }
    .header{
        text-align: left;
    }
    .header img{
        width: clamp(120px, 46vw, 170px);
        height: auto;
    }
    .header .system-title{
        font-size: 12px;
    }
    .home-button{
        min-height: 34px;
        padding: 6px 10px;
        font-size: 0.72rem;
    }
    
    .sidebar{
        width: 330px;
        
    }
    .profile-pic{
        width: 125px;
        height: auto;
    }
    .ads-vid{
        display: none;
        width: 100%;
        height: auto;
        position: relative;
    }
    .footer1{
        width: auto;
    }
}


/* Early checkout block (kinder & grade school before 4 PM) */
.sidebar--alarm {
  animation: sidebar-alarm-pulse 0.6s ease-in-out 6;
  box-shadow: inset 0 0 0 4px #fbbf24;
}

@keyframes sidebar-alarm-pulse {
  0%, 100% { background-color: var(--brand-primary, #29abe2); }
  50% { background-color: #7f1d1d; }
}

.early-out-alarm {
  width: 100%;
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: #fef2f2;
  border: 3px solid #dc2626;
  color: #7f1d1d;
  text-align: center;
  animation: alarm-shake 0.4s ease-in-out 3;
}

.early-out-alarm__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.early-out-alarm__title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.early-out-alarm__message {
  font-size: 0.95rem;
  margin: 0.5rem 0;
  line-height: 1.35;
}

.early-out-alarm__hint {
  font-size: 0.85rem;
  margin: 0;
  color: #991b1b;
}

.name-box--blocked .label {
  color: #64748b;
}

.status-button.status-blocked {
  background: #dc2626;
  padding: 8px 24px;
  font-size: 1.1rem;
}

.status-button.status-visitor {
  background: #f59e0b;
  color: #fff;
}

.scan-result-box--visitor .label {
  color: #fbbf24;
}

@keyframes alarm-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ===== SIDEBAR DIVIDER / SCAN NAME DISPLAY ===== */
.sidebar-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary-darker, #125a82);
  overflow: hidden;
}

.scan-name-display {
  width: 100%;
  text-align: center;
  padding: 14px 24px;
  animation: fadeInUp 0.3s ease;
}

.scan-name-welcome {
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 2px;
}

.scan-name-text {
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  line-height: 1.2;
  word-break: break-word;
}

.scan-status-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 20px;
  border-radius: 20px;
  background: var(--brand-primary, #29abe2);
  color: #ffffff;
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
}

.scan-status-badge.scan-status-out {
  background: #dc2626;
}

.scan-name-timestamp {
  margin-top: 4px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Poppins', sans-serif;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Landscape: thin vertical separator, name hidden */
@media (orientation: landscape) {
  .sidebar-divider {
    width: 6px;
  }
  .scan-name-display {
    display: none;
  }
}

/* Portrait: full-width horizontal banner (only when a scan is shown) */
@media (orientation: portrait) {
  .sidebar-divider {
    width: 100%;
    min-height: 0;
  }
  .sidebar-divider:has(.scan-name-display[hidden]) {
    display: none;
  }
  .sidebar > .scan-result-box {
    display: none;
  }
  .scan-name-display[hidden] {
    display: none;
  }
  .scan-name-display:not([hidden]) {
    display: block;
  }
}

/* ===== PORTRAIT KIOSK ===== */
@media (orientation: portrait) and (min-width: 769px) {
  body.scan-kiosk-page {
    overflow: hidden;
  }
  .main {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    gap: 6px;
    min-height: auto;
  }
  .date {
    text-align: center;
  }
  .time {
    font-size: clamp(28px, 5vw, 48px);
    text-align: center;
    margin-bottom: 8px;
  }
  .profile-pic {
    width: clamp(100px, 14vw, 160px);
    height: clamp(100px, 14vw, 160px);
    margin-bottom: 0;
  }
  .name-box {
    min-height: auto;
    margin-top: 8px;
    width: 100%;
    padding: 12px 16px;
  }
  .student-name {
    font-size: clamp(1rem, 3vw, 1.6rem);
  }
  .status-button {
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  }
  .right-content {
    flex: 1;
    padding: 12px 16px;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }
  .sidebar-divider:has(.scan-name-display:not([hidden])) {
    min-height: clamp(120px, 9vh, 180px);
  }
  .scan-name-display:not([hidden]) {
    padding: 20px 28px;
  }
  .right-content {
    padding: 12px 16px;
    border-radius: 14px;
  }
  .right-content video,
  .right-content iframe {
    display: block;
    width: 100%;
    height: 35vh;
    max-width: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
    border: 3px solid var(--brand-primary, #29abe2);
    box-shadow: 0 8px 32px rgba(41, 171, 226, 0.2);
  }
  .ads-vid {
    display: block;
    width: 100%;
    height: 35vh;
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
  }
  .header {
    padding: 6px clamp(10px, 2vw, 20px);
  }
  .header img {
    width: clamp(180px, 32vw, 260px);
    height: auto;
  }
  .header .system-title {
    font-size: 13px;
  }
  .home-button {
    min-height: 32px;
    padding: 5px 12px;
    font-size: 0.75rem;
  }
  .scan-name-text {
    font-size: clamp(1.6rem, 5vw, 3rem);
  }
  .scan-name-welcome {
    font-size: 1rem;
    letter-spacing: 3px;
  }
  .scan-status-badge {
    font-size: 1.1rem;
    padding: 6px 28px;
  }
}
