@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #0b1118;
    --bg-elevated: #101721;
    --bg-panel: #121b26;
    --bg-panel-muted: #0e151f;
    --bg-panel-strong: #162231;
    --bg-code: #0a0f16;
    --surface-highlight: rgba(255, 255, 255, 0.03);
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(148, 163, 184, 0.28);
    --text: #edf2f7;
    --text-strong: #ffffff;
    --text-muted: #9eacbb;
    --text-soft: #748397;
    --accent: #8da0b5;
    --accent-soft: rgba(141, 160, 181, 0.12);
    --success: #3fb786;
    --success-soft: rgba(63, 183, 134, 0.12);
    --warning: #d9a354;
    --warning-soft: rgba(217, 163, 84, 0.12);
    --danger: #e07272;
    --danger-soft: rgba(224, 114, 114, 0.12);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.34);
    --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.28);
    --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.22);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --page-width: 1260px;
    --transition-fast: 160ms ease;
    --transition-base: 220ms ease;
}

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

html {
    font-size: 16px;
    scrollbar-color: rgba(141, 160, 181, 0.45) transparent;
    scrollbar-width: thin;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(141, 160, 181, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(63, 183, 134, 0.06), transparent 26%),
        linear-gradient(180deg, #0a1016 0%, #0b1118 100%);
    color: var(--text);
    font-family: "Manrope", sans-serif;
    letter-spacing: -0.01em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 28px 28px;
    background-position: 0 132px, 0 0;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 92%);
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(141, 160, 181, 0.35);
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(141, 160, 181, 0.55);
    background-clip: padding-box;
}

.shell {
    padding: 32px 24px 64px;
}

.page {
    width: min(var(--page-width), 100%);
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.page-upload-center {
    max-width: 960px;
}

.shell-app {
    padding: 0;
}

.app-frame {
    width: min(var(--page-width), calc(100% - 48px));
    margin: 0 auto;
    padding: 0 0 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 64px;
    padding: 16px 0;
    border-bottom: none;
    box-shadow: none;
}

.topbar-brand-row,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.brand-logo {
    display: block;
    height: 36px;
    width: auto;
    transform: scale(1.1);
    transform-origin: left center;
}

.topbar-meta {
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-upload-focused {
    max-width: 100%;
    min-height: calc(100vh - 88px);
    align-content: start;
}

.page-report-modern {
    gap: 18px;
}

.tool-stage {
    width: 100%;
}

.upload-shell,
.progress-shell {
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.upload-shell {
    width: min(1040px, 100%);
    gap: 24px;
}

.progress-shell {
    width: min(560px, 100%);
}

.upload-context {
    margin: 0;
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-intro {
    display: grid;
    gap: 8px;
}

.section-intro h1,
.section-intro h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    letter-spacing: -0.04em;
}

.section-intro-centered {
    justify-items: center;
    text-align: center;
}

.section-description {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.sample-showcase,
.upload-form-stage {
    display: grid;
    gap: 18px;
}

.sample-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sample-card {
    display: grid;
    align-content: start;
    gap: 16px;
    width: 100%;
    min-height: 208px;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(141, 160, 181, 0.12), rgba(141, 160, 181, 0.02)),
        rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.sample-card:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: var(--shadow-sm);
}

.sample-card:disabled {
    opacity: 0.72;
    cursor: progress;
    transform: none;
}

.sample-card-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
}

.sample-card-meta {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(11, 17, 24, 0.45);
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.upload-choice-divider {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.upload-choice-divider::before,
.upload-choice-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.14);
}

.upload-choice-divider span {
    padding: 0 14px;
}

.upload-form-stage {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.015);
}

.is-hidden {
    display: none !important;
}

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

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 4px 4px 8px;
}

.app-header-center {
    justify-content: center;
    text-align: center;
}

