/* =============================================================================
   DESIGN TOKENS
   ============================================================================= */
:root {
    color-scheme: light only;     /* Forces browser to stay in light mode — no dark override possible */

    /* --- Background layers ---
       Warm off-white reduces eye strain vs pure #fff.
       Cards sit on white so they visually "lift" off the page.         */
    --bg:           #f5f4f1;
    --bg-card:      #ffffff;
    --bg-subtle:    #f0efe9;
    --bg-sidebar:   #fdfcfa;

    /* --- Borders --- */
    --border:       rgba(0, 0, 0, 0.07);
    --border-med:   rgba(0, 0, 0, 0.11);
    --border-focus: rgba(0, 0, 0, 0.45);

    /* --- Text --- */
    --text:         #17171a;
    --text-2:       #46444d;
    --text-3:       #8c8a96;
    --text-inv:     #faf9f7;

    /* --- Status colours (ONLY used for AI / Human verdicts) --- */
    --c-ai:         #c0392b;
    --c-human:      #27ae60;
    --c-ai-bg:      rgba(192, 57,  43, 0.07);
    --c-human-bg:   rgba( 39, 174, 96, 0.07);

    /* --- Elevation --- */
    --shadow-xs:    0 1px 2px  rgba(0,0,0,0.04);
    --shadow-sm:    0 2px 8px  rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 20px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:    0 8px 40px rgba(0,0,0,0.09), 0 2px 8px rgba(0,0,0,0.05);
    --shadow-card:  0 1px 3px  rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.05);

    /* --- Border Radii --- */
    --r-xs:  4px;
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  20px;
    --r-xl:  28px;

    /* --- Typography --- */
    --font-en: 'Inter', system-ui, -apple-system, sans-serif;
    --font-ar: 'Noto Naskh Arabic', 'Amiri', serif;

    /* --- Spacing (4-pt grid) --- */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-5:  24px;
    --sp-6:  32px;
    --sp-7:  48px;
    --sp-8:  64px;
    --sp-9:  88px;

    /* --- Transitions --- */
    --t-fast:   0.14s cubic-bezier(0.4, 0, 0.2, 1);
    --t-med:    0.24s cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow:   1.1s  cubic-bezier(0.22, 1, 0.36, 1);
    --t-spring: 0.5s  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =============================================================================
   FORCE LIGHT MODE — override any OS/browser/extension dark mode attempt
   The footer is explicitly excluded so it keeps its #111111 dark background.
   ============================================================================= */
@media (prefers-color-scheme: dark) {
    :root { color-scheme: light only; }

    /* Force the entire page to light palette */
    html, body, * {
        background-color: #FFFFFF !important;
        color: #111111 !important;
        border-color: #E5E5E5 !important;
    }
}

/* Restore the dark footer AFTER the blanket light override above */
@media (prefers-color-scheme: dark) {
    footer, footer * {
        background-color: #111111 !important;
        color: #F5F5F5 !important;
    }
}


/* =============================================================================
   RESET & BASE
   ============================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    color-scheme: light;          /* Belt-and-braces: also on html element */
}

body {
    font-family: var(--font-en);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html[lang="ar"] body {
    font-family: var(--font-ar);
    direction: rtl;
}

/* Type scale — editorial hierarchy per design spec */
h1 {
    font-size: clamp(2.9rem, 7vw, 4.5rem);  /* scaled up ~12% for stronger presence */
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.08;
    color: var(--text);
}

h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: var(--text);
}

h3, h4, h5 {
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

p { line-height: 1.6; }  /* per spec: 1.6 for readable paragraph flow */

.hidden { display: none !important; }
.muted  { color: var(--text-3); }


/* =============================================================================
   SCROLLBAR
   ============================================================================= */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-med);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.16); }


/* =============================================================================
   BUTTONS
   ============================================================================= */
button {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all var(--t-fast);
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
}

/* Primary CTA — Scan button, most prominent element per spec */
.btn-primary {
    background: var(--text);
    color: var(--text-inv);
    padding: 14px 48px;              /* spec: 14px 48px — wider than before */
    border-radius: 999px;            /* spec: pill */
    font-size: 16px;                 /* spec: 16px */
    font-weight: 700;                /* spec: 700 */
    letter-spacing: 0.02em;          /* spec: 0.02em */
    box-shadow: 0 1px 3px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}
