/* ==========================================================================
   AKTU ResultDesk — Editorial Premium Stylesheet
   Light base · atmospheric lighting · Spotlight-class search
   ========================================================================== */

:root {
    /* Surface */
    --bg-color: #ffffff;
    --surface: #ffffff;
    --surface-soft: #fbfbfd;

    /* Ink */
    --text-main: #16171c;
    --text-strong: #0b0c10;
    --text-muted: #63666f;
    --text-faint: #9a9ea8;
    --text-inverse: #ffffff;

    /* Ink CTA (blue is reserved as a whisper accent only) */
    --ink: #17181d;
    --ink-hi: #24262e;

    /* Brand — used sparingly as accent */
    --primary: #3a63d8;
    --primary-hover: #2f52bd;
    --primary-soft: rgba(58, 99, 216, 0.08);
    --primary-ring: rgba(58, 99, 216, 0.12);

    /* Status */
    --success: #0ca86e;
    --success-bg: rgba(12, 168, 110, 0.10);
    --danger: #e5484d;
    --danger-bg: rgba(229, 72, 77, 0.10);
    --warning: #d98a00;
    --warning-bg: rgba(217, 138, 0, 0.10);

    /* Lines & shadows */
    --line: rgba(15, 18, 30, 0.07);
    --line-soft: rgba(15, 18, 30, 0.045);
    --hairline: rgba(15, 18, 30, 0.055);

    /* Soft, layered shadows — no harsh single drop */
    --shadow-xs:
        0 1px 1px rgba(16, 22, 40, 0.03),
        0 2px 4px rgba(16, 22, 40, 0.03);
    --shadow-sm:
        0 1px 2px rgba(16, 22, 40, 0.03),
        0 4px 10px rgba(16, 22, 40, 0.04),
        0 10px 24px -12px rgba(16, 22, 40, 0.06);
    --shadow-md:
        0 1px 2px rgba(16, 22, 40, 0.03),
        0 6px 16px rgba(16, 22, 40, 0.045),
        0 20px 44px -18px rgba(16, 22, 40, 0.09);
    --shadow-lg:
        0 2px 6px rgba(16, 22, 40, 0.04),
        0 14px 32px -12px rgba(16, 22, 40, 0.08),
        0 40px 90px -30px rgba(16, 22, 40, 0.16);
    /* Search centerpiece — five stacked layers for real depth */
    --shadow-float:
        0 1px 1px rgba(16, 22, 40, 0.04),
        0 3px 6px rgba(16, 22, 40, 0.04),
        0 8px 16px rgba(16, 22, 40, 0.05),
        0 18px 38px -10px rgba(16, 22, 40, 0.09),
        0 40px 80px -24px rgba(16, 22, 40, 0.16);

    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);

    --btn-secondary-bg: #f3f4f7;
    --btn-secondary-hover: #e9ebf0;
    --btn-secondary-border: rgba(10, 10, 20, 0.08);

    --table-hover: rgba(47, 107, 255, 0.035);
    --status-bg: rgba(10, 10, 20, 0.03);
    --status-border: rgba(10, 10, 20, 0.06);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
    font-feature-settings: "cv02", "cv03", "cv04", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Atmospheric background — soft blurred radial glows + fine grain
   ========================================================================== */
.atmosphere {
    position: fixed;
    inset: -20vmax;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    will-change: transform;
}

/* Cool overhead key light — desaturated, barely blue */
.glow-a {
    width: 72vmax; height: 60vmax;
    top: -26vmax; left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(70, 96, 170, 0.13), rgba(70, 96, 170, 0) 72%);
    animation: driftA 34s ease-in-out infinite alternate;
}

/* Soft grey-violet fill, lower left */
.glow-b {
    width: 48vmax; height: 48vmax;
    top: 26vmax; left: -12vmax;
    background: radial-gradient(closest-side, rgba(120, 110, 160, 0.10), rgba(120, 110, 160, 0) 70%);
    animation: driftB 40s ease-in-out infinite alternate;
}