.brand-lockup {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.upload-header {
    align-items: center;
}

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

.brand-lockup-center {
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(141, 160, 181, 0.22);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
        var(--bg-panel-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-sm);
    color: var(--text-strong);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.brand-copy {
    display: grid;
    gap: 10px;
}

.brand-lockup-center .brand-copy {
    justify-items: center;
}

.eyebrow,
.field-label,
.summary-label,
.record-chip,
.support-note span,
.count-badge,
.finding-kicker,
.metric-kicker,
.overview-meta,
.section-icon {
    font-family: "JetBrains Mono", monospace;
}

.eyebrow {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.79rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--text-strong);
    font-weight: 700;
    line-height: 1.08;
}

h1 {
    font-size: clamp(2.8rem, 5vw, 4.6rem);
    max-width: 16ch;
}

.brand-lockup-center h1 {
    max-width: 14ch;
}

h2 {
    font-size: 1.45rem;
}

h3 {
    font-size: 1.05rem;
}

h4 {
    font-size: 0.92rem;
}

.lede,
.panel-header p,
.field-help,
.dropzone-copy,
.dropzone-meta,
.record-subtitle,
.empty-copy,
.footer-copy p,
.summary-copy,
.metric-description,
.overview-copy span,
.status span,
.section-heading span,
.overview-table-head {
    color: var(--text-muted);
}

.lede {
    margin: 0;
    max-width: 64ch;
    font-size: 1.03rem;
    line-height: 1.7;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        var(--bg-panel);
    box-shadow: var(--shadow-lg);
}

.upload-panel,
.report-panel {
    padding: 28px;
}

.upload-workbench {
    display: grid;
    gap: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.panel-header-compact {
    margin-bottom: 0;
}

.panel-header p {
    margin: 10px 0 0;
    max-width: 58ch;
    line-height: 1.6;
}

.support-note {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.support-note span,
.record-chip,
.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.icon-button:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-sm);
}

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

.icon-button-small {
    width: 40px;
    height: 40px;
    border-radius: 14px;
}

.icon-button-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(158, 172, 187, 0.45);
    box-shadow: 0 0 0 4px rgba(158, 172, 187, 0.08);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.icon-button.is-configured .icon-button-indicator {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(63, 183, 134, 0.14);
}

.count-badge {
    justify-content: center;
    min-width: 38px;
    color: var(--text-strong);
}

.upload-form,
.upload-stack,
.stack {
    display: grid;
    gap: 22px;
}

.upload-form-compact {
    gap: 18px;
}

.wizard-step {
    display: grid;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)),
        rgba(255, 255, 255, 0.02);
}