.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.10);
}
.btn-primary:active  { transform: scale(0.97); box-shadow: var(--shadow-xs); }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }

/* Outlined */
.btn-outline {
    border: 1px solid var(--border-med);
    color: var(--text-2);
    padding: 0.46rem 1rem;
    border-radius: var(--r-sm);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    font-size: 0.85rem;
}
.btn-outline:hover {
    border-color: var(--border-focus);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* Small outlined — "Export Report" button per spec */
.btn-outline-sm {
    border: 1.5px solid #111111;  /* spec: 1.5px solid #111111 */
    color: var(--text);
    padding: 10px 28px;            /* spec: 10px 28px */
    border-radius: 999px;          /* spec: pill */
    font-size: 0.8rem;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline-sm:hover {
    background: #111111;           /* spec: hover → solid black */
    color: #FFFFFF;                /* spec: white text on hover */
}

/* Ghost — pill-shaped for "Human Article / AI Article" sample buttons per spec */
.btn-ghost {
    color: var(--text-3);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text);
    border-color: var(--text);
    transform: translateY(-2px);
}
.btn-ghost.active { background: var(--bg-subtle); color: var(--text); font-weight: 500; border-color: var(--border-med); }

.btn-icon:hover { 
    background: var(--bg-subtle); 
    color: var(--text); 
    transform: scale(1.1) rotate(5deg);
}
.btn-icon:active { 
    transform: scale(0.85); 
    transition: transform 0.1s ease;
}


/* Global icon hover effect */
i.ph {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
    display: inline-block;
}

/* Ensure any element containing an icon triggers the icon animation */
button:hover i.ph, 
a:hover i.ph,
.brand:hover i.ph {
    transform: scale(1.2) rotate(8deg);
}

/* Active "clicked" state for icons */
button:active i.ph,
a:active i.ph,
.brand:active i.ph,
i.ph:active {
    transform: scale(0.9) !important;
    transition: transform 0.1s ease; /* Faster snap on click */
}


.brand:hover .brand-icon {
    transform: scale(1.2) rotate(-10deg);
    color: var(--c-human);
}




/* =============================================================================
   NAVBAR
   ============================================================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245, 244, 241, 0.90);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.navbar-inner {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 var(--sp-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 58px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--text);
    letter-spacing: -0.015em;
    user-select: none;
}
.brand-icon { font-size: 1.2rem; }

.navbar-controls { display: flex; align-items: center; gap: 4px; }

/* Language toggle pill */
.lang-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #E5E5E5;
    border-radius: 999px;
    padding: 6px 14px;
    background: transparent;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.lang-toggle-pill:hover {
    background: #111111;
    color: #FFFFFF;
    border-color: #111111;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lang-toggle-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}
.lang-toggle-pill.icon-rotated .lang-toggle-icon {
    transform: rotate(180deg);
}


/* =============================================================================
   SIDEBAR
   ============================================================================= */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 8, 0.28);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--t-med);
}
.sidebar-overlay.visible { opacity: 1; }

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 100vw;
    height: 100vh;
    background: #FAFAFA;
    border-left: 1px solid #F0F0F0;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

html[lang="ar"] .sidebar {
    right: auto; left: 0;
    border-left: none;
    border-right: 1px solid #F0F0F0;
    transform: translateX(-100%);
}

.sidebar.visible { transform: translateX(0); }
html[lang="ar"] .sidebar.visible { transform: translateX(0); }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid #F0F0F0;
    flex-shrink: 0;
    background: #FAFAFA;
}

.sidebar-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sidebar-body {
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    flex: 1;
}

.sidebar-section {
    padding: var(--sp-4) 0;
}

.sidebar-divider {
    height: 1px;
    background: #F0F0F0;
    flex-shrink: 0;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #BBBBBB;
    margin-bottom: var(--sp-3);
}

.chart-wrap { position: relative; height: 180px; }

/* Auth block */
.sidebar-auth-section {
    padding-top: var(--sp-3);
    padding-bottom: var(--sp-3);
}

