:root {
  --ink: #172b3a;
  --muted: #73808c;
  --line: #e2e8eb;
  --blue: #295ee7;
  --pale: #edf2ff;
  --paper: #f6f8fa;
  --green: #27856f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    14px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 14px;
  color: var(--ink);
}
button:hover {
  border-color: var(--blue);
  color: var(--blue);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #a6baff;
  outline-offset: 2px;
}
input,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  background: white;
  color: var(--ink);
  min-width: 0;
}
a {
  color: var(--blue);
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 31px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.2px;
  margin-bottom: 0;
}
h3 {
  font-size: 15px;
}
label {
  font-size: 12px;
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--blue);
  margin-bottom: 12px;
}
.sidebar {
  overflow-y: auto;
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -1.3px;
  color: var(--ink);
  gap: 10px;
  padding: 0 12px;
}
.brand-dot {
  color: var(--blue);
  margin-left: -10px;
}
.brand-mark {
  width: 35px;
  height: 35px;
  background: var(--blue);
  display: inline-grid;
  place-items: center;
  color: #fff;
  border-radius: 9px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -2px;
}
.workspace-label {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #94a0a9;
  margin: 46px 12px 14px;
  font-weight: 700;
}
nav {
  display: grid;
  gap: 5px;
}
nav button {
  text-align: left;
  border: 0;
  padding: 12px 14px;
  color: #75828e;
  background: transparent;
  font-weight: 550;
}
nav button span {
  display: inline-block;
  width: 30px;
  font-size: 19px;
  vertical-align: middle;
}
nav button.active {
  color: var(--blue);
  background: var(--pale);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 12px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--green);
}
.sidebar-bottom p {
  margin: 7px 0 16px;
  font-size: 13px;
  color: var(--ink);
  word-break: break-word;
}
.connection-dot {
  display: inline-block;
  border-radius: 50%;
  width: 6px;
  height: 6px;
  background: var(--green);
  margin-right: 5px;
}
.text-button {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
}
.workspace {
  margin-left: 220px;
}
.topbar {
  height: 78px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  gap: 18px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb span {
  padding: 0 15px;
  color: #bfc7cd;
}
.breadcrumb b {
  font-weight: 500;
  color: var(--ink);
}
.top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-controls label {
  color: var(--muted);
}
.top-controls select {
  max-width: 250px;
  min-width: 160px;
}
.top-controls button {
  font-size: 12px;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 38px 40px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-heading .muted {
  margin: 0;
}
.badge {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--green);
  background: #e9f5ef;
  padding: 7px 10px;
  border: 1px solid #d4e9df;
  border-radius: 5px;
  white-space: nowrap;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-bottom: 25px;
}
.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 2px 3px #1e344003;
}
.card {
  padding: 22px;
  position: relative;
}
.card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.card-icon {
  float: right;
  color: var(--blue);
  background: var(--pale);
  padding: 2px 7px;
  border-radius: 5px;
}
.card-number {
  font-size: 34px;
  letter-spacing: -1px;
  margin: 12px 0 8px;
  line-height: 1.2;
}
.card-note {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
}
.grid-two {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
  margin-bottom: 24px;
}
.panel {
  padding: 24px;
  margin-bottom: 23px;
  min-width: 0;
}
.grid-two .panel {
  margin-bottom: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}
