/* ==========================================================================
   SKYLEARN DESIGN SYSTEM — EXCEL ROYAL ACADEMY EDITION
   Warmly bright edtech aesthetic. Dyslexia-friendly. Large touch targets.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&family=Hubot+Sans:ital,wght@0,400..900;1,400..900&family=JetBrains+Mono:wght@400;600;700&family=Nunito:wght@600;700;800;900&display=swap');

:root {
  /* Skylearn Primary Brand Colors */
  --c-sky: #3B82F6;
  --c-sky-bright: #60A5FA;
  --c-sky-deep: #1D4ED8;
  --c-sky-soft: #DBEAFE;

  /* Skylearn Sun / Achievements */
  --c-sun: #FBBF24;
  --c-sun-bright: #FCD34D;
  --c-sun-deep: #D97706;

  /* Skylearn Leaf / Progress & Correctness */
  --c-leaf: #22C55E;
  --c-leaf-soft: #DCFCE7;
  --c-leaf-deep: #16A34A;

  /* Skylearn Coral / Gentle Error Indicator */
  --c-coral: #F87171;
  --c-coral-soft: #FEE2E2;

  /* Skylearn Berry / Secondary Accent */
  --c-berry: #A855F7;
  --c-berry-soft: #F3E8FF;

  /* Skylearn Surfaces & Inks */
  --c-bg: #FFFFFF;
  --c-surface: #F8FAFC;
  --c-surface-elevated: #FFFFFF;
  --c-surface-sunken: #F1F5F9;

  --c-ink: #0F172A;
  --c-ink-muted: #475569;
  --c-ink-subtle: #94A3B8;
  --c-ink-faint: #CBD5E1;

  --c-outline: #E2E8F0;
  --c-outline-strong: #94A3B8;

  /* System Semantic Aliases */
  --c-purple-primary: var(--c-sky);
  --c-purple-dark: var(--c-sky-deep);
  --c-purple-deep: #1E3A8A;
  --c-purple-light: var(--c-sky-bright);
  --c-purple-tint: var(--c-sky-soft);
  --c-purple-border: #BFDBFE;
  --c-gold: var(--c-sun);

  --c-present-bg: var(--c-leaf-soft);
  --c-present-text: var(--c-leaf-deep);
  --c-present-border: #86EFAC;

  --c-late-bg: #FEF3C7;
  --c-late-text: var(--c-sun-deep);
  --c-late-border: var(--c-sun-bright);

  --c-absent-bg: var(--c-coral-soft);
  --c-absent-text: #DC2626;
  --c-absent-border: #FCA5A5;

  --c-info-bg: var(--c-sky-soft);
  --c-info-text: var(--c-sky-deep);
  --c-info-border: #BFDBFE;

  --c-canvas: var(--c-surface);
  --c-card: var(--c-surface-elevated);
  --c-border: var(--c-outline);
  --c-border-light: var(--c-surface-sunken);
  --c-ink-primary: var(--c-ink);
  --c-ink-secondary: var(--c-ink-muted);

  /* Skylearn Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-modal: 28px;
  --radius-full: 9999px;

  /* Typography Stacks */
  --font-display: 'Hubot Sans', 'Nunito', 'Quicksand', -apple-system, sans-serif;
  --font-body: 'Atkinson Hyperlegible', 'Nunito Sans', Inter, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--c-surface);
  color: var(--c-ink);
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

/* Desktop App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Desktop Control Bar */
.desktop-bar {
  background: #111827;
  border-bottom: 1px solid #1F2937;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.desktop-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.desktop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.role-switcher {
  display: flex;
  background: #1F2937;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #374151;
}

.role-tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #9CA3AF;
  transition: all 0.2s;
}

.role-tab.active {
  background: var(--c-purple-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(72, 22, 109, 0.4);
}

.screen-select {
  background: #1F2937;
  color: #E9D5FF;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.btn-control {
  background: #1F2937;
  color: #E5E7EB;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-control:hover {
  background: #374151;
}

/* Viewport Stage */
.viewport-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 30%, #1A0D30 0%, #0F121C 100%);
  overflow-x: auto;
  overflow-y: auto;
}