.auth-user-block {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-subtle);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}

.auth-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-med);
}

.auth-info {
    flex: 1;
    min-width: 0;
}

.auth-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-email {
    font-size: 0.72rem;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-sign-out {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text-3);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
}
.btn-sign-out:hover { background: var(--border); color: var(--text); }

.auth-signin-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
}

.auth-hint {
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.5;
}

/* Stats row */
.stats-row {
    display: flex;
    gap: var(--sp-2);
}

.stat-pill {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--sp-3) var(--sp-2);
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.stat-num {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stat-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
}

.stat-ai-pill .stat-num   { color: var(--c-ai); }
.stat-human-pill .stat-num { color: var(--c-human); }

/* History items */
.history-item {
    border: 1px solid #F0F0F0;
    border-radius: 12px;
    padding: 12px 14px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: var(--sp-2);
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.history-item:hover {
    border-color: #111111;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-3);
}

.history-snippet {
    font-size: 13px;
    color: #333333;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-timestamp {
    font-size: 11px;
    color: #AAAAAA;
    margin-top: 4px;
}

/* Status badges */
.badge-ai {
    background: #111111;
    color: #FFFFFF;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.badge-human {
    background: #FFFFFF;
    color: #111111;
    border: 1px solid #111111;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Skeleton */
.skeleton {
    height: 64px;
    border-radius: var(--r-sm);
    background: linear-gradient(
        90deg,
        var(--bg-subtle) 25%,
        var(--border) 50%,
        var(--bg-subtle) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    margin-bottom: var(--sp-2);
}


/* =============================================================================
   PAGE LAYOUT
   ============================================================================= */
.main {
    flex: 1;
    max-width: 780px;          /* focused, readable column per spec */
    width: 100%;
    margin: 0 auto;
    padding: var(--sp-9) var(--sp-5) var(--sp-8);
    display: flex;
    flex-direction: column;
    gap: var(--sp-7);          /* 48px between all major sections */
}


/* =============================================================================
   HERO
   ============================================================================= */
.hero {
    text-align: center;
    padding-bottom: var(--sp-6);

    /* Subtle radial glow behind the title — warm, barely visible */
    background: radial-gradient(
        ellipse 70% 55% at 50% 20%,
        rgba(255, 255, 250, 0.85) 0%,
        transparent 100%
    );
}

/* Hero/heading entry: 0.4s duration (shorter than standard 0.5s reveals) */
.hero.reveal {
    transition-duration: 0.4s;
}

/* Pill label above headline — container (no border on the wrapper itself) */
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--sp-5);
    flex-wrap: wrap;
    justify-content: center;
}

/* Each individual keyword tag is its own bordered pill */
.eyebrow-tag {
    font-size: 11px;               /* spec: 11px */
    font-weight: 500;
    letter-spacing: 0.12em;        /* spec: 0.12em */
    text-transform: uppercase;
    color: var(--text-3);
    border: 1px solid #D1D5DB;     /* spec: 1px solid #D1D5DB */
    border-radius: 999px;          /* spec: 999px full pill */
    padding: 4px 12px;             /* spec: 4px 12px */
    background: var(--bg-card);
    animation: fadeUp 0.4s ease-out both; /* spec: 0.4s fade-in */
}

/* Pulsing dot */
.eyebrow-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c-human);
    flex-shrink: 0;
    animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1;    transform: scale(1);    }
    50%       { opacity: 0.4; transform: scale(0.65); }
}

.hero h1 {
    margin-bottom: var(--sp-4);
    text-shadow: 0 2px 12px rgba(0,0,0,0.08); /* spec: subtle shadow for brand weight */
}

.hero p {
    font-size: 1.05rem;
    color: #555555;                /* spec: #555555 — softer than pure black for hierarchy */
    max-width: 560px;              /* spec: 560px */
    margin: 0 auto;
    line-height: 1.75;             /* spec: 1.75 */
}


/* =============================================================================
   CARDS — shared base
   ============================================================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
}


/* =============================================================================
   INPUT CARD
   ============================================================================= */
.input-card {
    padding: var(--sp-5);
    transition: box-shadow var(--t-med);
}
.input-card:focus-within {
    box-shadow: var(--shadow-lg);
    border-color: rgba(0,0,0,0.09);
}

