@import url('https://fonts.bunny.net/css?family=plus-jakarta-sans:400,500,600,700,800|inter:400,500,600,700|jetbrains-mono:500,600,700&display=swap');

/* ========================================================
   🎨 iOS & Apple-Inspired Modern Design System Tokens
   ======================================================== */
:root {
    --primary-gov: #007052;        /* Official Bangladesh Emerald */
    --primary-dark: #00523c;       /* Deep Emerald */
    --primary-light: #008763;      /* Crisp Accent Green */
    --primary-gradient: linear-gradient(180deg, #007a58 0%, #00563e 100%);
    --primary-tint: #ecf8f3;       /* Soft Emerald Tint */
    --primary-tint-border: rgba(0, 112, 82, 0.22);
    
    --accent-blue: #0284c7;        /* iOS Accent Blue */
    --accent-blue-dark: #0369a1;
    --accent-blue-gradient: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    
    --bg-canvas: #f2f4f7;          /* iOS Grouped System Background */
    --bg-card: #ffffff;
    --bg-surface: #f8fafc;
    --bg-hover: #f1f5f9;
    
    --text-primary: #0f172a;        /* Deep Slate / Charcoal */
    --text-secondary: #334155;      /* Slate-700 */
    --text-muted: #64748b;          /* Slate-500 */
    --text-placeholder: #94a3b8;    /* Muted Placeholder */
    --text-white: #ffffff;
    
    --border-color: #d1d5db;        /* Crisp modern border */
    --border-subtle: #e2e8f0;       /* Divider line */
    --border-focus: #007052;
    
    --shadow-ios-card: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 12px 24px -4px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(0, 0, 0, 0.04);
    --shadow-ios-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-ios-btn: 0 3px 10px rgba(0, 112, 82, 0.28);
    
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 9999px;
}

/* ========================================================
   📱 Global Reset & iOS Optimization
   ======================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    min-height: 100dvh;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* ========================================================
   🏛️ Top Official Navigation Header (iOS Style)
   ======================================================== */
.official-top-banner {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: max(14px, env(safe-area-inset-top)) 18px 14px 18px;
    box-shadow: 0 3px 12px rgba(0, 80, 58, 0.25);
    position: relative;
    z-index: 10;
}

.banner-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.gov-crest-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.35), 0 4px 10px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
    overflow: hidden;
}

.gov-crest-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-pill);
    display: block;
}

.banner-titles {
    flex: 1;
    text-align: center;
}

.banner-titles h1 {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    text-transform: uppercase;
}

.banner-titles p {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    opacity: 0.92;
    margin-top: 3px;
}

.banner-status-box {
    flex-shrink: 0;
}

.network-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.network-status.online {
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(52, 211, 153, 0.5);
    color: #ffffff;
}

.network-status.offline {
    background: rgba(244, 63, 94, 0.25);
    border: 1px solid rgba(253, 164, 175, 0.5);
    color: #ffffff;
}

/* ========================================================
   🎯 Main Content Canvas
   ======================================================== */
.main-content-canvas {
    flex: 1;
    max-width: 860px;
    width: 100%;
    margin: 18px auto 14px auto;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.app-screen {
    width: 100%;
}

/* ========================================================
   🔍 SCREEN 1: iOS-STYLED PREMIUM SEARCH FORM
   ======================================================== */
.search-form-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-ios-card);
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.form-header-bar {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.form-header-bar h2 {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sub-label {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.32);
    padding: 2.5px 9px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.alert-box {
    background: #ffe4e6;
    border: 1px solid #fecdd3;
    color: #9f1239;
    padding: 10px 14px;
    margin: 14px 18px 0 18px;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
}

.search-grid {
    padding: 18px 22px 14px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 14px;
}

.form-row label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    letter-spacing: -0.01em;
}

/* 🍎 iOS Native Form Controls */
.field-control {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 14px;
    font-size: 15px; /* 15-16px prevents iOS Safari auto-zoom */
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-ios-sm);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.field-control::placeholder {
    color: var(--text-placeholder);
    font-weight: 400;
}

.field-control:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.field-control:focus {
    outline: none;
    border-color: var(--border-focus);
    background-color: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(0, 112, 82, 0.16);
}

/* 🍎 Clean iOS SVG Chevron for Selects */
select.field-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 15px;
    padding-right: 38px;
    cursor: pointer;
}

select.field-control:invalid,
select.field-control option[value=""] {
    color: var(--text-placeholder);
}

