:root {
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "Segoe UI Variable", "Segoe UI", sans-serif;
  font-synthesis: none;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-alt: #f8f8fa;
  --graphite: #1d1d1f;
  --graphite-hover: #2c2c2e;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --muted: #8e8e93;
  --border: #d2d2d7;
  --border-soft: #e5e5ea;
  --accent: #e30613;
  --accent-hover: #c7000c;
  --blue: #0878d1;
  --success: #087f5b;
  --warning: #b05a00;
  --danger: #c91827;
  --shadow: 0 14px 40px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { border: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid color-mix(in srgb, var(--blue) 70%, white); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .44; }
h1, h2, h3, h4, p { margin: 0; }
svg { width: 19px; height: 19px; stroke-width: 1.8; }
.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; }
[hidden] { display: none !important; }

.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.icon-button:hover { background: #ededf0; }
.icon-button.small { width: 30px; height: 30px; }
.icon-button.small svg { width: 16px; height: 16px; }
.primary-button, .secondary-button, .danger-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.primary-button { background: var(--graphite); color: white; }
.primary-button:hover { background: #343437; }
.primary-button.compact, .secondary-button.compact, .danger-button.compact { min-height: 36px; padding: 7px 13px; }
.secondary-button { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.secondary-button:hover { background: #ededf0; }
.danger-button { background: var(--danger); color: white; }
.danger-button:hover { background: #aa1020; }

label { display: grid; gap: 7px; color: var(--secondary); font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); padding: 8px 11px; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #a9a9af; }

.login-view { min-height: 100%; position: relative; display: grid; place-items: center; padding: 32px; overflow: auto; }
.language-corner { position: fixed; top: 22px; right: 24px; }
.login-panel { width: min(408px, 100%); display: grid; gap: 20px; padding: 24px 0 48px; }
.login-logo { width: 76px; height: 76px; object-fit: contain; }
.login-heading { display: grid; gap: 7px; margin-bottom: 3px; }
.login-heading h1 { font-size: 34px; line-height: 1.12; font-weight: 680; }
.login-heading p { color: var(--secondary); line-height: 1.5; }
.login-form { display: grid; gap: 15px; }
.text-button { width: max-content; padding: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 13px; }
.text-button:hover { text-decoration: underline; }
.login-account-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.form-error { color: var(--danger); font-size: 13px; line-height: 1.45; }
.form-note { min-height: 18px; color: var(--secondary); font-size: 12px; line-height: 1.4; }
.dialog-intro { color: var(--secondary); font-size: 13px; line-height: 1.5; }
.button-spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-view { height: 100%; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 48px; display: grid; grid-template-rows: 64px 1fr auto; padding: 0 3px; background: var(--graphite); color: white; overflow: hidden; transition: width .18s ease; box-shadow: 1px 0 rgba(255,255,255,.08); }
.sidebar:hover, .sidebar:focus-within { width: 224px; box-shadow: var(--shadow); }
.sidebar-brand { width: 218px; height: 64px; display: grid; grid-template-columns: 42px 160px; align-items: center; gap: 10px; padding: 0; white-space: nowrap; overflow: hidden; }
.sidebar-brand img { width: 32px; height: 32px; justify-self: center; object-fit: contain; }
.sidebar-brand span { font-size: 15px; font-weight: 650; }
.sidebar-nav { display: grid; align-content: start; gap: 4px; padding-top: 12px; }
.sidebar-footer { display: grid; gap: 4px; padding-bottom: 0; }
.sidebar-item { width: 218px; height: 46px; display: grid; grid-template-columns: 42px 160px; align-items: center; gap: 10px; padding: 0; border-radius: 4px; background: transparent; color: #f5f5f7; text-align: left; white-space: nowrap; cursor: pointer; }
.sidebar-item:hover { background: var(--graphite-hover); }
.sidebar-item.active { background: #343437; }
.sidebar-item > svg { justify-self: center; }
.account-item { height: 54px; }
.account-item > span { display: grid; gap: 2px; min-width: 0; }
.group-item > span { display: grid; gap: 2px; min-width: 0; }
.group-item > .notification-anchor { display: inline-grid; }
.account-item strong, .account-item small, .group-item strong, .group-item small { overflow: hidden; text-overflow: ellipsis; }
.account-item strong, .group-item strong { font-size: 13px; }
.account-item small, .group-item small { color: #a1a1a6; font-size: 11px; }
.notification-anchor { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; }
.notification-anchor > svg { width: 19px; height: 19px; }
.sidebar-notification-anchor { width: 42px; height: 32px; justify-self: center; }
.notification-badge {
  position: absolute;
  top: -8px;
  right: -11px;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  pointer-events: none;
}
.sidebar-notification-anchor .notification-badge {
  top: 0;
  right: 1px;
  border-color: var(--graphite);
}
.sidebar-item:hover .sidebar-notification-anchor .notification-badge { border-color: var(--graphite-hover); }

.workspace { min-width: 0; height: 100%; margin-left: 48px; display: grid; grid-template-rows: 68px minmax(0,1fr) 34px; transition: margin-left .18s ease; }
.sidebar:hover + .workspace, .sidebar:focus-within + .workspace { margin-left: 224px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.9); backdrop-filter: blur(18px); }
.topbar h2 { font-size: 26px; font-weight: 670; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-status { max-width: 360px; color: var(--secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-status.busy::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border: 2px solid #b9b9be; border-top-color: var(--graphite); border-radius: 50%; animation: spin .7s linear infinite; }

.page { min-height: 0; }
.projects-page { display: grid; grid-template-columns: 300px minmax(0,1fr); }
.no-group-state { grid-column: 1 / -1; place-self: center; width: min(460px, calc(100% - 40px)); display: grid; justify-items: center; gap: 13px; color: var(--secondary); text-align: center; }
.no-group-state > svg { width: 38px; height: 38px; color: var(--text); }
.no-group-state h3 { color: var(--text); font-size: 19px; }
.no-group-state p { line-height: 1.55; }
.no-group-state .primary-button { margin-top: 5px; }
.no-group-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 5px; }
.no-group-actions .primary-button { margin-top: 0; }
.project-index { min-width: 0; border-right: 1px solid var(--border); background: var(--surface-alt); overflow: hidden; }
.section-toolbar, .panel-toolbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 12px; border-bottom: 1px solid var(--border-soft); }
.toolbar-buttons { display: flex; align-items: center; gap: 6px; }
.section-toolbar > div, .panel-toolbar > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.section-toolbar h3, .panel-toolbar h4 { font-size: 16px; }
.section-toolbar span, .panel-toolbar p { color: var(--secondary); font-size: 12px; }
.project-list { height: calc(100% - 52px); overflow: auto; }
.project-row { width: 100%; display: grid; gap: 5px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); background: transparent; text-align: left; cursor: pointer; }
.project-row:hover { background: #ededf0; }
.project-row.active { background: var(--surface); box-shadow: inset 3px 0 var(--accent); }
.project-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.project-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--secondary); font-size: 12px; }

.project-detail { min-width: 0; min-height: 0; background: var(--surface); }
.project-detail.empty { display: grid; place-items: center; }
.empty-state { display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; }
.empty-state h3 { font-size: 15px; font-weight: 600; }
#project-content { height: 100%; display: grid; grid-template-rows: auto 48px minmax(0,1fr); }
.project-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 28px; border-bottom: 1px solid var(--border-soft); }
.project-header > div { min-width: 0; display: grid; gap: 5px; }
.project-header h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 21px; }
.project-header p { max-width: 780px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--secondary); font-size: 13px; }
.tabs { display: flex; align-items: end; gap: 22px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.tab { height: 48px; padding: 0 2px; border-bottom: 2px solid transparent; background: transparent; color: var(--secondary); cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 650; }
.tab-panel { min-height: 0; display: none; overflow: auto; }
.tab-panel.active { display: block; }
.panel-toolbar { min-height: 72px; padding: 12px 22px; }
.panel-toolbar > div:first-child { display: grid; gap: 4px; }
.command-row { display: flex; align-items: center; gap: 8px; }

.dataset-validation-summary { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 8px 22px; border-bottom: 1px solid var(--border-soft); color: var(--secondary); background: var(--surface-alt); font-size: 12px; }
.dataset-validation-summary svg { width: 16px; height: 16px; }
.dataset-validation-summary.valid { color: var(--success); }
.dataset-validation-summary.invalid { color: var(--danger); }

.transfer-strip { display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,340px) 32px; align-items: center; gap: 16px; padding: 10px 22px; border-bottom: 1px solid var(--border-soft); background: #f8f8fa; }
.transfer-strip > div { display: grid; gap: 2px; min-width: 0; }
.transfer-strip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.transfer-strip strong { color: var(--secondary); font-size: 11px; font-weight: 500; }
progress { width: 100%; height: 5px; accent-color: var(--accent); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { height: 48px; padding: 8px 12px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: middle; font-size: 12px; }
th { position: sticky; top: 0; z-index: 2; background: var(--surface-alt); color: var(--secondary); font-weight: 650; }
th:first-child, td:first-child { padding-left: 22px; width: 31%; }
th:last-child, td:last-child { width: 88px; padding-right: 16px; text-align: right; }
td { color: var(--secondary); }
td strong { color: var(--text); font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--secondary); font-size: 11px; font-weight: 650; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-pill.ready::before, .status-pill.succeeded::before { background: var(--success); }
.status-pill.running::before, .status-pill.pending::before, .status-pill.validating::before, .status-pill.uploadingStatus::before { background: var(--blue); }
.status-pill.failed::before, .status-pill.cancelled::before { background: var(--danger); }
#dataset-rows td:first-child strong, #dataset-rows td:first-child small { display: block; overflow: hidden; text-overflow: ellipsis; }
#dataset-rows td:first-child small { margin-top: 4px; color: var(--secondary); font-size: 11px; white-space: normal; }
.row-action { border: 0; background: transparent; color: var(--secondary); cursor: pointer; }
.row-action:hover { color: var(--danger); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-action.slam-action:hover { color: var(--accent); }
.row-action:disabled { color: var(--muted); cursor: default; opacity: .55; }
.row-action svg { width: 17px; height: 17px; }
.row-action.loading svg { animation: spin .8s linear infinite; }

.training-layout { min-height: 100%; display: grid; grid-template-columns: 300px minmax(0,1fr); }
.training-content { min-width: 0; overflow: auto; }
.parameter-panel { max-width: 1080px; display: grid; align-content: start; gap: 16px; padding: 24px 28px; background: var(--surface); }
.parameter-panel > div { display: grid; gap: 4px; margin-bottom: 2px; }
.parameter-panel h4 { font-size: 16px; }
.parameter-panel p { color: var(--secondary); font-size: 12px; line-height: 1.45; }
.parameter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px !important; }
.training-options { display: flex !important; align-items: center; gap: 24px !important; }
.parameter-panel > .primary-button { justify-self: start; }
.toggle-row { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 500; }
.toggle-row input { width: 17px; min-height: 17px; accent-color: var(--accent); }
.job-area { min-width: 0; display: grid; grid-template-rows: 52px minmax(150px,1fr); border-right: 1px solid var(--border-soft); background: var(--surface-alt); }
.job-list { overflow: auto; }
.job-row { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); background: transparent; text-align: left; cursor: pointer; }
.job-row:hover, .job-row.active { background: var(--surface-alt); }
.job-row strong { display: block; margin-bottom: 4px; font-size: 13px; }
.job-row small { color: var(--secondary); }
.mini-progress { display: grid; grid-template-columns: 1fr 35px; align-items: center; gap: 7px; color: var(--secondary); font-size: 11px; }
.job-row .job-time, .job-row .mini-progress { display: none; }
.job-detail { max-width: 1080px; padding: 20px 28px 36px; border-top: 1px solid var(--border); background: var(--surface); overflow: visible; }
.job-detail-grid { display: grid; grid-template-columns: repeat(4,minmax(100px,1fr)); gap: 12px; }
.metric { display: grid; gap: 3px; }
.metric span { color: var(--secondary); font-size: 10px; text-transform: uppercase; }
.metric strong { font-size: 13px; }
.job-result-section { margin-top: 22px; border-top: 1px solid var(--border); }
.colmap-result-section { margin-top: 22px; border: 1px solid #c8daf8; background: #f5f9ff; }
.colmap-result-section > header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px; }
.colmap-result-section > header > div { min-width: 0; display: grid; gap: 4px; }
.colmap-result-section h5 { font-size: 14px; }
.colmap-result-section p { color: var(--secondary); font-size: 11px; line-height: 1.4; }
.colmap-result-section .result-metric-grid { background: var(--surface); }
.job-result-section > header { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.job-result-section > header h5 { font-size: 15px; }
.job-result-section > header span { color: var(--secondary); font-size: 11px; }
.result-group { border-top: 1px solid var(--border-soft); }
.result-group h6, .stage-breakdown h6 { margin: 0; padding: 12px 0 9px; color: var(--secondary); font-size: 11px; font-weight: 650; }
.result-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-block: 1px solid var(--border-soft); }
.result-metric { min-width: 0; display: grid; gap: 5px; padding: 13px 14px; }
.result-metric + .result-metric { border-left: 1px solid var(--border-soft); }
.result-metric span { overflow: hidden; color: var(--secondary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.result-metric strong { overflow: hidden; font-size: 17px; font-weight: 660; text-overflow: ellipsis; white-space: nowrap; }
.result-note { padding: 10px 2px 2px; color: var(--secondary); font-size: 11px; }
.stage-breakdown { border-top: 1px solid var(--border-soft); }
.stage-row { display: grid; grid-template-columns: 126px minmax(90px,1fr) 62px; align-items: center; gap: 12px; min-height: 31px; font-size: 11px; }
.stage-row > span { overflow: hidden; color: var(--secondary); text-overflow: ellipsis; white-space: nowrap; }
.stage-row > strong { text-align: right; font-size: 11px; }
.stage-track { height: 5px; overflow: hidden; background: #e5e5ea; }
.stage-track i { display: block; height: 100%; background: var(--blue); }
.stage-row:nth-of-type(3n+2) .stage-track i { background: var(--success); }
.stage-row:nth-of-type(3n) .stage-track i { background: var(--warning); }
.job-actions { display: flex; gap: 8px; margin-top: 14px; }

.viewer-panel.active { position: relative; display: block; overflow: hidden; background: #090a0c; }
.viewer-toolbar { position: absolute; z-index: 4; top: 14px; left: 14px; width: 330px; display: grid; gap: 8px; padding: 14px; border: 1px solid #48484a; border-radius: 4px; background: rgba(29,29,31,.94); color: white; }
.viewer-toolbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.viewer-toolbar select { width: 100%; min-height: 36px; border-color: #48484a; background: #2c2c2e; color: white; }
.model-source { overflow: hidden; margin: 0; color: #c7c7cc; font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.viewer-toolbar .icon-button { border-color: #48484a; background: #2c2c2e; color: white; }
.viewer-toolbar .icon-button:hover { background: #3a3a3c; }
.viewer-command-row { display: flex; align-items: center; gap: 8px; }
.viewer-actions { position: absolute; z-index: 4; top: 14px; right: 14px; display: flex; gap: 6px; padding: 4px; border: 1px solid #48484a; border-radius: 4px; background: rgba(29,29,31,.94); }
.viewer-actions .icon-button { border-color: transparent; background: transparent; color: white; }
.viewer-actions .icon-button:hover { background: #3a3a3c; }
.viewer-panel:fullscreen { width: 100vw; height: 100vh; background: #090a0c; }
.viewer-panel.viewer-expanded { position: fixed; inset: 0; z-index: 120; width: 100vw; height: 100vh; display: block; background: #090a0c; }
.fps { color: #a1a1a6; font: 11px Consolas, monospace; }
.viewer-stage { position: absolute; inset: 0; overflow: hidden; }
.viewer-stage canvas { width: 100%; height: 100%; display: block; }
.viewer-empty { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: #a1a1a6; pointer-events: none; }
.viewer-empty img { width: 62px; height: 62px; opacity: .8; }
.viewer-empty p { font-size: 12px; }
.viewer-progress { position: absolute; left: 20%; right: 20%; bottom: 24px; z-index: 5; display: grid; gap: 7px; padding: 12px 14px; border: 1px solid #48484a; background: rgba(29,29,31,.9); color: white; box-shadow: var(--shadow); }
.viewer-progress span { font-size: 11px; }

.statusbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 14px; border-top: 1px solid var(--border); background: var(--surface-alt); }
.statusbar small { color: var(--secondary); font: 10px Consolas, monospace; }

.settings-page { overflow: auto; padding: 28px; }
.settings-section { max-width: 720px; display: grid; gap: 17px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.settings-section header { display: grid; gap: 5px; }
.settings-section h3 { font-size: 18px; }
.settings-section p, .settings-section small { color: var(--secondary); }
.settings-section .primary-button { justify-self: start; }
.settings-form { width: min(440px, 100%); display: grid; gap: 14px; }

.app-dialog { width: min(480px,calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(0,0,0,.28); backdrop-filter: blur(3px); }
.app-dialog form { display: grid; gap: 16px; padding: 20px; }
.app-dialog header, .app-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-dialog footer { justify-content: flex-end; padding-top: 5px; }
.register-dialog { width: min(520px,calc(100vw - 32px)); }
.register-dialog form { gap: 12px; }
.register-dialog .form-note { margin-block: -5px -3px; }
.verification-code-row { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 8px; }
.verification-code-row .secondary-button { min-width: 0; padding-inline: 10px; font-size: 12px; }
.app-dialog footer.dialog-split-footer { justify-content: space-between; }
.dialog-split-footer > span { display: flex; align-items: center; gap: 8px; }
.group-invitations-dialog { width: min(680px,calc(100vw - 32px)); }
.group-invitations-shell { max-height: min(760px,calc(100vh - 32px)); display: grid; grid-template-rows: auto auto minmax(0,auto) minmax(0,1fr) auto; overflow: auto; }
.group-invitations-shell > header { position: sticky; top: 0; z-index: 2; padding: 18px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.group-invitations-shell > header > div { display: grid; gap: 4px; }
.group-invitations-shell > header p, .group-invitation-heading p { color: var(--secondary); font-size: 12px; line-height: 1.45; }
.group-invitations-shell > footer { position: sticky; bottom: 0; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.invitation-feedback { margin: 14px 20px 0; }
.group-invitation-section { display: grid; gap: 12px; padding: 18px 20px; }
.group-invitation-section + .group-invitation-section { border-top: 1px solid var(--border); }
.group-invitation-section h4 { font-size: 14px; }
.group-invite-form { display: grid !important; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px !important; padding: 0 !important; }
.group-invite-form .primary-button { min-height: 40px; }
.sent-invitations-title { padding-top: 4px; }
.group-invitation-list { display: grid; border-top: 1px solid var(--border-soft); }
.group-invitation-empty { padding: 18px 0; color: var(--secondary); font-size: 12px; }
.group-invitation-row { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.group-invitation-copy { min-width: 0; display: grid; gap: 4px; }
.group-invitation-copy strong, .group-invitation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-invitation-copy strong { font-size: 13px; }
.group-invitation-copy small { color: var(--secondary); font-size: 11px; }
.group-invitation-actions { display: flex; align-items: center; gap: 6px; }
.group-invitation-status { color: var(--secondary); font-size: 11px; }
.group-invitation-status.accepted { color: var(--success); }
.group-invitation-status.declined, .group-invitation-status.cancelled { color: var(--muted); }
.confirm-dialog p { color: var(--secondary); line-height: 1.5; }
.dataset-format-dialog { width: min(880px,calc(100vw - 32px)); max-height: min(820px,calc(100vh - 32px)); overflow: auto; }
.dataset-format-content { display: grid; gap: 0; padding: 0 22px 20px; }
.dataset-format-content > header { position: sticky; top: 0; z-index: 2; padding: 20px 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dataset-format-content > header > div { display: grid; gap: 4px; }
.dataset-format-content > header p, .format-layouts p, .sensor-format p, .validation-rule-band p, .validation-report-heading p { color: var(--secondary); font-size: 12px; line-height: 1.45; }
.format-layouts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-bottom: 1px solid var(--border); }
.format-layouts > div { min-width: 0; padding: 18px 16px 18px 0; }
.format-layouts > div:nth-child(even) { padding-right: 0; padding-left: 16px; border-left: 1px solid var(--border-soft); }
.format-layouts > div:nth-child(n+3) { border-top: 1px solid var(--border-soft); }
.format-layouts strong, .sensor-format strong, .validation-rule-band strong { display: block; margin-bottom: 5px; font-size: 13px; }
.dataset-format-content pre { margin: 13px 0 0; padding: 12px; overflow: auto; border: 1px solid var(--border-soft); border-radius: 4px; background: var(--surface-alt); color: #343437; font: 11px/1.55 Consolas, "SFMono-Regular", monospace; }
.sensor-format { display: grid; grid-template-columns: minmax(210px,.8fr) minmax(320px,1.2fr); gap: 22px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--border); }
.sensor-format pre { margin: 0; }
.validation-rule-band { padding: 17px 0; border-bottom: 1px solid var(--border); }
.dataset-validation-report { padding: 18px 0 4px; }
.validation-report-heading { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px; }
.validation-report-heading > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb,var(--success) 12%,white); color: var(--success); }
.dataset-validation-report.invalid .validation-report-heading > span { background: color-mix(in srgb,var(--danger) 10%,white); color: var(--danger); }
.validation-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; margin: 16px 0 0; border-block: 1px solid var(--border-soft); }
.validation-metrics > div { min-width: 0; display: grid; gap: 3px; padding: 12px 10px; }
.validation-metrics > div + div { border-left: 1px solid var(--border-soft); }
.validation-metrics dt { color: var(--secondary); font-size: 10px; }
.validation-metrics dd { margin: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 650; }
.validation-issues { display: grid; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.validation-issues li { display: grid; grid-template-columns: 16px minmax(0,1fr); gap: 8px; align-items: start; color: var(--danger); font-size: 12px; line-height: 1.45; }
.validation-issues li svg { width: 15px; height: 15px; margin-top: 1px; }
.dataset-format-content > footer { padding-top: 18px; }

.slam-dialog { width: min(1180px,calc(100vw - 28px)); height: min(760px,calc(100vh - 28px)); max-width: none; max-height: none; padding: 0; border: 1px solid #3a3a3c; border-radius: 8px; background: #111215; color: white; box-shadow: 0 24px 70px rgba(0,0,0,.3); overflow: hidden; }
.slam-dialog::backdrop { background: rgba(0,0,0,.42); backdrop-filter: blur(4px); }
.slam-shell { height: 100%; display: grid; grid-template-rows: 64px minmax(0,1fr); }
.slam-header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px 10px 20px; border-bottom: 1px solid #3a3a3c; background: #1d1d1f; }
.slam-header > div:first-child { min-width: 0; display: grid; gap: 3px; }
.slam-header > div:last-child { display: flex; gap: 6px; }
.slam-header h3, .slam-header p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slam-header h3 { font-size: 16px; }
.slam-header p { color: #a1a1a6; font-size: 11px; }
.slam-header .icon-button { border-color: #48484a; background: #2c2c2e; color: white; }
.slam-header .icon-button:hover { background: #3a3a3c; }
.slam-layout { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 340px; }
.slam-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #111215; }
.slam-stage canvas { width: 100%; height: 100%; display: block; }
.slam-loading { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; background: #111215; color: #d1d1d6; }
.slam-loading .button-spinner { width: 22px; height: 22px; border-color: #48484a; border-top-color: #f5f5f7; }
.slam-loading progress { width: min(320px,60vw); }
.slam-loading small { min-height: 14px; color: #8e8e93; font: 11px Consolas,monospace; }
.slam-inspector { min-width: 0; display: grid; grid-template-rows: auto minmax(92px,auto) auto; align-content: start; border-left: 1px solid #3a3a3c; background: #f5f5f7; color: #1d1d1f; }
.slam-image-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: #050506; }
.slam-image-frame img { width: 100%; height: 100%; display: block; object-fit: contain; }
.slam-image-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,5,6,.45); }
.slam-camera-copy { min-width: 0; display: grid; align-content: start; gap: 5px; padding: 16px 18px; border-bottom: 1px solid #d2d2d7; }
.slam-camera-copy span { color: #6e6e73; font-size: 11px; font-weight: 650; }
.slam-camera-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.slam-camera-copy small { color: #6e6e73; font-size: 11px; }
.slam-navigation { display: grid; grid-template-columns: 36px minmax(0,1fr) 36px; align-items: center; gap: 10px; padding: 14px 16px; }
.slam-navigation .icon-button { background: white; }
.slam-navigation input { width: 100%; accent-color: var(--accent); }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 11px 14px; border: 1px solid var(--border); border-left: 3px solid var(--graphite); border-radius: 5px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { border-left-color: var(--danger); }

@media (max-width: 920px) {
  .projects-page { grid-template-columns: 220px minmax(0,1fr); }
  .training-layout { grid-template-columns: 220px minmax(0,1fr); }
  .parameter-grid { grid-template-columns: 1fr; }
  .format-layouts { grid-template-columns: 1fr; }
  .format-layouts > div { padding: 16px 0; }
  .format-layouts > div:nth-child(even) { padding-left: 0; border-left: 0; }
  .format-layouts > div + div { border-top: 1px solid var(--border-soft); }
  .sensor-format { grid-template-columns: 1fr; }
  .validation-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .validation-metrics > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--border-soft); }
  .validation-metrics > div:nth-child(4) { border-top: 1px solid var(--border-soft); }
  .slam-layout { grid-template-columns: minmax(0,1fr) 300px; }
}

@media (max-width: 700px) {
  html, body { overflow: auto; }
  .app-view { min-height: 100dvh; }
  .sidebar { inset: 0 0 auto; width: 100%; height: 58px; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr; padding: 5px 8px; transition: none; }
  .sidebar:hover, .sidebar:focus-within { width: 100%; box-shadow: none; }
  .sidebar-brand { width: 44px; height: 48px; grid-template-columns: 42px; }
  .sidebar-brand span { display: none; }
  .sidebar-nav, .sidebar-footer { display: flex; align-items: center; justify-content: flex-end; padding: 0; }
  .sidebar-nav { justify-content: center; }
  .sidebar-item { width: 44px; grid-template-columns: 42px; overflow: hidden; }
  .sidebar-item > span { display: none; }
  .account-item { display: none; }
  .workspace { min-height: 100dvh; height: auto; margin-left: 0; padding-top: 58px; grid-template-rows: 62px auto 34px; }
  .sidebar:hover + .workspace, .sidebar:focus-within + .workspace { margin-left: 0; }
  .topbar { position: sticky; top: 58px; z-index: 20; padding: 0 15px; }
  .topbar h2 { font-size: 20px; }
  .global-status { display: none; }
  .verification-code-row { grid-template-columns: 1fr; }
  .group-invite-form { grid-template-columns: 1fr; }
  .group-invitation-row { grid-template-columns: 1fr; }
  .group-invitation-actions { justify-content: flex-start; }
  .app-dialog footer.dialog-split-footer { align-items: stretch; flex-direction: column; }
  .dialog-split-footer > span { justify-content: flex-end; }
  .projects-page { min-height: calc(100dvh - 120px); grid-template-columns: 1fr; }
  .project-index { height: 210px; border-right: 0; border-bottom: 1px solid var(--border); }
  .project-detail { min-height: 620px; }
  .project-header { min-height: 76px; padding: 13px 15px; }
  .project-header h3 { font-size: 18px; }
  .tabs { gap: 18px; padding: 0 15px; overflow-x: auto; }
  .panel-toolbar { align-items: flex-start; padding: 12px 15px; }
  .command-row { flex-wrap: wrap; justify-content: flex-end; }
  .transfer-strip { grid-template-columns: 1fr 30px; }
  .transfer-strip progress { grid-column: 1 / -1; grid-row: 2; }
  .training-layout { grid-template-columns: 1fr; }
  .parameter-panel { padding: 20px 16px; border-bottom: 1px solid var(--border); }
  .training-options { align-items: flex-start; flex-direction: column; gap: 10px !important; }
  .job-area { min-height: 420px; }
  .job-row { padding: 11px 12px; gap: 8px; }
  .job-detail-grid { grid-template-columns: repeat(2,1fr); }
  .result-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .result-metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--border-soft); }
  .result-metric:nth-child(4) { border-top: 1px solid var(--border-soft); }
  .stage-row { grid-template-columns: 100px minmax(70px,1fr) 54px; gap: 8px; }
  .viewer-panel.active { min-height: 620px; }
  .viewer-toolbar { left: 10px; right: 10px; width: auto; }
  .viewer-actions { top: auto; right: 10px; bottom: 10px; }
  .viewer-progress { left: 15px; right: 15px; }
  .settings-page { padding: 20px 16px; }
  th:nth-child(2), td:nth-child(2), th:nth-child(4), td:nth-child(4) { display: none; }
  th:first-child, td:first-child { width: 48%; padding-left: 15px; }
  .slam-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .slam-shell { grid-template-rows: 58px minmax(0,1fr); }
  .slam-layout { grid-template-columns: 1fr; grid-template-rows: minmax(300px,1fr) auto; overflow: auto; }
  .slam-inspector { grid-template-columns: minmax(160px,.9fr) minmax(0,1.1fr); grid-template-rows: auto auto; border-top: 1px solid #3a3a3c; border-left: 0; }
  .slam-image-frame { grid-row: 1 / 3; }
  .slam-camera-copy { border-bottom: 1px solid #d2d2d7; }
}