.input-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border);
}
.toolbar-start { display: flex; gap: 2px; }

/* Textarea container — animated focus ring + colour transition + glow */
.textarea-wrap {
    border: 1.5px solid #E5E5E5;
    border-radius: 16px;
    background: var(--bg-subtle);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
}
.textarea-wrap:focus-within {
    border-color: #c0392b;
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12), 0 2px 12px rgba(192, 57, 43, 0.08);
    animation: textarea-glow 0.35s ease forwards;
}

@keyframes textarea-glow {
    0%   { box-shadow: 0 0 0 0   rgba(192, 57, 43, 0); }
    60%  { box-shadow: 0 0 0 5px rgba(192, 57, 43, 0.14); }
    100% { box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12), 0 2px 12px rgba(192, 57, 43, 0.08); }
}

.textarea-wrap.has-text {
    border-color: rgba(192, 57, 43, 0.45);
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.07);
    animation: textarea-pulse 2.8s ease-in-out infinite;
}

@keyframes textarea-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.07); }
    50%       { box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.13); }
}

.textarea-wrap.has-text:focus-within {
    border-color: #c0392b;
    animation: textarea-glow 0.35s ease forwards;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    caret-color: #c0392b;
}

textarea::placeholder {
    color: var(--text-3);
    transition: color 0.3s ease;
}
textarea:focus::placeholder {
    color: rgba(140, 138, 150, 0.55);
}

.textarea-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px var(--sp-5);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: #AAAAAA;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.textarea-footer.visible { opacity: 1; }
.sep { opacity: 0.3; }

.input-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--sp-4);
}


/* =============================================================================
   RESULTS CARD
   ============================================================================= */
.results-card {
    padding: var(--sp-6);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}

/* Model status badge */
.badge {
    font-size: 0.67rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border-med);
    color: var(--text-3);
    background: var(--bg-subtle);
    letter-spacing: 0.02em;
}


/* =============================================================================
   VERDICT BLOCK — centered gauge + text result
   ============================================================================= */
.verdict-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-6);
    margin-bottom: var(--sp-5);
    padding: var(--sp-2) 0 var(--sp-5);
    border-bottom: 1px solid var(--border);
}


/* SVG Gauge */
.gauge-wrap {
    position: relative;
    width: 200px;
    flex-shrink: 0;
}

.gauge-svg { width: 100%; overflow: visible; }

.gauge-track {
    stroke: var(--bg-subtle);
    stroke-width: 9;
    stroke-linecap: round;
}

.gauge-arc {
    stroke: var(--text);
    stroke-width: 9;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.12));
}

.gauge-label {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.gauge-label span {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    color: var(--text);
}

.gauge-label small {
    display: block;
    font-size: 0.65rem;
    color: var(--text-3);
    margin-top: 5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Verdict text + probability bars */
.verdict-details {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

#verdict-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    transition: color var(--t-med);
}


#verdict-desc {
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.65;
}

/* Probability bars */
.prob-bars {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
}

.prob-row { display: flex; flex-direction: column; gap: 7px; }

.prob-row-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
}
.prob-row-label strong {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bar-track {
    height: 5px;
    background: var(--bg-subtle);
    border-radius: 99px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-human { background: var(--c-human); }
.bar-ai    { background: var(--c-ai);    }


/* Probability bar rows (new layout) */
.prob-bar-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
}
.prob-label {
    min-width: 60px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-2);
    text-align: start;
}
.prob-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 99px;
    overflow: hidden;
}
.prob-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.prob-bar-human { background: var(--c-human); }
.prob-bar-ai    { background: var(--c-ai); }
.prob-pct {
    min-width: 44px;
    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    text-align: end;
}

/* =============================================================================
   STYLOMETRIC FEATURES SECTION (32 features grid)
   ============================================================================= */
.features-section {
    margin-top: var(--sp-6);
    margin-bottom: var(--sp-4);
}
.features-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--sp-2);
}
.feature-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.feature-chip:hover {
    border-color: var(--text-2);
    box-shadow: var(--shadow-sm);
}
.feature-chip-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-2);
    line-height: 1.3;
}
.feature-chip-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* =============================================================================
   STYLOMETRIC FEATURE CARDS (legacy — kept for backward compat)
   ============================================================================= */
