/* Tenant-branded header: navigation stays sticky; image banner scrolls away naturally. */
.app-header-banner[hidden],.app-header-banner-image[hidden]{display:none!important}
.app-header-banner{width:100%;padding:8px 12px 2px;background:transparent;position:relative;flex-shrink:0}
.app-header-banner-image{display:block;width:100%;height:auto;max-height:240px;object-fit:contain;object-position:center;background:linear-gradient(100deg,#064e3b,#065f46);border-radius:12px;box-shadow:0 5px 18px rgba(0,0,0,.16);border:1px solid rgba(255,255,255,.28)}
.header-branding-settings{padding:18px;border:1px solid #dcece6;background:linear-gradient(145deg,#fff,#f3faf7);border-radius:15px}
.header-branding-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.header-branding-preview{border-radius:12px;overflow:hidden;border:1px solid #d7e4e0;background:#fff}
.header-branding-preview-title{background:linear-gradient(100deg,#064e3b,#065f46);color:#fff;font-weight:850;font-size:13px;line-height:1.4;padding:12px;overflow-wrap:anywhere}
.header-branding-preview-title[hidden]{display:none!important}
.header-branding-preview-image{width:100%;max-height:120px;object-fit:contain;display:block;background:#e6f3ef}
.header-branding-preview-image[hidden]{display:none!important}
.header-branding-preview-empty{padding:24px 8px;text-align:center;background:#eaf4ef;color:#475569;font-size:12px}
.header-branding-preview-empty[hidden]{display:none!important}
.header-branding-button{padding:10px 13px;border-radius:10px;font-weight:800;font-size:13px;transition:filter .15s}
.header-branding-button:disabled{opacity:.6;cursor:wait}
.header-branding-button:not(:disabled):hover{filter:brightness(1.06)}
@media(max-width:700px){.header-branding-options{grid-template-columns:1fr}.app-header-banner{padding:5px 6px 1px}.app-header-banner-image{max-height:160px;border-radius:8px}.header-branding-settings{padding:12px}}
@media(prefers-reduced-motion:reduce){.header-branding-button{transition:none}}

/* Size guide and device preview are scoped only to administrator settings. */
.header-banner-size-guide{margin:13px 0;padding:14px;border-radius:12px;border:1px solid #cce6db;background:#f2fbf7;display:flex;flex-direction:column;gap:9px}
.header-banner-size-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.header-banner-size-card{display:flex;flex-direction:column;gap:4px;background:#fff;border:1px solid #d5e8df;border-radius:11px;padding:11px;min-width:0}
.header-banner-size-card strong{font-size:12px;color:#14532d}
.header-banner-size-card span{font-size:17px;font-weight:900;color:#0f766e;white-space:nowrap}
.header-banner-size-card small{font-size:11px;color:#64748b;line-height:1.4}
.header-banner-device-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}
.header-branding-secondary-button{align-self:start;font-weight:700;color:#b45309;background:#fff7ed;border:1px solid #fed7aa;border-radius:7px;padding:6px 8px;font-size:11px;margin-top:4px}
.header-banner-preview-select{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.header-banner-preview-select button{font-size:11px;padding:7px 8px;border:1px solid #cbd5e1;border-radius:9px;background:#f8fafc;color:#334155;font-weight:750}
.header-banner-preview-select button[aria-pressed=true]{background:#d1fae5;border-color:#059669;color:#065f46}
.header-banner-preview-viewport{width:100%;max-width:100%;margin:0 auto;transition:max-width .2s ease}
.header-banner-preview-viewport[data-device=tablet]{max-width:440px}
.header-banner-preview-viewport[data-device=mobile]{max-width:240px}
.header-branding-preview-image{height:auto;max-height:165px;object-fit:contain}
.header-banner-preview-viewport[data-device=mobile] .header-branding-preview-image{max-height:155px}
@media (min-width:601px) and (max-width:1024px){.app-header-banner{padding:7px 10px 2px}.app-header-banner-image{max-height:190px}}
@media(max-width:700px){.header-banner-size-grid{grid-template-columns:1fr}.header-banner-device-inputs{grid-template-columns:1fr}.header-banner-size-guide{padding:11px}.header-banner-preview-viewport[data-device=tablet]{max-width:100%}}
@media(prefers-reduced-motion:reduce){.header-banner-preview-viewport{transition:none}}

/* Desktop-only: a 20% shorter header (240px -> 192px) that spans the
   available screen content width. Cover avoids distortion; older 6:1
   banners may be cropped vertically until replaced by a 7.5:1 image. */
@media (min-width:1025px){
  .app-header-banner{width:100%;padding:8px 0 2px}
  .app-header-banner-image{width:100%;height:auto;aspect-ratio:15/2;max-height:192px;object-fit:cover;object-position:center;border-radius:0}
  .header-banner-preview-viewport[data-device=desktop] .header-branding-preview-image{aspect-ratio:15/2;max-height:132px;object-fit:cover}
  .student-exam-branding-img{max-height:68px}
}


/* Nonblocking visual guidance for recommended banner dimensions. */
.header-banner-dimension-feedback{padding:8px 10px;border-radius:9px;line-height:1.45;background:#f1f5f9;color:#475569}
.header-banner-dimension-feedback[data-status=good]{background:#ecfdf5;color:#065f46}
.header-banner-dimension-feedback[data-status=warning]{background:#fffbeb;color:#92400e}
.header-banner-dimension-feedback[data-status=invalid]{background:#fef2f2;color:#991b1b}

/* Tenant branding inside the student exam fullscreen root only. */
.student-exam-branding[hidden],.student-exam-branding-title[hidden],.student-exam-branding-img[hidden]{display:none!important}
.student-exam-branding{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;padding:6px 10px;margin:0 0 8px;background:linear-gradient(110deg,#064e3b,#065f46);border:1px solid #047857;border-radius:11px;overflow:hidden}
.student-exam-branding-title{color:white;font-size:clamp(13px,2vw,20px);font-weight:800;line-height:1.3;text-align:center;overflow-wrap:anywhere;max-width:100%}
.student-exam-branding-img{display:block;width:100%;height:auto;max-height:85px;object-fit:contain;object-position:center;border-radius:6px}
/* Align the exam identity header with the top and side edges of the
   active fullscreen viewport. Keep its contents inside the device safe area. */
#exam-interface:fullscreen > #exam-header-branding,
#exam-interface:-webkit-full-screen > #exam-header-branding {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-top: 0;
  margin-right: 0;
  margin-left: 0;
  padding-top: max(5px, env(safe-area-inset-top, 0px));
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}
.student-exam-header-setting{display:flex;flex-direction:column;gap:9px;margin-bottom:14px;background:#ecfdf5;border:1px solid #a7f3d0;border-radius:12px;padding:14px}
.student-exam-header-setting select{max-width:360px}
@media(max-width:700px){.student-exam-branding{padding:5px 7px;margin-bottom:6px;gap:4px;border-radius:7px}.student-exam-branding-title{font-size:13px}.student-exam-branding-img{max-height:54px}.student-exam-header-setting{padding:11px}}
@media(min-width:701px) and (max-width:1024px){.student-exam-branding-img{max-height:70px}}