.step-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.step-copy {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.analysis-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.analysis-card-grid-compact {
    gap: 14px;
}

.analysis-card {
    position: relative;
    display: grid;
    gap: 16px;
    min-height: 176px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.analysis-card-compact {
    min-height: 150px;
    padding: 18px;
    gap: 12px;
}

.analysis-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.analysis-card.is-selected {
    border-color: rgba(141, 160, 181, 0.5);
    background:
        linear-gradient(180deg, rgba(141, 160, 181, 0.14), rgba(141, 160, 181, 0.03)),
        rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 0 1px rgba(141, 160, 181, 0.16), var(--shadow-sm);
}

.analysis-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.upload-form {
    width: min(520px, 100%);
    margin: 0 auto;
}

.analysis-card-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.analysis-card-icon svg {
    width: 24px;
    height: 24px;
}

.analysis-card-copy {
    display: grid;
    gap: 10px;
}

.analysis-card-copy strong {
    color: var(--text-strong);
    font-size: 1.04rem;
}

.analysis-card-copy span {
    color: var(--text-muted);
    line-height: 1.65;
}

.collapsible-block {
    overflow: hidden;
    transform-origin: top;
    transition: max-height var(--transition-base), opacity var(--transition-base), transform var(--transition-base), margin var(--transition-base);
}

.collapsible-block.is-collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.collapsible-block:not(.is-collapsed) {
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
}

.upload-secondary-grid,
.field-grid,
.dashboard-layout,
.detail-grid,
.notes-grid,
.summary-grid {
    display: grid;
    gap: 18px;
}

.upload-secondary-grid {
    grid-template-columns: 1.1fr 1fr;
}

.field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-grid {
    align-items: start;
}

.field-block {
    display: grid;
    gap: 10px;
}

.field-block-wide {
    grid-column: 1 / -1;
}

.selection-line {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.selection-line-emphasis {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.document-count {
    font-weight: 600;
}

.dropzone-count-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 32, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.document-count-safe {
    color: var(--success);
}

.document-count-warning {
    color: var(--warning);
}

.document-count-danger {
    color: var(--danger);
}

.field-status {
    margin-top: 2px;
}

.analyze-estimate {
    text-align: center;
}

.field-help-spaced {
    margin: -2px 0 0;
}

.hint-badge {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    vertical-align: middle;
}

.field-label {
    color: var(--text-soft);
    font-size: 0.77rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

input[type="number"],
input[type="password"],
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-panel-muted);
    color: var(--text);
    font: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input[type="number"],
input[type="password"] {
    min-height: 52px;
    padding: 0 16px;
}

textarea {
    min-height: 116px;
    padding: 14px 16px;
    resize: vertical;
    line-height: 1.55;
}

input[type="number"]:focus-visible,
input[type="password"]:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: rgba(141, 160, 181, 0.5);
    box-shadow: 0 0 0 4px rgba(141, 160, 181, 0.1);
}

.input-shell {
    position: relative;
}

.input-shell input {
    padding-left: 48px;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-soft);
}

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

.dropzone {
    position: relative;
    display: grid;
    gap: 16px;
    align-content: start;
    min-height: 220px;
    padding: 24px;
    border: 1px dashed rgba(141, 160, 181, 0.3);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        var(--bg-panel-muted);
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.dropzone::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(141, 160, 181, 0.08), transparent 45%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.dropzone:hover,
.dropzone-active {
    transform: translateY(-2px);
    border-color: rgba(141, 160, 181, 0.55);
    box-shadow: var(--shadow-md);
    background: var(--bg-panel);
}

.dropzone:hover::after,
.dropzone-active::after {
    opacity: 1;
}

.dropzone-primary {
    min-height: 260px;
    justify-items: center;
    text-align: center;
    align-content: center;
}

.dropzone-primary-tight {
    min-height: 220px;
}

.dropzone-secondary {
    min-height: 190px;
}

.dropzone-secondary-tight {
    min-height: 150px;
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.dropzone-icon {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border: 1px solid rgba(141, 160, 181, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.dropzone-icon-small {
    width: 46px;
    height: 46px;
    border-radius: 14px;
}

.dropzone-body {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
}

.dropzone-title {
    color: var(--text-strong);
    font-size: 1.1rem;
    font-weight: 700;
}

.dropzone-copy,
.dropzone-meta,
.field-help,
.record-subtitle,
.empty-copy,
.metric-description,
.footer-copy p {
    line-height: 1.6;
}

.record-subtitle,
.empty-copy,
.summary-copy,
.footer-copy p,
.metric-description {
    margin: 0;
}

.dropzone-meta {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.9rem;
}

.advanced-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.advanced-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    color: var(--text-strong);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.advanced-toggle::-webkit-details-marker {
    display: none;
}

.advanced-toggle small {
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.advanced-panel[open] .advanced-toggle {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.advanced-body {
    padding: 20px;
}

.advanced-panel-compact {
    background: rgba(255, 255, 255, 0.015);
}

.status {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

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

.status-error {
    border-color: rgba(224, 114, 114, 0.28);
    background: rgba(224, 114, 114, 0.08);
}

.status-info {
    border-color: rgba(141, 160, 181, 0.2);
    background: rgba(141, 160, 181, 0.08);
}

.status-warning {
    border-color: rgba(246, 193, 119, 0.28);
    background: rgba(246, 193, 119, 0.12);
}

.key-prompt {
    justify-content: space-between;
}

.inline-actions,
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    padding-top: 2px;
}

.footer-copy {
    display: grid;
    gap: 6px;
}

.footer-copy p {
    margin: 0;
}

.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.94rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.button-primary {
    background: var(--text-strong);
    color: var(--bg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.button-primary:hover,
.button-secondary:hover {
    transform: translateY(-1px);
}

.button-secondary {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.button-primary,
.button-secondary {
    cursor: pointer;
}

.button-cta {
    min-width: 160px;
}

.sample-report-banner,
.sample-report-cta {
    justify-content: space-between;
    align-items: center;
}

.sample-report-banner-copy {
    display: grid;
    gap: 6px;
}

.button-block {
    width: 100%;
}

.progress-panel {
    gap: 20px;
}

.progress-stage {
    min-height: calc(100vh - 88px);
    align-content: center;
}

.progress-header {
    display: grid;
    gap: 8px;
}

.progress-stack {
    display: grid;
    gap: 12px;
}

.progress-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.progress-icon {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.22);
}

.progress-icon.status-pending {
    background: rgba(148, 163, 184, 0.08);
}

.progress-icon.status-active {
    border-color: rgba(141, 160, 181, 0.25);
}

.progress-icon.status-active::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid transparent;
    border-top-color: var(--text-strong);
    border-radius: inherit;
    animation: spin 0.9s linear infinite;
}

.progress-icon.status-completed {
    border-color: rgba(63, 183, 134, 0.3);
    background: rgba(63, 183, 134, 0.12);
}

.progress-icon.status-completed::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border-right: 2px solid var(--success);
    border-bottom: 2px solid var(--success);
    transform: rotate(45deg);
}

.progress-icon.status-error {
    border-color: rgba(224, 114, 114, 0.3);
    background: rgba(224, 114, 114, 0.12);
}

.progress-icon.status-error::before,
.progress-icon.status-error::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 2px;
    height: 10px;
    background: var(--danger);
}

.progress-icon.status-error::before {
    transform: rotate(45deg);
}

.progress-icon.status-error::after {
    transform: rotate(-45deg);
}

.progress-copy {
    display: grid;
    gap: 4px;
}

.progress-copy strong {
    color: var(--text-strong);
}

.progress-copy span {
    color: var(--text-muted);
    line-height: 1.55;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(5, 9, 14, 0.7);
    backdrop-filter: blur(6px);
}

.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 40;
    width: min(560px, calc(100vw - 32px));
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
        var(--bg-panel);
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, -50%);
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.settings-copy {
    margin: 10px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.settings-form {
    display: grid;
    gap: 20px;
}

.menu-dropdown {
    position: relative;
}

.menu-dropdown > summary {
    list-style: none;
}

.menu-dropdown > summary::-webkit-details-marker {
    display: none;
}

.menu-dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 20;
    display: grid;
    gap: 6px;
    min-width: 190px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-panel);
    box-shadow: var(--shadow-md);
}

.menu-dropdown:not([open]) .menu-dropdown-panel {
    display: none;
}

.menu-dropdown-panel form {
    margin: 0;
}

.menu-dropdown-action {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.menu-dropdown-action:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-strong);
}

.health-overview-panel {
    padding: 24px 26px;
}

.health-overview-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.health-gauge-card {
    padding: 22px;
    gap: 16px;
}

.health-gauge-copy {
    display: grid;
    gap: 8px;
}

.health-gauge-copy strong {
    color: var(--text-strong);
}

.health-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.health-metric-card {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    min-height: 120px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.health-metric-card .summary-label {
    display: block;
    line-height: 1.5;
}

.health-metric-value {
    color: var(--text-strong);
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.health-metric-note {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.health-metric-note.is-danger {
    color: var(--danger);
}

.findings-panel {
    display: grid;
    gap: 14px;
}

.section-label {
    margin: 0 6px;
    color: var(--text-soft);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.findings-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dashboard-panel {
    padding: 30px;
}

.dashboard-layout {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: stretch;
}

.gauge-card {
    display: grid;
    align-content: start;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.02);
}

.gauge-ring,
.severity-red,
.severity-orange,
.severity-green,
.severity-neutral {
    --tone: var(--accent);
    --tone-soft: var(--accent-soft);
}

.severity-red {
    --tone: var(--danger);
    --tone-soft: var(--danger-soft);
}

.severity-orange {
    --tone: var(--warning);
    --tone-soft: var(--warning-soft);
}

.severity-green {
    --tone: var(--success);
    --tone-soft: var(--success-soft);
}

.gauge-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 232px);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--tone) calc(var(--gauge-value) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.gauge-ring::after {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 50%;
    background: var(--bg-panel);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

.gauge-ring-inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.metric-kicker {
    color: var(--text-soft);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.gauge-value {
    color: var(--text-strong);
    font-size: clamp(3rem, 7vw, 4.7rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
}

.metric-caption {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.gauge-details {
    display: grid;
    gap: 10px;
}

.metric-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-panel-muted);
}

.metric-inline span {
    color: var(--text-muted);
}

.metric-inline strong {
    color: var(--text-strong);
    font-size: 1.05rem;
}

.dashboard-content {
    display: grid;
    gap: 20px;
}

.dimension-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.dimension-card,
.summary-card,
.detail-card,
.record-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.dimension-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    min-width: 0;
}

.dimension-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}

.dimension-head .summary-label {
    flex: 1 1 120px;
    min-width: 0;
    line-height: 1.45;
}

.dimension-head strong {
    flex: 0 0 auto;
    color: var(--text-strong);
    font-size: 1.05rem;
    white-space: nowrap;
}

.dimension-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.dimension-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tone);
}

.dashboard-summary-grid,
.metadata-summary-grid,
.summary-grid,
.detail-grid {
    display: grid;
    gap: 16px;
}

.dashboard-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metadata-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-card {
    padding: 18px;
    min-width: 0;
}

.summary-card .summary-label {
    display: block;
    line-height: 1.5;
}

.summary-card strong {
    display: block;
    margin-top: 10px;
    color: var(--text-strong);
    font-size: 1.65rem;
    line-height: 1.1;
}

.summary-card strong.summary-copy {
    font-size: 1rem;
    line-height: 1.5;
}

.overview-panel {
    display: grid;
    gap: 18px;
}

.overview-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px 80px;
    gap: 14px;
    padding: 0 16px;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.overview-list {
    display: grid;
    gap: 12px;
}

.overview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.overview-row:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.overview-row:focus-visible,
.section-toggle:focus-visible,
.finding-summary:focus-visible,
.button-primary:focus-visible,
.button-secondary:focus-visible {
    outline: 2px solid rgba(141, 160, 181, 0.6);
    outline-offset: 2px;
}

.overview-primary {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.overview-indicator {
    display: inline-flex;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--tone);
}

.overview-copy {
    display: grid;
    gap: 4px;
}

.overview-copy strong {
    color: var(--text-strong);
    font-size: 1rem;
}

.overview-meta {
    justify-self: start;
}

.report-section-panel {
    padding: 0;
    overflow: hidden;
}

.report-section-panel[open],
.finding-card[open] {
    box-shadow: var(--shadow-md);
}

.section-toggle,
.finding-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 24px;
    cursor: pointer;
    list-style: none;
    transition: background var(--transition-fast);
}

.section-toggle:hover,
.finding-summary:hover {
    background: rgba(255, 255, 255, 0.02);
}

.section-toggle::-webkit-details-marker,
.finding-summary::-webkit-details-marker {
    display: none;
}

.section-toggle {
    position: relative;
    padding-right: 72px;
}

.section-toggle::after {
    content: "";
    position: absolute;
    top: 29px;
    right: 28px;
    width: 11px;
    height: 11px;
    border-right: 2px solid var(--text-soft);
    border-bottom: 2px solid var(--text-soft);
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
}

.report-section-panel[open] > .section-toggle::after {
    transform: rotate(-135deg);
}

.report-section-panel[open] > .section-toggle {
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.section-toggle-copy,
.finding-summary-copy {
    display: grid;
    gap: 8px;
}

.section-kicker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.finding-kicker {
    margin: 0;
    color: var(--tone);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header-badges,
.record-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.section-panel-body,
.finding-body {
    display: grid;
    gap: 18px;
}

.section-panel-body {
    padding: 24px;
}

.finding-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)),
        var(--bg-panel-muted);
    overflow: hidden;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.finding-card[open] {
    border-color: rgba(148, 163, 184, 0.24);
}

.finding-card[open] .finding-body,
.report-section-panel[open] > .section-panel-body {
    animation: panel-reveal 220ms ease;
}

.finding-body {
    padding: 0 24px 24px;
}

.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-card,
.note-card {
    padding: 18px;
}

.detail-card h4 {
    margin-bottom: 10px;
}

.finding-text-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.compare-card {
    min-width: 0;
}

.record-card {
    padding: 22px;
}

.record-header,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.record-header {
    margin-bottom: 18px;
}

.metadata-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.metadata-list div {
    display: grid;
    gap: 4px;
}

.metadata-list dt {
    color: var(--text-soft);
    font-size: 0.73rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.metadata-list dd {
    margin: 0;
    color: var(--text);
    word-break: break-word;
}

.text-block {
    display: grid;
    gap: 12px;
}

pre {
    margin: 0;
    max-height: 460px;
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    background: var(--bg-code);
    color: #d9e3ee;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.86rem;
    line-height: 1.72;
    white-space: pre-wrap;
    word-break: break-word;
}

.analysis-footer {
    margin-top: 8px;
}

.panel-subheader {
    margin-top: 12px;
    margin-bottom: 0;
}

.appendix-panel .finding-card,
.export-panel {
    background: rgba(255, 255, 255, 0.015);
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.export-actions form {
    margin: 0;
}

.finding-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: var(--text);
}

.summary-card-wide {
    grid-column: span 1;
}

.severity-red,
.severity-high,
.severity-exact {
    border-color: rgba(224, 114, 114, 0.25);
}

.severity-orange,
.severity-medium,
.severity-near {
    border-color: rgba(217, 163, 84, 0.25);
}

.severity-green,
.severity-low {
    border-color: rgba(63, 183, 134, 0.22);
}

.severity-red .finding-kicker,
.severity-high .finding-kicker,
.severity-exact .finding-kicker {
    color: var(--danger);
}

.severity-orange .finding-kicker,
.severity-medium .finding-kicker,
.severity-near .finding-kicker {
    color: var(--warning);
}

.severity-green .finding-kicker,
.severity-low .finding-kicker {
    color: var(--success);
}

.severity-red .overview-indicator {
    background: var(--danger);
}

.severity-orange .overview-indicator {
    background: var(--warning);
}

.severity-green .overview-indicator {
    background: var(--success);
}

.severity-neutral .overview-indicator {
    background: var(--accent);
}

.severity-red .dimension-bar span,
.severity-red .gauge-ring,
.severity-high .dimension-bar span {
    background-color: var(--danger);
}

.severity-orange .dimension-bar span,
.severity-orange .gauge-ring,
.severity-medium .dimension-bar span {
    background-color: var(--warning);
}

.severity-green .dimension-bar span,
.severity-green .gauge-ring,
.severity-low .dimension-bar span {
    background-color: var(--success);
}

.severity-red.summary-card,
.severity-orange.summary-card,
.severity-green.summary-card {
    background: rgba(255, 255, 255, 0.02);
}

@keyframes panel-reveal {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 1180px) {
    .dashboard-layout,
    .upload-secondary-grid {
        grid-template-columns: 1fr;
    }

    .health-overview-layout {
        grid-template-columns: 1fr;
    }

    .health-card-grid,
    .metadata-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .app-header,
    .form-footer,
    .panel-header,
    .record-header,
    .section-heading,
    .section-toggle,
    .finding-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .field-grid,
    .detail-grid,
    .finding-text-grid,
    .metadata-summary-grid,
    .sample-card-grid,
    .analysis-card-grid,
    .analysis-card-grid-compact,
    .health-card-grid {
        grid-template-columns: 1fr;
    }

    .overview-table-head {
        display: none;
    }

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

    .header-actions {
        width: 100%;
    }

    .header-actions .button-secondary,
    .key-prompt,
    .sample-report-banner,
    .sample-report-cta,
    .inline-actions,
    .settings-actions,
    .step-heading,
    .advanced-toggle,
    .settings-modal-header,
    .topbar,
    .topbar-brand-row,
    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .header-badges,
    .record-chip-group {
        justify-content: flex-start;
    }

    .page-upload-focused,
    .progress-stage {
        min-height: auto;
    }

    .upload-shell,
    .progress-shell {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .shell {
        padding: 18px 14px 40px;
    }

    .shell-app {
        padding: 0;
    }

    .app-frame {
        width: min(100%, calc(100% - 24px));
        padding-bottom: 28px;
    }

    .upload-panel,
    .report-panel {
        padding: 20px;
    }

    .upload-form-stage {
        padding: 20px;
    }

    .dropzone,
    .dropzone-primary,
    .dropzone-secondary {
        min-height: 0;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .wizard-step,
    .settings-modal {
        padding: 18px;
    }

    .analysis-card {
        min-height: 0;
    }

    .sample-card {
        min-height: 0;
    }

    .topbar-meta {
        letter-spacing: 0.04em;
    }

    .gauge-ring {
        width: 200px;
    }

    .brand-logo {
        height: 32px;
        transform: scale(1.06);
    }
}