/* Faint warm counter-light, right — keeps it from feeling clinical */
.glow-c {
    width: 44vmax; height: 44vmax;
    top: 14vmax; right: -14vmax;
    background: radial-gradient(closest-side, rgba(190, 170, 150, 0.09), rgba(190, 170, 150, 0) 70%);
    animation: driftC 38s ease-in-out infinite alternate;
}

/* Very soft vignette + top light lift for depth (not colour) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 46%),
        radial-gradient(120% 90% at 50% 112%, rgba(23, 26, 44, 0.05), rgba(23, 26, 44, 0) 42%);
}

@keyframes driftA {
    from { transform: translateX(-50%) translateY(0) scale(1); }
    to   { transform: translateX(-46%) translateY(3vmax) scale(1.08); }
}
@keyframes driftB {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(4vmax, -3vmax) scale(1.1); }
}
@keyframes driftC {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-3vmax, 4vmax) scale(1.06); }
}

/* Very light film grain overlay */
.grain {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* legacy container hidden */
.glow-bg { display: none !important; }

/* ==========================================================================
   Layout
   ========================================================================== */
.app-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.75rem clamp(1.15rem, 4vw, 2.25rem) 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   Navbar — minimal, transparent
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0 0.4rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.62rem;
    text-decoration: none;
    color: var(--text-strong);
    opacity: 0.92;
    transition: opacity .35s var(--ease);
}
.logo:hover { opacity: 1; }

.logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.82rem;
    background: linear-gradient(155deg, var(--ink-hi) 0%, var(--ink) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 4px 12px -6px rgba(16, 22, 40, 0.5);
}

.logo-text {
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    white-space: nowrap;
}

.logo-highlight { color: var(--text-faint); font-weight: 500; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.server-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.8rem 0.38rem 0.68rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--line-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--text-muted);
    white-space: nowrap;
}

.status-indicator {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
    position: relative;
    flex-shrink: 0;
}
.status-indicator.online::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0.35;
    animation: statusPing 2.2s var(--ease) infinite;
}
@keyframes statusPing {
    0% { transform: scale(0.6); opacity: 0.5; }
    70%, 100% { transform: scale(2.2); opacity: 0; }
}

/* ==========================================================================
   Main
   ========================================================================== */
.main-content {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Hero — occupies the viewport, single focal point
   ========================================================================== */
.search-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(2.5rem, 8vh, 5.5rem) 0 clamp(1.5rem, 3vh, 2.25rem);
}

.hero {
    width: 100%;
    max-width: 940px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem 0.3rem 0.3rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1.5rem;
}
.eyebrow-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Two-line editorial heading: bold ink (lightly italic) + blue serif italic */
.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.02em;
    margin: 0 auto;
    max-width: 100%;
    line-height: 1;
    text-wrap: balance;
}
.ht-main {
    font-size: clamp(2.4rem, 6.6vw, 4.6rem);
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    letter-spacing: -0.045em;
    color: var(--text-strong);
}
.ht-serif {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.6rem, 7.4vw, 5.2rem);
    line-height: 1.02;
    letter-spacing: -0.005em;
    color: #2f6bff;
}

.hero-subtitle {
    margin: 1.4rem auto 0;
    max-width: 40ch;
    font-size: clamp(1.02rem, 1.35vw, 1.2rem);
    line-height: 1.58;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    text-wrap: pretty;
}

/* ==========================================================================
   Command search — Spotlight / Raycast inspired centerpiece
   ========================================================================== */
.command-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: min(100%, 600px);
    height: 78px;
    margin: 2rem auto 0;
    padding: 0.6rem 0.6rem 0.6rem 1.65rem;
    border-radius: var(--radius-pill);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.74));
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255,255,255,0.9);
    backdrop-filter: blur(26px) saturate(1.3);
    -webkit-backdrop-filter: blur(26px) saturate(1.3);
    transition: box-shadow .55s var(--ease), transform .55s var(--ease);
}

