@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");
:root {
  --ink: #142a45;
  --muted: #566575;
  --line: #d7dfe7;
  --paper: #f0f3f7;
  --blue: #204ed8;
  --blue-dark: #173aa3;
  --green: #087c65;
  --red: #b33c4c;
  --mono: "IBM Plex Mono", monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    16px/1.55 "IBM Plex Sans",
    system-ui,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button,
input,
select,
textarea {
  border-radius: 5px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #7b9cff;
  outline-offset: 3px;
}
h1,
h2,
p {
  overflow-wrap: break-word;
}
h2 {
  font-size: 20px;
  line-height: 1.35;
  margin: 0;
  font-weight: 600;
}
button {
  transition:
    background 0.15s,
    color 0.15s;
}
input,
select,
textarea {
  max-width: 100%;
}
.topbar {
  min-height: 78px;
  padding: 14px max(24px, calc((100vw - 1420px) / 2));
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-size: 23px;
  letter-spacing: -0.6px;
}
.brand strong {
  font-weight: 600;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #778da6;
  font: 500 20px var(--mono);
  letter-spacing: -1px;
}
.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: #d5dfeb;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4a449;
}
.status-dot.live {
  background: #6dddaf;
}
.text-button {
  margin-left: 12px;
  color: white;
  background: none;
  border: 1px solid #6e8198;
  padding: 7px 12px;
  font-size: 14px;
}
.text-button:hover {
  background: #2a4361;
}
.main {
  max-width: 1468px;
  margin: auto;
  padding: 32px 24px 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 28px;
}
.eyebrow {
  font: 500 12px/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin: 0 0 8px;
}
.page-heading h1 {
  font-size: clamp(27px, 2.65vw, 38px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -1.1px;
  margin: 0;
}
.page-heading > p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.mobile-break {
  display: none;
}
.workspace {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: white;
  min-height: 580px;
}
.model-sidebar {
  padding: 25px 22px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}
.sidebar-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
}
.sidebar-heading h2 {
  font-size: 18px;
}
.section-number {
  font: 14px var(--mono);
  color: #66778b;
}
.field-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
}
.family-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 24px;
  border: 1px solid #a5b4c5;
  border-radius: 5px;
  overflow: hidden;
}
.family-picker button {
  border: 0;
  border-radius: 0;
  background: white;
  padding: 10px 5px;
  font-size: 14px;
  color: var(--ink);
}
.family-picker button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.model-sidebar select {
  width: 100%;
  padding: 10px 8px;
  border: 1px solid #a5b4c5;
  background: white;
  color: var(--ink);
  font-weight: 500;
}
.model-description {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 24px;
  min-height: 65px;
}
.model-detail {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.availability {
  font: 12px var(--mono);
  color: #866014;
  margin: 0 0 12px;
}
.availability.ready {
  color: var(--green);
}
.scope-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.class-key {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 28px;
}
.class-key > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 9px;
}
.key-dot {
  width: 7px;
  height: 7px;
  background: var(--muted);
}
.misconception {
  background: var(--red);
}
.understood {
  background: var(--green);
}
.unknown {
  background: #6f7d90;
}
.analysis-workspace {
  min-width: 0;
}
.mode-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  min-height: 66px;
  align-items: stretch;
}
.mode-tab {
  padding: 20px 0 17px;
  border: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 15px;
}
.mode-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}
.mode-view {
  padding: 28px;
}
.hidden {
  display: none !important;
}
.single-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
}
.input-panel {
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.counter {
  font: 12px var(--mono);
  color: var(--muted);
  white-space: nowrap;
  margin-top: 4px;
}
.input-panel textarea {
  width: 100%;
  display: block;
  min-height: 220px;
  margin: 22px 0 16px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #a5b4c5;
  color: var(--ink);
  line-height: 1.75;
  background: #fff;
}
.input-panel textarea::placeholder {
  color: #768494;
}
.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.hint,
.field-note {
  font-size: 14px;
  color: var(--muted);
}
.hint {
  max-width: 155px;
}
.primary-button {
  background: var(--blue);
  color: white;
  border: 1px solid var(--blue);
  padding: 11px 17px;
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
}
.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
}
.full {
  width: 100%;
}
.result-panel {
  background: #f3f6fc;
  border-top: 3px solid var(--blue);
  padding: 24px;
  min-height: 345px;
  min-width: 0;
}
.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.empty-state .section-number {
  margin-bottom: 22px;
}
.empty-state p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 300px;
  margin: 10px 0 0;
}
.prediction-kicker {
  font: 12px var(--mono);
  text-transform: uppercase;
  color: var(--muted);
}
.prediction-title {
  margin: 10px 0 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
.prediction-title strong {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.2;
}
.confidence-pill {
  font: 14px var(--mono);
  color: var(--blue);
}
.probability-row {
  margin: 15px 0;
}
.probability-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 6px;
}
.probability-meta span:last-child {
  font: 12px/1.8 var(--mono);
}
.probability-track {
  height: 5px;
  background: #dce3ee;
  overflow: hidden;
}
.probability-fill {
  height: 100%;
  background: var(--blue);
}
.secondary-button {
  width: 100%;
  background: white;
  color: var(--ink);
  border: 1px solid #a5b4c5;
  padding: 10px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
}
.secondary-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.target-select {
  margin-top: 20px;
}
.target-select select {
  width: 100%;
  padding: 8px;
  background: white;
  border: 1px solid #a5b4c5;
  font-size: 14px;
  color: var(--ink);
}
.truncation-note {
  font-size: 13px;
  color: #855a12;
}
.result-model {
  margin: 0 0 5px;
  font-size: 13px;
  color: var(--muted);
}
.explanation-panel {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.explain-note {
  font: 12px/1.6 var(--mono);
  color: var(--muted);
  max-width: 230px;
  text-align: right;
}
.shap-context {
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0;
}
.explain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 30px;
}
.shap-bar-row {
  display: grid;
  grid-template-columns: 100px minmax(40px, 1fr) 72px;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.shap-token {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shap-track {
  position: relative;
  height: 10px;
  background: #f0f3f7;
}
.shap-axis {
  position: absolute;
  left: 50%;
  top: -4px;
  height: 18px;
  width: 1px;
  background: #98a6b6;
}
.shap-bar {
  position: absolute;
  height: 100%;
  top: 0;
}
.shap-bar.positive {
  left: 50%;
  background: var(--green);
}
.shap-bar.negative {
  right: 50%;
  background: var(--red);
}
.shap-number {
  font: 12px var(--mono);
  text-align: right;
}
.explain-side {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.metric-row strong {
  font: 12px/1.7 var(--mono);
}
.small-note {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.positive-text {
  color: var(--green);
}
.negative-text {
  color: var(--red);
}
.bulk-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 28px;
}
.drop-zone {
  position: relative;
  min-height: 190px;
  padding: 18px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed #8296ae;
  cursor: pointer;
  background: #f8fafc;
}
.drop-zone:hover,
.drop-zone.dragging {
  background: #edf2ff;
  border-color: var(--blue);
}
.drop-zone:focus-within {
  outline: 3px solid #7b9cff;
}
.drop-zone span:last-of-type {
  font-size: 13px;
  color: var(--muted);
}
.upload-icon {
  font-size: 30px;
  color: var(--blue);
}
.drop-zone strong {
  font-size: 15px;
  word-break: break-word;
}
.upload-panel > input {
  width: 100%;
  padding: 10px;
  border: 1px solid #a5b4c5;
  margin-bottom: 18px;
}
.upload-panel .field-label span {
  font-weight: 400;
}
.bulk-result {
  border-top: 3px solid var(--blue);
  background: #f3f6fc;
  min-width: 0;
  padding: 24px;
}
.bulk-head h2 {
  font-size: 21px;
}
.bulk-actions {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.tiny-button {
  font-size: 14px;
  padding: 8px 10px;
  background: white;
  border: 1px solid #a5b4c5;
  color: var(--ink);
}
.bulk-meta {
  font-size: 13px;
  color: var(--muted);
}
.table-wrap {
  max-height: 380px;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
}
.preview-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
.preview-table th,
.preview-table td {
  padding: 10px 12px;
  max-width: 260px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.preview-table th {
  position: sticky;
  top: 0;
  background: #e6edf6;
  font-size: 12px;
  font-weight: 500;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 30px;
  color: var(--muted);
  font-size: 13px;
}
.footer-separator {
  margin: 0 8px;
  color: #9aa7b5;
}
.settings-dialog {
  width: min(460px, calc(100% - 32px));
  border: 1px solid var(--line);
  padding: 28px;
  border-radius: 8px;
  color: var(--ink);
}
.settings-dialog::backdrop {
  background: #142a4570;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.icon-button {
  font-size: 26px;
  background: none;
  border: 0;
  color: var(--muted);
}
.settings-dialog input {
  width: 100%;
  padding: 12px;
  border: 1px solid #a5b4c5;
}
.settings-dialog .field-note {
  margin: 12px 0 22px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 12px);
  max-width: min(560px, calc(100% - 32px));
  width: max-content;
  background: var(--ink);
  color: white;
  padding: 14px 20px;
  border-radius: 5px;
  box-shadow: 0 5px 22px #142a4525;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  font-size: 15px;
  z-index: 10;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .model-sidebar {
    padding: 24px 18px;
  }
  .single-grid,
  .bulk-grid {
    grid-template-columns: 1fr;
  }
  .result-panel {
    min-height: 240px;
  }
  .hint {
    max-width: none;
  }
  .explain-grid {
    grid-template-columns: 1fr;
  }
  .explain-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }
  .input-panel textarea {
    min-height: 160px;
  }
}
@media (max-width: 700px) {
  .topbar {
    padding: 16px;
    min-height: 72px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 21px;
  }
  .connection {
    font-size: 12px;
    gap: 6px;
  }
  .text-button {
    margin-left: 3px;
    font-size: 13px;
    padding: 6px 8px;
  }
  .main {
    padding: 24px 16px 0;
  }
  .page-heading {
    display: block;
    margin-bottom: 22px;
  }
  .page-heading > p {
    display: none;
  }
  .page-heading h1 {
    font-size: 29px;
    line-height: 1.25;
  }
  .mobile-break {
    display: block;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .model-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 20px;
  }
  .sidebar-heading {
    margin-bottom: 16px;
  }
  .family-picker {
    margin-bottom: 16px;
  }
  .model-description {
    min-height: 0;
    margin: 10px 0 14px;
  }
  .class-key {
    display: none;
  }
  .scope-note {
    font-size: 13px;
  }
  .model-detail {
    padding: 10px 0;
  }
  .mode-tabs {
    padding: 0 20px;
    gap: 22px;
  }
  .mode-tab {
    font-size: 14px;
  }
  .mode-view {
    padding: 20px;
  }
  .single-grid,
  .bulk-grid {
    gap: 24px;
  }
  .input-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .panel-heading h2 {
    font-size: 18px;
  }
  .counter {
    font-size: 12px;
  }
  .result-panel,
  .bulk-result {
    padding: 20px;
  }
  .section-heading {
    display: block;
  }
  .explain-note {
    display: block;
    text-align: left;
    max-width: none;
    margin-top: 12px;
  }
  .shap-bar-row {
    grid-template-columns: 80px minmax(30px, 1fr) 62px;
    gap: 8px;
  }
  .shap-number {
    font-size: 12px;
  }
  .footer {
    display: block;
    font-size: 12px;
  }
  .footer > span {
    display: block;
    margin-bottom: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