/* Phone Mockup Frame */
.phone-mockup {
  width: 375px;
  height: 812px;
  background: #000000;
  border-radius: 50px;
  padding: 12px;
  box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.9), 0 0 0 6px #1F2937;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 28px;
  background: #000000;
  border-radius: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
}

.dynamic-island-cam {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111827;
}

.dynamic-island-lens {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #030712;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dynamic-island-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1E3A8A;
}

/* Inner Phone Screen Canvas */
.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--c-canvas);
  border-radius: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--c-ink-primary);
}

/* iOS Bottom Home Indicator */
.home-indicator {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 4px;
  background: #1F2937;
  border-radius: 9999px;
  z-index: 50;
  pointer-events: none;
}

/* Status Bar (Hidden on all screens to eliminate redundant whitespace and duplicate clocks) */
.status-bar {
  display: none !important;
}

.status-bar.dark-bar {
  display: none !important;
}

.status-bar-icons {
  display: none !important;
}

/* App Bar */
.app-bar {
  background: var(--c-purple-primary);
  color: #FFFFFF;
  padding: 10px 16px 12px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-bar.white-bar {
  background: #FFFFFF;
  color: var(--c-ink-primary);
  border-bottom: 1px solid var(--c-border);
}

.app-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-bar-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-size: 18px;
  padding: 4px;
  border-radius: 8px;
  line-height: 1;
}

/* Screen Body */
.screen-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Common Card (Skylearn: 20px radius, 1px outline, soft lift) */
.card {
  background: var(--c-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--c-outline);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease;
}
.card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-present {
  background: var(--c-leaf-soft);
  color: var(--c-leaf-deep);
  border-color: #86EFAC;
}

.badge-late {
  background: #FEF3C7;
  color: var(--c-sun-deep);
  border-color: var(--c-sun-bright);
}

.badge-absent {
  background: var(--c-coral-soft);
  color: #DC2626;
  border-color: #FCA5A5;
}

.badge-purple {
  background: var(--c-sky-soft);
  color: var(--c-sky-deep);
  border-color: #BFDBFE;
}

/* Skylearn Form Inputs (16px minimum, 12px radius, Sky Focus Ring) */
.input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-outline);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 52px;
  transition: all 0.2s;
}
.input-group:focus-within {
  border-color: var(--c-sky);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px var(--c-sky-soft);
}

.input-field {
  border: none;
  background: transparent;
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--c-ink);
  outline: none;
}
.input-field::placeholder {
  color: var(--c-ink-faint);
}

/* Skylearn Big Friendly Button (56px min height, 16px radius, Tactile Snap) */
.btn-primary {
  width: 100%;
  min-height: 56px;
  border-radius: var(--radius-lg);
  background: var(--c-sky);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-primary:hover {
  background: var(--c-sky-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.35);
}
.btn-primary:active {
  transform: scale(0.97);
  background: var(--c-sky-deep);
}

.btn-outline {
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-lg);
  background: var(--c-surface-elevated);
  color: var(--c-sky);
  border: 2px solid var(--c-sky);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: var(--c-sky-soft);
  color: var(--c-sky-deep);
}
.btn-outline:active {
  transform: scale(0.97);
}

/* Skylearn Specific Components */
.skylearn-star-badge {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--c-sun);
  color: #1E1B4B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.skylearn-streak-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FEF3C7;
  border: 1px solid var(--c-sun);
  color: var(--c-sun-deep);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
}

.skylearn-progress-strip {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--c-sky-soft);
  overflow: hidden;
  position: relative;
}
.skylearn-progress-fill {
  height: 100%;
  background: var(--c-leaf);
  border-radius: var(--radius-full);
  transition: width 480ms ease-out;
}

.skylearn-help-bubble {
  background: var(--c-sky-soft);
  color: var(--c-sky-deep);
  border-radius: var(--radius-xl);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
}

