/* ================================================
   SIGHTFUL — Mission Control CSS
   Fonts: Orbitron (display) + Sora (body)
================================================ */

/* ── CSS Variables ── */
:root {
    --bg:           #05070f;
    --surface:      #0d1225;
    --surface-2:    #111827;
    --border:       rgba(0, 245, 212, 0.12);
    --border-hover: rgba(0, 245, 212, 0.4);

    --cyan:         #00f5d4;
    --cyan-dim:     rgba(0, 245, 212, 0.15);
    --cyan-glow:    rgba(0, 245, 212, 0.35);
    --magenta:      #f72585;
    --magenta-dim:  rgba(247, 37, 133, 0.15);
    --purple:       #7b2fff;
    --purple-dim:   rgba(123, 47, 255, 0.15);
    --amber:        #ffbe0b;
    --amber-dim:    rgba(255, 190, 11, 0.15);
    --red:          #ff3860;
    --red-dim:      rgba(255, 56, 96, 0.15);

    --text:         #c8d8f0;
    --text-dim:     rgba(200, 216, 240, 0.5);
    --text-xdim:    rgba(200, 216, 240, 0.25);

    --font-display: 'Orbitron', monospace;
    --font-body:    'Sora', sans-serif;

    --radius:       12px;
    --radius-sm:    6px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
}

/* ── Starfield Canvas ── */
#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Grain overlay ── */
.grain {
    position: fixed;
    inset: -50%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    animation: grain-drift 8s steps(10) infinite;
}

@keyframes grain-drift {
    0%, 100% { transform: translate(0, 0); }
    10%       { transform: translate(-2%, -3%); }
    20%       { transform: translate(3%, 1%); }
    30%       { transform: translate(-1%, 4%); }
    40%       { transform: translate(2%, -2%); }
    50%       { transform: translate(-3%, 3%); }
    60%       { transform: translate(1%, -1%); }
    70%       { transform: translate(-2%, 2%); }
    80%       { transform: translate(3%, -3%); }
    90%       { transform: translate(-1%, 1%); }
}


/* ================================================
   SCREENS
================================================ */
.screen {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}


/* ================================================
   SCREEN 1 — LAUNCH PAD
================================================ */
#screen-launch {
    flex-direction: column;
}

.launch-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 560px;
    padding: 40px 24px;
    animation: launch-enter 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes launch-enter {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo */
.logo-lockup {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 0 12px var(--cyan));
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { filter: drop-shadow(0 0 12px var(--cyan)); }
    50%       { filter: drop-shadow(0 0 24px var(--cyan)) drop-shadow(0 0 48px var(--purple)); }
}

.wordmark {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    background: linear-gradient(135deg, var(--cyan) 0%, #a78fff 60%, var(--cyan) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    from { background-position: 0% center; }
    to   { background-position: 200% center; }
}

.tagline {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Launch Card */
.launch-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 245, 212, 0.04), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: border-color 0.3s;
}

.launch-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
    opacity: 0.6;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-label {
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    color: var(--text-xdim);
}

/* Pulsing status dot */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cyan);
}

.status-dot.pulse {
    box-shadow: 0 0 0 0 var(--cyan-glow);
    animation: dot-pulse 2s ease-out infinite;
}

@keyframes dot-pulse {
    0%   { box-shadow: 0 0 0 0 var(--cyan-glow); }
    70%  { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* URL Input */
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-dim), inset 0 0 20px rgba(0, 245, 212, 0.03);
}

.input-icon {
    color: var(--cyan);
    width: 20px; height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.input-icon svg { width: 100%; height: 100%; }

#url-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

#url-input::placeholder { color: var(--text-xdim); }

/* Depth Selector */
.depth-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.depth-selector {
    display: flex;
    gap: 8px;
}

.depth-btn {
    flex: 1;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

.depth-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.depth-btn.active {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 12px var(--cyan-dim);
}

.depth-hint {
    font-size: 0.75rem;
    color: var(--text-xdim);
    letter-spacing: 0.02em;
}

/* Scheduled Scans link on launch pad — only visible to Pro users */
.schedules-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.2s;
}

.schedules-link:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-dim);
}

