:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #111827;
  --muted: #5f6b7a;
  --line: #d9dee7;
  --line-strong: #c6ceda;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #e8f5f2;
  --danger: #b42318;
  --danger-soft: #fff4f2;
  --code: #111827;
  --radius: 14px;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.top-nav {
  width: min(1180px, calc(100% - 32px));
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #a9d3ca;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.nav-links a,
.intro-actions a,
.footer-links a {
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a {
  padding: 9px 11px;
}

.nav-links a:hover,
.intro-actions a:hover,
.footer-links a:hover {
  background: #edf1f5;
  color: var(--text);
}

.page-intro {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 720px) auto;
  gap: 20px;
  align-items: end;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 8px 0 0;
  font-size: 36px;
  line-height: 1.08;
}

h2 {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.lead-copy {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.intro-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.intro-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0 13px;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 42px;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  grid-template-areas:
    "tool result"
    "summary result";
  gap: 16px;
  align-items: start;
}

.tool-panel,
.metrics-panel,
.result-panel,
.docs-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-panel {
  grid-area: tool;
  padding: 20px;
}

.metrics-panel {
  grid-area: summary;
  padding: 18px;
}

.result-panel {
  grid-area: result;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(540px, calc(100vh - 214px));
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin-bottom: 14px;
}

.status-pill {
  min-width: 76px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.status-pill.ready {
  border-color: #b7ddd4;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-pill.offline {
  border-color: #f4c7c3;
  background: var(--danger-soft);
  color: var(--danger);
}

.upload-form {
  display: grid;
  gap: 14px;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 236px;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 1.5px dashed #a7b0bf;
  border-radius: var(--radius);
  background: #fbfcfe;
  cursor: pointer;
  padding: 22px;
  text-align: center;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: #f2fbf8;
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.upload-icon {
  display: inline-grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid #bdd9d3;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
}

.drop-title {
  font-size: 21px;
  font-weight: 850;
}

.drop-subtitle,
.file-name {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.file-name {
  max-width: 100%;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.select-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select,
button {
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

select {
  padding: 0 12px;
}

button {
  padding: 0 15px;
  cursor: pointer;
  font-weight: 800;
}

button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #f8fafc;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.support-list {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.support-list div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 11px 12px;
}

.support-list strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.support-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metrics strong {
  min-width: 0;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.warning-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.warning-list p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f4c7c3;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.tabs,
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs {
  margin-top: 8px;
}

.tab.active {
  border-color: #a9d3ca;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.output-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.output {
  margin: 0;
  padding: 18px;
  overflow: auto;
  background: var(--code);
  color: #edf2f7;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.docs-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 50px;
}

.docs-content {
  padding: 28px;
}

.docs-content ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.docs-code {
  margin: 10px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--code);
  color: #edf2f7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 20px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

.footer-inner p {
  max-width: 440px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.footer-brand {
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 520px;
}

.footer-links a {
  padding: 8px 10px;
}

.copyright {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .page-intro,
  .app-shell {
    width: min(100% - 24px, 760px);
  }

  .page-intro {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 22px;
  }

  .intro-actions {
    justify-content: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "tool"
      "summary"
      "result";
  }

  .result-panel {
    grid-template-rows: auto auto minmax(440px, 65vh);
  }
}

@media (max-width: 680px) {
  .top-nav {
    width: min(100% - 20px, 680px);
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
  }

  .nav-links {
    width: 100%;
  }

  h1 {
    font-size: 30px;
  }

  .page-intro,
  .app-shell,
  .footer-inner,
  .copyright {
    width: min(100% - 20px, 680px);
  }

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

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions button,
  .tabs button {
    flex: 1 1 auto;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
