:root {
    color-scheme: dark;
    --bg: #101012;
    --sidebar: #111113;
    --surface: #171719;
    --surface-strong: #1d1d20;
    --border: #2b2b2f;
    --border-strong: #3a3a40;
    --text: #f5f4f4;
    --muted: #aaaaaf;
    --subtle: #86868e;
    --red: #f15459;
    --action: #cb252d;
    --action-hover: #b9242b;
    --green: #80d6a9;
    --amber: #edbd7a;
    --radius: 13px;
    --display: "Inter", "Aptos", "Helvetica Neue", system-ui, sans-serif;
    --body: "Inter", "Aptos", "Helvetica Neue", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding: 1rem; }
body { margin: 0; color: var(--text); background: var(--bg); font: 400 .925rem/1.55 var(--body); }
a { color: inherit; text-decoration: none; }
button, input, select { color: inherit; font: inherit; }
button, select, summary { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.14; }
.icon { display: inline-block; flex: none; vertical-align: middle; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.skip-link:focus { position: fixed; z-index: 5; top: .75rem; left: .75rem; padding: .65rem 1rem; border-radius: 6px; background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid #ff7e82; outline-offset: 4px; }

.workspace { display: grid; grid-template-columns: 234px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 30px 17px 18px; background: var(--sidebar); border-right: 1px solid #252529; }
.brand { display: block; align-self: flex-start; margin: 1px 0 38px 7px; }
.brand img { display: block; width: 166px; height: auto; object-fit: contain; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: .865rem; font-weight: 560; }
.nav-link:hover { background: var(--surface-strong); color: var(--text); }
.nav-link.is-active { border-color: #47282d; color: var(--text); background: #281b1f; }
.nav-link.is-active::before { content: ""; position: absolute; inset: 8px auto 8px 0; width: 2px; border-radius: 4px; background: var(--red); }
.nav-link.is-active .icon { color: var(--red); }
.sidebar-account { margin-top: auto; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 17px 1px 0; border-top: 1px solid #29292c; }
.sidebar-account form { margin-left: auto; }
.avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; color: #ff9395; background: #332024; border: 1px solid #47282d; border-radius: 50%; font-weight: 720; font-size: .81rem; }
.account-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 550; }
.icon-button { display: grid; place-items: center; width: 35px; height: 35px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--muted); }
.icon-button:hover { border-color: var(--border); background: var(--surface-strong); color: var(--text); }
.content-frame { width: min(100%, 1390px); margin: 0 auto; padding-inline: clamp(22px, 3.4vw, 54px); }
.topbar { border-bottom: 1px solid #252529; }
.topbar-content { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 63px; }
.breadcrumb { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--muted); font-size: .82rem; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb strong { color: var(--text); font-weight: 570; }
.breadcrumb-separator { color: var(--subtle); }
.private-label { display: inline-flex; flex: none; align-items: center; gap: 6px; color: var(--muted); font-size: .79rem; }
.private-label .icon { color: var(--subtle); }
.page { padding-top: 28px; padding-bottom: 44px; }

.hero { position: relative; display: flex; align-items: center; min-height: clamp(260px, 27vw, 365px); isolation: isolate; overflow: hidden; margin-bottom: 22px; padding: clamp(27px, 4vw, 55px); border: 1px solid #323036; border-radius: var(--radius); background-color: #161517; }
.hero-image, .hero-shade { position: absolute; z-index: -1; inset: 0; }
.hero-image { left: 22%; background: url("asd-workshop.jpg") center 47% / cover no-repeat; }
.hero-shade {
    background: linear-gradient(90deg, #171517 1%, #161517 20%, rgba(20,18,21,.95) 29%, rgba(20,18,21,.71) 47%, rgba(20,18,21,.13) 78%, rgba(20,18,21,.05)),
        linear-gradient(0deg, rgba(12,10,12,.28), transparent 45%);
}
.hero-content { max-width: 690px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #f1e8e9; font-size: .71rem; font-weight: 740; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow > span { width: 19px; height: 2px; background: var(--red); }
.hero h1 { margin-top: 13px; font-size: clamp(2.05rem, 4.45vw, 4.58rem); font-weight: 780; letter-spacing: -.068em; line-height: 1.02; }
.hero p { max-width: 340px; margin-top: 15px; color: #d3ced0; font-size: clamp(.9rem, 1.24vw, 1.05rem); }
.hero-action { display: inline-flex; align-items: center; gap: 10px; margin-top: 21px; padding-bottom: 2px; border-bottom: 1px solid #e56166; color: #ff777b; font-weight: 680; font-size: .89rem; }
.hero-action:hover { color: #ffaeae; border-color: #ffaeae; }
.hero-action .icon { transform: rotate(90deg); }

.dashboard-grid, .job-grid { display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.upload-panel, .flow-panel, .job-panel { padding: clamp(18px, 2vw, 24px); }
.panel-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 19px; }
.panel-heading h2, .flow-panel h2 { font-size: 1.17rem; font-weight: 720; letter-spacing: -.027em; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: .82rem; }
.section-icon { display: grid; place-items: center; flex-shrink: 0; width: 39px; height: 39px; border: 1px solid #37373c; border-radius: 8px; background: #242427; color: #cacace; }
.section-icon--red { color: #ff7277; background: #312024; border-color: #502b31; }
.files-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.file-field { display: grid; grid-template-columns: 31px minmax(0, 1fr); align-content: start; align-items: center; gap: 5px 8px; min-width: 0; padding: 12px 11px; border: 1px dashed var(--border-strong); border-radius: 9px; background: #141416; cursor: pointer; }
.file-field:hover, .file-field:focus-within { border-color: #a75055; }
.file-field.has-file { border-color: #826347; border-style: solid; }
.file-icon { display: grid; place-items: center; width: 31px; height: 31px; color: #f17175; }
.file-caption { display: grid; min-width: 0; }
.file-caption strong { font-size: .86rem; font-weight: 650; overflow-wrap: anywhere; }
.file-caption small { font-size: .72rem; color: var(--muted); }
.file-input { grid-column: 1 / -1; display: block; width: 100%; min-width: 0; margin: 3px 0 1px; color: var(--muted); font-size: .73rem; cursor: pointer; }
.file-input::file-selector-button { margin-right: 6px; padding: 5px 7px; border: 1px solid var(--border-strong); border-radius: 5px; background: #232326; color: var(--text); font: 610 .71rem/1.2 var(--body); cursor: pointer; }
.file-input:hover::file-selector-button { border-color: #78787e; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 41px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; font-size: .83rem; line-height: 1.3; text-align: center; font-weight: 680; cursor: pointer; }
.button--primary { background: var(--action); color: #fff; box-shadow: 0 5px 16px rgba(107,9,15,.18); }
.button--primary:hover { background: var(--action-hover); }
.button--secondary { background: #232326; border-color: var(--border-strong); color: var(--text); }
.button--secondary:hover { border-color: #74747b; background: #2b2b30; }
.process-list { display: grid; margin: 10px 0 0; padding: 0; list-style: none; }
.process-list li { display: flex; align-items: center; gap: 10px; padding-block: 9px; }
.process-list li + li { border-top: 1px solid var(--border); }
.process-list .section-icon { width: 33px; height: 33px; border-radius: 7px; }
.process-list strong, .process-list small { display: block; }
.process-list strong { font-size: .84rem; font-weight: 650; }
.process-list small { color: var(--muted); font-size: .76rem; }

.history-heading { padding: 21px clamp(18px, 2vw, 24px) 0; }
.table-scroll { overflow-x: auto; scrollbar-width: thin; border-radius: 0 0 var(--radius) var(--radius); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; color: var(--text); font-size: .84rem; }
.data-table thead { background: #1c1c1f; }
.data-table thead th { padding: 10px 15px; color: var(--muted); font-weight: 600; text-wrap: nowrap; }
.data-table tbody td, .data-table tbody th { padding: 12px 15px; border-top: 1px solid var(--border); }
.data-table :is(td, th):first-child { padding-left: clamp(18px, 2vw, 24px); }
.data-table :is(td, th):last-child { padding-right: clamp(18px, 2vw, 24px); }
.data-table tbody tr:hover { background: #1a1a1d; }
.file-cell { max-width: 450px; min-width: 156px; }
.record-name { display: flex; align-items: flex-start; gap: 8px; color: var(--text); font-weight: 620; overflow-wrap: anywhere; }
.record-name .icon { margin-top: 2px; color: var(--subtle); }
.record-meta { margin: 3px 0 0 25px; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.date-cell { color: var(--muted); text-wrap: nowrap; font-variant-numeric: tabular-nums; }
.table-action { text-align: right; white-space: nowrap; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: #ff8588; font-size: .84rem; font-weight: 650; }
.text-link:hover { color: #ffb3b6; text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid #424248; border-radius: 999px; color: #d3d3d7; background: #242427; font-size: .72rem; font-weight: 620; white-space: nowrap; }
.status > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--good { border-color: #29443a; color: var(--green); background: #1a2b25; }
.status--wait { border-color: #55412b; color: var(--amber); background: #30261e; }
.status--bad { border-color: #62363a; color: #ff9c9c; background: #382327; }
.empty-state { display: flex; align-items: center; gap: 13px; min-height: 86px; padding: 13px clamp(18px, 2vw, 24px) 17px; border-top: 1px solid var(--border); }
.empty-state strong { font-size: .9rem; }
.empty-state p { color: var(--muted); font-size: .8rem; }

.notice { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 13px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: #232326; color: #e2e1e2; font-size: .85rem; overflow-wrap: anywhere; }
.notice .icon { margin-top: 2px; }
.notice--warning { background: #30261e; border-color: #55412b; color: #f6cf9b; }
.notice--error { background: #382327; border-color: #62363a; color: #ffafaf; }
.notice--success { background: #1a2b25; border-color: #29443a; color: #b5edcc; }
.notice:last-child { margin-bottom: 0; }
.job-heading { margin: 1px 0 20px; }
.back-link { margin-bottom: 16px; color: var(--muted); }
.job-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; }
.job-heading-row > div { min-width: 0; }
.job-heading-row .status { margin-top: 20px; }
.job-heading h1 { margin-top: 7px; font-size: clamp(1.5rem, 3vw, 2.55rem); line-height: 1.12; font-weight: 740; letter-spacing: -.045em; overflow-wrap: anywhere; }
.job-meta { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: var(--muted); font-size: .83rem; }
.job-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.detail-list { display: grid; margin: 0; }
.detail-list div { display: grid; grid-template-columns: 123px minmax(0, 1fr); gap: 9px; padding-block: 7px; border-top: 1px solid var(--border); font-size: .81rem; }
.detail-list dt, .detail-notes { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 560; overflow-wrap: anywhere; }
.detail-disclosure { margin-top: 10px; color: var(--muted); font-size: .82rem; }
.detail-disclosure summary { width: fit-content; color: #e1dbdc; }
.detail-list--nested { margin-top: 8px; }
.detail-notes { padding-left: 19px; overflow-wrap: anywhere; }
.job-panel { margin-bottom: 20px; }
.job-grid .job-panel { margin-bottom: 0; }
.analysis-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.analysis-fields fieldset { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.analysis-fields legend { padding: 0 4px; font-size: .83rem; font-weight: 630; }
.analysis-fields legend span { color: var(--muted); font-size: .72rem; font-weight: 450; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.text-field { display: grid; align-content: start; min-width: 0; gap: 5px; font-size: .83rem; }
.text-field > span { color: #dddce0; font-weight: 560; }
.text-field input, .text-field select { width: 100%; min-width: 0; min-height: 38px; padding: 6px 8px; border: 1px solid #404047; border-radius: 6px; background: #111113; }
.text-field input:focus, .text-field select:focus { border-color: #e56b71; }
.text-field input::-webkit-inner-spin-button { opacity: 0; }
.text-field input:hover::-webkit-inner-spin-button, .text-field input:focus::-webkit-inner-spin-button { opacity: 1; }
.confirmation { display: grid; gap: 12px; margin-bottom: 16px; padding: 12px; border: 1px solid #55412b; border-radius: 8px; background: #2b241d; }
.confirmation .text-field { max-width: 580px; }
.run-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.check-field { display: inline-flex; align-items: flex-start; gap: 8px; font-size: .84rem; cursor: pointer; }
.check-field input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--action); }
.check-field strong, .check-field small { display: block; }
.check-field small { color: var(--muted); font-size: .75rem; }
.section-heading-split { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 7px 13px; margin-bottom: 15px; }
.section-heading-split .panel-heading { margin-bottom: 0; }
.download-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.metric-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0 0 15px; }
.metric-list div { padding: 10px 11px; border: 1px solid var(--border); border-radius: 7px; background: #141416; }
.metric-list dt { color: var(--muted); font-size: .79rem; }
.metric-list dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.peak-note { margin: 0 0 15px; color: var(--muted); font-size: .84rem; }
.peak-note strong { color: var(--text); }
.result-panel .table-scroll { border: 1px solid var(--border); border-radius: 8px; }
.result-table { min-width: 330px; }
.result-table tbody th { font-weight: 560; }
.result-table :is(td, th):not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.login-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr); min-height: 100vh; min-height: 100svh; }
.login-image { background:
    linear-gradient(90deg, rgba(12,11,13,.12), transparent 52%, rgba(12,11,13,.4)),
    linear-gradient(0deg, rgba(12,11,13,.49), transparent 48%),
    url("asd-workshop.jpg") 43% center / cover no-repeat;
}
.login-side { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 36px; padding: clamp(28px, 4vw, 65px); border-left: 1px solid #2c292c; background: radial-gradient(circle at 100% 0%, rgba(86,25,32,.2), transparent 52%), #111113; }
.login-brand { display: block; width: 175px; height: auto; }
.login-card { width: 100%; max-width: 410px; margin-inline: auto; }
.login-mark { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 20px; color: #ff8185; background: #321d23; border: 1px solid #5d2f38; border-radius: 10px; }
.login-card h1 { font-size: clamp(2.1rem, 4vw, 3.36rem); font-weight: 760; letter-spacing: -.058em; }
.login-card p { margin-top: 6px; color: var(--muted); }
.login-card .notice { margin-top: 15px; margin-bottom: 0; }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form .text-field input { min-height: 45px; padding-inline: 11px; background: #19191b; }
.login-form .button { justify-content: space-between; min-height: 46px; margin-top: 3px; padding-inline: 12px; }
.login-footer { color: var(--subtle); font-size: .78rem; }

@media (max-width: 1160px) {
    .workspace { grid-template-columns: 199px minmax(0, 1fr); }
    .sidebar { padding-inline: 13px; }
    .brand img { width: 150px; }
    .analysis-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .dashboard-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
    .job-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
}

@media (max-width: 790px) {
    .workspace { display: block; }
    .sidebar { position: static; height: auto; min-height: 62px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px clamp(12px, 3vw, 24px); border-right: 0; border-bottom: 1px solid #252529; }
    .brand { align-self: center; margin: 0; }
    .brand img { width: clamp(101px, 19vw, 145px); }
    .sidebar-nav { display: flex; align-items: center; gap: 3px; }
    .nav-link { min-height: 37px; padding: 5px 8px; gap: 5px; font-size: .78rem; }
    .nav-link .icon { width: 15px; height: 15px; }
    .sidebar-account { margin: 0; padding: 0; border: 0; }
    .sidebar-account .avatar, .account-name { display: none; }
    .topbar-content { min-height: 50px; }
    .content-frame { padding-inline: clamp(13px, 4vw, 27px); }
    .page { padding-top: 18px; }
    .hero { min-height: 245px; margin-bottom: 14px; }
    .hero h1 { font-size: clamp(1.85rem, 6.6vw, 3.3rem); }
    .dashboard-grid { gap: 14px; margin-bottom: 14px; }
    .login-layout { grid-template-columns: minmax(0, .85fr) minmax(340px, 1.15fr); }
}

@media (max-width: 580px) {
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .hero-image { left: 0; background-position: 62% center; }
    .hero-shade { background: linear-gradient(90deg, rgba(14,12,15,.96), rgba(14,12,15,.65) 58%, rgba(14,12,15,.22)); }
    .hero { padding: 20px; }
    .hero h1 { overflow-wrap: anywhere; }
    .history-heading { margin-bottom: 13px; }
    .job-heading-row { flex-wrap: wrap; }
    .job-heading-row .status { margin-top: 0; }
    .login-layout { grid-template-columns: minmax(0, 1fr); }
    .login-image { min-height: clamp(150px, 37vw, 245px); background-position: center 48%; }
    .login-side { gap: 26px; padding: 23px clamp(18px, 5vw, 35px); border-top: 1px solid #2c292c; border-left: 0; }
    .login-brand { width: 138px; }
}

@media (max-width: 380px) {
    .nav-link .icon { display: none; }
    .sidebar { gap: 4px; }
    .nav-link { padding-inline: 6px; }
    .analysis-fields { grid-template-columns: minmax(0, 1fr); }
    .run-actions { align-items: stretch; flex-direction: column; }
    .files-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-list div { grid-template-columns: 90px minmax(0, 1fr); }
}