/* Scan Button */
.scan-button {
    position: relative;
    width: 100%;
    padding: 18px;
    background: transparent;
    border: 1px solid var(--cyan);
    border-radius: var(--radius-sm);
    color: var(--cyan);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.scan-button:hover {
    background: var(--cyan-dim);
    box-shadow: 0 0 30px var(--cyan-glow), inset 0 0 30px rgba(0, 245, 212, 0.05);
    transform: translateY(-1px);
}

.scan-button:active { transform: translateY(0); }

.btn-icon {
    font-size: 1.1rem;
    animation: btn-spin 4s linear infinite;
}

@keyframes btn-spin {
    0%, 80%, 100% { transform: rotate(0deg); }
    40%           { transform: rotate(360deg); }
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, var(--cyan-dim), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.scan-button:hover .btn-glow { opacity: 1; }

.error-msg {
    min-height: 20px;
    font-size: 0.78rem;
    color: var(--magenta);
    text-align: center;
    letter-spacing: 0.05em;
}

/* Launch Footer */
.launch-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-xdim);
}

.footer-contact {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact:hover { color: var(--cyan); }

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ================================================
   SCREEN 2 — SCANNING
================================================ */
.scanning-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    text-align: center;
    padding: 40px 24px;
    animation: launch-enter 0.6s ease forwards;
}

/* Radar */
.radar-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--cyan);
    animation: radar-expand 2.4s ease-out infinite;
}

.r1 { width: 200px; height: 200px; animation-delay: 0s; }
.r2 { width: 200px; height: 200px; animation-delay: 0.8s; }
.r3 { width: 200px; height: 200px; animation-delay: 1.6s; }

@keyframes radar-expand {
    0%   { transform: scale(0.1); opacity: 0.9; border-color: var(--cyan); }
    100% { transform: scale(1);   opacity: 0;   border-color: var(--purple); }
}

.radar-sweep {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, var(--cyan-dim) 20%, transparent 25%);
    animation: radar-rotate 2s linear infinite;
}

@keyframes radar-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.radar-core {
    position: relative;
    width: 40px; height: 40px;
    z-index: 2;
    filter: drop-shadow(0 0 8px var(--cyan));
}

.scanning-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan-glow);
}

.scanning-url {
    font-size: 0.85rem;
    color: var(--text-dim);
    max-width: 400px;
    word-break: break-all;
}

.scanning-sub {
    font-size: 0.8rem;
    color: var(--text-xdim);
    letter-spacing: 0.05em;
}

.scan-progress-bar {
    width: 280px;
    height: 2px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.scan-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    border-radius: 99px;
    box-shadow: 0 0 8px var(--cyan);
    animation: scan-progress 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes scan-progress {
    0%   { width: 0%;   margin-left: 0%; }
    50%  { width: 60%;  margin-left: 20%; }
    100% { width: 0%;   margin-left: 100%; }
}


/* ================================================
   SCREEN 3 — RESULTS
================================================ */
#screen-results {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
}

/* Results Header */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 7, 15, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
}

.new-scan-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.new-scan-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.wordmark-sm {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scanned-url-badge {
    font-size: 0.75rem;
    color: var(--text-xdim);
    max-width: 240px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Download Report Button */
.download-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--cyan-dim);
    border: 1px solid var(--cyan);
    border-radius: var(--radius-sm);
    color: var(--cyan);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 0 12px var(--cyan-dim);
}

.download-btn:hover {
    background: rgba(0, 245, 212, 0.25);
    box-shadow: 0 0 20px var(--cyan-glow);
    transform: translateY(-1px);
}

.download-btn:active { transform: translateY(0); }

.download-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* ── Page Limit Notice Banner ── */
.page-limit-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    background: rgba(255, 190, 11, 0.08);
    border-bottom: 1px solid rgba(255, 190, 11, 0.2);
    font-size: 0.8rem;
    color: var(--amber);
    letter-spacing: 0.02em;
    flex-shrink: 0;
    animation: launch-enter 0.4s ease both;
}

.notice-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Stat Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.stat-card {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border-right: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.2s;
    animation: stat-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stat-card:last-child { border-right: none; }

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes stat-enter {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    transform: scaleX(0);
    transition: transform 0.3s;
}

.stat-card:hover::after { transform: scaleX(1); }
.stat-card:hover { background: rgba(255,255,255,0.02); }

.cat-ok::after        { background: var(--cyan); }
.cat-broken::after    { background: var(--magenta); }
.cat-redirect::after  { background: var(--purple); }
.cat-auth::after      { background: var(--amber); }
.cat-error::after     { background: var(--red); }

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.cat-ok    .stat-number { color: var(--cyan);    text-shadow: 0 0 20px var(--cyan-glow); }
.cat-broken .stat-number { color: var(--magenta); text-shadow: 0 0 20px rgba(247,37,133,0.4); }
.cat-redirect .stat-number { color: var(--purple); text-shadow: 0 0 20px rgba(123,47,255,0.4); }
.cat-auth .stat-number { color: var(--amber);    text-shadow: 0 0 20px rgba(255,190,11,0.4); }
.cat-error .stat-number { color: var(--red);     text-shadow: 0 0 20px rgba(255,56,96,0.4); }

.stat-label {
    font-family: var(--font-display);
    font-size: 0.55rem;
    letter-spacing: 0.22em;
    color: var(--text-xdim);
}

.stat-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    opacity: 0.06;
    font-weight: 900;
}

