@import url("brand/fonts.css");

:root {
  color-scheme: light;
  --bg: #faf9f6;
  --sidebar: #f3f5ef;
  --surface: #fffefc;
  --surface-raised: #f5f7f2;
  --surface-soft: #f1f4ed;
  --surface-inset: #f7f8f3;
  --surface-hover: #eaf0e6;
  --text: #26352c;
  --text-soft: #3e4c42;
  --muted: #5b685f;
  --quiet: #616e63;
  --line: #dfe5da;
  --line-subtle: #e9ede5;
  --line-strong: #c8d3c4;
  --accent: #2e6b47;
  --accent-hover: #225839;
  --accent-soft: #e6efe3;
  --accent-line: #c9dcc5;
  --green: #39764d;
  --green-soft: #edf4e9;
  --yellow: #95651c;
  --yellow-soft: #faf2df;
  --red: #b54747;
  --red-soft: #fbefed;
  --blue: #3c6897;
  --blue-soft: #edf2f8;
  --mod-1: #426e95;
  --mod-2: #488264;
  --mod-3: #a57630;
  --mod-4: #b65c61;
  --mod-5: #8165a1;
  --mod-6: #34828a;
  --mod-7: #ac6d3c;
  --mod-8: #69746c;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 16px;
  --text-muted: var(--muted);
  --chart-grid: rgba(38, 53, 44, .15);
  --shadow: 0 12px 40px rgba(39, 54, 35, .07);
  font: 400 14px/1.65 var(--font-sans);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
a { color: inherit; }
[hidden] { display: none !important; }

.zh, .en { display: initial; }
html[data-lang="zh-CN"] .en { display: none !important; }
html[data-lang="en"] .zh { display: none !important; }
html:not([data-lang]) .en { display: none !important; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font: 700 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.quiet { color: var(--quiet); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Authentication */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 1.05fr) minmax(430px, .95fr);
  background: var(--bg);
}
.auth-brand {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 6vw, 88px);
  border-right: 1px solid var(--line);
  background-image: none;
  background-size: 44px 44px;
}
.auth-brand h1 {
  max-width: 760px;
  margin: 12px 0 24px;
  font-size: clamp(46px, 5.7vw, 76px);
  line-height: .97;
  letter-spacing: -.055em;
}
.auth-brand > div > p:last-child { max-width: 690px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.auth-brand ul { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 34px 0 0; padding: 0; color: var(--muted); list-style: none; font-size: 12px; }
.auth-brand li::before { content: "✓"; margin-right: 8px; color: var(--green); }
.back-link { color: var(--muted); text-decoration: none; }
.auth-card {
  align-self: center;
  width: min(470px, calc(100% - 56px));
  margin: 42px auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 25px; font-size: 30px; letter-spacing: -.035em; }
.tab-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 28px; padding: 4px; border-radius: 9px; background: var(--surface-soft); }
.tab { min-height: 39px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.tab.active { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 4px rgba(39,54,35,.06); }
.tab:disabled { cursor: not-allowed; color: var(--quiet); opacity: .72; }
label { display: block; margin: 15px 0; color: var(--text-soft); font-size: 12px; }
label input, label select, .field-input {
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
}
label input:focus, label select:focus, .field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label small { display: block; margin-top: 5px; color: var(--muted); }
.auth-note { margin: 20px 0 0; color: var(--muted); font-size: 11px; }

/* Buttons and status */
.button, .primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  text-decoration: none;
}
.button, .primary-button { border: 1px solid var(--accent); background: var(--accent); color: #ffffff; }
.button:hover, .primary-button:hover { filter: brightness(1.07); }
.button.full, .secondary-button.full { width: 100%; min-height: 46px; margin-top: 7px; }
.secondary-button { border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--text); }
.secondary-button:hover, .ghost-button:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.ghost-button { border: 1px solid transparent; background: transparent; color: var(--muted); }
.inline-actions { display: flex; align-items: center; gap: 8px; min-width: max-content; }
.inline-actions .secondary-button, .inline-actions .danger-button { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.federated-signin { display: grid; gap: 8px; margin-top: 16px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; margin: 3px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.danger-button { border: 1px solid rgba(255,109,118,.35); background: var(--red-soft); color: #a63c3c; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.status-pill, .scope-chip, .count-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill { padding: 4px 8px; color: var(--muted); font: 650 10px/1.3 ui-monospace, monospace; text-transform: uppercase; }
.status-pill::before, .scope-chip .dot { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--quiet); }
.status-pill.ready::before, .status-pill.active::before, .status-pill.completed::before, .status-pill.ok::before { background: var(--green); box-shadow: none; }
.status-pill.processing::before, .status-pill.pending::before, .status-pill.open::before, .status-pill.attention::before { background: var(--yellow); }
.status-pill.failed::before, .status-pill.offline::before, .status-pill.dead::before, .status-pill.disabled::before { background: var(--red); }
.status-pill.archived::before, .status-pill.retired::before, .status-pill.registered::before { background: var(--blue); }
.status-pill.configured::before, .status-pill.runtime-ready::before { background: var(--green); box-shadow: none; }
.status-pill.contract-ready::before, .status-pill.contract-only::before { background: var(--blue); }
.status-pill.misconfigured::before { background: var(--red); }
.status-pill.test::before { background: var(--blue); box-shadow: none; }
.status-pill.customer::before { background: var(--green); }
.status-pill.stale::before, .status-pill.not_ready::before { background: var(--yellow); }
.status-pill.unavailable::before { background: var(--red); }
.status-pill.staff::before { background: var(--yellow); }
.count-pill { min-width: 23px; justify-content: center; padding: 2px 7px; background: var(--surface-raised); color: var(--quiet); font: 10px ui-monospace, monospace; }
.message { margin: 14px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: 12px; }
.message.error { border-color: rgba(255,109,118,.38); background: var(--red-soft); color: #9c3535; }
.message.info { border-color: rgba(67,214,162,.28); background: var(--green-soft); color: #38613e; }
.message:empty { display: none; }

/* Product shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  overflow: hidden;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 17px 14px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; padding: 4px; object-fit: contain; flex: none; }
.sidebar-brand strong { font-size: 14px; letter-spacing: -.02em; }
.sidebar-brand small { display: block; color: var(--quiet); font-size: 10px; }
.workspace-switcher {
  display: grid;
  grid-template-columns: 31px minmax(0,1fr) auto;
  gap: 9px;
  align-items: center;
  margin: 2px 11px 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.workspace-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 7px; background: var(--accent); color: #ffffff; font: 800 11px ui-monospace, monospace; }
.workspace-switcher strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-switcher small { display: block; color: var(--quiet); font: 9px ui-monospace, monospace; text-transform: uppercase; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 10px 18px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 0; }
.nav-label { display: block; padding: 0 9px 5px; color: var(--quiet); font: 700 9px ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 2px; }
.nav-item {
  position: relative;
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-soft); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 2px; border-radius: 0 2px 2px 0; background: var(--accent); }
.nav-icon { width: 19px; color: var(--quiet); font: 700 13px ui-monospace, monospace; text-align: center; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item > span:not(.nav-icon):not(.count-pill) { flex: 1; }
.sidebar-foot { display: grid; gap: 4px; padding: 12px 10px; border-top: 1px solid var(--line); }
.sidebar-foot a, .sidebar-foot button { min-height: 34px; display: flex; align-items: center; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; text-decoration: none; text-align: left; }
.sidebar-foot a:hover, .sidebar-foot button:hover { background: var(--surface); color: var(--text); }

.app-frame { min-width: 0; }
.product-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 57px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(250,249,246,.94);
  backdrop-filter: blur(16px);
}
.breadcrumb { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--quiet); font-size: 12px; }
.breadcrumb strong { overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.topbar-search { width: min(360px, 35vw); display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--quiet); }
.topbar-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.scope-chip { padding: 6px 9px; color: var(--muted); font: 10px ui-monospace, monospace; }
.scope-chip .dot { background: var(--green); }
.account-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--text-soft); font: 700 10px ui-monospace, monospace; }

.workspace-main { max-width: 1480px; margin: 0 auto; padding: 36px clamp(28px, 3.5vw, 56px) 88px; }
.view { display: grid; gap: 22px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 4px; }
.page-heading h1, .page-heading h2 { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: -.035em; }
.page-heading p:not(.eyebrow) { max-width: 700px; margin: 8px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* Dashboard primitives */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }
.metric-card, .panel, .feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-card { min-height: 132px; padding: 20px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--accent); font: 700 11px ui-monospace, monospace; }
.metric-card strong { display: block; margin: 13px 0 3px; font-size: 27px; letter-spacing: -.035em; }
.metric-card > span { color: var(--quiet); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 18px; }
.dashboard-grid.equal { grid-template-columns: repeat(2, minmax(0,1fr)); }
.panel { min-width: 0; overflow: hidden; }
.panel.padded { padding: 22px; }
.panel-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 14px; }
.panel-head p { margin: 2px 0 0; color: var(--quiet); font-size: 10px; }
.panel-body { padding: 20px; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 10px; }

.lineage-map { display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; align-items: center; padding: 22px 17px; }
.lineage-node { position: relative; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.lineage-node:not(:last-child)::after { content: "→"; position: absolute; right: -17px; top: 37px; color: var(--accent); }
.lineage-node small { color: var(--quiet); font: 9px ui-monospace, monospace; text-transform: uppercase; }
.lineage-node strong { font-size: 18px; }
.lineage-node span { color: var(--muted); font-size: 10px; }

.meter { margin: 14px 0; }
.meter-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.meter-track { height: 6px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.meter-fill.green { background: var(--green); }
.kv-list { display: grid; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv-row span { color: var(--muted); font-size: 11px; }
.kv-row strong { font-size: 11px; text-align: right; }

.table-tools { display: flex; align-items: center; gap: 8px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.table-tools > label { flex: 1; margin: 0; }
.search-field { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--quiet); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.filter-select { padding: 8px 28px 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--accent) var(--surface-soft); scrollbar-width: thin; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: var(--surface-soft); }
.table-wrap::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--accent); }
.table-browser { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.table-browser input { width: min(100%, 340px); min-width: 140px; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--text); font: inherit; font-size: 12px; }
.table-browser input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-result-count { margin-left: auto; color: var(--text-muted); white-space: nowrap; font-size: 12px; }
.table-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); }
.table-pagination span, .table-no-results { color: var(--text-muted); font-size: 13px; }
.table-no-results { padding: 20px; }
.table-sort { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
th[aria-sort="ascending"] .table-sort::after { content: " ↑"; color: var(--accent); }
th[aria-sort="descending"] .table-sort::after { content: " ↓"; color: var(--accent); }
tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.annotation-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.annotation-metrics .metric-card { min-height: 126px; }
.annotation-sections { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 20px; }
.annotation-sections button { padding: 10px 18px; min-height: 42px; background: var(--surface-soft); color: var(--text-muted); border: 1px solid var(--line); border-radius: 8px; font: inherit; cursor: pointer; }
.annotation-sections button.active { color: var(--text); border-color: var(--accent); background: var(--surface-raised); }
@media (max-width: 1200px) { .annotation-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .annotation-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-browser { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
  .table-browser input { width: 100%; }
  .table-result-count { margin-left: 0; }
}
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--quiet); font: 650 10px ui-monospace, monospace; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-id] { cursor: pointer; }
tbody tr[data-id]:hover { background: var(--surface-hover); }
.cell-title { display: block; color: var(--text-soft); font-weight: 650; }
.cell-subtitle { display: block; margin-top: 2px; color: var(--quiet); font: 9px ui-monospace, monospace; }
.empty-state { min-height: 235px; display: grid; place-items: center; padding: 34px; text-align: center; }
.empty-state.compact { min-height: 145px; }
.empty-state-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--accent); }
.empty-state h3 { margin: 0 0 5px; font-size: 14px; }
.empty-state p { max-width: 470px; margin: 0 auto 15px; color: var(--muted); font-size: 11px; }
.unavailable { position: relative; }
.unavailable::after { content: "NOT AVAILABLE"; position: absolute; right: 14px; top: 14px; color: var(--yellow); font: 700 8px ui-monospace, monospace; letter-spacing: .12em; }

