:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --line: #d5ddea;
  --line-strong: #b8c4d6;
  --text: #0e1726;
  --muted: #5d6a7c;
  --blue: #155eef;
  --blue-dark: #0f4acc;
  --blue-soft: #edf3ff;
  --amber: #b76200;
  --amber-soft: #fff7e8;
  --green: #147449;
  --green-soft: #eaf8f0;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 520px),
    var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(100% - 32px, 1480px);
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 470px;
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: #204f98;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.06;
  letter-spacing: 0;
}

.lede {
  max-width: 820px;
  margin: 10px 0 0;
  color: #334155;
  font-size: 17px;
}

.hero-note,
.safety-card,
.info-block,
.faq-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.hero-note {
  padding: 18px 20px;
  border-color: #f1c987;
  background: var(--amber-soft);
}

.hero-note strong,
.hero-note span {
  display: block;
}

.hero-note span {
  margin-top: 4px;
  color: #54350a;
}

.workbench {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 282px;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.workbench-title {
  grid-column: 1 / -1;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
}

.workbench-title h2,
.workbench-title p {
  margin: 0;
}

.workbench-title h2 {
  font-size: 17px;
}

.workbench-title p {
  margin-top: 2px;
  color: var(--muted);
}

.upload-rail,
.report-panel,
.safety-card {
  padding: 16px;
}

.upload-rail {
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.rail-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.rail-heading h3,
.safety-card h3,
.report-header h3,
.info-block h2,
.faq-section h2 {
  margin: 0;
}

.step {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.dropzone {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #9aa9c1;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.dropzone strong {
  font-size: 17px;
}

.dropzone small,
.dropzone span {
  color: var(--muted);
}

.drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid #b7c5da;
  border-radius: 8px;
  color: #29384e;
  font-family: var(--mono);
  font-weight: 800;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.primary-btn,
.secondary-btn,
.text-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border-radius: 6px;
  font-weight: 800;
}

.primary-btn {
  border: 1px solid var(--blue-dark);
  color: #fff;
  background: linear-gradient(180deg, #1b6dff, var(--blue));
}

.secondary-btn {
  border: 1px solid #b7c8e6;
  color: var(--blue);
  background: #fff;
}

.text-btn {
  border: 0;
  color: #435266;
  background: transparent;
}

.compact {
  width: auto;
  min-height: 36px;
  margin-top: 0;
  padding: 0 14px;
}

.mini-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.mini-panel h4,
.mini-panel p,
.status-message,
.engine-note {
  margin: 0;
}

.mini-panel p,
.status-message {
  color: var(--muted);
  font-size: 13px;
}

.status-message {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #cbd8ec;
  border-radius: 6px;
  background: var(--blue-soft);
}

.report-panel {
  min-width: 0;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tabs {
  display: flex;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  background: #f6f8fc;
}

.tab {
  min-width: 116px;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  color: #344257;
  background: transparent;
}

.tab.is-active {
  color: var(--blue);
  background: #fff;
  box-shadow: inset 0 -2px 0 var(--blue);
  font-weight: 800;
}

.tab-panel {
  display: none;
  min-height: 322px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.tab-panel.is-active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metrics-grid div {
  padding: 10px;
  border: 1px solid #dce4f0;
  border-radius: 6px;
  background: #fbfcff;
}

.metrics-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics-grid strong {
  display: block;
  margin-top: 3px;
}

.mono-table,
.data-list,
.dependency-tree {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
  font-family: var(--mono);
  font-size: 12px;
}

.table-row,
.data-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr 1.4fr;
  min-width: 620px;
}

.table-row span,
.data-row span {
  padding: 8px 10px;
  border-bottom: 1px solid #e4eaf3;
}

.table-head,
.data-head {
  color: #233147;
  background: #eef3fa;
  font-weight: 800;
}

.dependency-tree {
  padding: 12px;
  color: #243349;
}

.tree-line {
  margin: 5px 0;
  padding-left: calc(var(--level) * 18px);
  font-family: var(--mono);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.engine-note {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #d7e6dd;
  border-radius: 6px;
  color: #244b37;
  background: #f0faf4;
  font-size: 13px;
}

.safety-card {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--amber-soft);
}

.safety-card h3 {
  color: #7a4300;
}

.warning-copy {
  color: #603c07;
  font-weight: 800;
}

.safety-card ul {
  margin: 14px 0;
  padding-left: 20px;
}

.safety-card li + li {
  margin-top: 10px;
}

.amber-note {
  padding: 12px;
  border: 1px solid #edb65a;
  border-radius: 6px;
  color: #7a4300;
  background: #fffaf0;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.info-block {
  padding: 20px;
}

.info-block h2,
.faq-section h2 {
  font-size: 20px;
}

.info-block p,
.info-block li {
  color: #344257;
}

.info-block ol,
.info-block ul {
  padding-left: 22px;
}

.limitations {
  border-color: #f0c275;
  background: #fffaf2;
}

.examples {
  background: #f8fbff;
}

.faq-section {
  margin-top: 14px;
  padding: 20px;
}

details {
  border-top: 1px solid var(--line);
}

details:first-of-type {
  margin-top: 10px;
}

summary {
  padding: 14px 0;
  font-weight: 800;
  cursor: pointer;
}

details p {
  margin: 0 0 14px;
  color: #344257;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .workbench {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .safety-card {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 0;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .lede {
    font-size: 16px;
  }

  .workbench,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .upload-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .report-header {
    display: block;
  }

  .badge {
    margin-top: 8px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .tab-panel {
    min-height: 0;
  }
}