/* Results Body */
.results-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Chart Panel */
.chart-panel {
    border-right: 1px solid var(--border);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    animation: panel-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes panel-enter {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.panel-title {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.28em;
    color: var(--text-xdim);
}

.chart-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
}

#donut-chart {
    width: 220px !important;
    height: 220px !important;
    filter: drop-shadow(0 0 20px rgba(0, 245, 212, 0.2));
}

.chart-centre {
    position: absolute;
    text-align: center;
    pointer-events: none;
}

.chart-total {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.chart-total-label {
    font-family: var(--font-display);
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: var(--text-xdim);
    margin-top: 4px;
}

/* Legend */
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-name {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.legend-count {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Header scan info — URL and depth badge grouped together */
.header-scan-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.scan-depth-badge {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--cyan);
    opacity: 0.8;
}

/* Pages Crawled Info */
.pages-crawled-info {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.pages-crawled-count {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--purple);
    text-shadow: 0 0 16px rgba(123, 47, 255, 0.4);
    margin-top: 4px;
}

/* Table Panel */
.table-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: panel-enter-r 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

@keyframes panel-enter-r {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 12px;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pill {
    padding: 5px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pill:hover { border-color: var(--cyan); color: var(--cyan); }

.pill.active {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Table Scroll */
.table-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.table-scroll::-webkit-scrollbar { width: 4px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.results-table thead tr {
    border-bottom: 1px solid var(--border);
}

.results-table th {
    padding: 12px 20px;
    text-align: left;
    font-family: var(--font-display);
    font-size: 0.55rem;
    letter-spacing: 0.22em;
    color: var(--text-xdim);
    font-weight: 400;
}

/* Column widths: STATUS | URL | LINK TEXT | SOURCE PAGE | CODE
   STATUS widened to prevent badge text truncating with ellipsis.
   URL reduced by ~30% from auto. Link Text widened by 10%.
   Code widened to show full 3-digit status codes. */
.results-table th:nth-child(1) { width: 115px; } /* STATUS — wider to fit REDIRECT badge */
.results-table th:nth-child(2) { width: 160px; } /* URL — reduced by ~30% */
.results-table th:nth-child(3) { width: 194px; } /* LINK TEXT — widened by 10% */
.results-table th:nth-child(4) { width: 180px; } /* SOURCE PAGE — unchanged */
.results-table th:nth-child(5) { width: 92px;  } /* CODE — widened to show 3 digits */

.results-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
    animation: row-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.results-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.results-table td {
    padding: 12px 20px;
    font-size: 0.8rem;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-table td:nth-child(2) {
    color: var(--text-dim);
    font-size: 0.78rem;
}

/* Source page cell — more muted, smaller */
.results-table td:nth-child(4) {
    color: var(--text-xdim);
    font-size: 0.72rem;
}

/* Clickable URL links in the results table */
.table-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.78rem;
    transition: color 0.15s;
}

.table-link:hover {
    color: var(--cyan);
    text-decoration: underline;
}

/* Source page link — more muted than the main URL */
.table-link-dim {
    color: var(--text-xdim);
    font-size: 0.72rem;
}

.table-link-dim:hover { color: var(--text-dim); }
    color: var(--text-dim);
    font-size: 0.78rem;
    font-style: normal;
}

.no-text {
    color: var(--text-xdim);
    font-size: 0.72rem;
}

/* Status Badge — overflow hidden removed so no ellipsis on short labels */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-display);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    font-weight: 600;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
}

.badge-ok       { background: var(--cyan-dim);    color: var(--cyan);    border: 1px solid rgba(0,245,212,0.3);    box-shadow: 0 0 8px var(--cyan-dim); }
.badge-broken   { background: var(--magenta-dim); color: var(--magenta); border: 1px solid rgba(247,37,133,0.3);   box-shadow: 0 0 8px var(--magenta-dim); }
.badge-redirect { background: var(--purple-dim);  color: var(--purple);  border: 1px solid rgba(123,47,255,0.3);   box-shadow: 0 0 8px var(--purple-dim); }
.badge-auth     { background: var(--amber-dim);   color: var(--amber);   border: 1px solid rgba(255,190,11,0.3);   box-shadow: 0 0 8px var(--amber-dim); }
.badge-error    { background: var(--red-dim);     color: var(--red);     border: 1px solid rgba(255,56,96,0.3);    box-shadow: 0 0 8px var(--red-dim); }

/* Row left border stripe */
.results-table tbody tr td:first-child {
    position: relative;
}

.results-table tbody tr td:first-child::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
}

tr.row-ok       td:first-child::before { background: var(--cyan); }
tr.row-broken   td:first-child::before { background: var(--magenta); }
tr.row-redirect td:first-child::before { background: var(--purple); }
tr.row-auth     td:first-child::before { background: var(--amber); }
tr.row-error    td:first-child::before { background: var(--red); }

/* Code cell — colour matches the row category for visual consistency */
.code-cell {
    font-family: var(--font-display);
    font-size: 0.78rem;
    color: var(--text-xdim);
}

tr.row-ok       .code-cell { color: var(--cyan);    }
tr.row-broken   .code-cell { color: var(--magenta); }
tr.row-redirect .code-cell { color: var(--purple);  }
tr.row-auth     .code-cell { color: var(--amber);   }
tr.row-error    .code-cell { color: var(--red);     }

@keyframes row-enter {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}


/* ================================================
   RESPONSIVE
================================================ */
@media (max-width: 900px) {
    .results-body {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .chart-panel { border-right: none; border-bottom: 1px solid var(--border); }

    .stat-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    .stat-cards .stat-card:nth-child(4),
    .stat-cards .stat-card:nth-child(5) {
        border-top: 1px solid var(--border);
    }

    /* Hide link text and source page columns on smaller screens */
    .results-table th:nth-child(3),
    .results-table td:nth-child(3),
    .results-table th:nth-child(4),
    .results-table td:nth-child(4) { display: none; }
}


/* ================================================
   DEPTH BUTTON — PRO LOCK
================================================ */
.depth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.depth-btn .lock-icon {
    font-size: 0.65rem;
    margin-left: 4px;
    opacity: 0.7;
}

/* Lock icon hidden once user is pro */
.depth-btn.unlocked .lock-icon { display: none; }

/* User status bar */
.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-dim);
}

.user-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
    flex-shrink: 0;
}