.features-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

.feature-card {
    background: #FAFAFA;           /* spec: #FAFAFA */
    border: 1px solid #F0F0F0;     /* spec: 1px solid #F0F0F0 */
    border-radius: 12px;           /* spec: 12px */
    padding: 20px;                 /* spec: 20px */
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
    border-color: #111111;         /* spec: hover → border-color: #111111 */
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-xs);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-2);
    margin-bottom: 2px;
    flex-shrink: 0;
}

.feature-body h4 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.feature-val {
    font-size: 28px;               /* spec: 28px */
    font-weight: 700;              /* spec: 700 */
    letter-spacing: -0.035em;
    color: var(--text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.feature-body p {
    font-size: 13px;               /* spec: 13px */
    color: #777777;                /* spec: #777777 */
    line-height: 1.6;              /* spec: 1.6 */
    margin-top: 2px;
}

.results-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
}


/* =============================================================================
   HOW IT WORKS
   ============================================================================= */
.how-it-works {
    padding: var(--sp-2) 0 var(--sp-8);
}

/* Section title — small caps label style */
.how-it-works h3 {
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-3);
    margin-bottom: var(--sp-5);
}

/* Steps — flex column, gap between bordered cards */
.steps {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);              /* space between the three step cards */
    position: relative;
}

/* Dashed connector line between step cards on desktop */
@media (min-width: 769px) {
    .steps::before {
        content: '';
        position: absolute;
        left: 28px;
        top: 80px;
        bottom: 80px;
        width: 1px;
        border-left: 1px dashed #DDDDDD;
        pointer-events: none;
    }
}

.step {
    display: flex;
    flex-direction: column;
    padding: 32px 28px;
    border-radius: 20px;
    border: 1.5px solid #F0F0F0;
    background: #FFFFFF;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    position: relative;
}
.step:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.09);
    border-color: #111111;
}

/* Number badge — solid black pill above title */
.step-num {
    display: inline-block;
    background: #111111;
    color: #FFFFFF;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    align-self: flex-start;
}

.step-body { padding-top: 0; }

.step-body h5 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.step-body p {
    font-size: 14px;
    color: #666666;
    line-height: 1.75;
}


/* =============================================================================
   FOOTER — dark, full-width, three-column professional layout
   Spec: #111111 bg, #F5F5F5 text, 48px 24px padding, full-width
   ============================================================================= */
.footer {
    width: 100%;                    /* full-width edge-to-edge */
    margin-top: auto;
    background: #111111;            /* near-black per spec */
    border-top: 1px solid #E5E5E5; /* subtle separator from page body */
    color: #F5F5F5;                 /* off-white text per spec */
    font-size: 14px;                /* spec: 14px */
    font-weight: 400;
    line-height: 1.7;
}

.footer-inner {
    max-width: 780px;               /* aligns with .main content width */
    margin: 0 auto;
    padding: 48px 24px;             /* spec: 48px 24px generous padding */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 48px;               /* spec: 48px column gap */
}

/* RTL layout support */
html[lang="ar"] .footer-inner { direction: rtl; }

.footer-col-title {
    font-size: 11px;               /* spec: 11px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;         /* spec: 0.1em */
    color: #555555;                /* spec: #555555 */
    margin-bottom: 16px;           /* spec: 16px */
}

.footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-list a {
    color: #AAAAAA;                 /* spec: muted link colour */
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);    /* spec: smooth colour transition */
}
.footer-list a:hover { 
    color: #FFFFFF; 
    transform: translateX(8px);
}
html[lang="ar"] .footer-list a:hover {
    transform: translateX(-8px);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--c-human);
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.3s ease;
}
.footer-status:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
}


.status-dot {
    width: 6px;                    /* spec: 6px circle */
    height: 6px;
    border-radius: 50%;
    background: #22C55E;           /* spec: #22C55E green */
    flex-shrink: 0;
    animation: pulse-status 2s ease-in-out infinite; /* spec: 2s loop */
}

@keyframes pulse-status {
    0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.4); }
    100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);   }
}