select.field-control option {
    color: var(--text-primary);
    background-color: #ffffff;
}

/* 🧩 Captcha Interactive Area */
.captcha-row {
    align-items: center;
}

.captcha-interactive {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
}

.captcha-display {
    background: var(--primary-tint);
    border: 1.5px solid var(--primary-tint-border);
    border-radius: var(--radius-md);
    height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--primary-gov);
    letter-spacing: 0.5px;
    min-width: 90px;
    user-select: none;
    box-shadow: var(--shadow-ios-sm);
}

.captcha-reload-btn {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-ios-sm);
    flex-shrink: 0;
}

.captcha-reload-btn:hover {
    background: var(--primary-tint);
    border-color: var(--primary-gov);
}

.captcha-reload-btn:active {
    transform: scale(0.92) rotate(90deg);
}

.captcha-input {
    width: 120px !important;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* 🍎 iOS Action Buttons Bar */
.form-buttons-bar {
    padding: 14px 22px 18px 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-subtle);
    background: #fafbfc;
}

.btn {
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-size: 0.90rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.btn:active {
    transform: scale(0.97);
}

.btn-search {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-ios-btn);
}

.btn-search:hover {
    opacity: 0.95;
    box-shadow: 0 4px 14px rgba(0, 112, 82, 0.35);
}

.btn-reset {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    box-shadow: var(--shadow-ios-sm);
}

.btn-reset:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* ========================================================
   📜 SCREEN 2: EXACT OFFICIAL RESULT FORMAT (iOS Refined)
   ======================================================== */
.result-tables-container {
    width: 100%;
}

.official-marksheet-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-ios-card);
    padding: 18px 18px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

/* 💧 Watermark visible on both Screen & Print */
.marksheet-watermark {
    position: absolute;
    top: 54%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.12;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.marksheet-watermark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 🏛️ Official Print & Screen Verification Footer */
.print-official-banner {
    display: none;
}

.print-official-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 12px;
    border-top: 1px dashed #cbd5e1;
    position: relative;
    z-index: 2;
}

.print-footer-info {
    flex: 1;
    text-align: left;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #475569;
}

.print-footer-info p {
    margin: 2px 0;
}

.print-footer-info .footer-auth strong,
.print-footer-info .footer-update strong {
    color: #0f172a;
    font-weight: 700;
}

.print-footer-info .footer-copy {
    font-size: 0.68rem;
    color: #64748b;
}

.print-footer-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 14px;
    flex-shrink: 0;
}

.print-footer-qr .qr-box {
    background: #ffffff;
    padding: 5px;
    border: 1.5px solid #94a3b8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.print-footer-qr canvas {
    display: block;
    width: 182px;
    height: 182px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.print-footer-qr .qr-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f172a;
    margin-top: 5px;
}

.result-title-bar {
    text-align: center;
    padding: 4px 0 12px 0;
    position: relative;
    z-index: 2;
}

.result-title-bar h2 {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.action-buttons-strip {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.action-buttons-strip.bottom-strip {
    margin-top: 16px;
    margin-bottom: 0;
}

.btn-search-again {
    background: var(--primary-gradient);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 0 16px;
    height: 38px;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: var(--shadow-ios-btn);
}

.btn-search-again:active {
    transform: scale(0.97);
}

.btn-print {
    background: var(--accent-blue-gradient);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 0 18px;
    height: 38px;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25);
}

.btn-print:active {
    transform: scale(0.97);
}

.table-section {
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.88);
}

.section-table-header {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 7px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.official-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    background: transparent;
}

.official-table td, .official-table th {
    border: 1px solid var(--border-subtle);
    padding: 7px 12px;
}

.summary-table td.field-k {
    width: 22%;
    color: var(--text-secondary);
    font-weight: 600;
    background: var(--bg-surface);
}

.summary-table td.field-v {
    width: 28%;
    color: var(--text-primary);
}

.summary-table td.col-span-3 {
    width: 78%;
}

.grades-table th {
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1.5px solid var(--border-color);
    padding: 7px 12px;
}

.grades-table .th-code, .grades-table .col-code {
    width: 20%;
    text-align: left;
    font-weight: 700;
}

.grades-table .th-name, .grades-table .col-name {
    width: 50%;
    text-align: left;
    font-weight: 600;
}

.grades-table .th-grade, .grades-table .col-grade {
    width: 15%;
    text-align: center;
    font-weight: 800;
    color: var(--primary-gov);
}

