:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #f9fafc;
  --ink: #111318;
  --muted: #667085;
  --line: #e3e8f0;
  --line-strong: #cfd8e6;
  --accent: #0071e3;
  --accent-dark: #0057b8;
  --accent-soft: #eaf4ff;
  --warn: #9a3412;
  --warn-soft: #fff4ed;
  --code: #0b1020;
  --good: #0a84ff;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a,
button,
textarea {
  font: inherit;
}

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

button,
.feature-menu a,
.feature-menu span,
.ghost {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 14px;
}

button {
  cursor: pointer;
}

button:hover,
.feature-menu a:hover,
.feature-menu span:hover,
.ghost:hover {
  border-color: var(--accent);
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.18);
  outline-offset: 2px;
}

#analyzeBtn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

#analyzeBtn:hover {
  background: var(--accent-dark);
}

.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.feature-menu a,
.feature-menu span {
  min-height: 34px;
  background: var(--panel-strong);
  font-size: 0.9rem;
  color: var(--muted);
}

.feature-menu span {
  cursor: default;
}

.home-page {
  background:
    linear-gradient(rgba(17, 19, 24, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbfcff 0%, #eef3fa 100%);
  background-size: 44px 44px, 44px 44px, auto;
}

.home-shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.home-nav,
.home-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
}

.wordmark {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.github-link {
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(102, 112, 133, 0.32);
}

.github-link:hover {
  color: var(--accent-dark);
  border-color: var(--accent-dark);
}

.home-hero {
  align-self: center;
  display: grid;
  gap: 28px;
  padding: 64px 0;
}

.kicker {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 760px;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  font-weight: 650;
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.home-copy {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
}

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

.tool-card {
  min-height: 170px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.tool-card > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.tool-card strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.tool-card small {
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-card.active {
  background: #111827;
  color: #ffffff;
  border-color: var(--ink);
}

.tool-card.active small,
.tool-card.active > span {
  color: rgba(255, 255, 255, 0.64);
}

.tool-card.active:hover {
  transform: translateY(-2px);
}

.tool-card.muted {
  color: rgba(17, 19, 24, 0.58);
  cursor: default;
}

.home-foot {
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.47fr);
  gap: 16px;
}

.editor-panel,
.result-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.editor-panel {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  overflow: hidden;
}

.panel-head,
.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.panel-head {
  border-bottom: 1px solid var(--line);
}

.panel-head label {
  font-weight: 650;
}

.language-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 650;
}

textarea {
  width: 100%;
  min-height: 100%;
  resize: vertical;
  border: 0;
  background: var(--code);
  color: #f8fafc;
  padding: 18px;
  font-family: "SF Mono", "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  tab-size: 2;
}

.editor-foot {
  min-height: 54px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 0.95fr) auto;
  overflow: hidden;
}

.result-hero {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  display: grid;
  gap: 4px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-hero strong {
  color: var(--accent-dark);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.result-hero span:last-child {
  color: var(--muted);
  font-weight: 650;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.metric {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 6px;
  border-right: 1px solid var(--line);
  background: var(--panel-strong);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.metric strong {
  font-weight: 600;
  min-height: 1.3em;
  overflow-wrap: anywhere;
}

.meter {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf5;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--good);
}

.result-section {
  min-height: 0;
  padding: 14px 16px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
}

.result-section:last-child {
  border-bottom: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.signals,
.notes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signals li,
.notes li {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  line-height: 1.35;
}

.notes li {
  border-color: #e6c7ae;
  background: var(--warn-soft);
  color: var(--warn);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td {
  border-bottom: 0;
}

td:first-child,
td:last-child {
  width: 1%;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .shell {
    padding: 14px;
  }

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

  .topbar {
    display: grid;
    align-items: stretch;
  }

  .feature-menu {
    justify-content: start;
  }

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

  .editor-panel {
    grid-template-rows: auto minmax(360px, 56vh) auto;
  }

  .result-panel {
    min-height: 680px;
  }
}

@media (max-width: 640px) {
  .home-nav,
  .home-foot {
    align-items: flex-start;
    display: grid;
  }

  .home-hero {
    padding: 36px 0;
  }

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

  .tool-card {
    min-height: 130px;
  }

  .panel-head,
  .editor-foot,
  .metrics {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .editor-foot {
    display: grid;
  }

  .actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .metric:last-child {
    border-bottom: 0;
  }
}
