/* ═══════════════════════════════════════════════════════════
   PROJECT JAG — Clinical Noir Theme
   ═══════════════════════════════════════════════════════════ */

/* ── Self-hosted fonts ────────────────────────────────────── */

/* Instrument Serif — latin-ext */
@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/instrument-serif-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Instrument Serif — latin */
@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/instrument-serif-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Plus Jakarta Sans — cyrillic-ext (400,500,600,700) */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-cyrillic-ext.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-cyrillic-ext.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-cyrillic-ext.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-cyrillic-ext.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* Plus Jakarta Sans — vietnamese (400,500,600,700) */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-vietnamese.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-vietnamese.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-vietnamese.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-vietnamese.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Plus Jakarta Sans — latin-ext (400,500,600,700) */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Plus Jakarta Sans — latin (400,500,600,700) */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/plus-jakarta-sans-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

:root {
    /* Core palette */
    --bg-deep: #0a0e17;
    --bg-base: #0f1420;
    --bg-raised: #161c2e;
    --bg-surface: rgba(22, 28, 46, 0.7);
    --bg-glass: rgba(22, 28, 46, 0.45);

    /* Accent: clinical teal */
    --accent: #2dd4a8;
    --accent-dim: rgba(45, 212, 168, 0.15);
    --accent-glow: rgba(45, 212, 168, 0.25);

    /* Text */
    --text-primary: #e8ecf4;
    --text-secondary: #7a8baa;
    --text-tertiary: #4a5672;

    /* Semantic */
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --pending: #818cf8;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(45, 212, 168, 0.2);

    /* Misc */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(45, 212, 168, 0.08);

    /* Fonts */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── Base ──────────────────────────────────────────────── */

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ── Ambient Background ────────────────────────────────── */

.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(45, 212, 168, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: drift 25s ease-in-out infinite alternate;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: drift 30s ease-in-out infinite alternate-reverse;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(45, 212, 168, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -30px) scale(1.1); }
}

/* ── Noise texture overlay ─────────────────────────────── */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    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;
}

/* ── Header ────────────────────────────────────────────── */

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

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

.brand-icon {
    width: 38px;
    height: 38px;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-accent);
    flex-shrink: 0;
}

.brand-icon svg {
    width: 20px;
    height: 20px;
}

.brand h1 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    animation: blink 3s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Main Container ────────────────────────────────────── */

main {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    width: 100%;
    flex: 1;
}

/* Staggered entrance */
.upload-section,
.jobs-section {
    animation: fadeSlideIn 0.6s ease-out both;
    animation-delay: calc(var(--delay, 0) * 0.12s);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Upload Section ────────────────────────────────────── */

.upload-section {
    margin-bottom: 3rem;
}

.drop-zone {
    position: relative;
    border: 1.5px dashed var(--text-tertiary);
    border-radius: var(--radius);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    border-style: solid;
    box-shadow: var(--shadow-glow), inset 0 0 60px rgba(45, 212, 168, 0.03);
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
    opacity: 1;
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.drop-zone-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    color: var(--text-tertiary);
    transition: color 0.3s, transform 0.3s;
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.drag-over .drop-zone-icon {
    color: var(--accent);
    transform: translateY(-4px);
}

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

.drop-zone-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.drop-zone-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.file-label {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.file-label:hover {
    border-bottom-color: var(--accent);
}

/* ── Progress ──────────────────────────────────────────── */

.progress-container {
    margin-top: 1rem;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    animation: fadeSlideIn 0.3s ease-out;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.progress-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-pct {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #5eead4);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(45, 212, 168, 0.4);
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
}

/* ── Error ─────────────────────────────────────────────── */

.error-message[hidden] {
    display: none !important;
}

.error-message {
    margin-top: 1rem;
    padding: 0.875rem 1.125rem;
    background: rgba(248, 113, 113, 0.08);
    color: var(--error);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid rgba(248, 113, 113, 0.2);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    animation: shake 0.4s ease-out;
}

.error-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(5px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-1px); }
}

/* ── Jobs Section ──────────────────────────────────────── */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
}

.job-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-raised);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* ── Empty State ───────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.95rem;
    font-weight: 500;
}

.empty-hint {
    font-size: 0.82rem !important;
    font-weight: 400 !important;
    color: var(--text-tertiary) !important;
    margin-top: 0.35rem;
}

/* ── Job Card ──────────────────────────────────────────── */

.job-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeSlideIn 0.4s ease-out both;
}

.job-card:hover {
    background: rgba(22, 28, 46, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.job-card.completed {
    border-left: 3px solid var(--success);
}

.job-card.failed {
    border-left: 3px solid var(--error);
}

.job-card.processing {
    border-left: 3px solid var(--warning);
}

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

.job-filename {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.job-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.job-meta .sep {
    color: var(--text-tertiary);
}

.job-error {
    color: var(--error);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

.job-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Status Badges ─────────────────────────────────────── */

.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-PENDING {
    background: rgba(129, 140, 248, 0.12);
    color: var(--pending);
}

.status-PROCESSING,
.status-SUMMARIZING {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
}

.status-COMPLETED {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
}

.status-FAILED {
    background: rgba(248, 113, 113, 0.12);
    color: var(--error);
}

/* Processing spinner dot */
.status-PROCESSING::before,
.status-SUMMARIZING::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: statusPulse 1.2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

/* ── Buttons ───────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-accent {
    background: var(--accent);
    color: var(--bg-deep);
}

.btn-accent:hover {
    background: #5eead4;
    box-shadow: 0 0 20px rgba(45, 212, 168, 0.3);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.78rem;
}

.btn-danger-ghost {
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    padding: 0.375rem 0.5rem;
}

.btn-danger-ghost:hover {
    color: var(--error);
    background: rgba(248, 113, 113, 0.08);
}

.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ── Modal ─────────────────────────────────────────────── */

.modal[hidden] {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    position: relative;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.modal-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.modal-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
}

.summary-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'DM Mono', 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.75;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.25);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* ── Footer ────────────────────────────────────────────── */

footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 640px) {
    header { padding: 0 1rem; }
    .header-inner { height: 60px; }
    .header-status { display: none; }

    main {
        padding: 1.5rem 1rem 3rem;
    }

    .drop-zone {
        padding: 2.5rem 1.25rem;
    }

    .drop-zone-icon {
        width: 44px;
        height: 44px;
    }

    .job-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .job-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-content {
        max-height: 92vh;
    }

    .modal {
        padding: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.15rem;
    }
}

/* ── Utility ───────────────────────────────────────────── */

/* Smooth scroll for all */
html { scroll-behavior: smooth; }

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .orb { display: none; }
}