/* hairline ring that warms to a whisper of blue on focus */
.command-search::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(20,24,44,0.10), rgba(20,24,44,0.04));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: background .55s var(--ease);
    pointer-events: none;
}
/* soft outer focus glow */
.command-search::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 var(--primary-ring);
    opacity: 0;
    transition: box-shadow .55s var(--ease), opacity .55s var(--ease);
    pointer-events: none;
}

.command-search:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255,255,255,0.9), 0 24px 48px -22px rgba(16,22,40,0.18);
}

.command-search:focus-within {
    transform: translateY(-3px);
}
.command-search:focus-within::before {
    background: linear-gradient(180deg, rgba(58,99,216,0.45), rgba(58,99,216,0.14));
}
.command-search:focus-within::after { opacity: 1; box-shadow: 0 0 0 5px var(--primary-ring); }

.command-icon {
    display: grid;
    place-items: center;
    color: var(--text-faint);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color .4s var(--ease), transform .4s var(--ease);
}
.command-search:focus-within .command-icon { color: var(--text-muted); transform: scale(1.06); }

.command-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-strong);
    font-family: inherit;
    font-size: clamp(1.08rem, 2.1vw, 1.3rem);
    font-weight: 500;
    letter-spacing: -0.015em;
}
.command-input::placeholder {
    color: var(--text-faint);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Ink CTA — quiet, confident; blue lives only in the focus ring */
.command-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    height: 100%;
    padding: 0 1.75rem;
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, var(--ink-hi), var(--ink));
    color: #fff;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 560;
    letter-spacing: -0.01em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 8px 20px -10px rgba(16,22,40,0.55);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), filter .35s var(--ease);
}
.command-cta i { font-size: 0.8rem; transition: transform .35s var(--ease); opacity: 0.9; }
.command-cta:hover {
    filter: brightness(1.12);
    box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 12px 26px -10px rgba(16,22,40,0.6);
}
.command-cta:hover i { transform: translateX(3px); }
.command-cta:active { transform: scale(0.985); }
.command-cta:disabled {
    background: #eef0f4;
    color: var(--text-faint);
    box-shadow: none;
    cursor: not-allowed;
}
.command-cta:disabled i { display: none; }

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1.5rem;
    color: var(--text-faint);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: -0.005em;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-meta i { color: var(--text-faint); font-size: 0.78rem; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

/* ==========================================================================
   Reveal animation (framer-motion feel)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: revealUp 0.9s var(--ease-out) forwards;
    animation-delay: var(--d, 0ms);
}
@keyframes revealUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card.glass {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    transition: var(--transition);
}
.card.glass:hover {
    border-color: rgba(10,10,20,0.11);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}
.btn-primary {
    background: linear-gradient(180deg, var(--ink-hi), var(--ink));
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(16,22,40,0.6), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.12); box-shadow: 0 14px 28px -12px rgba(16,22,40,0.65); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    background: #eceef3 !important;
    color: var(--text-faint) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}
.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-main);
    border: 1px solid var(--btn-secondary-border);
}
.btn-secondary:hover { background: var(--btn-secondary-hover); }

/* ==========================================================================
   Loading section
   ========================================================================== */
/* Terminal-window loader */
.loading-section.terminal {
    --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo,
        Consolas, "Liberation Mono", monospace;
    display: block;
    padding: 0;
    max-width: 600px;
    margin: 2.5rem auto;
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    font-family: var(--mono);
}

/* Title bar: traffic lights + filename */
.terminal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.15rem;
    background: rgba(248, 249, 251, 0.9);
    border-bottom: 1px solid var(--hairline);
}
.terminal-dots {
    display: flex;
    gap: 0.5rem;
}
.terminal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }
.terminal-file {
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    color: var(--text-faint);
}

