/* ==========================================================================
   PatentLex AI 2.0 — Global Cyber-Aurora Glassmorphism Design System
   Shared across Workbench (/projects), Applicants, Billing (/account/*), Auth
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root, html[data-theme="dark"] {
    --bg-base: #050814;
    --bg-elevated: rgba(13, 20, 38, 0.78);
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-card-hover: rgba(22, 33, 58, 0.84);
    --bg-subpane: rgba(8, 13, 26, 0.72);
    --bg-pill: rgba(30, 41, 59, 0.68);
    --bg-pill-hover: rgba(51, 65, 85, 0.85);
    --nav-bg: rgba(5, 8, 20, 0.78);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-subtle: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.28);
    --border-glow: rgba(56, 189, 248, 0.45);

    --accent-cyan: #22d3ee;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-violet: #a855f7;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --hero-grad: linear-gradient(135deg, #ffffff 15%, #7dd3fc 52%, #c084fc 90%);
    --btn-grad: linear-gradient(135deg, #2563eb 0%, #6366f1 52%, #8b5cf6 100%);
    --shadow-card: 0 18px 42px -12px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --grid-dot: rgba(148, 163, 184, 0.14);
    --spotlight-color: rgba(56, 189, 248, 0.1);
    --orb-opacity: 0.32;
}

html[data-theme="light"] {
    --bg-base: #f3f6fc;
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --bg-card: rgba(255, 255, 255, 0.84);
    --bg-card-hover: rgba(255, 255, 255, 0.96);
    --bg-subpane: rgba(241, 245, 249, 0.85);
    --bg-pill: rgba(241, 245, 249, 0.94);
    --bg-pill-hover: rgba(226, 232, 240, 0.98);
    --nav-bg: rgba(255, 255, 255, 0.82);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border-subtle: rgba(15, 23, 42, 0.09);
    --border-strong: rgba(15, 23, 42, 0.18);
    --border-glow: rgba(37, 99, 235, 0.42);

    --accent-cyan: #2563eb;
    --accent-blue: #2563eb;
    --accent-indigo: #4f46e5;
    --accent-violet: #7c3aed;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;

    --hero-grad: linear-gradient(135deg, #0f172a 10%, #2563eb 55%, #7c3aed 92%);
    --btn-grad: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #7c3aed 100%);
    --shadow-card: 0 12px 32px -10px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --grid-dot: rgba(15, 23, 42, 0.07);
    --spotlight-color: rgba(37, 99, 235, 0.06);
    --orb-opacity: 0.15;
}

*, *::before, *::after { box-sizing: border-box; }
html { zoom: 1; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color .22s ease, color .22s ease;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace; font-feature-settings: "tnum"; }

/* ==================== AMBIENT CYBER-AURORA CANVAS ==================== */
.ambient-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.ambient-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse 80% 65% at 50% 22%, #000 35%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 22%, #000 35%, transparent 100%);
}
.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(95px);
    opacity: var(--orb-opacity);
    animation: auroraDrift 18s ease-in-out infinite alternate;
}
.orb-1 { width: 560px; height: 420px; background: #4f46e5; top: -140px; left: 10%; }
.orb-2 { width: 480px; height: 380px; background: #06b6d4; top: -90px; right: 10%; animation-delay: -6s; }
.orb-3 { width: 520px; height: 420px; background: #9333ea; top: 280px; left: 40%; opacity: calc(var(--orb-opacity) * 0.6); animation-delay: -11s; }
@keyframes auroraDrift {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(34px, 26px, 0) scale(1.07); }
}

/* ==================== FLOATING FROSTED GLASS NAVBAR ==================== */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
    max-width: 1320px;
    margin: 0 auto;
    min-height: 62px;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.02em;
    margin-right: 12px;
}
.brand-logo:hover { text-decoration: none; color: var(--text-primary); }
.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--btn-grad);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}
.brand-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.14);
    color: var(--accent-cyan);
    border: 1px solid rgba(34, 211, 238, 0.3);
    letter-spacing: 0.04em;
}
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all .16s ease;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-pill); text-decoration: none; }
.nav-link.active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.24);
    border: 1px solid rgba(99, 102, 241, 0.45);
}
html[data-theme="light"] .nav-link.active {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
}
.nav-spacer, .spacer { flex: 1; }
.user-chip {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-pill);
    border: 1px solid var(--border-subtle);
}
.theme-btn {
    width: auto;
    height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-pill);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .15s;
}
.theme-btn:hover { border-color: var(--border-strong); background: var(--bg-pill-hover); }

/* Legacy .topbar fallback so any subpage still looks sleek */
.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-card);
}
.topbar a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 7px;
}
.topbar a:hover { color: var(--text-primary); background: var(--bg-pill); }
.brand { font-weight: 800; color: var(--text-primary) !important; text-decoration: none; }
.user { font-size: 13px; color: var(--text-secondary); }