.user-email {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cyan);
    font-size: 0.72rem;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-xdim);
    font-family: var(--font-body);
    font-size: 0.68rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.logout-btn:hover { color: var(--magenta); }

/* History link — Pro users only */
.history-link {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-xdim);
    font-family: var(--font-body);
    font-size: 0.68rem;
    cursor: pointer;
    padding: 4px 10px;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.history-link:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Manage Subscription button — Pro users only */
.manage-sub-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-xdim);
    font-family: var(--font-body);
    font-size: 0.68rem;
    cursor: pointer;
    padding: 4px 10px;
    transition: all 0.2s;
    white-space: nowrap;
}

.manage-sub-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}


/* ================================================
   MODALS — SHARED
================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(5, 7, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: backdrop-in 0.3s ease;
}

@keyframes backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 0 80px rgba(0, 245, 212, 0.08);
    animation: modal-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
    opacity: 0.7;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    color: var(--text-xdim);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.modal-logo {
    text-align: center;
    margin-bottom: 20px;
}


/* ── Auth Modal ── */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    gap: 0;
}

.modal-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.modal-tab:hover { color: var(--text); }

.modal-tab.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

.modal-pane { display: none; }
.modal-pane.active { display: block; }

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-label {
    font-family: var(--font-display);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    color: var(--text-xdim);
}

.modal-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-dim);
}

.modal-input::placeholder { color: var(--text-xdim); }

.modal-error {
    min-height: 18px;
    font-size: 0.75rem;
    color: var(--magenta);
    margin-bottom: 8px;
}

.modal-success {
    min-height: 18px;
    font-size: 0.75rem;
    color: var(--cyan);
    margin-bottom: 8px;
}

.modal-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--cyan);
    border-radius: var(--radius-sm);
    color: var(--cyan);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.modal-btn:hover {
    background: var(--cyan-dim);
    box-shadow: 0 0 20px var(--cyan-glow);
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}


/* ── Upgrade Modal ── */
.upgrade-modal {
    text-align: center;
    max-width: 380px;
}

.upgrade-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.upgrade-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan-glow);
    margin-bottom: 12px;
}

.upgrade-subtitle {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 20px;
}

.upgrade-subtitle strong { color: var(--text); }

.upgrade-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    text-align: left;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
}

.upgrade-feature {
    font-size: 0.82rem;
    color: var(--cyan);
}

.upgrade-btn {
    background: var(--cyan-dim);
    box-shadow: 0 0 20px var(--cyan-dim);
}

.modal-link {
    display: block;
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--text-xdim);
    font-family: var(--font-body);
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.2s;
}
 
.modal-link:hover { color: var(--text-dim); }