/* Forms, uploads and cards */
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.inline-form { display: grid; grid-template-columns: minmax(160px,1fr) minmax(220px,2fr) auto; gap: 12px; align-items: end; padding: 20px; }
.inline-form label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; }
.inline-form label > input, .inline-form label > select {
  width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); outline: none; background: var(--surface); color: var(--text); font: inherit;
}
.inline-form label > input:focus, .inline-form label > select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stack-form { display: grid; gap: 14px; padding: 20px; }
.inline-form > input, .inline-form > select, .stack-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.stack-form textarea { min-height: 128px; resize: vertical; }
.inline-form > input:focus, .inline-form > select:focus, .stack-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inline-form > .primary-button, .stack-form > .primary-button { min-height: 42px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.form-grid .full-row { grid-column: 1 / -1; }
.upload-drop {
  position: relative;
  min-height: 200px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
}
.upload-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.upload-drop strong { display: block; margin: 10px 0 4px; }
.upload-drop span { color: var(--muted); font-size: 11px; }
.upload-file { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.progress { height: 7px; margin-top: 13px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; }
.progress > span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }

.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.region-list { display: grid; gap: 14px; }
.compact-list { display: grid; }
.compact-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.compact-row:last-child { border-bottom: 0; }
.compact-row-main { min-width: 0; }
.compact-row-main strong { display: block; overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.compact-row-main span { display: block; margin-top: 3px; overflow: hidden; color: var(--quiet); font: 9px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.compact-row-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
button.compact-row { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; }
button.compact-row:hover { background: var(--surface-hover); }
.feature-card { padding: 17px; }
.feature-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.feature-card h3 { margin: 12px 0 4px; font-size: 14px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 11px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.callout { display: flex; align-items: flex-start; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.callout strong { display: block; font-size: 11px; }
.callout p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }

/* Drawer and modal */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(38,53,44,.24); backdrop-filter: blur(2px); }
.drawer {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  width: min(620px, 94vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--sidebar);
  box-shadow: -12px 0 48px rgba(39,54,35,.10);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 4px 0 0; font-size: 22px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-section { margin-bottom: 24px; }
.drawer-section h3 { margin: 0 0 10px; color: var(--text-soft); font-size: 12px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.modal {
  position: fixed;
  z-index: 80;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0 0; font-size: 20px; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.secret-code { margin: 14px 0; padding: 16px; border: 1px solid rgba(67,214,162,.3); border-radius: 9px; background: var(--green-soft); color: #2e6b47; font: 700 18px ui-monospace, monospace; text-align: center; letter-spacing: .12em; }

/* Ops-specific visualizations */
.service-matrix { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.service-tile { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.service-tile strong { display: block; margin-bottom: 8px; font-size: 11px; }
.region-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 20px; }
.region-identity { display: flex; align-items: center; gap: 14px; }
.region-identity h3 { margin: 0 0 4px; font-size: 15px; }
.region-identity p { margin: 0; color: var(--muted); font-size: 11px; }
.region-code { width: 47px; height: 47px; display: grid; place-items: center; border: 1px solid rgba(67,214,162,.3); border-radius: 12px; background: var(--green-soft); color: var(--green); font: 800 15px ui-monospace, monospace; }
.timeline { position: relative; display: grid; gap: 13px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-left: 24px; }
.timeline-item::before { content: ""; position: absolute; left: 1px; top: 5px; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); }
.timeline-item strong { display: block; font-size: 11px; }
.timeline-item span { color: var(--quiet); font-size: 10px; }

/* Language */
.language-switch {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,254,252,.97);
  color: var(--text);
  font: 750 11px/1 ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 4px 18px rgba(39,54,35,.08);
  backdrop-filter: blur(12px);
}
.language-switch:hover { border-color: var(--accent); }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid, .dashboard-grid.equal { grid-template-columns: 1fr; }
  .card-grid, .service-matrix { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 850px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { min-height: auto; padding: 32px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-brand > div > p:last-child, .auth-brand ul { display: none; }
  .auth-brand h1 { margin-bottom: 0; font-size: 40px; }
  .auth-card { margin: 26px auto; }
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar-brand { justify-content: center; }
  .sidebar-brand > div:last-child, .workspace-switcher > div, .workspace-switcher > span:last-child, .nav-label, .nav-item > span:not(.nav-icon):not(.count-pill), .sidebar-foot span { display: none; }
  .workspace-switcher { display: flex; justify-content: center; margin-inline: 9px; padding: 7px; }
  .nav-item { justify-content: center; }
  .nav-item.active::before { left: -10px; }
  .sidebar-foot a, .sidebar-foot button { justify-content: center; }
  .product-topbar { height: auto; min-height: 98px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; padding-block: 10px; }
  .topbar-search { width: 100%; min-height: 38px; grid-row: 2; grid-column: 1 / -1; margin-left: 0; }
}
@media (max-width: 620px) {
  /* The 104px sticky sidebar covers content scrolled to the viewport top;
     scroll-padding keeps scroll-into-view targets clickable. */
  html { scroll-padding-top: 116px; }
  .auth-card { width: calc(100% - 26px); padding: 23px; }
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 30; width: 100%; height: 104px; flex-direction: column; align-items: stretch; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { min-height: 54px; display: flex; justify-content: flex-start; padding: 13px 15px 10px; }
  .sidebar-brand > div:last-child { display: block; }
  .workspace-switcher, .nav-label, .sidebar-foot { display: none; }
  .sidebar-scroll { width: 100%; display: flex; flex: none; gap: 4px; padding: 0 10px 9px; overflow-x: auto; scrollbar-width: none; }
  .sidebar-scroll::-webkit-scrollbar { display: none; }
  .nav-group, .nav-group:first-child, .sidebar nav { display: contents; }
  .nav-item { width: auto; min-width: auto; min-height: 39px; flex: 0 0 auto; justify-content: flex-start; gap: 7px; padding: 8px 11px; border: 1px solid transparent; white-space: nowrap; }
  .nav-item > span:not(.nav-icon):not(.count-pill) { display: block; flex: none; }
  .nav-item .nav-icon { display: none; }
  .nav-item .count-pill { display: inline-flex; }
  .nav-item.active { border-color: var(--line); background: var(--surface-raised); }
  .nav-item.active::before { left: 10px; right: 10px; top: auto; bottom: -10px; width: auto; height: 2px; }
  .product-topbar { top: 104px; height: auto; grid-template-columns: minmax(0,1fr) auto; padding-inline: 15px; }
  .topbar-search .mono { display: none; }
  .breadcrumb { flex: 1; }
  .scope-chip { display: none; }
  .workspace-main { padding: 26px 18px 80px; }
  .view { gap: 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1, .page-heading h2 { font-size: 25px; }
  .page-actions { justify-content: flex-start; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .metric-card { min-height: 116px; padding: 14px; }
  .metric-card strong { margin-top: 10px; font-size: 24px; }
  .card-grid, .service-matrix, .form-grid, .inline-form { grid-template-columns: 1fr; }
  .inline-form, .stack-form { padding: 18px; }
  .form-grid .full-row { grid-column: auto; }
  .lineage-map { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 14px; }
  .lineage-node { min-height: 88px; }
  .lineage-node:not(:last-child)::after { display: none; }
  .region-hero { grid-template-columns: 1fr; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .table-tools > label { width: 100%; }
  .filter-select { width: 100%; }
  .table-wrap table { min-width: 680px; }
  .panel-head { align-items: flex-start; flex-wrap: wrap; padding: 16px 18px; }
  .language-switch { top: 12px; right: 13px; bottom: auto; }
  .compact-row { padding-inline: 14px; }
  .compact-row-meta > span:not(.status-pill) { display: none; }
}

/* Dataset preview panel and sequence timeline */
/* Sequence preview + timeline (logbook hierarchy: panel > inset well > hairline) */
.sequence-timeline { position: relative; height: 8px; background: var(--surface-inset); border-radius: 4px; overflow: hidden; margin: 10px 0 4px; }
.sequence-timeline .timeline-bar { position: absolute; top: 0; bottom: 0; border-radius: 0; box-shadow: 1px 0 0 var(--surface); }
.sequence-timeline .timeline-bar:last-child { box-shadow: none; }
.sequence-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 2px 0 10px; }
.sequence-caption .cap-left { color: var(--muted); font-size: 11px; }
.sequence-caption .cap-right { font: 11px ui-monospace, monospace; color: var(--quiet); white-space: nowrap; }
#sequence-preview { margin: 12px 0 0; border: 1px solid var(--line-subtle); border-radius: var(--radius-sm); background: var(--surface-inset); overflow: hidden; }
#preview-content > .preview-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line-subtle); }
.preview-caption .preview-meta { margin: 0; font: 11px ui-monospace, monospace; color: var(--muted); }
.preview-close { min-height: 22px; width: 22px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; }
.preview-close:hover { color: var(--text); border-color: var(--line-strong); }
#preview-content video, #preview-content img { max-width: 100%; max-height: 320px; display: block; margin: 0 auto; background: #000; }
#preview-content pre { max-height: 280px; overflow: auto; background: transparent; border-top: 1px solid var(--line-subtle); border-radius: 0; padding: 12px; font-size: 12px; margin: 0; }
.preview-chart { display: block; width: 100%; max-height: 300px; padding: 12px 12px 8px; }
.preview-button { min-height: 26px; padding: 3px 9px; font-size: 11px; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; }
.preview-button:hover { color: var(--text); border-color: var(--line-strong); }

/* Dataset three-column layout */
.dataset-split { display: grid; grid-template-columns: minmax(320px, 2fr) minmax(0, 3fr); gap: 18px; align-items: start; }
#dataset-detail { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; }
#datasets-list tbody tr { cursor: pointer; }
#datasets-list tbody tr.dataset-row-selected { outline: none; background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
#datasets-list tbody tr:hover { background: var(--surface-hover); }
#datasets-list tbody tr.dataset-row-selected:hover { background: var(--accent-soft); }
#datasets-list tbody tr td { border-bottom: 1px solid var(--line-subtle); }
#datasets-list .table-wrap table, #datasets-list table { min-width: 0; }
#datasets-list td, #datasets-list th { padding: 10px 12px; }
.cell-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; white-space: nowrap; }
.status-pill.annotation { opacity: .75; }
.status-pill:lang(zh) { text-transform: none; letter-spacing: 0; font-size: 11px; }
#dataset-detail-head { position: sticky; top: 0; z-index: 5; background: var(--surface); padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.detail-title-block h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
#dataset-detail-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
#dataset-detail-sub .mono { font-family: ui-monospace, monospace; color: var(--quiet); }
.format-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.format-badge { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 10.5px; color: var(--muted); background: transparent; }
.format-badge.format-sequence { color: var(--mod-1); border-color: var(--mod-1); }
.format-badge.format-physical-ai { color: var(--mod-2); border-color: var(--mod-2); }
.format-badge.format-raw { color: var(--quiet); }
.format-description { margin-top: 4px; font-size: 11px; color: var(--quiet); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.detail-actions .primary-button, .detail-actions .secondary-button, .detail-actions .danger-button { min-height: 32px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; gap: 6px; }
.detail-actions .secondary-button, .detail-actions .danger-button { background: transparent; border-color: transparent; color: var(--muted); }
.detail-actions .secondary-button:hover { color: var(--text); border-color: var(--line-strong); }
.detail-actions .danger-button:hover { color: var(--red); border-color: var(--red-soft); }
.detail-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 14px 20px 0; border: 1px solid var(--line-subtle); border-radius: var(--radius-sm); background: var(--surface-soft); }
.detail-stat { border: 0; border-radius: 0; background: transparent; padding: 10px 16px; }
.detail-stat + .detail-stat { border-left: 1px solid var(--line-subtle); }
.detail-stat span { display: block; font-size: 11px; font-weight: 500; color: var(--quiet); margin-bottom: 3px; }
.detail-stat strong { font-size: 16px; font-weight: 650; color: var(--text); }
.detail-stat strong .status-pill { margin-top: 2px; padding: 3px 8px; }
.detail-collapse summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 14px 20px; border-top: 1px solid var(--line-subtle); color: var(--text-soft); list-style: none; }
.detail-collapse summary::before { content: "\25B8"; display: inline-block; margin-right: 8px; color: var(--quiet); transition: transform .15s; }
.detail-collapse[open] summary::before { transform: rotate(90deg); }
.detail-collapse summary::-webkit-details-marker { display: none; }
.detail-collapse > .kv-list, .detail-collapse > pre { margin: 0 20px 14px; }
#dataset-detail-body .drawer-section { padding: 16px 20px; border-top: 1px solid var(--line-subtle); margin-bottom: 0; }
#dataset-detail-body .drawer-section:first-child { border-top: 0; }
#dataset-detail-body .drawer-section > h3 { margin: 0 0 12px; font-size: 13px; font-weight: 650; color: var(--text-soft); }
.modality-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
#sequence-artifacts { table-layout: fixed; width: 100%; }
#sequence-artifacts th, #sequence-artifacts td { padding: 9px 10px; font-size: 12px; border-bottom: 1px solid var(--line-subtle); overflow: hidden; text-overflow: ellipsis; }
#sequence-artifacts th:nth-child(1), #sequence-artifacts td:nth-child(1) { width: 120px; }
#sequence-artifacts th:nth-child(3), #sequence-artifacts td:nth-child(3) { width: 70px; }
#sequence-artifacts th:nth-child(4), #sequence-artifacts td:nth-child(4) { width: 70px; text-align: right; }
#sequence-artifacts th:nth-child(5), #sequence-artifacts td:nth-child(5) { width: 118px; }
#sequence-artifacts th:nth-child(6), #sequence-artifacts td:nth-child(6) { width: 56px; }
#sequence-artifacts td:nth-child(2) { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-soft); }
.mono-path { display: flex; min-width: 0; }
.mono-path .path-dir { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--quiet); }
.mono-path .path-base { white-space: nowrap; color: var(--text-soft); }
#sequence-artifacts td:nth-child(4), #sequence-artifacts td:nth-child(5) { font-family: ui-monospace, monospace; font-size: 11px; color: var(--quiet); white-space: nowrap; }
#dataset-back { display: none; }
@media (max-width: 959px) {
  .dataset-split { grid-template-columns: 1fr; }
  #dataset-detail { position: static; max-height: none; }
  body:not(.dataset-detail-open) #dataset-detail { display: none; }
  body.dataset-detail-open #dataset-list-column { display: none; }
  body.dataset-detail-open #dataset-back { display: inline-flex; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sequence explorer */
.explorer-split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
#explorer-modalities { position: sticky; top: 18px; }
#explorer-modalities .explorer-modality-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-subtle); font-size: 12px; }
#explorer-modalities .explorer-modality-row:last-child { border-bottom: 0; }
#explorer-modalities .explorer-modality-row.focusable { cursor: pointer; }
#explorer-modalities .explorer-modality-row.focusable:hover { background: var(--surface-hover); }
#explorer-modalities .explorer-modality-row.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
#explorer-modalities .explorer-modality-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#explorer-modalities .explorer-modality-row .mod-size { margin-left: auto; font: 10.5px ui-monospace, monospace; color: var(--quiet); }
#explorer-main { padding: 16px 20px; }
#explorer-video-wrap video { width: 100%; max-height: 420px; background: #000; border-radius: var(--radius-sm); }
#explorer-timeline-wrap { margin-top: 14px; }
#explorer-timeline { cursor: crosshair; overflow: visible; }
.explorer-playhead { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); pointer-events: none; }
#explorer-chart-wrap { position: relative; margin-top: 14px; border: 1px solid var(--line-subtle); border-radius: var(--radius-sm); background: var(--surface-inset); }
#explorer-chart { display: block; width: 100%; }
#chart-cursor { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; }
#explorer-chart-wrap .explorer-chart-fallback { margin: 10px 12px; }
#explorer-asr { margin-top: 14px; }
.asr-line { display: flex; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; }
.asr-line .asr-speaker { color: var(--quiet); font-size: 11px; min-width: 88px; }
.asr-line.current { background: var(--accent-soft); }
.asr-line:hover { background: var(--surface-hover); }
@media (max-width: 959px) {
  .explorer-split { grid-template-columns: 1fr; }
  #explorer-modalities { position: static; order: 2; }
}

/* MxAware identity: approved artwork, minimum clear space = mark height / 6. */
.auth-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-decoration: none; margin-bottom: 24px; }
.auth-logo img { width: 190px; height: auto; }
.auth-logo > span, .brand-chinese { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.sidebar-brand .brand-chinese { margin-top: 2px; font-size: 10px; }

/* Calm light presentation: content leads, pale sage supports. */
.auth-brand { background-color: #f0f4ed; display: grid; grid-template-rows: auto auto 1fr auto; gap: 28px; }
.auth-brand > div { align-self: center; }
.auth-brand h1 { font-size: clamp(34px, 3.3vw, 48px); font-weight: 600; line-height: 1.3; letter-spacing: -.035em; max-width: 640px; }
.auth-brand > div > p:last-child { font-size: 15px; line-height: 1.9; max-width: 570px; }
.auth-logo { margin-bottom: 0; }
.auth-logo img { width: 174px; }
.auth-brand .back-link { width: fit-content; font-size: 12px; }
.auth-brand ul { gap: 12px 20px; font-size: 11px; }
.auth-card { border-radius: 16px; padding: 34px; box-shadow: 0 12px 40px rgba(39,54,35,.05); }
.auth-card h2 { font-size: 27px; font-weight: 600; letter-spacing: -.035em; }
.button:hover, .primary-button:hover { filter: none; background: var(--accent-hover); border-color: var(--accent-hover); }
.workspace-avatar { background: var(--accent-soft); color: var(--accent); }
.workspace-switcher { background: rgba(255,254,252,.7); }
.product-topbar { backdrop-filter: blur(12px); }
.metric-card, .panel, .feature-card { box-shadow: 0 1px 2px rgba(39,54,35,.025); }
.metric-icon { background: var(--green-soft); border-color: transparent; }
.metric-card strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.panel-head { background: transparent; }
.panel-head h3 { font-weight: 600; }
.table-wrap thead { background: #f8f9f5; }
tbody tr[data-id]:hover { background: var(--surface-hover); }
.status-pill, .scope-chip, .format-badge { background: rgba(255,254,252,.65); }
.status-pill { font-weight: 550; }
.nav-item.active .count-pill { background: rgba(255,254,252,.65); color: var(--accent); }
@media (max-width: 850px) {
  .auth-brand { min-height: auto; gap: 14px; padding: 28px 24px; grid-template-rows: auto auto auto; }
  .auth-brand h1 { font-size: 29px; line-height: 1.35; margin: 4px 0 0; }
  .auth-brand .eyebrow { font-size: 9px; }
  .auth-logo img { width: 142px; }
}
@media (max-width: 620px) {
  .auth-brand { padding: 25px 22px; }
  .auth-brand h1 { font-size: 27px; }
  .auth-card { padding: 25px; margin-top: 22px; }
  .sidebar { background: rgba(250,249,246,.98); }
}

/* Shared content rail and bilingual reading scale (all three application surfaces). */
:root { --app-max: 1568px; --app-gutter: clamp(20px, 3vw, 40px); --mobile-nav-height: 116px; }
body { font-family: var(--font-sans); font-weight: 400; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: var(--font-sans); }
button, a, input, select, textarea { touch-action: manipulation; }
.app-shell { grid-template-columns: 264px minmax(0,1fr); }
.workspace-main { width: 100%; max-width: var(--app-max); padding: 36px var(--app-gutter) 80px; }
.workspace-main > .view { width: 100%; min-width: 0; gap: 24px; }
.view > *, .dashboard-grid > *, .metrics > *, .panel-head > div, .page-heading > div { min-width: 0; }
.product-topbar { min-height: 64px; padding-inline: max(var(--app-gutter), calc((100% - var(--app-max)) / 2 + var(--app-gutter))); }
.page-heading { align-items: flex-start; gap: 24px; margin: 0; }
.page-heading h1, .page-heading h2 { font-size: 28px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; }
html[data-lang="en"] .page-heading h1, html[data-lang="en"] .page-heading h2 { line-height: 1.25; letter-spacing: -.025em; }
.page-heading p:not(.eyebrow) { max-width: 85ch; font-size: 14px; line-height: 1.8; }
.page-actions { flex: 0 0 auto; max-width: 100%; }
.metrics, .dashboard-grid, .card-grid { gap: 20px; }
.dashboard-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.panel, .feature-card, .metric-card { width: 100%; max-width: 100%; }
.metric-card { min-height: 132px; padding: 22px; }
.metric-card strong { font-size: 30px; line-height: 1.3; }
.metric-top { font-size: 13px; }
.panel-head, .panel-body, .panel-footer, .inline-form, .stack-form { padding-inline: 22px; }
.panel-head { min-height: 72px; align-items: flex-start; flex-wrap: wrap; }
.panel-head h3, .drawer-section h3, .feature-card h3 { font-size: 15px; line-height: 1.55; font-weight: 600; }
.panel-head p, .panel-footer, .empty-state p, .callout p { font-size: 13px; line-height: 1.8; }
.panel-head p, .page-heading p, .callout p, .empty-state p, .kv-row strong { overflow-wrap: anywhere; }
.nav-item { min-height: 40px; font-size: 14px; font-weight: 400; }
.nav-label, .eyebrow, .status-pill, .scope-chip, .count-pill, .cell-subtitle, .kv-row span, .kv-row strong,
.workspace-switcher small, .metric-card > span, .format-badge, .format-description, .detail-stat span,
.compact-row-meta, .preview-caption .preview-meta, .sidebar-foot a, .sidebar-foot button {
  font-family: var(--font-sans); font-size: 12px; line-height: 1.55; letter-spacing: normal; text-transform: none;
}
.nav-label { font-size: 11px; padding-top: 8px; padding-bottom: 8px; font-weight: 500; }
.eyebrow { font-size: 12px; font-weight: 500; }
html[data-lang="en"] .eyebrow { letter-spacing: .07em; }
.button, .primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 40px; font-size: 14px; line-height: 1.4; font-weight: 500; }
.table-wrap { width: 100%; max-width: 100%; }
th { font: 500 12px/1.5 var(--font-sans); letter-spacing: normal; text-transform: none; padding: 13px 16px; }
td { padding: 15px 16px; font-size: 13px; line-height: 1.65; }
.cell-title { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.cell-subtitle { margin-top: 5px; font-size: 11px; overflow-wrap: anywhere; }
.cell-pills { gap: 5px; white-space: normal; }
.table-tools { flex-wrap: wrap; padding: 16px 18px; }
.table-tools > label { min-width: 0; }
.filter-select, .search-field input, .table-browser input, .topbar-search input { font-size: 13px; }
.table-result-count, .table-pagination { font-size: 12px; }
.stack-form, .inline-form, .form-grid { width: 100%; min-width: 0; }
label, .inline-form label { font-size: 13px; line-height: 1.65; }
label input, label select, .field-input, .inline-form input, .inline-form select, .stack-form textarea { min-height: 44px; font-size: 14px; }
label small, .auth-note { font-size: 12px; line-height: 1.8; }
.inline-actions { min-width: 0; flex-wrap: wrap; }
.status-pill { padding: 4px 9px; font-size: 11px; }
.count-pill { font-size: 11px; }
#datasets-list td, #datasets-list th { padding: 12px 14px; }
.detail-title-block h3 { font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.detail-actions { margin-left: 0; width: 100%; }
.detail-actions .primary-button, .detail-actions .secondary-button, .detail-actions .danger-button { min-height: 36px; font-size: 13px; }
.detail-stat strong { font-size: 18px; }
#sequence-artifacts th, #sequence-artifacts td { font-size: 12px; }
#explorer-modalities .explorer-modality-row { font-size: 13px; padding: 12px; }
.asr-line { font-size: 14px; line-height: 1.8; }
.asr-line .asr-speaker { font-size: 12px; }
.sidebar-brand { min-height: 100px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 20px; }
.sidebar-wordmark { display: block; width: 168px; height: 40px; object-fit: contain; object-position: left center; }
.sidebar-brand .brand-symbol { display: none; }
.sidebar-product { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; width: 100%; }
.sidebar-product strong { font-size: 12px; font-weight: 600; }
.sidebar-product small { font: 400 11px/1.5 var(--font-sans); }
.auth-layout { grid-template-columns: repeat(2,minmax(0,1fr)); }
.auth-brand { padding-inline: clamp(32px,5vw,88px); }
.auth-brand h1 { font-size: clamp(32px,2.8vw,44px); line-height: 1.45; font-weight: 500; letter-spacing: 0; }
html[data-lang="en"] .auth-brand h1 { line-height: 1.25; letter-spacing: -.025em; }
.auth-brand > div > p:last-child { font-size: 15px; line-height: 1.9; }
.auth-brand ul { font-size: 12px; line-height: 1.65; }
.auth-logo img { width: auto; height: 46px; max-width: 206px; }
.auth-logo > span { font-size: 12px; }
.auth-card { width: min(480px,calc(100% - 64px)); padding: 32px; }
.auth-card h2 { font-size: 26px; line-height: 1.45; font-weight: 600; }
.tab { font-size: 13px; }
.auth-card input { font-size: 16px; }
.language-switch { font: 500 13px/1 var(--font-sans); min-width: 44px; min-height: 40px; }
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid, .dashboard-grid.equal { grid-template-columns: minmax(0,1fr); }
}
@media (min-width: 621px) and (max-width: 1000px) {
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar-brand { min-height: 76px; padding: 16px; align-items: center; }
  .sidebar-brand .sidebar-wordmark, .sidebar-brand > .sidebar-product { display: none; }
  .sidebar-brand .brand-symbol { display: block; width: 38px; height: 38px; }
  .workspace-switcher { display: flex; justify-content: center; margin-inline: 9px; padding: 7px; }
  .workspace-switcher > div, .workspace-switcher > span:last-child, .nav-label, .nav-item > span:not(.nav-icon):not(.count-pill), .sidebar-foot span { display: none; }
  .nav-item { justify-content: center; }
  .sidebar-foot a, .sidebar-foot button { justify-content: center; }
}
@media (max-width: 850px) {
  .auth-layout { grid-template-columns: minmax(0,1fr); }
  .auth-brand { padding: 28px var(--app-gutter); }
  .auth-brand h1 { font-size: 28px; line-height: 1.45; }
  .auth-card { width: min(480px,calc(100% - 2 * var(--app-gutter))); margin: 28px auto; }
  .page-heading { flex-wrap: wrap; }
  .page-actions { justify-content: flex-start; }
  .panel-head { gap: 12px; }
  .inline-form { grid-template-columns: minmax(0,1fr); }
  .auth-brand .eyebrow { font-size: 11px; }
}
@media (max-width: 620px) {
  :root { --app-gutter: 20px; }
  html { scroll-padding-top: calc(var(--mobile-nav-height) + 16px); }
  .app-shell { display: block; }
  .sidebar { height: var(--mobile-nav-height); }
  .sidebar-brand { height: 64px; min-height: 64px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 12px 18px; }
  .sidebar-brand .sidebar-wordmark { display: block; width: 150px; height: 36px; }
  .sidebar-brand .brand-symbol { display: none; }
  .sidebar-brand > .sidebar-product { display: block; width: auto; }
  .sidebar-product small { font-size: 10px; }
  .sidebar-scroll { padding-bottom: 8px; }
  .nav-item { min-height: 44px; font-size: 13px; }
  .product-topbar { top: var(--mobile-nav-height); min-height: 98px; padding-inline: var(--app-gutter); }
  .workspace-main { padding-block: 26px 64px; }
  .workspace-main > .view { gap: 20px; }
  .page-heading h1, .page-heading h2 { font-size: 25px; line-height: 1.4; }
  .page-heading p:not(.eyebrow) { font-size: 14px; }
  .page-actions { width: 100%; }
  .button, .primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 44px; }
  .panel-head, .panel-body, .panel-footer, .inline-form, .stack-form { padding-inline: 18px; }
  .metric-card { min-height: 132px; padding: 18px; }
  .metric-card strong { font-size: 27px; }
  .metric-top { align-items: flex-start; gap: 8px; }
  .table-tools { flex-direction: column; align-items: stretch; }
  .table-browser { padding-inline: 18px; }
  .filter-select, .search-field input, .table-browser input, .topbar-search input, input, select, textarea { font-size: 16px; }
  .topbar-search { min-height: 42px; }
  .auth-card { padding: 24px; }
  .auth-card h2 { font-size: 24px; }
  .auth-logo img { height: 38px; }
  .tab-list { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .tab { padding-inline: 6px; font-size: 12px; line-height: 1.5; }
  .detail-actions .primary-button, .detail-actions .secondary-button, .detail-actions .danger-button { min-height: 42px; }
  .detail-stats { margin-inline: 18px; }
  #dataset-detail-head, #dataset-detail-body .drawer-section, #explorer-main { padding-inline: 18px; }
  .preview-button { min-height: 40px; }
  .modal { width: calc(100vw - 32px); }
}
/* Required attribution for the optional local country database. */
.language-geolocation-credit { color: #526159; font: 12px/1.5 Inter, sans-serif; }
body > .language-geolocation-credit { position: fixed; right: 20px; bottom: 2px; z-index: 100; }