/* Console body */
.terminal-body {
    padding: 1.5rem 1.6rem 1.65rem;
}

.terminal-line {
    font-family: var(--mono);
    font-size: 0.98rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--text-strong);
    margin: 0 0 1.4rem;
    min-height: 1.5em;
}
.term-prompt {
    color: var(--success);
    font-weight: 700;
    margin-right: 0.55rem;
}
.term-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 0.15em;
    vertical-align: -0.18em;
    background: var(--primary);
    border-radius: 1px;
    animation: termBlink 1.05s steps(1) infinite;
}
@keyframes termBlink { 50% { opacity: 0; } }

/* Step checklist */
.loader-steps {
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.loader-step {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    font-family: var(--mono);
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-faint);
    transition: color 0.35s var(--ease);
}
.step-tag {
    flex-shrink: 0;
    display: inline-block;
    min-width: 3em;
    font-weight: 700;
    white-space: pre;
    transition: color 0.35s var(--ease);
}
.step-tag::before { content: "[ ]"; }

/* pending */
.loader-step.pending { color: var(--text-faint); }
.loader-step.pending .step-tag { color: var(--text-faint); }
.loader-step.pending .step-tag::before { content: "[ ]"; }

/* active */
.loader-step.active { color: var(--primary); }
.loader-step.active .step-tag {
    color: var(--primary);
    animation: tagPulse 1s ease-in-out infinite;
}
.loader-step.active .step-tag::before { content: "[>>]"; }
@keyframes tagPulse { 50% { opacity: 0.45; } }

/* completed */
.loader-step.completed { color: var(--success); }
.loader-step.completed .step-tag { color: var(--success); }
.loader-step.completed .step-tag::before { content: "[ok]"; }

/* Thin blue progress bar with shimmer sweep */
.loader-bar-wrap {
    position: relative;
    width: 100%;
    height: 4px;
    margin-top: 1.6rem;
    background: rgba(15, 18, 30, 0.06);
    border-radius: 10px;
    overflow: hidden;
}
.loader-bar-wrap .progress-fill {
    position: relative;
    height: 100%;
    width: 5%;
    background: linear-gradient(90deg, #4c82ff, var(--primary));
    border-radius: 10px;
    overflow: hidden;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.loader-bar-wrap .progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: barShimmer 1.4s infinite;
}
@keyframes barShimmer { 100% { transform: translateX(100%); } }

@media (max-width: 600px) {
    .terminal-body { padding: 1.25rem 1.15rem 1.35rem; }
    .terminal-line { font-size: 0.9rem; }
    .loader-step { font-size: 0.86rem; }
}

/* Respect reduced motion for the loader loops */
@media (prefers-reduced-motion: reduce) {
    .term-cursor,
    .loader-step.active .step-tag,
    .loader-bar-wrap .progress-fill::after {
        animation: none !important;
    }
}

/* ==========================================================================
   Error section
   ========================================================================== */
.error-section {
    padding: 3rem; max-width: 540px; margin: 2.5rem auto;
    display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: 1.35rem;
}
.error-icon-wrapper {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--danger-bg);
    border: 1px solid rgba(229,72,77,0.28);
    color: var(--danger);
    display: grid; place-items: center; font-size: 1.6rem;
}
.error-info h2 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.5rem; color: var(--text-strong); }
.error-info p { color: var(--text-muted); font-size: 0.94rem; max-width: 400px; line-height: 1.6; }
.error-info p a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ==========================================================================
   Dashboard / result view
   ========================================================================== */