/* ==================== PAGE CONTAINERS & CARDS ==================== */
.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 24px 72px;
}

.card, .auth-box, .spotlight-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.card::before, .auth-box::before, .spotlight-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(460px circle at var(--mx, -250px) var(--my, -250px), var(--spotlight-color), transparent 45%);
    pointer-events: none;
    z-index: 0;
}
.card > *, .auth-box > *, .spotlight-card > * { position: relative; z-index: 1; }
.card:hover { border-color: var(--border-strong); }

.auth-shell {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}
.auth-box {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 34px 32px;
}

/* ==================== TYPOGRAPHY & LINKS ==================== */
h1 {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--text-primary);
}
h2, .card h2 {
    font-size: 17.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    color: var(--text-primary);
}
h3 { font-size: 15.5px; font-weight: 700; margin: 14px 0 10px; color: var(--text-primary); }
h4 { font-size: 14px; font-weight: 700; margin: 14px 0 8px; color: var(--text-secondary); }

a { color: var(--accent-cyan); text-decoration: none; transition: opacity .15s; }
a:hover { text-decoration: underline; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.25);
    padding: 3px 10px;
    border-radius: 999px;
    margin: 0 0 12px;
}
html[data-theme="light"] .eyebrow { color: #2563eb; background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.22); }

.meta { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 12px; }
.empty { color: var(--text-muted); font-size: 14px; }
.hint { font-size: 13px; color: var(--text-secondary); text-align: center; margin-top: 18px; }
.hint-inline { font-size: 13px; color: var(--text-secondary); margin: 10px 0 0; line-height: 1.6; }
.fail-note { color: #fb7185 !important; font-weight: 600; }
html[data-theme="light"] .fail-note { color: #e11d48 !important; }

code {
    display: block;
    font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    background: rgba(8, 13, 26, 0.85);
    color: #6ee7b7;
    border: 1px solid var(--border-subtle);
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 13px;
    word-break: break-all;
    margin-top: 8px;
}
html[data-theme="light"] code { background: #0f172a; color: #6ee7b7; }

/* ==================== FORMS, INPUTS & BUTTONS ==================== */
label {
    display: block;
    margin-bottom: 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-subpane);
    color: var(--text-primary);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}
input[type="file"] {
    padding: 9px 12px;
    border-style: dashed;
    cursor: pointer;
}
textarea { resize: vertical; }

button, .button, .btn-link {
    width: 100%;
    padding: 11px 20px;
    background: var(--btn-grad);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 6px 20px -4px rgba(99, 102, 241, 0.45);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
}
button:hover:not(:disabled), .button:hover, .btn-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -4px rgba(99, 102, 241, 0.65);
    text-decoration: none;
    color: #fff;
}
button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.inline { display: inline; width: auto; }
.link-btn {
    width: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--accent-cyan) !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}
.link-btn:hover { transform: none !important; text-decoration: underline !important; }

.stack-form { margin-top: 16px; max-width: 680px; }
.stack-form button:not(.link-btn) { width: auto; margin-top: 10px; padding: 11px 22px; }
.field-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.field-row label { flex: 1; min-width: 160px; }
.field-row button { width: auto; margin-bottom: 14px; padding: 10px 18px; }
.upload-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.upload-form label { margin-bottom: 0; flex: 1; min-width: 180px; }
.upload-form button { width: auto; padding: 10px 18px; height: 41px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled { opacity: 0.6; }
details { margin-top: 14px; }
summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-cyan);
    padding: 4px 0;
}
.check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-secondary);
    margin-top: 16px;
    cursor: pointer;
}
.check-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 3px 0 0;
    accent-color: #6366f1;
}