.footer-bottom {
    max-width: 780px;
    margin: 24px auto 0;
    padding: 16px 24px 24px;
    border-top: 1px solid #2A2A2A;
    text-align: center;
    font-size: 12px;
    color: #555555;
    letter-spacing: 0.02em;
}

/* HuggingFace badge link in Resources column */
.hf-badge-link {
    display: inline-flex !important;
    align-items: flex-start !important;
    transform: none !important;
}
.hf-badge-link:hover {
    transform: none !important;
    color: inherit !important;
}

.hf-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 197, 23, 0.1);
    border: 1px solid rgba(255, 197, 23, 0.35);
    border-radius: 20px;
    padding: 5px 10px 5px 8px;
    color: #e0a800;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.hf-badge-link:hover .hf-badge {
    background: rgba(255, 197, 23, 0.18);
    border-color: rgba(255, 197, 23, 0.6);
    color: #ffc517;
}

.hf-logo {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #ffc517;
}

.hf-pill {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 197, 23, 0.2);
    border-radius: 10px;
    padding: 1px 6px;
    color: #e0a800;
    margin-left: 2px;
}

.hf-badge-link:hover .hf-pill {
    color: #ffc517;
    background: rgba(255, 197, 23, 0.3);
}

/* Mobile: keep all three footer columns on one row, reduce padding and gap */
@media (max-width: 600px) {
    .footer-inner {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 16px;
        padding: 32px 16px;
    }
    .footer-col-title {
        font-size: 10px;
        letter-spacing: 0.07em;
    }
    .footer-list a,
    .footer-status {
        font-size: 12px;
    }
    .hf-badge {
        font-size: 11px;
        padding: 4px 7px 4px 6px;
        flex-wrap: wrap;
    }
    .hf-pill {
        display: none;
    }
}


/* =============================================================================
   TOAST SYSTEM
   ============================================================================= */
#toast-container {
    position: fixed;
    bottom: var(--sp-5);
    right: var(--sp-5);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    pointer-events: none;
}
html[lang="ar"] #toast-container { right: auto; left: var(--sp-5); }

.toast {
    background: var(--text);
    color: var(--text-inv);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s var(--t-spring) both;
    pointer-events: all;
    line-height: 1.4;
}
.toast.error   { border-left: 3px solid var(--c-ai);    }
.toast.success { border-left: 3px solid var(--c-human); }


/* =============================================================================
   ANIMATIONS
   ============================================================================= */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

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

@keyframes shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes spin { to { transform: rotate(360deg); } }

.ph-spin { animation: spin 0.7s linear infinite; }

/* Loading breathe — opacity pulse on the Scan button while API call is in flight */
@keyframes breathe {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}
.btn-loading { animation: breathe 0.6s ease-in-out infinite; }

/* Verdict badge scale-in + sonar ripple (runs once on result reveal) */
@keyframes badgeIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1);    }
}
@keyframes sonar {
    0%   { transform: scale(1);   opacity: 0.5; }
    100% { transform: scale(2.2); opacity: 0;   }
}

/* Result card reveal animation class (toggled by JS) */
.result-reveal {
    animation: fadeUp 0.42s ease-out both;
}

/* Verdict badge wrapper — used for sonar ring */
.verdict-badge-wrap {
    position: relative;
    display: inline-block;
}
.verdict-badge-wrap .sonar-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: sonar 0.6s ease-out forwards;
    pointer-events: none;
}

/* Scroll-reveal — sections start invisible, JS adds .visible */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Global: all interactive elements should show pointer cursor */
a, label, select, input[type="checkbox"], input[type="radio"] {
    cursor: pointer;
}

/* Footer link sliding underline via ::after */
.footer-list a {
    position: relative;
}
.footer-list a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #FFFFFF;
    transition: width 0.2s ease;
}
.footer-list a:hover::after { width: 100%; }

/* External link arrow — visible on hover */
.ext-arrow {
    opacity: 0;
    margin-left: 3px;
    font-style: normal;
    transition: opacity 0.2s ease;
    font-size: 0.75em;
}
.footer-list a:hover .ext-arrow { opacity: 1; }