.grades-table .th-marks, .grades-table .col-marks {
    width: 15%;
    text-align: center;
    font-weight: 700;
    color: #0b6623;
}

.grades-table.has-marks .th-code, .grades-table.has-marks .col-code {
    width: 18%;
}

.grades-table.has-marks .th-name, .grades-table.has-marks .col-name {
    width: 52%;
}

.grades-table.has-marks .th-marks, .grades-table.has-marks .col-marks {
    width: 15%;
    text-align: center;
}

.grades-table.has-marks .th-grade, .grades-table.has-marks .col-grade {
    width: 15%;
    text-align: center;
}

.highlight-marks {
    color: #0b6623;
    font-size: 1.02rem;
    font-weight: 800;
}

.marks-summary-row {
    background: #f6fbf7 !important;
}

.grades-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

.grades-table tbody tr:hover {
    background: #f1f5f9;
}

/* ========================================================
   🏛️ Official Footer (Apple-Style Compact Grouped)
   ======================================================== */
.official-footer {
    background: transparent;
    padding: 10px 16px max(14px, env(safe-area-inset-bottom)) 16px;
    margin-top: auto;
}

.footer-inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.footer-inner p {
    margin-bottom: 2px;
}

.footer-inner p:last-child {
    margin-bottom: 0;
    opacity: 0.85;
}