.dashboard-section {
    display: flex; flex-direction: column; gap: 1.4rem;
    padding-top: 1.5rem;
    animation: fadeIn 0.6s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.dashboard-header-actions { display: flex; justify-content: space-between; width: 100%; }

.btn-back, .btn-print-action {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-family: inherit; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: var(--transition); outline: none;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-back:hover { color: var(--text-main); border-color: var(--primary-ring); transform: translateX(-2px); }
.btn-back i, .btn-back:hover i { transition: transform 0.3s var(--ease); }
.btn-back:hover i { transform: translateX(-2px); }
.btn-print-action { color: var(--text-main); }
.btn-print-action:hover { color: var(--primary); border-color: var(--primary-ring); }

.student-profile { padding: 1.85rem; }
.profile-header {
    display: flex; align-items: center; gap: 1.25rem;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 1.35rem; margin-bottom: 1.35rem;
    flex-wrap: wrap;
    transition: border-color 0.3s ease, margin-bottom 0.3s ease, padding-bottom 0.3s ease;
}
.profile-title { flex-grow: 1; min-width: 0; }
.profile-title h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.025em; color: var(--text-strong); }

.btn-toggle-details {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-muted);
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    transition: var(--transition); flex-shrink: 0;
}
.btn-toggle-details:hover { background: var(--btn-secondary-bg); color: var(--text-main); }
.btn-toggle-details i { transition: transform 0.35s var(--ease); font-size: 0.85rem; }
.btn-toggle-details.expanded i { transform: rotate(180deg); }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.4rem;
    transition: max-height 0.4s var(--ease), opacity 0.35s var(--ease);
    overflow: hidden;
}
.profile-grid.collapsed { max-height: 0; opacity: 0; pointer-events: none; }
.profile-grid.expanded { max-height: 600px; opacity: 1; }
.student-profile:has(.profile-grid.collapsed) .profile-header {
    border-bottom-color: transparent; margin-bottom: 0; padding-bottom: 0;
}

.info-item { display: flex; flex-direction: column; gap: 0.3rem; }
.info-label { font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.info-value { font-size: 0.98rem; font-weight: 500; color: var(--text-main); }

.selector-container { display: flex; justify-content: flex-start; width: 100%; }
.select-wrapper { position: relative; min-width: 220px; }
.sem-select {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1.25rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--text-main);
    font-family: inherit; font-size: 0.92rem; font-weight: 600;
    cursor: pointer; outline: none; appearance: none; -webkit-appearance: none;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}
.sem-select:hover, .sem-select:focus { border-color: var(--primary-ring); box-shadow: 0 6px 20px -10px rgba(47,107,255,0.4); }
.select-arrow {
    position: absolute; right: 1.15rem; top: 50%; transform: translateY(-50%);
    color: var(--text-faint); font-size: 0.8rem; pointer-events: none; transition: var(--transition);
}
.select-wrapper:hover .select-arrow { color: var(--primary); }

.semester-details { padding: 1.85rem; }
.sem-details-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.4rem; border-bottom: 1px solid var(--hairline);
    padding-bottom: 1.2rem; flex-wrap: wrap; gap: 1rem;
}
.sem-details-header h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }
.sem-details-header p { color: var(--text-muted); font-size: 0.84rem; margin-top: 0.2rem; }

.sem-metrics { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.sem-badge {
    background: var(--status-bg);
    border: 1px solid var(--status-border);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem; font-weight: 600; color: var(--text-main);
}

.table-container { overflow-x: auto; margin-bottom: 0.75rem; }
.subjects-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.88rem; }
.subjects-table th {
    padding: 0.85rem 1rem; color: var(--text-faint); font-weight: 600;
    text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line);
}
.subjects-table td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--hairline); color: var(--text-main); }
.subjects-table td strong { color: var(--text-strong); font-weight: 600; }
.subjects-table tbody tr { transition: background 0.2s ease; }
.subjects-table tbody tr:hover { background: var(--table-hover); }
.subjects-table tbody tr:last-child td { border-bottom: none; }
.text-center { text-align: center; }

.subjects-table tbody tr.carry-over { background: rgba(229,72,77,0.035); }
.subjects-table tbody tr.carry-over td:first-child { border-left: 3px solid var(--danger); }

