/* Inter 4.1, SIL Open Font License 1.1. See Inter-OFL.txt. */
@font-face {
  font-family: Inter;
  src: url("inter-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #eef5ff;
  --subtle: #a9bbd1;
  --muted: #91a9c3;
  --line: #afceff2b;
  --rim: #bfdcff49;
  --field: #091426c9;
  --accent: #9ceaf3;
  --accent-strong: #c8f9ff;
  --focus: #a2f3ff;
  --glass: #101f35;
  --glass-shadow: 0 18px 48px #01071163, inset 0 1px #e5f4ff21;
  --glass-radius: 17px;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font: 14px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: #080f1c;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 75% 32%, #233866 0%, transparent 57%),
    radial-gradient(ellipse at 89% 75%, #12364b 0%, transparent 60%),
    radial-gradient(ellipse at 15% 92%, #121e37 0%, transparent 42%),
    #080f1c;
  pointer-events: none;
}
.field-scene { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
body:has(#auth-screen[hidden]) .field-scene { opacity: .36; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, p, dl, dd { margin: 0; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 730; letter-spacing: -.035em; white-space: nowrap; }
.brand-secondary { color: #becee3; font-weight: 490; }
.brand-mark {
  position: relative;
  display: inline-block;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border: 1px solid #a4dfff55;
  border-radius: 10px;
  background: linear-gradient(150deg, #90c4ed3d, #75dce014 70%);
  box-shadow: inset 0 1px #c8efff41, 0 3px 14px #020a1875;
}
.brand-mark::before { content: ""; position: absolute; inset: 10px 5px; border: 1.5px solid #9bf4fc; border-radius: 50%; transform: rotate(-39deg); }
.brand-mark::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #d5faff; box-shadow: 0 0 8px #80f0fa88; }
.portal-link, .quiet-button { color: var(--subtle); font-size: 12px; }
.portal-link { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.portal-link:hover, .quiet-button:hover { color: var(--accent-strong); }

.auth-screen { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  margin: 0 clamp(22px, 5vw, 84px);
  border-bottom: 1px solid var(--line);
}
.public-header .portal-link { min-height: 36px; padding: 6px 12px; border: 1px solid var(--rim); border-radius: 8px; background: #a4d3ef13; }
.public-header .portal-link span { color: var(--accent); }
.auth-layout {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr);
  gap: clamp(38px, 7vw, 112px);
  width: min(100%, 1400px);
  margin-inline: auto;
  padding: clamp(34px, 7vh, 92px) clamp(24px, 8vw, 120px) clamp(34px, 7vh, 92px);
}
.access, .diagnostics, .sidebar, .workspace-summary, .panel, dialog {
  background: var(--glass);
  border: 1px solid var(--rim);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}
@supports (backdrop-filter: blur(12px)) {
  .access, .diagnostics, .sidebar, .workspace-summary, .panel, dialog {
    background: var(--glass-tint, linear-gradient(140deg, #182b46c9, #0b1729b8));
    backdrop-filter: blur(var(--glass-blur, 15px));
  }
}
.access {
  --glass-tint: linear-gradient(153deg, #203450d9, #101f35cf 46%, #0a1727d5);
  width: min(100%, 430px);
  padding: clamp(24px, 3.4vw, 42px);
}
.access h1 { font-size: clamp(29px, 3.2vw, 42px); font-weight: 695; line-height: 1.15; letter-spacing: -.055em; }
.access h1 + p { margin-top: 10px; color: var(--subtle); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; margin: 27px 0 20px; background: #06112280; border: 1px solid var(--line); border-radius: 9px; }
.auth-tabs button { border: 1px solid transparent; min-height: 34px; padding: 4px 10px; border-radius: 6px; background: transparent; color: var(--subtle); font-weight: 600; }
.auth-tabs button[aria-pressed="true"] { background: #9ecfff29; border-color: var(--rim); box-shadow: inset 0 1px #e1f4ff17; color: var(--ink); }
.form-stack { display: grid; gap: 7px; }
.form-stack input + label { margin-top: 8px; }
.form-stack input + .primary-button, #account-confirm { margin-top: 15px; }
.form-stack label, .field-grid label, .field-heading { font-weight: 610; font-size: 13px; }
input:not([type="file"]), select {
  display: block;
  width: 100%;
  min-height: 45px;
  background: var(--field);
  border: 1px solid var(--rim);
  border-radius: 8px;
  padding: 8px 11px;
  transition: border-color 150ms, background-color 150ms;
}
select option { background: #101f35; color: var(--ink); }
input::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover { border-color: #b4d6ff80; }
input:focus-visible, select:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.primary-button, .secondary-button { align-items: center; display: inline-flex; justify-content: center; gap: 11px; border-radius: 8px; font-weight: 665; white-space: nowrap; }
.primary-button {
  min-height: 43px;
  padding: 8px 17px;
  border: 1px solid #d6faff;
  color: #091625;
  background: linear-gradient(155deg, #d3faff, #8ddde9 85%);
  box-shadow: inset 0 1px #fff8, 0 4px 20px #76e5f026;
}
.primary-button:hover:not(:disabled) { background: #d3faff; }
.secondary-button { min-height: 34px; padding: 5px 11px; border: 1px solid var(--rim); background: #b1d1f017; font-size: 12px; }
.secondary-button:hover:not(:disabled) { background: #a8d2ff2c; border-color: #b7dfff82; }
.quiet-button { padding: 5px 0; border: 0; background: transparent; }
.account-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px 16px; margin-top: 12px; }
.form-feedback { margin-top: 12px; padding: 7px 10px; color: #d0f5ff; background: #151f36; border-left: 2px solid #a1e7f1; font-size: 13px; overflow-wrap: anywhere; }
.form-feedback[data-tone="error"] { color: #ffd2d6; background: #3c2130; border-color: #ffa5ae; }

.diagnostics {
  --glass-tint: linear-gradient(145deg, #27486785, #122d486b 45%, #0a1c2b91);
  --glass-blur: 7px;
  min-width: 0;
  margin: 0;
  padding: clamp(19px, 2.5vw, 33px);
}
.diagnostics-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.diagnostics h2 { font-size: clamp(23px, 2.4vw, 30px); font-weight: 660; letter-spacing: -.04em; line-height: 1.25; }
.figure-kind { display: inline-block; margin-top: 5px; color: var(--subtle); font-size: 12px; }
.sample-label { color: #ccdfef; border: 1px solid var(--rim); border-radius: 5px; background: #091e3070; padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.plot-area { height: clamp(205px, 36vh, 385px); min-width: 0; margin-top: 18px; }
.plot-area canvas { display: block; width: 100%; height: 100%; }
.plot-notes { border-top: 1px solid var(--rim); display: flex; align-items: center; justify-content: space-between; padding-top: 13px; gap: 10px; flex-wrap: wrap; }
.legend, .plot-notes dl { display: flex; gap: 13px; align-items: center; }
.legend { flex-wrap: wrap; color: #b7cade; font-size: 11px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.legend-line { width: 15px; border-top: 1px dashed #c4d8ef; }
.plot-notes dl { gap: clamp(12px, 2.25vw, 32px); }
.plot-notes dt { color: #b7cade; font-size: 11px; }
.plot-notes dd { font: 580 19px/1.3 var(--mono); margin-top: 3px; }

.app-screen { display: grid; grid-template-columns: 202px minmax(0, 1fr); gap: 19px; min-height: 100svh; max-width: 1740px; margin: 0 auto; padding: 17px 20px 20px; }
.sidebar { position: sticky; top: 17px; height: calc(100svh - 34px); min-height: 350px; display: flex; flex-direction: column; align-items: stretch; padding: 19px 12px 15px; }
.sidebar .brand { margin-left: 3px; font-size: 14px; }
.sidebar .brand-mark { width: 30px; height: 30px; }
.sidebar .brand-mark::after { inset: 11px; }
.workspace-nav { display: grid; gap: 5px; margin-top: 28px; }
.workspace-nav a { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; color: var(--subtle); font-size: 13px; font-weight: 595; }
.workspace-nav a:hover { background: #a0cdfa13; color: var(--ink); }
.workspace-nav a[aria-current] { background: #89d7f41d; color: #c9f6ff; border-color: #90ddff4d; box-shadow: inset 0 1px #d3f3ff1c; }
.icon { display: inline-block; width: 14px; height: 14px; position: relative; color: inherit; flex: 0 0 auto; }
.icon-grid { border: 1px solid currentColor; border-radius: 2px; }
.icon-grid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 46%, currentColor 46% 54%, transparent 54%), linear-gradient(0deg, transparent 46%, currentColor 46% 54%, transparent 54%); }
.icon-plus::before, .icon-plus::after { content: ""; position: absolute; top: 6px; left: 1px; width: 12px; height: 1px; background: currentColor; }
.icon-plus::after { transform: rotate(90deg); }
.icon-list::before { content: ""; position: absolute; top: 3px; left: 1px; width: 12px; height: 1px; background: currentColor; box-shadow: 0 4px currentColor, 0 8px currentColor; }
.sidebar-plan { margin: auto 3px 13px; border-top: 1px solid var(--line); padding-top: 13px; }
.quota-heading { display: flex; justify-content: space-between; gap: 7px; font-size: 12px; }
.quota-heading strong { font-family: var(--mono); }
.sidebar-plan p { margin-top: 4px; color: var(--subtle); font-size: 11px; }
.sidebar-portal { padding: 3px; }
.workspace { min-width: 0; }
.workspace-header { min-height: 47px; margin-inline: 3px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.workspace-label { color: var(--subtle); font-size: 13px; white-space: nowrap; }
.user-menu { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 12px; }
.avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rim); background: #a1d4f427; color: var(--accent-strong); flex: 0 0 auto; font-weight: 670; }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .quiet-button { margin-left: 5px; white-space: nowrap; }
.workspace-content { max-width: 1430px; margin-inline: auto; padding: 19px 3px 12px; }
.workspace-title { display: flex; align-items: center; gap: 12px; }
.workspace-title h1 { font-size: clamp(27px, 3vw, 36px); letter-spacing: -.05em; line-height: 1.21; }
.plan-label { color: #ccdeef; border: 1px solid var(--rim); background: #a8d3f11c; border-radius: 5px; font: 560 11px var(--mono); padding: 4px 7px; }
.workspace-summary { --glass-radius: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 16px; overflow: hidden; }
.workspace-summary > div { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; padding: 10px 17px; }
.workspace-summary > div + div { border-left: 1px solid var(--line); }
.workspace-summary dt { color: var(--subtle); font-size: 12px; }
.workspace-summary dd { font: 560 25px/1.15 var(--mono); font-variant-numeric: tabular-nums; }
.experiment-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(232px, 1fr); gap: 14px; }
.panel { min-width: 0; --glass-radius: 13px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 15px; letter-spacing: -.015em; font-weight: 655; }
#job-form { padding: 12px 17px 14px; }
.field-heading { margin-bottom: 6px; }
.dropzone { display: flex; align-items: center; width: 100%; min-height: 63px; gap: 11px; padding: 9px 11px; border: 1px dashed #b3d8ff76; border-radius: 8px; background: #7baedb13; text-align: left; }
.dropzone:hover, .dropzone.dragover { background: #8edcee2e; border-color: var(--accent); }
.file-label { flex: 1; min-width: 0; }
.file-label strong, .file-label small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-label strong { font-weight: 620; font-size: 13px; }
.file-label small { color: var(--subtle); font-size: 11px; margin-top: 2px; }
.upload-symbol { display: block; position: relative; color: var(--accent-strong); background: #96dfed24; border: 1px solid #a9e2ff55; width: 34px; height: 34px; border-radius: 7px; flex: 0 0 auto; }
.upload-symbol::before { content: "↑"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.browse-label { color: var(--accent); font-weight: 620; font-size: 12px; flex: 0 0 auto; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 11px; margin-top: 12px; }
.field-grid label { min-width: 0; }
.field-grid input, .field-grid select { font-size: 13px; margin-top: 4px; min-height: 38px; padding-block: 7px; }
.field-grid label[data-inactive] { opacity: .65; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px 11px; border-top: 1px solid var(--line); padding-top: 11px; margin-top: 12px; flex-wrap: wrap; }
.form-footer > span { font-size: 11px; color: var(--subtle); }
.form-footer b { font: 550 11px var(--mono); color: var(--ink); }
.divider { display: inline-block; height: 10px; margin: 0 8px; vertical-align: -1px; border-left: 1px solid var(--line); }
.form-footer .primary-button { min-height: 37px; font-size: 13px; margin-left: auto; }

.queue-panel { display: flex; flex-direction: column; }
.queue-content { flex: 1; padding: 10px 16px; overflow-wrap: anywhere; }
.queue-content > p { color: var(--subtle); text-align: center; padding: 24px 0; font-size: 13px; }
.queue-content > p:only-child { display: grid; place-items: center; min-height: 100%; }
.queue-count { min-width: 26px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); color: #c0d6ed; background: #0a182a75; font: 550 12px var(--mono); text-align: center; }
.queue-content ul { list-style: none; padding: 0; margin: 0; }
.queue-content li { display: flex; justify-content: space-between; align-items: start; gap: 8px; font-size: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.queue-content li:last-child { border-bottom: 0; }
.queue-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 595; }
.queue-content .queue-more { text-align: left; padding: 9px 0 0; font-size: 11px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; color: #b5c6dc; white-space: nowrap; font-size: 12px; font-weight: 600; }
.status-badge::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-running { color: #a0defe; }
.status-succeeded { color: #a3eccb; }
.status-failed { color: #ffb8bf; }

.history { margin-top: 14px; }
.history-heading { border-bottom: 0; }
.history-filter { display: flex; gap: 17px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.history-filter button { font-size: 12px; padding: 4px 0 8px; color: var(--subtle); background: none; border: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.history-filter button[aria-pressed="true"] { color: var(--accent-strong); border-color: var(--accent); font-weight: 620; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--glass-radius) var(--glass-radius); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
th, td { padding: 9px 11px; text-align: left; vertical-align: top; }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
th { background: #0b182979; color: var(--subtle); font-weight: 595; border-bottom: 1px solid var(--line); }
th:first-child { width: 32%; }
.task-col { width: 19%; }
.date-col { width: 17%; }
.action-col { width: 146px; }
td { border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #b8dcff0a; }
.table-empty { text-align: center; padding: 20px 12px; color: var(--subtle); }
.file-name { display: block; font-weight: 650; }
.table-meta { display: block; color: var(--subtle); margin-top: 3px; }
.job-error { color: #ffd0d4; }
.row-actions { display: flex; gap: 4px 6px; flex-wrap: wrap; }
.row-actions button { font-size: 11px; padding: 2px 6px; min-height: 28px; }

dialog { color: var(--ink); --glass-tint: #142640ef; padding: 19px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: #020917b0; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog-header h2 { font-size: 18px; }
.plan-grid { display: grid; gap: 7px; }
.plan-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; border: 1px solid var(--rim); background: var(--field); border-radius: 7px; }
.plan-option:hover { border-color: var(--accent); }
.plan-option span { color: var(--subtle); font-size: 12px; }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 10; max-width: min(420px, calc(100% - 40px)); background: #1a2e48; border: 1px solid var(--rim); padding: 10px 13px; border-radius: 8px; box-shadow: var(--glass-shadow); font-size: 13px; overflow-wrap: anywhere; }
.toast[data-tone="error"] { background: #482631; }

@media (max-width: 1000px) {
  .auth-layout { gap: 28px; padding-inline: clamp(24px, 4.5vw, 48px); }
  .app-screen { grid-template-columns: 175px minmax(0, 1fr); gap: 14px; padding-inline: 13px; }
  .sidebar .brand { font-size: 13px; gap: 8px; }
  .experiment-layout { grid-template-columns: minmax(0, 1.65fr) minmax(170px, 1fr); }
  .date-col { display: none; }
  th:first-child { width: 38%; }
}

@media (max-width: 760px) {
  .public-header { min-height: 65px; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; gap: 17px; padding-top: 24px; }
  .access, .diagnostics { width: min(100%, 475px); }
  .plot-area { height: clamp(182px, 54vw, 260px); }
  .app-screen { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 10px 11px 14px; }
  .sidebar { position: static; height: auto; min-height: 0; flex-direction: row; align-items: center; gap: 6px 9px; flex-wrap: wrap; padding: 9px 12px; --glass-radius: 12px; }
  .sidebar .brand { margin-left: 0; }
  .sidebar-portal { margin-left: auto; padding: 0; }
  .sidebar-plan { order: 2; border: 0; flex: 1 0 100%; padding: 4px 0 0; margin: 0; display: flex; gap: 7px; align-items: baseline; flex-wrap: wrap; }
  .quota-heading { justify-content: start; }
  .sidebar-plan p { margin: 0; }
  .workspace-nav { order: 2; margin: 0; display: flex; flex: 1 0 100%; flex-wrap: wrap; }
  .workspace-nav a { min-height: 35px; padding: 4px 7px; }
  .workspace-header { min-height: 40px; }
  .workspace-content { padding-top: 14px; }
  .experiment-layout { grid-template-columns: minmax(0, 1fr); }
  .queue-content > p { padding: 20px 0; }
}

@media (max-width: 470px) {
  .public-header { margin-inline: 17px; }
  .auth-layout { padding-inline: 15px; }
  .public-header .brand { font-size: 15px; }
  .workspace-summary > div { padding: 9px 7px 9px 10px; }
  .workspace-summary dd { font-size: 22px; }
  .task-col { display: none; }
  th:first-child { width: 42%; }
  .action-col { width: 113px; }
  th, td { padding-inline: 7px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 9px; }
}

@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .field-scene, body::before { display: none; }
  .access, .diagnostics, .sidebar, .workspace-summary, .panel, dialog { backdrop-filter: none; background: var(--glass); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
