:root {
    --bg: #f5f7fb;
    --ink: #0f172a;
    --muted: #4b5563;
    --surface: #ffffff;
    --line: #dde4ee;
    --brand-blue-deep: #1f4d76;
    --brand-blue: #2f8fc8;
    --brand-teal: #2ea090;
    --brand-green: #70b649;
    --brand: #2f8fc8;
    --brand-strong: #1f4d76;
    --accent: #2ea090;
    --brand-gradient: linear-gradient(135deg, var(--brand-blue-deep) 0%, var(--brand-blue) 52%, var(--brand-green) 100%);
    --brand-gradient-strong: linear-gradient(135deg, #173c5d 0%, #2d78b2 52%, #5ea73d 100%);
    --ok: #0f9f6d;
    --error: #b42318;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 34px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body,
#root {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Outfit", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 12% 8%, #e3efff 0%, transparent 36%),
        radial-gradient(circle at 88% 90%, #d7f7f4 0%, transparent 32%),
        var(--bg);
}

.app-bg {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ambient {
    position: fixed;
    z-index: -1;
    filter: blur(30px);
    opacity: 0.28;
    pointer-events: none;
}

.ambient-a {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, #74b3df 0%, var(--brand-blue) 72%);
    top: -100px;
    left: -80px;
}

.ambient-b {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, #86d8ce 0%, var(--brand-green) 70%);
    bottom: -90px;
    right: -70px;
}

.topbar {
    width: calc(100% - 24px);
    margin: 14px 12px 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #cfdaea;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.nav-left {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.nav-subtext {
    font-size: 0.78rem;
    color: #5b6f86;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.brand-block {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.brand-logo-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-wordmark {
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
    letter-spacing: -0.01em;
    font-family: "Urbanist", sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-blue-deep);
    background-image: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-data {
    color: var(--brand-blue-deep);
}

.brand-lytics {
    color: var(--brand-green);
}

.brand-wordmark .brand-data,
.brand-wordmark .brand-lytics {
    color: inherit;
}

.top-links {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.top-links a {
    text-decoration: none;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 140ms ease, color 140ms ease;
}

.top-links a:hover {
    border-color: #cfe0f0;
    background: #eef7ff;
    color: var(--brand-blue-deep);
}

.nav-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-chip {
    display: inline-block;
    border: 1px solid #c8dff2;
    background: #edf7ff;
    color: var(--brand-blue-deep);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.84rem;
    border-radius: 10px;
    padding: 9px 12px;
    background: var(--brand-gradient);
}

.shell {
    width: calc(100% - 24px);
    margin: 0 12px;
    display: grid;
    gap: 14px;
    flex: 1;
}

.pipeline-form {
    display: grid;
    gap: 14px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.hero {
    background: linear-gradient(135deg, #132337 0%, var(--brand-blue-deep) 38%, var(--brand-blue) 68%, var(--brand-green) 100%);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.74rem;
    font-weight: 700;
    color: #c8f5f0;
}

.hero h1 {
    margin: 10px 0 10px;
    font-family: "Urbanist", sans-serif;
    font-size: clamp(1.65rem, 4vw, 2.7rem);
    line-height: 1.1;
}

.hero-copy {
    margin: 0;
    color: #e8f2ff;
    max-width: 65ch;
}

.hero-pill-row {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 14px;
    align-items: start;
}

.workspace-grid > .card {
    align-self: start;
}

.workspace-main {
    display: grid;
    gap: 14px;
    align-content: start;
}

.workspace-advanced {
    align-self: start;
}

.card h2 {
    margin: 0 0 12px;
    font-family: "Urbanist", sans-serif;
    font-size: 1.12rem;
}

.dropzone {
    border: 1.5px dashed #b6c5da;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7faff 0%, #f1f6ff 100%);
    transition: border-color 160ms ease, transform 160ms ease;
}

.dropzone-active {
    border-color: var(--brand);
    transform: translateY(-1px);
}

.dropzone input {
    display: none;
}

.dropzone-label {
    display: grid;
    gap: 3px;
    padding: 16px;
    cursor: pointer;
}

.drop-title {
    font-weight: 700;
    color: #0f172a;
}

.drop-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
}

.drop-file {
    margin-top: 2px;
    font-size: 0.86rem;
    color: var(--brand-blue-deep);
    font-weight: 600;
}

.stack {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.advanced-block {
    border: 1px solid #d9e3f1;
    border-radius: 12px;
    padding: 10px;
    background: #fafcff;
}

.advanced-block + .advanced-block {
    margin-top: 10px;
}

.advanced-block h3 {
    margin: 0;
    font-size: 0.92rem;
    font-family: "Urbanist", sans-serif;
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field {
    display: grid;
    gap: 6px;
}

.field-label {
    font-size: 0.79rem;
    font-weight: 700;
    color: #5f6b7e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

select,
input[type="number"] {
    width: 100%;
    border: 1px solid #c7d4e6;
    border-radius: 10px;
    padding: 10px 11px;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
}

select:disabled,
input[type="number"]:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.toggle-row {
    border: 1px solid #d5deec;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.93rem;
    font-weight: 500;
    background: #f9fbff;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}

details {
    border: 1px solid #d9e3f1;
    border-radius: 12px;
    padding: 10px;
    background: #fafcff;
}

details + details {
    margin-top: 10px;
}

summary {
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    font-size: 0.94rem;
    color: #0f172a;
}

summary::-webkit-details-marker {
    display: none;
}

.detail-stack {
    margin-top: 10px;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.workspace-action-bar {
    grid-column: 1 / -1;
    width: 100%;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: var(--brand-gradient);
    box-shadow: 0 10px 22px rgba(31, 77, 118, 0.24);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(31, 77, 118, 0.3);
}

button:disabled {
    opacity: 0.72;
    cursor: wait;
}

.button-secondary {
    background: linear-gradient(130deg, #374151 0%, #4b5563 100%);
    box-shadow: 0 10px 20px rgba(55, 65, 81, 0.2);
}

.status {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--muted);
}

.status-error {
    color: var(--error);
}

.status-ok {
    color: var(--ok);
}

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

.full {
    grid-column: 1 / -1;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.metric {
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 9px;
    background: #f9fbff;
}

.metric-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.metric-value {
    display: block;
    margin-top: 4px;
    font-weight: 700;
    font-size: 1.02rem;
}

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

.quality-item {
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 10px;
    background: #f9fbff;
}

.quality-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quality-value {
    display: block;
    margin-top: 4px;
    font-weight: 700;
    font-size: 0.98rem;
    color: #0f172a;
}

.accuracy-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.accuracy-score {
    margin: 0;
    font-family: "Urbanist", sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: #0f172a;
}

.accuracy-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.accuracy-item {
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 9px 10px;
    background: #f9fbff;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
}

.accuracy-pass {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.accuracy-fail {
    border-color: #fecaca;
    background: #fff1f2;
}

.accuracy-warn {
    border-color: #fde68a;
    background: #fffbeb;
}

.accuracy-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #0f172a;
    background: #e2e8f0;
}

.log-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #d9e3f1;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    text-align: left;
    padding: 9px;
    border-bottom: 1px solid #e4ecf6;
    white-space: nowrap;
}

thead {
    background: #f4f8ff;
}

tbody tr:nth-child(even) {
    background: #fbfdff;
}

.download-link {
    display: inline-block;
    margin-top: 4px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--brand-gradient-strong);
    box-shadow: 0 10px 22px rgba(31, 77, 118, 0.28);
}

pre {
    margin: 0;
    max-height: 300px;
    overflow: auto;
    border: 1px solid #d9e3f1;
    border-radius: 10px;
    background: #f9fbff;
    padding: 10px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.chart {
    width: 100%;
    border: 1px solid #d9e3f1;
    border-radius: 10px;
    background: #fff;
}

.muted {
    margin: 0;
    color: var(--muted);
}

.empty-state p {
    margin: 0;
}

.site-footer {
    width: calc(100% - 24px);
    margin: 16px 12px 22px;
    padding-top: 14px;
    border-top: 1px solid #d8e1ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-main {
    display: grid;
    gap: 4px;
}

.footer-brand {
    margin: 0;
    font-family: "Urbanist", sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.footer-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-maker {
    display: inline-block;
    margin-top: 6px;
    text-decoration: none;
    color: var(--brand-blue);
    font-size: 0.84rem;
    font-weight: 700;
}

.footer-maker:hover {
    text-decoration: underline;
}

.footer-links {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
}

.footer-links span,
.footer-links a {
    display: inline-block;
    border: 1px solid #ccd8e9;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.78rem;
    background: #fff;
    color: #334155;
    text-decoration: none;
}

.footer-links a:hover {
    background: #eef4ff;
}

/* Auxiliary pages */
.aux-page {
    margin: 0;
    min-height: 100vh;
}

.aux-bg {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 10% 10%, #e4efff 0%, transparent 34%),
        radial-gradient(circle at 86% 90%, #d9f8f3 0%, transparent 34%),
        var(--bg);
}

.aux-topbar {
    width: min(1060px, 92vw);
    margin: 22px auto 12px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #cfdaea;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aux-shell {
    width: min(1060px, 92vw);
    margin: 0 auto;
    display: grid;
    gap: 14px;
    flex: 1;
}

.aux-hero {
    border: 1px solid #d4deef;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #132337 0%, var(--brand-blue-deep) 42%, var(--brand-blue) 70%, var(--brand-green) 100%);
    color: #fff;
    padding: clamp(18px, 4vw, 28px);
    box-shadow: var(--shadow-md);
}

.aux-hero h1 {
    margin: 10px 0;
    font-family: "Urbanist", sans-serif;
    line-height: 1.1;
    font-size: clamp(1.55rem, 4vw, 2.4rem);
    max-width: 22ch;
}

.aux-hero p {
    margin: 0;
    max-width: 72ch;
    color: #e8f2ff;
}

.aux-hero-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-link {
    display: inline-flex;
    text-decoration: none;
    border-radius: 999px;
    padding: 9px 13px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
    background: linear-gradient(130deg, #dbeafe 0%, #bfdbfe 100%);
}

.hero-link-secondary {
    color: #fff;
    background: var(--brand-gradient);
}

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

.aux-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.aux-card h2 {
    margin: 0 0 8px;
    font-family: "Urbanist", sans-serif;
    font-size: 1.04rem;
}

.aux-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.aux-card code {
    border: 1px solid #d6e2f0;
    border-radius: 6px;
    padding: 1px 6px;
    background: #f7fbff;
    color: #15324f;
    font-size: 0.84em;
    font-family: Consolas, "Liberation Mono", Menlo, monospace;
}

.guide-shell {
    gap: 16px;
}

.guide-meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.guide-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.13);
    color: #eff7ff;
    font-size: 0.8rem;
    font-weight: 600;
}

.guide-chip code {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.2);
    color: #f5fbff;
}

.guide-section h2 {
    margin-bottom: 10px;
}

.guide-toc-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.guide-toc-link {
    text-decoration: none;
    border: 1px solid #d6e2f0;
    border-radius: 10px;
    padding: 9px 11px;
    background: #f8fbff;
    color: #15324f;
    font-weight: 700;
    font-size: 0.88rem;
}

.guide-toc-link:hover {
    border-color: #bdd3e8;
    background: #eef6ff;
}

.guide-steps {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px;
    color: var(--muted);
    line-height: 1.55;
}

.guide-table-wrap {
    overflow-x: auto;
    border: 1px solid #e0e8f3;
    border-radius: 12px;
}

.guide-table-wrap .aux-table {
    min-width: 640px;
}

.guide-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.guide-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 7px;
    color: var(--muted);
    line-height: 1.5;
}

.guide-code-block {
    margin: 0;
    border: 1px solid #2f4f72;
    border-radius: 12px;
    background: #0e1a2b;
    padding: 12px;
    overflow: auto;
}

.guide-code-block code {
    border: 0;
    padding: 0;
    background: transparent;
    color: #d8ebff;
    font-size: 0.82rem;
    line-height: 1.55;
    font-family: Consolas, "Liberation Mono", Menlo, monospace;
}

.guide-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.guide-note {
    border: 1px solid #d9e5f3;
    border-radius: 14px;
    background: #f8fbff;
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.guide-note h3 {
    margin: 0 0 8px;
    font-family: "Urbanist", sans-serif;
    font-size: 0.96rem;
}

.guide-note-warning {
    border-color: #efd8a9;
    background: #fff8ea;
}

.aux-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.aux-table th,
.aux-table td {
    border-bottom: 1px solid #e3eaf4;
    text-align: left;
    padding: 9px 7px;
    vertical-align: top;
}

.aux-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.aux-footer {
    width: min(1060px, 92vw);
    margin: 0 auto 22px;
    padding-top: 14px;
    border-top: 1px solid #d8e1ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aux-footer p {
    margin: 0;
    font-weight: 700;
}

.aux-footer a {
    text-decoration: none;
    color: var(--brand-blue);
    font-weight: 700;
}

.aux-footer-links {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.reveal {
    animation: fade-up 380ms ease both;
}

.reveal-delay-1 {
    animation-delay: 40ms;
}

.reveal-delay-2 {
    animation-delay: 90ms;
}

.reveal-delay-3 {
    animation-delay: 140ms;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .workspace-grid,
    .results-grid,
    .aux-grid {
        grid-template-columns: 1fr;
    }

    .advanced-grid {
        grid-template-columns: 1fr;
    }

    .quality-grid {
        grid-template-columns: 1fr;
    }

    .guide-grid-two,
    .guide-notes {
        grid-template-columns: 1fr;
    }

    .guide-table-wrap .aux-table {
        min-width: 560px;
    }
}

@media (max-width: 860px) {
    .topbar,
    .aux-topbar {
        border-radius: 14px;
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 8px;
    }

    .top-links {
        justify-content: flex-start;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
    }

    .brand-wordmark {
        font-size: 1.5rem;
    }

    .action-bar {
        align-items: flex-start;
    }

    .aux-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .site-footer {
        align-items: flex-start;
    }

    .footer-links {
        justify-content: flex-start;
    }
}