/* ==================== ALERTS, NOTICES & BADGES ==================== */
.notice {
    color: var(--text-primary);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.32);
    padding: 12px 16px;
    border-radius: 11px;
    font-size: 13.5px;
    margin: 12px 0;
}
.warning {
    color: var(--text-primary);
    background: rgba(245, 158, 11, 0.13);
    border: 1px solid rgba(245, 158, 11, 0.36);
    padding: 14px 18px;
    border-radius: 11px;
    font-size: 13.5px;
    margin: 14px 0;
}
.warning p { margin: 0 0 8px; }
.error {
    color: #fecdd3;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    padding: 12px 16px;
    border-radius: 11px;
    font-size: 13.5px;
    margin: 12px 0;
}
html[data-theme="light"] .error { color: #be123c; background: rgba(244, 63, 94, 0.08); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg-pill);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.badge-DONE { background: rgba(16, 185, 129, 0.16); color: #34d399; border-color: rgba(16, 185, 129, 0.35); }
.badge-PROCESSING, .badge-QUEUED, .badge-PENDING { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); }
.badge-REVIEW_REQUIRED { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.badge-FAILED { background: rgba(244, 63, 94, 0.18); color: #fb7185; border-color: rgba(244, 63, 94, 0.4); }
.badge-DRAFT, .badge-ANALYZING { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.38); }

html[data-theme="light"] .badge-DONE { color: #047857; }
html[data-theme="light"] .badge-PROCESSING, html[data-theme="light"] .badge-QUEUED, html[data-theme="light"] .badge-PENDING, html[data-theme="light"] .badge-REVIEW_REQUIRED { color: #b45309; }
html[data-theme="light"] .badge-FAILED { color: #be123c; }
html[data-theme="light"] .badge-DRAFT, html[data-theme="light"] .badge-ANALYZING { color: #4338ca; }

/* ==================== TABLES ==================== */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
    text-align: left;
    padding: 11px 14px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-subpane);
    border-bottom: 1px solid var(--border-subtle);
}
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
tbody tr:hover td { background: rgba(99, 102, 241, 0.06); }

/* ==================== WORKFLOW PIPELINE & PROJECT WORKBENCH ==================== */
.workflow-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}
.workflow-nav a {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all .16s ease;
}
.workflow-nav a:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.workflow-nav strong { font-size: 14px; color: var(--text-primary); }
.workflow-nav small { font-size: 12px; color: var(--text-muted); }
.step-number {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--bg-pill);
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.workflow-nav .step-current {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.22), rgba(34, 211, 238, 0.12));
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.45);
}
.workflow-nav .step-complete {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), var(--bg-card));
    border-color: rgba(16, 185, 129, 0.45);
}
.workflow-nav .step-complete .step-number { background: rgba(16, 185, 129, 0.25); color: var(--accent-emerald); }

.workflow-panel { scroll-margin-top: 78px; }
.workflow-progress { width: 100%; height: 10px; accent-color: #22d3ee; margin-bottom: 14px; border-radius: 999px; }

.analysis-summary {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 13.5px;
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-subpane);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 11px;
}
.tech-profile-card {
    margin-top: 14px;
    padding: 16px 18px;
    background: var(--bg-subpane);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-cyan);
    border-radius: 12px;
}
.tech-profile-card h3 { font-size: 14.5px; margin: 0 0 10px; color: var(--text-primary); }

.preparation-details > summary { font-size: 15px; font-weight: 700; }
.preparation-details .card {
    padding: 20px 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    margin-bottom: 0;
}

.applicant { border-top: 1px solid var(--border-subtle); padding: 18px 0; }
.alias-list { padding-left: 20px; font-size: 13.5px; color: var(--text-secondary); }
.alias-list li { padding: 4px 0; }
.issues { margin: 10px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--accent-amber); }
.issues li { margin-bottom: 6px; }

/* Terminology Grid */
.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.term-card {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg-subpane);
    transition: all .25s ease;
}
.term-card.term-confirmed { border-color: rgba(16, 185, 129, 0.42); background: rgba(16, 185, 129, 0.08); }
.term-card.term-just-saved { border-color: var(--accent-emerald); box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
.term-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.term-card-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.term-source { font-weight: 700; font-size: 14px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-form input[name="target"] { margin-top: 0; padding: 7px 10px; font-size: 13.5px; }
.term-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.term-card-actions button:not(.link-btn) { width: auto; padding: 6px 13px; font-size: 12.5px; }

/* Segments, Evidence & Credibility */
.evidence-header-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.evidence-header-row h2 { margin: 0; }
.btn-refresh-evidence { width: auto; padding: 8px 15px; font-size: 13px; }
.evidence-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-subpane);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}
.evidence-kpi-item { display: flex; flex-direction: column; gap: 3px; }
.evidence-kpi-item small { font-size: 12px; color: var(--text-secondary); }
.evidence-kpi-item strong { font-size: 20px; font-weight: 800; color: var(--text-primary); }

.evidence-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.filter-chip {
    width: auto;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 999px;
    background: var(--bg-pill);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    box-shadow: none;
}
.filter-chip:hover { color: var(--text-primary); border-color: var(--border-strong); transform: none; box-shadow: none; }
.filter-chip.active { background: var(--btn-grad); color: #fff; border-color: transparent; }

.segment { padding: 18px 0; border-bottom: 1px solid var(--border-subtle); }
.segment:last-child { border-bottom: none; }
.segment:target { background: rgba(245, 158, 11, 0.1); outline: 1px solid rgba(245, 158, 11, 0.45); border-radius: 10px; padding: 18px 14px; scroll-margin-top: 84px; }
.seg-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.seg-no { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.seg-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tier-pill { padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; background: var(--bg-pill); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.sim-pill { padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; background: rgba(56, 189, 248, 0.14); color: var(--accent-cyan); border: 1px solid rgba(56, 189, 248, 0.3); }
.cred-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cred-badge-HIGH { background: rgba(16, 185, 129, 0.16); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.35); }
.cred-badge-MEDIUM { background: rgba(245, 158, 11, 0.16); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.35); }
.cred-badge-LOW { background: rgba(244, 63, 94, 0.16); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.35); }