.skylearn-parent-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--c-surface-sunken);
  border: 1px solid var(--c-outline);
  border-radius: var(--radius-full);
  padding: 3px;
}
.skylearn-parent-toggle button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-ink-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.skylearn-parent-toggle button.active {
  background: var(--c-sky);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.btn-primary:active {
  transform: scale(0.98);
  background: var(--c-purple-dark);
}

.btn-outline {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--c-purple-primary);
  border: 2px solid var(--c-purple-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-outline:active {
  background: var(--c-purple-tint);
}

/* Bottom Navigation Bar */
.bottom-nav {
  height: auto;
  min-height: 60px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  position: sticky;
  bottom: 0;
  z-index: 40;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 9.5px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 4px 1px;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1;
  max-width: 20%;
  min-width: 0;
}

.nav-item.active {
  color: var(--c-purple-primary);
  font-weight: 800;
}

.nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item.active .nav-icon-wrap {
  background: #EFF6FF;
  color: var(--c-purple-primary);
}

.nav-label {
  font-size: 9.5px;
  line-height: 1.1;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ==========================================================================
   EXECUTIVE MANAGEMENT PORTAL COMPONENTS
   ========================================================================== */

.exec-card {
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  padding: 16px;
}

.exec-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.exec-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exec-card-icon-pill {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exec-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.01em;
}

.exec-card-subtitle {
  font-size: 10.5px;
  color: #64748B;
  margin: 2px 0 0 0;
}

/* Executive Quick Action Grid */
.exec-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.exec-action-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 12px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.exec-action-tile:hover, .exec-action-tile:active {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.exec-tile-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: transform 0.2s ease;
}

.exec-action-tile:active .exec-tile-icon-wrap {
  transform: scale(0.92);
}

.exec-tile-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.25;
  display: block;
}

.exec-tile-sub {
  font-size: 10px;
  color: #64748B;
  margin-top: 3px;
  line-height: 1.35;
  display: block;
}

/* Surcharges Metric Chips */
.exec-metric-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.exec-metric-pill {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.exec-metric-pill-label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  display: block;
}

.exec-metric-pill-val {
  font-size: 14px;
  font-weight: 900;
  color: #0F172A;
  margin-top: 3px;
  display: block;
}

.exec-metric-pill-sub {
  font-size: 8.5px;
  color: #64748B;
  margin-top: 2px;
  display: block;
}

/* Executive Buttons */
.btn-exec-primary {
  background: var(--c-purple-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.btn-exec-primary:active {
  transform: scale(0.98);
  opacity: 0.95;
}

.btn-exec-secondary {
  background: #FFFFFF;
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-exec-secondary:active {
  background: #F1F5F9;
}

/* ==========================================================================
   MOTION ANIMATIONS & GPU-ACCELERATED TRANSITIONS
   ========================================================================== */

/* 1. Screen Page Transitions */
@keyframes screenSlideFadeIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.screen-enter {
  animation: screenSlideFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
}

/* 2. Staggered Card Entrances */
@keyframes cardSlideUp {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-body > .card,
.screen-body > div > .card,
.screen-body div.card {
  animation: cardSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.screen-body .card:nth-child(1), .screen-body > .card:nth-child(1) { animation-delay: 0.03s; }
.screen-body .card:nth-child(2), .screen-body > .card:nth-child(2) { animation-delay: 0.07s; }
.screen-body .card:nth-child(3), .screen-body > .card:nth-child(3) { animation-delay: 0.11s; }
.screen-body .card:nth-child(4), .screen-body > .card:nth-child(4) { animation-delay: 0.15s; }
.screen-body .card:nth-child(5), .screen-body > .card:nth-child(5) { animation-delay: 0.19s; }
.screen-body .card:nth-child(6), .screen-body > .card:nth-child(6) { animation-delay: 0.23s; }
.screen-body .card:nth-child(7), .screen-body > .card:nth-child(7) { animation-delay: 0.27s; }
.screen-body .card:nth-child(8), .screen-body > .card:nth-child(8) { animation-delay: 0.31s; }

/* 3. Interactive Touch Springs */
.btn-primary, .btn-outline, .btn-control {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, background 0.15s ease !important;
}
.btn-primary:active, .btn-outline:active {
  transform: scale(0.95) !important;
}

.card {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}
.card:active {
  transform: scale(0.98);
}

.nav-item {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease !important;
}
.nav-item:active {
  transform: scale(0.88);
}
.nav-item.active {
  color: var(--c-purple-primary);
  font-weight: 700;
}
.nav-item.active span:first-child {
  display: inline-block;
  animation: navBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes navBounce {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* 4. Radar Expanding Concentric Waves */
@keyframes radar-pulse-1 {
  0% { transform: scale(0.85); opacity: 0.9; }
  50% { transform: scale(1.22); opacity: 0.25; }
  100% { transform: scale(0.85); opacity: 0.9; }
}

@keyframes radar-pulse-2 {
  0% { transform: scale(0.92); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 0.15; }
  100% { transform: scale(0.92); opacity: 0.8; }
}

.radar-pulse-ring {
  animation: radar-pulse-1 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
.radar-pulse-ring-outer {
  animation: radar-pulse-2 2.6s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* 5. QR Code High-Tech Laser Scanline */
@keyframes qrLaserScan {
  0% {
    top: 6%;
    opacity: 0.85;
  }
  50% {
    top: 88%;
    opacity: 1;
  }
  100% {
    top: 6%;
    opacity: 0.85;
  }
}

.qr-laser-line {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0) 0%, #8B5CF6 20%, #C084FC 50%, #8B5CF6 80%, rgba(139, 92, 246, 0) 100%);
  box-shadow: 0 0 12px 3px rgba(168, 85, 247, 0.7);
  border-radius: 2px;
  z-index: 20;
  pointer-events: none;
  animation: qrLaserScan 2.4s ease-in-out infinite;
}

/* 6. Modal Elastic Spring Entrance */
@keyframes modalBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBoxSpring {
  0% {
    opacity: 0;
    transform: scale(0.86) translateY(24px);
  }
  70% {
    transform: scale(1.02) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes ringBell {
  0% { transform: rotate(0); }
  10%, 30%, 50% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-14deg); }
  60%, 100% { transform: rotate(0); }
}

/* 7. Floating Portal Pill Continuous Hover Animation */
@keyframes floatBob {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
  50% {
    transform: translateY(-5px);
    box-shadow: 0 10px 22px rgba(139, 92, 246, 0.4);
  }
}

/* 8. Pulsing Live Indicators */
@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.45);
    opacity: 0.45;
  }
}

.pulse-live-dot {
  display: inline-block;
  animation: pulseDot 1.8s infinite ease-in-out;
}

/* 9. Success Confirmation Toast / Banner */
@keyframes successPop {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(-20px);
  }
  70% {
    transform: scale(1.04) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.success-toast-pop {
  animation: successPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ==========================================================================
   GALLERY MULTI-SCREEN BOARD VIEW (SIDE-BY-SIDE MATCHING DESIGN COLLAGE)
   ========================================================================== */
.gallery-board {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  padding: 20px 10px 60px 10px;
  max-width: 1920px;
  margin: 0 auto;
}

.gallery-screen-card {
  width: 360px;
  height: 780px;
  background: #000000;
  border-radius: 46px;
  padding: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7), 0 0 0 3px #374151;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-screen-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(72, 22, 109, 0.4), 0 0 0 3px #8B5CF6;
}

.gallery-card-badge {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(72, 22, 109, 0.9);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  z-index: 60;
  border: 1px solid rgba(233, 213, 255, 0.4);
  pointer-events: none;
}

.gallery-screen-inner {
  width: 100%;
  height: 100%;
  background: var(--c-canvas);
  border-radius: 38px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--c-ink-primary);
}

/* ==========================================================================
   REAL MOBILE DEVICE / STANDALONE APK FULLSCREEN VIEW
   ========================================================================== */
@media (max-width: 600px), (display-mode: standalone) {
  .desktop-bar {
    display: none !important;
  }
  .viewport-stage {
    padding: 0 !important;
    background: var(--c-surface) !important;
    height: 100vh !important;
    overflow: hidden !important;
  }
  .phone-mockup {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .dynamic-island {
    display: none !important;
  }
  .home-indicator {
    display: none !important;
  }
  .phone-screen {
    border-radius: 0 !important;
    height: 100vh !important;
  }
}

.portal-float-btn {
  position: fixed;
  bottom: 74px;
  right: 14px;
  background: #1E1B4B;
  color: #FFFFFF;
  border: 1.5px solid #8B5CF6;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 999;
  cursor: pointer;
  animation: floatBob 3.2s ease-in-out infinite;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.portal-float-btn:active {
  transform: scale(0.92) !important;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalBackdropFadeIn 0.22s ease-out both;
}
.app-modal-box {
  background: #FFFFFF;
  border-radius: 20px;
  width: 96%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: modalBoxSpring 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@media (max-width: 600px) {
  .app-modal-box {
    padding: 16px 14px;
    border-radius: 18px;
    max-height: 88dvh;
    width: 95% !important;
    max-width: 100% !important;
  }
}

/* Full-Screen Expanded Modal Experience */
.app-modal-box.modal-expanded {
  width: 98vw !important;
  max-width: 1400px !important;
  height: 94vh !important;
  max-height: 94vh !important;
  border-radius: 16px !important;
  padding: 20px !important;
}

.app-modal-box.modal-expanded .branded-pdf-container {
  max-height: calc(94vh - 40px) !important;
}

@media (max-width: 768px) {
  .app-modal-box.modal-expanded {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    padding: 12px 10px !important;
  }
}

/* Universal Mobile Table Responsiveness */
.table-responsive, .table-container, .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Toast Notification System */
.app-toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 480px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-toast {
  background: #1E1B4B;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.15);
  animation: toastDropIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  pointer-events: auto;
  cursor: pointer;
}
.app-toast.toast-success {
  background: linear-gradient(135deg, #065F46, #047857);
  border-color: #34D399;
}
.app-toast.toast-warning {
  background: linear-gradient(135deg, #92400E, #B45309);
  border-color: #FBBF24;
}
.app-toast.toast-info {
  background: linear-gradient(135deg, #48166D, #6B21A8);
  border-color: #C084FC;
}
.app-toast.toast-error {
  background: linear-gradient(135deg, #991B1B, #B91C1C);
  border-color: #F87171;
}
@keyframes toastDropIn {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

/* Live Camera Scanner Styles */
.scanner-viewport-box {
  width: 260px;
  height: 260px;
  margin: 10px auto;
  background: #0B0F19;
  border-radius: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(72, 22, 109, 0.2), inset 0 0 20px rgba(0,0,0,0.6);
  border: 1.5px solid rgba(139, 92, 246, 0.3);
}

.scanner-video-feed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  z-index: 10;
}

.scanner-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  z-index: 25;
}

.corner-tl { top: 12px; left: 12px; border-top: 3.5px solid #A855F7; border-left: 3.5px solid #A855F7; border-top-left-radius: 8px; }
.corner-tr { top: 12px; right: 12px; border-top: 3.5px solid #A855F7; border-right: 3.5px solid #A855F7; border-top-right-radius: 8px; }
.corner-bl { bottom: 12px; left: 12px; border-bottom: 3.5px solid #A855F7; border-left: 3.5px solid #A855F7; border-bottom-left-radius: 8px; }
.corner-br { bottom: 12px; right: 12px; border-bottom: 3.5px solid #A855F7; border-right: 3.5px solid #A855F7; border-bottom-right-radius: 8px; }

.scanner-reticle-box {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 1.5px dashed rgba(216, 180, 254, 0.6);
  border-radius: 16px;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: reticlePulse 2s ease-in-out infinite;
}

@keyframes reticlePulse {
  0% { transform: scale(0.96); opacity: 0.6; }
  50% { transform: scale(1.02); opacity: 0.95; }
  100% { transform: scale(0.96); opacity: 0.6; }
}

.scanner-reticle-crosshair {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.4);
  border: 1.5px solid #C084FC;
}

.scanner-success-flash {
  position: absolute;
  inset: 0;
  background: rgba(5, 150, 105, 0.92);
  border-radius: 24px;
  z-index: 35;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  text-align: center;
  padding: 16px;
  transition: opacity 0.3s ease;
}

.mode-toggle-segmented {
  background: #F1F5F9;
  padding: 4px;
  border-radius: 12px;
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.mode-toggle-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle-btn.active {
  background: #48166D;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(72, 22, 109, 0.25);
}

.mode-toggle-btn:not(.active) {
  background: transparent;
  color: #475569;
}

/* ========================================================
   BRANDED PDF REPORT & PRINT MEDIA STYLES (100% MOBILE-MATCHED)
   ======================================================== */

.branded-pdf-container {
  background: #FFFFFF;
  color: #0F172A;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pdf-letterhead {
  border-bottom: 2.5px solid #48166D;
  padding-bottom: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pdf-letterhead-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}

.pdf-school-crest {
  width: 48px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.pdf-school-title {
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 900;
  color: #48166D;
  letter-spacing: 0.4px;
  line-height: 1.15;
  margin: 0;
}

.pdf-school-motto {
  font-size: 9.5px;
  font-weight: 800;
  color: #B45309;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-top: 2px;
}

.pdf-school-address {
  font-size: 9px;
  color: #64748B;
  margin-top: 2px;
  line-height: 1.3;
}

.pdf-doc-badge {
  text-align: right;
  flex-shrink: 0;
}

.pdf-doc-badge-pill {
  background: #48166D;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 9999px;
  display: inline-block;
  text-transform: uppercase;
}

.pdf-report-title-banner {
  background: #FAF5FF;
  border-left: 4px solid #7E22CE;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
}

.pdf-report-title-text {
  font-size: clamp(11.5px, 3.3vw, 13.5px);
  font-weight: 900;
  color: #48166D;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  line-height: 1.25;
}

.pdf-report-sub-text {
  font-size: 10px;
  color: #64748B;
  margin-top: 2px;
  line-height: 1.3;
}

.pdf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.pdf-kpi-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 7px 8px;
  text-align: center;
  min-width: 0;
}

.pdf-kpi-card.highlight-purple {
  background: #FAF5FF;
  border-color: #D8B4FE;
}

.pdf-kpi-card.highlight-red {
  background: #FEF2F2;
  border-color: #FCA5A5;
}

.pdf-kpi-card.highlight-green {
  background: #ECFDF5;
  border-color: #A7F3D0;
}

.pdf-kpi-label {
  font-size: 8.5px;
  color: #64748B;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.pdf-kpi-val {
  font-size: clamp(12.5px, 3.5vw, 15px);
  font-weight: 900;
  color: #1E1B4B;
  margin-top: 2px;
  display: block;
  word-break: break-word;
}

.pdf-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
  margin-bottom: 12px;
  table-layout: auto;
}

.pdf-table th {
  background: #48166D;
  color: #FFFFFF;
  padding: 6px 5px;
  font-weight: 800;
  text-align: left;
  border: 1px solid #3B0764;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
}

.pdf-table td {
  padding: 5px 5px;
  border: 1px solid #E2E8F0;
  color: #1E293B;
  vertical-align: middle;
  word-break: break-word;
  line-height: 1.25;
}

.pdf-table tr:nth-child(even) {
  background: #F8FAFC;
}

.pdf-table tr.total-row {
  background: #F3E8FF !important;
  font-weight: 900;
  color: #48166D;
  border-top: 2px solid #7E22CE;
}

.pdf-sign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1.5px dashed #CBD5E1;
  width: 100%;
}

.pdf-sign-box {
  text-align: center;
  min-width: 0;
}

.pdf-sign-line {
  border-bottom: 1px solid #475569;
  margin-bottom: 5px;
  min-height: 24px;
  font-size: 9px;
  font-weight: 700;
  color: #48166D;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2px;
  word-break: break-word;
}

.pdf-sign-role {
  font-size: 8.5px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  line-height: 1.2;
}

.pdf-sign-sub {
  font-size: 8px;
  color: #94A3B8;
  margin-top: 1px;
  line-height: 1.15;
}

@media (max-width: 768px) {
  .app-modal-box:has(.branded-pdf-container) {
    width: 96% !important;
    max-width: 480px !important;
    padding: 10px 8px !important;
    max-height: 92dvh !important;
    border-radius: 16px !important;
  }
  .branded-pdf-container {
    padding: 12px 10px !important;
    max-height: 86dvh !important;
    border-radius: 12px !important;
  }
  .pdf-letterhead {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .pdf-doc-badge {
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    background: #F8FAFC;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
  }
  .pdf-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .pdf-sign-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .pdf-table {
    font-size: 8.5px !important;
  }
  .pdf-table th, .pdf-table td {
    padding: 4px 3px !important;
  }
}

/* Native Print Stylesheet — 100% Mobile-Matched & Zero Zoom */
@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  html, body {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Dedicated Active Report Print Mount (Mobile-Matched Layout) */
  body.printing-active-report .app-root-wrapper,
  body.printing-active-report .desktop-utility-bar,
  body.printing-active-report #screen-container,
  body.printing-active-report #global-modal-container,
  body.printing-active-report #toast-container,
  body.printing-active-report #hd-print-poster-mount {
    display: none !important;
  }

  body.printing-active-report #hd-print-report-mount {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    overflow: visible !important;
  }

  body.printing-active-report #hd-print-report-mount .branded-pdf-container,
  body.printing-active-report #hd-print-report-mount .cert-modal-wrap,
  body.printing-active-report #hd-print-report-mount .cert-frame-outer {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  body.printing-active-report #hd-print-report-mount .no-print,
  body.printing-active-report #hd-print-report-mount button {
    display: none !important;
  }

  /* When printing the Official HD Gate QR Poster, hide ALL app screens & modals and show ONLY the 300-DPI Poster */
  body.printing-gate-poster .app-root-wrapper,
  body.printing-gate-poster .desktop-utility-bar,
  body.printing-gate-poster #screen-container,
  body.printing-gate-poster #global-modal-container,
  body.printing-gate-poster #toast-container,
  body.printing-gate-poster #hd-print-report-mount {
    display: none !important;
  }

  body.printing-gate-poster #hd-print-poster-mount {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    page-break-inside: avoid !important;
  }

  body.printing-gate-poster #hd-print-poster-mount img {
    width: 100% !important;
    max-width: 196mm !important;
    max-height: 282mm !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
  }

  /* Standard Report Modal Printing: Hide the background dashboard so only the report prints */
  .app-root-wrapper,
  .desktop-utility-bar,
  .dev-controller-bar,
  .app-bar,
  .bottom-nav,
  .no-print,
  #toast-container,
  .app-modal-backdrop > *:not(.app-modal-box),
  button:not(.allow-print) {
    display: none !important;
  }

  .app-modal-backdrop {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .app-modal-box,
  .app-modal-box.modal-expanded {
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .branded-pdf-container {
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    padding: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .pdf-kpi-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .pdf-table {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 8.5px !important;
  }

  .pdf-table th, .pdf-table td {
    white-space: normal !important;
    word-break: break-word !important;
    padding: 4px 4px !important;
  }

  .pdf-table tr, .mobile-pdf-card-item {
    page-break-inside: avoid !important;
  }
}

/* ========================================================
   OFFICIAL EXCEL ROYAL ACADEMY CERTIFICATE RESPONSIVE ENGINE
   Seamless fit for Mobile Viewport (Portrait/Landscape), Tablet & Desktop
   ======================================================== */
.cert-modal-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  box-sizing: border-box;
}

.cert-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.cert-frame-outer {
  background: #FFFDF9;
  border: 4px solid #48166D;
  outline: 2px solid #D97706;
  outline-offset: -6px;
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 24px rgba(72, 22, 109, 0.12);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.cert-logo {
  width: 68px;
  height: auto;
  margin: 0 auto 6px auto;
  display: block;
}

.cert-school-title {
  font-size: clamp(16px, 4.8vw, 22px);
  font-weight: 900;
  color: #48166D;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
  margin: 0;
}

.cert-school-motto {
  font-size: clamp(9px, 2.4vw, 11px);
  font-weight: 800;
  color: #D97706;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.cert-school-sub {
  font-size: clamp(8.5px, 2.2vw, 10px);
  color: #64748B;
  margin-top: 2px;
}

.cert-ribbon-badge {
  margin: 12px auto;
  display: inline-block;
  background: linear-gradient(135deg, #48166D, #6B21A8);
  color: #FDE68A;
  padding: 6px clamp(12px, 3.5vw, 24px);
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(72, 22, 109, 0.2);
  max-width: 96%;
  box-sizing: border-box;
}

.cert-ribbon-text {
  font-size: clamp(11.5px, 3.2vw, 15px);
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.cert-honour-subtitle {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 800;
  color: #78350F;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

.cert-conferred-label {
  font-size: clamp(10px, 2.6vw, 11.5px);
  color: #64748B;
  margin-top: 10px;
  font-style: italic;
}

.cert-recipient-wrap {
  margin: 8px auto;
  display: inline-block;
  border-bottom: 2px solid #D97706;
  padding: 0 16px 4px 16px;
  max-width: 96%;
  box-sizing: border-box;
}

.cert-recipient-name {
  font-size: clamp(18px, 5.5vw, 26px);
  font-weight: 900;
  color: #48166D;
  margin: 0;
  letter-spacing: 0.5px;
  font-family: serif;
  word-break: break-word;
  line-height: 1.2;
}

.cert-meta-info {
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 700;
  color: #475569;
  margin-top: 4px;
  word-break: break-word;
}

.cert-category-badge {
  display: inline-block;
  background: #FEF3C7;
  border: 1.5px solid #F59E0B;
  color: #92400E;
  padding: 5px clamp(10px, 3vw, 16px);
  border-radius: 8px;
  font-size: clamp(10.5px, 2.8vw, 12px);
  font-weight: 800;
  margin-top: 8px;
  max-width: 96%;
  word-break: break-word;
  box-sizing: border-box;
}

.cert-citation-box {
  margin: 12px auto;
  max-width: 520px;
  width: 100%;
  background: #FAF5FF;
  border-left: 3.5px solid #7E22CE;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
  box-sizing: border-box;
}

.cert-signatures-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.cert-sign-block {
  flex: 1;
  min-width: 95px;
  max-width: 170px;
  text-align: center;
}

.cert-sign-line {
  width: 100%;
  max-width: 130px;
  margin: 0 auto;
  border-bottom: 1.5px solid #1E1B4B;
  padding-bottom: 2px;
  font-family: cursive;
  font-size: clamp(11px, 3vw, 13px);
  color: #48166D;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cert-actions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .app-modal-box:has(.cert-modal-wrap) {
    padding: 12px 8px !important;
    width: 98% !important;
    max-width: 100% !important;
    max-height: 94dvh !important;
  }
  .cert-frame-outer {
    border: 3px solid #48166D;
    outline: 2px solid #D97706;
    outline-offset: -4px;
    border-radius: 12px;
    padding: 14px 8px;
  }
  .cert-logo {
    width: 54px;
  }
  .cert-signatures-row {
    gap: 8px;
    margin-top: 14px;
    padding-top: 8px;
  }
  .cert-sign-block {
    min-width: 80px;
    max-width: 140px;
  }
  .cert-sign-line {
    max-width: 110px;
  }
}




