:root {
  color-scheme: light;
  --bg: #f7faf9;
  --ink: #132022;
  --muted: #53676b;
  --line: #d7e2df;
  --panel: #ffffff;
  --panel-2: #eef7f6;
  --teal: #155e75;
  --blue: #1d4ed8;
  --green: #047857;
  --amber: #b45309;
  --red: #b91c1c;
  --black: #0d1b1e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--black);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small,
.eyebrow,
.host,
footer {
  color: var(--muted);
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
}

nav a:hover,
button:hover {
  background: #e7f2f0;
}

.shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 38px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.input-pane,
.result-pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  box-shadow: 0 16px 42px rgba(19, 32, 34, 0.08);
}

.input-pane {
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 174px);
}

.result-pane {
  padding: 18px;
  min-height: calc(100vh - 174px);
  display: flex;
  flex-direction: column;
}

.pane-title,
.result-head,
.actions,
.control-row,
.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pane-title {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(26px, 3.2vw, 48px);
  max-width: 740px;
}

h2 {
  font-size: clamp(22px, 2.4vw, 34px);
}

.host {
  border: 1px solid var(--line);
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
}

button {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.primary:hover {
  background: #0f4a5c;
}

.control-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.field-label {
  font-weight: 800;
  margin: 4px 0 8px;
}

textarea {
  width: 100%;
  flex: 1;
  min-height: 420px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #0d1b1e;
  color: #d9fff7;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

textarea::placeholder {
  color: #88a6a7;
}

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

.hint-grid span {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.score-ring {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) 0deg, var(--line) 0deg);
  color: var(--black);
  font-size: 22px;
  font-weight: 900;
  flex: 0 0 auto;
}

.actions {
  justify-content: flex-start;
  margin: 14px 0;
  flex-wrap: wrap;
}

.summary-box {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 13px 14px;
  background: #f9fcfb;
  color: var(--muted);
  line-height: 1.45;
}

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

.count-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.count-grid strong,
.count-grid span {
  display: block;
}

.count-grid strong {
  font-size: 24px;
}

.count-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tabs {
  justify-content: flex-start;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  gap: 0;
}

.tab {
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
}

.tab.active {
  border-bottom-color: var(--teal);
  color: var(--teal);
}

.panel {
  display: none;
  min-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.panel.active {
  display: block;
}

.finding {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 10px;
  background: #fff;
}

.finding h3 {
  margin: 8px 0;
  font-size: 17px;
}

.finding p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.critical,
.high {
  background: var(--red);
}

.medium {
  background: var(--amber);
}

.low {
  background: var(--blue);
}

.info {
  background: var(--green);
}

code {
  color: var(--black);
  background: #edf3f2;
  padding: 2px 5px;
  border-radius: 4px;
  word-break: break-word;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: #fbfdfc;
}

.step-list,
.source-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.step-list li,
.source-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  line-height: 1.45;
}

.source-list a {
  color: var(--blue);
  font-weight: 800;
}

footer {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 38px) 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

@media (max-width: 900px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

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

  .input-pane,
  .result-pane {
    min-height: auto;
  }

  textarea {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .pane-title,
  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hint-grid,
  .count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  button {
    width: 100%;
  }

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