.bilingual-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bilingual-row > div { background: var(--bg-subpane); border: 1px solid var(--border-subtle); border-radius: 11px; padding: 13px 15px; }
.bilingual-row > div:only-child { grid-column: 1 / -1; }
.text-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 6px; }
.seg-source { font-size: 14px; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.seg-target { font-size: 14.5px; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.seg-pending { font-size: 13.5px; color: var(--text-muted); font-style: italic; }

.matched-terms-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px; background: var(--bg-subpane); border-radius: 9px; border: 1px dashed var(--border-strong); }
.matched-terms-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.term-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; font-size: 12px; background: var(--bg-pill); border: 1px solid var(--border-subtle); color: var(--text-primary); }
.term-pill-target { color: var(--accent-cyan); font-weight: 700; }
.term-pill small { font-size: 10.5px; color: var(--text-muted); }

.parallel-evidence-drawer { margin-top: 10px; background: var(--bg-subpane); border: 1px solid var(--border-subtle); border-left: 3px solid var(--accent-indigo); border-radius: 10px; padding: 10px 14px; }
.parallel-evidence-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.parallel-evidence-item { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 9px; padding: 11px 13px; }
.parallel-evidence-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; color: var(--text-secondary); }
.corpus-tag { font-weight: 700; color: var(--accent-cyan); background: rgba(34, 211, 238, 0.12); padding: 2px 8px; border-radius: 5px; }
.sim-meter-wrap { display: inline-flex; align-items: center; gap: 6px; }
.sim-meter { width: 72px; height: 6px; background: var(--bg-pill); border-radius: 999px; overflow: hidden; }
.sim-meter-fill { height: 100%; background: var(--btn-grad); border-radius: 999px; }
.parallel-pair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; font-size: 13px; }
.parallel-pair-col { background: var(--bg-subpane); padding: 9px 11px; border-radius: 7px; border: 1px solid var(--border-subtle); white-space: pre-wrap; overflow-wrap: anywhere; }
.parallel-pair-col small { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }

.reference-snapshot { margin-top: 10px; background: var(--bg-subpane); border-left: 3px solid var(--accent-cyan); border-radius: 8px; padding: 11px 15px; }
blockquote { margin: 10px 0; font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.hash-note { font-size: 11px; color: var(--text-muted); overflow-wrap: anywhere; margin-bottom: 0; }

/* Segment QA Box */
.segment-qa-box { margin-top: 10px; padding: 10px 13px; border-radius: 9px; background: rgba(244, 63, 94, 0.12); border-left: 3px solid var(--accent-rose); display: flex; flex-direction: column; gap: 6px; }
.segment-qa-box:has(.qa-warning:only-child) { background: rgba(245, 158, 11, 0.12); border-left-color: var(--accent-amber); }
.segment-qa-item { font-size: 13px; color: var(--text-primary); display: flex; align-items: flex-start; gap: 8px; }
.qa-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap; background: rgba(244, 63, 94, 0.25); color: #fda4af; }
.qa-warning .qa-badge { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.seg-badges .qa-header-pill { background: rgba(244, 63, 94, 0.18); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.35); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }

/* Official Export Panel */
.export-official-panel {
    margin-top: 18px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14) 0%, var(--bg-subpane) 65%, rgba(168, 85, 247, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.38);
    border-radius: 14px;
}
.export-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--text-primary); flex-wrap: wrap; }
.export-buttons-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s ease;
}
.btn-export:hover { border-color: var(--accent-cyan); transform: translateY(-1px); text-decoration: none; color: var(--text-primary); }
.btn-export-primary { background: var(--btn-grad); color: #ffffff !important; border-color: transparent; box-shadow: 0 6px 20px rgba(99, 102, 241, 0.42); }
.btn-export-primary strong, .btn-export-primary small { color: #ffffff !important; }
.btn-export .icon { font-size: 18px; line-height: 1; }
.btn-export span:not(.icon):not(.badge-recommend) { display: flex; flex-direction: column; text-align: left; }
.btn-export strong { font-size: 13px; font-weight: 700; line-height: 1.25; }
.btn-export small { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.btn-export .badge-recommend { background: #fbbf24; color: #78350f; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.export-nav-links { font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; }

@media (max-width: 760px) {
    .workflow-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bilingual-row, .parallel-pair-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .page { padding: 18px 14px 56px; }
    .card { padding: 18px; }
}