.section-heading .muted {
  font-size: 12px;
  margin: 3px 0 0;
}
.section-heading button {
  font-size: 11px;
  padding: 6px 11px;
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  background: #f8fafb;
  padding: 12px;
  white-space: nowrap;
}
td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf0f2;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafcff;
}
.record-row {
  cursor: pointer;
}
.empty {
  padding: 35px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 6px;
}
.total-strip {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  background: var(--pale);
  border: 1px solid #dce5fd;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 12px;
}
.total-strip strong {
  color: var(--blue);
  font-size: 20px;
  letter-spacing: -0.5px;
}
.bar-row {
  display: grid;
  grid-template-columns: 105px 1fr 60px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  margin: 18px 0;
}
.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  position: relative;
  height: 7px;
  background: #f0f3f7;
  border-radius: 5px;
  overflow: hidden;
}
.signed-track::after {
  content: "";
  position: absolute;
  height: 100%;
  left: 50%;
  border-left: 1px solid #8394a5;
}
.bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 5px;
}
.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 20px;
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}
.controls button {
  height: 41px;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  background: #204dcc;
  color: white;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.pager button {
  padding: 6px 12px;
}
.notice,
.error {
  padding: 13px 17px;
  background: #fff2ee;
  border: 1px solid #efd9cf;
  color: #9a4930;
  border-radius: 7px;
  margin-bottom: 22px;
}
.schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 17px;
}
.schema-card {
  margin: 0;
  padding: 18px;
}
.schema-card h3 {
  margin: 0 0 4px;
}
.schema-card ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.schema-card li {
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.schema-card small {
  color: var(--muted);
}
.relation-link {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  font-size: 11px;
  text-align: left;
}
pre {
  font:
    12px/1.7 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: #f5f7f9;
  padding: 16px;
  border-radius: 6px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  font-size: 12px;
}
.detail-row > strong {
  font-weight: 500;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  width: min(820px, 94vw);
  max-height: 85vh;
  color: var(--ink);
}
dialog::backdrop {
  background: #172b3a70;
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #98a3ac;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 70% 20%, #e6edfe, transparent 50%), var(--paper);
}
.login-card {
  width: min(430px, 95vw);
  padding: 40px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 15px 50px #27395309;
}
.login-card .brand-mark {
  margin-bottom: 30px;
}
.login-card h1 {
  font-size: 30px;
}
.login-card label {
  display: block;
  margin: 25px 0 8px;
}
.login-card input {
  width: 100%;
}
.login-card .primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin: 24px 0;
}
.login-card > .small {
  margin: 0;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip {
  background: var(--pale);
  color: var(--blue);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
}
@media (max-width: 1100px) {
  .sidebar {
    width: 190px;
    padding: 28px 14px;
  }
  .workspace {
    margin-left: 190px;
  }
  main {
    padding: 30px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 24px;
  }
  .workspace-label {
    display: none;
  }
  .sidebar-bottom {
    padding-top: 10px;
  }
  nav {
    display: flex;
    overflow: auto;
    margin-top: 12px;
  }
  nav button {
    font-size: 11px;
    padding: 9px;
    white-space: nowrap;
  }
  nav button span {
    display: none;
  }
  .workspace {
    margin: 0;
  }
  .topbar {
    height: auto;
    min-height: 65px;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .breadcrumb {
    display: none;
  }
  .top-controls {
    width: 100%;
    gap: 8px;
  }
  .top-controls select {
    flex: 1;
    min-width: 0;
  }
  main {
    padding: 25px 16px;
  }
  .page-heading {
    gap: 10px;
  }
  .page-heading .badge {
    display: none;
  }
  h1 {
    font-size: 27px;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 16px;
  }
  .panel {
    padding: 17px;
  }
  .detail-row {
    grid-template-columns: 110px 1fr;
  }
  .total-strip {
    align-items: center;
  }
  footer {
    gap: 10px;
  }
  .bar-row {
    grid-template-columns: 80px 1fr 45px;
  }
}

/* Shared schema review and workflow guide. */
[hidden] { display: none !important; }
.review-layout { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); gap: 24px; align-items: start; }
.model-list { max-height: 74vh; overflow: auto; position: sticky; top: 15px; }
.model-choice { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; background: transparent; border: 0; padding: 10px; margin: 2px 0; }
.model-choice[aria-pressed="true"] { background: #e8eefc; color: #234d9b; border-left: 3px solid #3a65b7; }
.model-inspector { min-width: 0; }
.model-inspector h2 { overflow-wrap: anywhere; }
.model-inspector h3 { margin-top: 24px; }
.model-links { display: flex; gap: 8px 14px; flex-wrap: wrap; }
.model-links button { overflow-wrap: anywhere; text-align: left; }
.review-summary, .workflow-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(290px,1fr)); gap: 18px; margin-top: 24px; }
.workflow-grid .panel { box-shadow: none; }
.workflow-steps { padding-left: 24px; }
.workflow-steps li { padding: 0 0 20px 8px; border-left: 2px solid #e8edf4; }
.workflow-steps li::marker { color: #3a65b7; font-weight: 700; }
.workflow-steps h3 { margin-top: 0; }
.table-scroll { overflow-x: auto; }
.table-scroll td { white-space: normal; overflow-wrap: anywhere; min-width: 75px; vertical-align: top; }
@media (max-width: 1050px) { .review-layout { grid-template-columns: minmax(0,1fr); } .model-list { position: static; max-height: 240px; border-bottom: 1px solid #dde5ef; } }

.scientific-plot { width: 100%; }

.schema-erd { width: 100%; height: auto; }

.catalog-model { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 3px 10px 3px 0; }
.model-provider { display: block; font-size: 11px; color: #526477; padding: 3px 6px; }

.nav-group { margin: 14px 12px 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 700px) { nav .nav-group { display: none; } }