.sem-details-footer { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.75rem; }

/* ==========================================================================
   Footer — minimal
   ========================================================================== */
.app-footer {
    padding: 0.75rem 1rem 1.4rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.footer-links {
    display: flex; justify-content: center; align-items: center;
    gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.footer-links a {
    color: var(--text-main); font-size: 0.95rem; text-decoration: none; font-weight: 600;
    transition: var(--transition); display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.68rem 1.5rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.footer-links a:hover { transform: translateY(-1px); }
.footer-links a i { font-size: 1.25rem; }
@media (min-width: 720px) {
    .footer-links a { font-size: 1.06rem; padding: 0.78rem 1.75rem; }
    .footer-links a i { font-size: 1.4rem; }
}
.footer-links .fa-whatsapp { color: #25D366; }
.footer-links .fa-telegram { color: #229ED9; }
.whatsapp-footer-link:hover { border-color: rgba(37,211,102,0.4); box-shadow: 0 8px 22px -10px rgba(37,211,102,0.5); transform: translateY(-1px); }
.telegram-contact-link:hover { border-color: rgba(34,158,217,0.4); box-shadow: 0 8px 22px -10px rgba(34,158,217,0.5); transform: translateY(-1px); }

.disclaimer-text { font-size: 0.75rem; color: var(--text-faint); max-width: 560px; margin: 0 auto; line-height: 1.5; }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(20, 24, 38, 0.28);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; opacity: 0; pointer-events: none;
    transition: opacity 0.35s var(--ease);
}
.modal-backdrop:not(.hidden) { opacity: 1; pointer-events: auto; }

.modal-card {
    position: relative; max-width: 420px; width: 90%;
    padding: 2.75rem 2rem; text-align: center;
    transform: scale(0.94) translateY(8px);
    transition: transform 0.4s var(--ease);
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}
.modal-backdrop:not(.hidden) .modal-card { transform: scale(1) translateY(0); }

.modal-close-btn {
    position: absolute; top: 1.1rem; right: 1.1rem;
    background: transparent; border: none; font-size: 1.1rem;
    color: var(--text-faint); cursor: pointer; transition: var(--transition);
    width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
}
.modal-close-btn:hover { background: var(--btn-secondary-bg); color: var(--text-main); }

.modal-content { display: flex; flex-direction: column; align-items: center; gap: 1.15rem; }
.modal-content h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }
.modal-content p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }

.whatsapp-icon-ring {
    width: 68px; height: 68px; border-radius: 50%;
    background: rgba(37,211,102,0.1); border: 2px solid rgba(37,211,102,0.28);
    color: #1eb954; display: grid; place-items: center; font-size: 2.2rem;
    animation: pulseWhatsapp 2.4s infinite;
}
@keyframes pulseWhatsapp {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37,211,102,0.18); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(37,211,102,0); }
}

.pwa-icon-ring {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--primary-soft); border: 2px solid var(--primary-ring);
    color: var(--primary); display: grid; place-items: center; font-size: 1.6rem;
}
.pwa-instructions {
    text-align: left; background: var(--surface-soft);
    border: 1px solid var(--line); padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm); font-size: 0.85rem; line-height: 1.5;
    color: var(--text-main); width: 100%; box-sizing: border-box;
}
.pwa-instructions i { color: var(--primary); }

