:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #626d7c;
  --line: #d8dee8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #d9f4ef;
  --warn: #9a3412;
  --warn-soft: #ffedd5;
  --shadow: 0 14px 40px rgba(27, 39, 58, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #edf7f5 0, rgba(237, 247, 245, 0) 360px),
    var(--bg);
}

.site-header,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header {
  padding: 18px 0 0;
}

.site-footer {
  padding: 20px 0 34px;
  color: var(--muted);
  font-size: 0.94rem;
}

.brand,
.site-header a,
.site-footer a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  font-weight: 900;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.site-header nav a,
.site-footer nav a {
  color: var(--muted);
  font-weight: 700;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.status {
  flex: 0 0 auto;
  max-width: 240px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
}

.pane {
  min-width: 0;
  background: var(--panel);
  padding: 18px;
}

.pane-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 12px;
}

.pane h2,
.report h2,
.content h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.2;
}

textarea {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  color: var(--ink);
  background: #fbfcfd;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

textarea[readonly] {
  background: #f8fafb;
}

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

.primary,
.secondary,
.copy-button,
.icon-button {
  min-height: 40px;
  border-radius: 6px;
  font-weight: 700;
}

.primary {
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary,
.copy-button {
  padding: 0 14px;
  color: var(--ink);
  background: #eef2f6;
}

.secondary:hover,
.copy-button:hover,
.icon-button:hover {
  background: #e2e8f0;
}

.icon-button {
  width: 40px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 1.35rem;
  line-height: 1;
}

.report {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
}

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

.report-head p,
.content p {
  color: var(--muted);
  line-height: 1.65;
}

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

.metrics div,
.category {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfd;
}

dt,
.category-name {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

dd,
.category-count {
  margin: 4px 0 0;
  font-size: 1.45rem;
  font-weight: 800;
}

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

.category.changed {
  border-color: #fed7aa;
  background: var(--warn-soft);
}

.category.changed .category-count {
  color: var(--warn);
}

.content {
  padding: 32px 4px 0;
}

.page-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.page-card h1 {
  margin-bottom: 18px;
}

.page-card h2 {
  margin-top: 26px;
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.page-card p,
.page-card li {
  color: var(--muted);
  line-height: 1.7;
}

.page-card a {
  color: var(--accent-strong);
  font-weight: 800;
}

.content h2 {
  margin-top: 26px;
  font-size: 1.15rem;
}

.content h2:first-child {
  margin-top: 0;
}

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

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 10px 0 0;
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 20px, 680px);
    padding-top: 10px;
  }

  .site-header,
  .site-footer {
    width: min(100% - 20px, 680px);
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav,
  .site-footer nav {
    justify-content: flex-start;
  }

  .tool-head,
  .report-head {
    display: block;
  }

  .status {
    max-width: none;
    margin-top: 14px;
  }

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

  textarea {
    min-height: 220px;
  }

  .tool-head,
  .pane,
  .report,
  .page-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .primary,
  .secondary {
    flex: 1 1 150px;
  }
}