.footer-inner em {
    font-style: normal;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========================================================
   📱 Mobile View Responsive Refinements (< 768px)
   Eliminating the empty vertical gap above footer!
   ======================================================== */
@media (max-width: 767px) {
    .official-top-banner {
        padding: max(10px, env(safe-area-inset-top)) 14px 10px 14px;
    }

    .banner-inner {
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .gov-crest-box {
        width: 40px;
        height: 40px;
    }

    .gov-crest-img {
        width: 32px;
        height: 32px;
    }

    .banner-titles h1 {
        font-size: 0.88rem;
        line-height: 1.22;
    }

    .banner-titles p {
        font-size: 0.68rem;
    }

    .banner-status-box {
        display: none;
    }

    /* 🎯 REMOVING EXCESSIVE VERTICAL EMPTY SPACE ON MOBILE: */
    .main-content-canvas {
        flex: 0 0 auto;
        margin: 10px auto 4px auto;
        padding: 0 12px;
        width: 100%;
    }

    .search-form-card {
        margin: 0 auto;
        border-radius: 16px;
    }

    .form-header-bar {
        padding: 10px 14px;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }

    .form-header-bar h2 {
        font-size: 0.94rem;
    }

    .search-grid {
        padding: 12px 14px 8px 14px;
        gap: 9px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .form-row label {
        text-align: left;
        font-size: 0.80rem;
    }

    .field-control {
        height: 42px;
        font-size: 15px;
        padding: 0 12px;
    }

    .captcha-interactive {
        height: 42px;
        gap: 6px;
    }

    .captcha-display {
        height: 42px;
        padding: 0 10px;
        font-size: 0.95rem;
        min-width: 75px;
    }

    .captcha-reload-btn {
        width: 42px;
        height: 42px;
    }

    .captcha-input {
        width: 100px !important;
        height: 42px;
        font-size: 0.95rem;
    }

    .form-buttons-bar {
        padding: 10px 14px 12px 14px;
        gap: 8px;
    }

    .btn {
        height: 42px;
        padding: 0 16px;
        font-size: 0.86rem;
    }

    /* 🏛️ Snug, clean footer placement directly below card without giant gap */
    .official-footer {
        margin-top: 8px;
        padding: 8px 12px max(12px, env(safe-area-inset-bottom)) 12px;
    }

    .footer-inner {
        font-size: 0.68rem;
        line-height: 1.35;
    }

    .summary-table tr {
        display: flex;
        flex-wrap: wrap;
    }

    .summary-table td.field-k {
        flex: 0 0 38%;
        width: 38%;
        font-weight: 600;
        font-size: 0.80rem;
        padding: 7px 10px;
        background: var(--bg-surface);
        color: var(--text-secondary);
    }

    .summary-table td.field-v {
        flex: 1 1 62%;
        width: 62%;
        font-size: 0.82rem;
        padding: 7px 10px;
        color: var(--text-primary);
        word-break: break-word;
    }

    /* 🎯 Keep Name, Father, Mother, Institute side-by-side with label on mobile (saves vertical space) */
    .summary-table td.col-span-3 {
        flex: 1 1 62% !important;
        width: 62% !important;
    }

    .summary-table tr td.field-k:nth-child(3):not(:last-child) {
        flex: 0 0 38%;
        width: 38%;
    }

    .summary-table tr td.field-v:nth-child(4) {
        flex: 1 1 62%;
        width: 62%;
    }

    .summary-table tr td.field-k:nth-child(3):last-child,
    .summary-table tr td.field-k:nth-child(4) {
        flex: 1 1 50%;
        width: 50%;
    }
}

/* ========================================================
   🖨️ Clean Official Print Styles (Guaranteed 1-Page Output)
   ======================================================== */
@page {
    size: A4 portrait;
    margin: 8mm 10mm;
}

@media print {
    *, *:before, *:after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box !important;
    }

    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        font-size: 11px !important;
        color: #000000 !important;
    }

    .official-top-banner,
    .action-buttons-strip,
    .official-footer,
    #screenSearch,
    #searchAlert {
        display: none !important;
    }

    #screenResult {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-content-canvas {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .result-tables-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .official-marksheet-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        position: relative !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* 🏛️ Official Top Header Banner in Print */
    .print-official-banner {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        background: #007052 !important;
        color: #ffffff !important;
        padding: 6px 12px !important;
        margin-bottom: 8px !important;
        border-radius: 4px !important;
        text-align: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .print-banner-logo {
        width: 38px !important;
        height: 38px !important;
        background: #ffffff !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        padding: 2px !important;
    }

    .print-banner-logo img {
        width: 32px !important;
        height: 32px !important;
        object-fit: contain !important;
        display: block !important;
    }

    .print-banner-text h1 {
        font-size: 11px !important;
        font-weight: 800 !important;
        color: #ffffff !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.2 !important;
        letter-spacing: 0.2px !important;
    }

    .print-banner-text p {
        font-size: 8px !important;
        font-weight: 600 !important;
        color: #ffffff !important;
        margin: 0 !important;
        letter-spacing: 0.3px !important;
        opacity: 0.95 !important;
    }

    /* 💧 Centered Subtle Watermark */
    .marksheet-watermark {
        display: flex !important;
        position: absolute !important;
        top: 52% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 320px !important;
        height: 320px !important;
        opacity: 0.16 !important;
        pointer-events: none !important;
        z-index: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .marksheet-watermark img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .result-title-bar {
        padding: 0 0 5px 0 !important;
        margin: 0 !important;
        text-align: center !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .result-title-bar h2 {
        font-size: 12.5px !important;
        font-weight: 700 !important;
        margin: 0 !important;
        color: #000000 !important;
        line-height: 1.2 !important;
    }

    .table-section {
        margin-bottom: 6px !important;
        border: 1px solid #777777 !important;
        border-radius: 0 !important;
        position: relative !important;
        z-index: 1 !important;
        background: transparent !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .section-table-header {
        background: #007052 !important;
        color: #ffffff !important;
        padding: 3.5px 8px !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        letter-spacing: 0 !important;
    }

    .official-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 10px !important;
        background: transparent !important;
    }

    .official-table td, 
    .official-table th {
        border: 1px solid #999999 !important;
        padding: 3px 6px !important;
        line-height: 1.2 !important;
        background: transparent !important;
    }

    /* Force Table display for print so mobile flex rules do not inflate height */
    .summary-table {
        display: table !important;
        background: transparent !important;
    }

    .summary-table tbody {
        display: table-row-group !important;
        background: transparent !important;
    }

    .summary-table tr {
        display: table-row !important;
        background: transparent !important;
    }

    .summary-table td.field-k {
        display: table-cell !important;
        flex: none !important;
        width: 22% !important;
        font-size: 9.5px !important;
        font-weight: 600 !important;
        background: rgba(240, 240, 240, 0.45) !important;
        color: #222222 !important;
        padding: 3px 6px !important;
    }

    .summary-table td.field-v {
        display: table-cell !important;
        flex: none !important;
        width: 28% !important;
        font-size: 9.5px !important;
        color: #000000 !important;
        padding: 3px 6px !important;
        background: transparent !important;
    }

    .summary-table td.col-span-3 {
        display: table-cell !important;
        flex: none !important;
        width: 78% !important;
    }

    .grades-table {
        display: table !important;
        background: transparent !important;
    }

    .grades-table thead {
        display: table-header-group !important;
        background: transparent !important;
    }

    .grades-table tbody {
        display: table-row-group !important;
        background: transparent !important;
    }

    .grades-table tr {
        display: table-row !important;
        background: transparent !important;
    }

    .grades-table tbody tr:nth-child(even) {
        background: transparent !important;
    }

    .grades-table th {
        background: rgba(240, 240, 240, 0.6) !important;
        color: #111111 !important;
        font-weight: 700 !important;
        font-size: 9.5px !important;
        padding: 3.5px 6px !important;
        border-bottom: 1.5px solid #666666 !important;
    }

    .grades-table td {
        font-size: 9.5px !important;
        padding: 2.5px 6px !important;
        background: transparent !important;
    }

    .grades-table .th-code, .grades-table .col-code {
        width: 18% !important;
        text-align: left !important;
    }

    .grades-table .th-name, .grades-table .col-name {
        width: 52% !important;
        text-align: left !important;
    }

    .grades-table .th-marks, .grades-table .col-marks {
        width: 15% !important;
        text-align: center !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    .grades-table .th-grade, .grades-table .col-grade {
        width: 15% !important;
        text-align: center !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    .highlight-marks {
        color: #000000 !important;
        font-size: 10.5px !important;
        font-weight: 800 !important;
    }

    /* 🏛️ Official Verification Footer & QR in Print (Bottom Strip) */
    .print-official-footer {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding-top: 6px !important;
        margin-top: 6px !important;
        border-top: 1px dashed #777777 !important;
        position: relative !important;
        z-index: 2 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .print-footer-info {
        flex: 1 !important;
        text-align: left !important;
        font-size: 8px !important;
        line-height: 1.35 !important;
        color: #333333 !important;
    }

    .print-footer-info p {
        margin: 1px 0 !important;
    }

    .print-footer-info .footer-auth strong,
    .print-footer-info .footer-update strong {
        color: #000000 !important;
        font-weight: 700 !important;
    }

    .print-footer-info .footer-copy {
        font-size: 7.5px !important;
        color: #666666 !important;
        margin-top: 2px !important;
    }

    .print-footer-qr {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: 14px !important;
        flex-shrink: 0 !important;
    }

    .print-footer-qr .qr-box {
        background: #ffffff !important;
        padding: 5px !important;
        border: 1.5px solid #334155 !important;
        border-radius: 4px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .print-footer-qr canvas {
        display: block !important;
        width: 182px !important;
        height: 182px !important;
        image-rendering: pixelated !important;
        image-rendering: crisp-edges !important;
    }

    .print-footer-qr .qr-label {
        font-size: 9.5px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        color: #0f172a !important;
        margin-top: 4px !important;
    }

    .attestation-verified-banner {
        background: #f0fdf4 !important;
        border: 1.5px solid #007052 !important;
        padding: 8px 12px !important;
        margin-bottom: 12px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .attestation-verified-banner .verified-badge-icon {
        background: #007052 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .attestation-verified-banner .verified-main-title {
        color: #007052 !important;
    }
    .attestation-verified-banner .verified-sub-title {
        color: #1e293b !important;
    }
}

/* 🏛️ Official Verification Attestation Banner (Screen) */
.attestation-verified-banner {
    background: #ecfdf5;
    border: 1.5px solid #10b981;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.attestation-verified-banner .verified-badge-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #007052;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 112, 82, 0.2);
}

.attestation-verified-banner .verified-badge-info {
    flex: 1;
}

.attestation-verified-banner .verified-main-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #065f46;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.3;
}

.attestation-verified-banner .verified-sub-title {
    font-size: 0.8rem;
    color: #047857;
    font-weight: 500;
    margin: 2px 0 0;
}

/* 🎟️ Virtual Waiting Room Overlay & Card */
.waiting-room-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.waiting-room-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 112, 82, 0.15);
    width: 100%;
    max-width: 480px;
    padding: 28px 24px;
    text-align: center;
    animation: slideUpCard 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpCard {
    from { transform: translateY(20px) scale(0.97); }
    to { transform: translateY(0) scale(1); }
}

.queue-icon-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ecf8f3;
    border: 2px solid #007052;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(0, 112, 82, 0.15);
}

.waiting-room-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.waiting-room-header .queue-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
}

.queue-info-box {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
}

.queue-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-stat .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
}

.queue-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #007052;
    font-family: var(--font-mono);
}

.queue-divider {
    width: 1px;
    height: 36px;
    background: #e2e8f0;
}

.queue-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.queue-progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.queue-estimate {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 14px;
}

.queue-note {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.45;
    background: #f1f5f9;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #007052;
}