.whatsapp-join-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    color: #fff !important; border: none !important; text-decoration: none !important;
    padding: 0.85rem 2rem !important; font-size: 0.98rem !important; font-weight: 700 !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    gap: 0.6rem !important; width: 100% !important; border-radius: var(--radius-pill) !important;
    box-shadow: 0 12px 26px -12px rgba(37,211,102,0.7) !important;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease) !important;
    cursor: pointer !important; margin-top: 0.25rem !important;
}
.whatsapp-join-btn:hover { transform: translateY(-2px) !important; filter: brightness(1.03) !important; box-shadow: 0 18px 34px -14px rgba(37,211,102,0.8) !important; }
.whatsapp-join-btn i { font-size: 1.25rem !important; color: #fff !important; }

/* ==========================================================================
   Helpers & shared keyframes
   ========================================================================== */
.hidden { display: none !important; }
@keyframes errorLoadingBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(250%); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
    .status-label { display: none; }
    .server-status { padding: 0.5rem; }
    .search-section { padding-top: clamp(1.5rem, 5vh, 3rem); }
    .command-search { height: 66px; padding-left: 1.15rem; }
    .command-cta { padding: 0 1.15rem; }
    .command-cta span { display: none; }
    .command-cta i { display: inline-block; font-size: 1rem; }
    .command-cta { width: 52px; justify-content: center; }
    /* Keep the countdown text visible when rate-limited */
    .command-cta:disabled { width: auto; padding: 0 1.1rem; }
    .command-cta:disabled span { display: inline; }
    /* avoid a stray dot when the eyebrow label wraps */
    .hero-eyebrow { gap: 0; margin-bottom: 1.7rem; }
    .eyebrow-dot { display: none; }
}

@media (max-width: 600px) {
    .app-container { padding: 1.15rem 1rem 1.5rem; }
    .loading-section, .error-section { padding: 2.25rem 1.35rem; margin: 1.5rem auto; }
    .student-profile, .semester-details { padding: 1.35rem !important; }
    .profile-grid { grid-template-columns: 1fr; gap: 1rem; }
    .sem-details-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .hero-meta { gap: 0.7rem; }
}

@media (max-width: 420px) {
    .logo-highlight { display: none; }
    .btn-install-pwa span { display: none; }
    .subjects-table { font-size: 0.8rem; }
    .subjects-table th, .subjects-table td { padding: 0.7rem 0.5rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
    .glow { animation: none; }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
    .atmosphere, .grain, .main-header, .search-section, .loading-section,
    .error-section, .app-footer, .sem-details-footer, .selector-container,
    .dashboard-header-actions { display: none !important; }

    body { background: #fff !important; color: #000 !important; }
    .app-container { padding: 0 !important; max-width: 100% !important; }
    .dashboard-section { display: block !important; }

    .student-profile.card.glass, .semester-details.card.glass {
        background: transparent !important; border: 1px solid #ccc !important; color: #000 !important;
        box-shadow: none !important; backdrop-filter: none !important; border-radius: 0 !important;
        padding: 1.5rem !important; margin-bottom: 2rem !important; page-break-inside: avoid;
    }
    .student-profile { margin-top: 2rem !important; }
    .profile-header { border-bottom: 2px solid #333 !important; padding-bottom: 1rem !important; margin-bottom: 1.5rem !important; }
    .profile-title h2 { font-size: 20pt !important; color: #000 !important; }
    .info-label { color: #555 !important; font-weight: bold !important; }
    .info-value { color: #000 !important; }
    .profile-grid { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 1rem !important; max-height: none !important; opacity: 1 !important; }
    .semester-details { display: block !important; border-top: 2px solid #333 !important; }
    .sem-details-header { border-bottom: 2px solid #333 !important; padding-bottom: 0.5rem !important; }
    .sem-details-header h3 { font-size: 16pt !important; }
    .sem-badge { border: 1px solid #333 !important; color: #000 !important; font-weight: bold !important; }
    .subjects-table { font-size: 10pt !important; }
    .subjects-table th, .subjects-table td { border: 1px solid #ccc !important; color: #000 !important; padding: 0.5rem !important; }
    .subjects-table th { background: #f2f2f2 !important; }
    .subjects-table tbody tr.carry-over { background: #ffe6e6 !important; font-weight: bold !important; }
    .subjects-table tbody tr.carry-over td:first-child { border-left: 5px solid #f00 !important; }
}