/* ── Team member rows ──────────────────────────────────────────────────────── */
.footer-about-desc {
    font-size: 13px;
    color: #888888;
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer-team {
    gap: 8px !important;
}

.team-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.team-name {
    font-size: 13px;
    color: #17171a;
    flex: 1;
}

.team-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8c8a96;
    transition: color 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.icon-link:hover {
    color: #c0392b;
    transform: translateY(-2px);
}

/* ── Privacy / About / ToS Modals ────────────────────────────────────────── */
.privacy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.privacy-box {
    background: #ffffff;
    border: 2px solid #c0392b;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    color: #17171a;
    box-shadow: 0 8px 48px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    animation: slideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { transform: translateY(28px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.privacy-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.privacy-close:hover {
    color: #17171a;
    background: rgba(0,0,0,0.07);
}

html[lang="ar"] .privacy-close {
    right: auto;
    left: 16px;
}

.privacy-title {
    font-size: 22px;
    font-weight: 700;
    color: #17171a;
    margin-bottom: 4px;
}

.privacy-date {
    font-size: 12px;
    color: #8c8a96;
    margin-bottom: 24px;
}

.privacy-body h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #c0392b;
    margin: 20px 0 6px;
}

.privacy-body h3:first-child { margin-top: 0; }

.privacy-body p {
    font-size: 14px;
    line-height: 1.7;
    color: #46444d;
    margin: 0;
}

html[lang="ar"] .privacy-box { direction: rtl; text-align: right; }

/* Footer scroll-reveal */
.footer.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.footer.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced-motion: disable all animations for sensitive users */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}


/* Export Button — Premium Look */
.btn-export {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111;
    color: white;
    padding: 12px 28px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-export:hover {
    background: #333;
}
/* Reverting to a more sensible hover for export */
.btn-export:hover {
    background: #333;
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.btn-export i { font-size: 1.1rem; }

/* Report Styles (Non-print fallback/scaffolding) */
.print-only { display: none; }

/* =============================================================================
   PRINT STYLES (PDF EXPORT) — Full Overhaul
   ============================================================================= */
@media print {
    .print-only { display: block !important; }

    /* Hide UI Components */
    .navbar, .sidebar-overlay, #dashboard-sidebar, .sidebar,
    .hero, .input-card, .how-it-works, .footer, 
    .results-actions, .input-toolbar, .textarea-footer,
    .input-actions, #toast-container, .badge, .results-header {
        display: none !important;
    }

    body {
        background: #fff !important;
        margin: 0;
        padding: 0;
        font-family: inherit;
    }

    .main {
        max-width: 100% !important;
        width: 100% !important;
        padding: 40px !important;
        margin: 0 !important;
        display: block !important;
    }

    .results-card {
        border: 2px solid #000 !important;
        box-shadow: none !important;
        padding: 40px !important;
        background: #fff !important;
        border-radius: 0 !important;
        display: block !important;
    }

    /* Professional Header Styles */
    .report-header {
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 4px double #000;
    }

    .report-header h1 {
        font-size: 28px;
        font-weight: 800;
        color: #000;
        margin: 0;
        white-space: pre-wrap;
    }

    .report-footer {
        margin-top: 40px;
        text-align: center;
        font-size: 11px;
        color: #AAA;
        font-weight: 500;
    }

    .report-footer .page-number::before {
        content: "Verification ID: " counter(page);
        display: block;
        margin-top: 5px;
    }


    .verdict-block {
        border-bottom: 1px dotted #CCC !important;
        padding: 30px 0 !important;
        margin-bottom: 30px !important;
        flex-direction: column !important;
        align-items: center !important;
        display: flex !important;
    }

    #verdict-title {
        font-size: 38px !important;
        font-weight: 900 !important;
        margin: 20px 0 !important;
        text-transform: uppercase;
        border: 3px solid currentColor;
        padding: 10px 30px;
    }

    #verdict-desc {
        font-size: 16px !important;
        max-width: 600px;
        line-height: 1.8;
    }

    /* Analyzed Text Section */
    .report-divider {
        border: 0;
        border-top: 1px solid #EEE;
        margin: 40px 0 20px;
    }

    #report-view-only h4 {
        font-size: 14px;
        text-transform: uppercase;
        color: #666;
        margin-bottom: 12px;
        letter-spacing: 0.05em;
    }

    .report-text-box {
        background: #F9F9F9 !important;
        border: 1px solid #DDD !important;
        padding: 24px !important;
        font-size: 14px !important;
        line-height: 1.8 !important;
        color: #333 !important;
        white-space: pre-wrap; /* Pre-wrap to handle the article format properly */
        text-align: justify;
    }

    /* Fix orientation if possible */
    @page {
        margin: 1.5cm;
    }

    .pdf-exclude {
        display: none !important;
    }
}




/* =============================================================================
   ANALYSIS LOADING OVERLAY
   ============================================================================= */

.analysis-overlay {
    position: fixed;
    inset: 0;
    z-index: 9900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 14, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.analysis-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.analysis-card {
    background: var(--bg-card, #fff);
    border-radius: 20px;
    padding: 2.5rem 2.25rem 2rem;
    width: min(420px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.06),
        0 24px 60px rgba(0,0,0,0.22);
    animation: card-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes card-pop {
    from { transform: scale(0.88) translateY(12px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* Pulsing ring icon */
.analysis-icon-ring {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.analysis-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--c-accent, #2563eb);
    animation: ring-pulse 2.4s ease-out infinite;
    opacity: 0;
}
.analysis-ring.r1 { animation-delay: 0s;    }
.analysis-ring.r2 { animation-delay: 0.8s;  }
.analysis-ring.r3 { animation-delay: 1.6s;  }
@keyframes ring-pulse {
    0%   { transform: scale(1);    opacity: 0.6; }
    100% { transform: scale(1.9);  opacity: 0;   }
}
.analysis-icon-center {
    font-size: 2rem;
    color: var(--c-accent, #2563eb);
    z-index: 1;
    position: relative;
}

/* Headline */
.analysis-headline {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #111);
    text-align: center;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Steps list */
.analysis-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.astep {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    background: var(--bg-subtle, #f5f5f7);
    transition: background 0.25s, transform 0.2s;
}
.astep.active {
    background: color-mix(in srgb, var(--c-accent, #2563eb) 9%, transparent);
    transform: translateX(0);
}
.astep.done {
    background: color-mix(in srgb, #22c55e 8%, transparent);
}

.astep-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-card, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-3, #999);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: color 0.2s, box-shadow 0.2s;
}
.astep.active .astep-icon {
    color: var(--c-accent, #2563eb);
    box-shadow: 0 2px 8px rgba(37,99,235,0.18);
}
.astep.done .astep-icon {
    color: #22c55e;
}

.astep-label {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2, #666);
    transition: color 0.2s;
}
.astep.active .astep-label { color: var(--text, #111); font-weight: 600; }
.astep.done  .astep-label  { color: var(--text, #111); }

.astep-status { display: flex; align-items: center; }

/* Animated pulsing dot (shown when active) */
.astep-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-accent, #2563eb);
    opacity: 0;
    transition: opacity 0.2s;
    animation: dot-blink 1s ease-in-out infinite;
}
.astep.active .astep-dot { opacity: 1; }
@keyframes dot-blink {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50%       { opacity: 1;   transform: scale(1.2); }
}

/* Check icon (shown when done) */
.astep-check {
    font-size: 1.1rem;
    color: #22c55e;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.25s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.astep.done .astep-check { opacity: 1; transform: scale(1); }
.astep.done .astep-dot   { display: none; }

/* Progress bar */
.analysis-progress-track {
    width: 100%;
    height: 4px;
    background: var(--bg-subtle, #f5f5f7);
    border-radius: 99px;
    overflow: hidden;
}
.analysis-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--c-accent, #2563eb), #60a5fa);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 640px) {
    .main { padding: var(--sp-7) var(--sp-4) var(--sp-6); }

    .hero p { font-size: 0.95rem; }

    .verdict-block {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .gauge-wrap { margin: 0 auto; }

    .features-row { grid-template-columns: 1fr; }

    .input-actions { justify-content: stretch; }
    .btn-primary { width: 100%; }

    .sidebar { width: 100%; }

    .steps::before { display: none; }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: var(--sp-5);
    }
}

