:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #20242a;
  --muted: #68707c;
  --line: #dde3ea;
  --accent: #146c63;
  --accent-2: #b45f06;
  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); display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #111820; color: #fff; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--accent); font-weight: 800; }
.brand small { display: block; color: #a9b4c1; margin-top: 4px; }
label span { display: block; color: #a9b4c1; margin-bottom: 8px; }
select, input, button, textarea, .export { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font: inherit; }
textarea { min-height: 140px; padding: 12px; resize: vertical; }
button, .export { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border: 0; text-decoration: none; font-weight: 700; cursor: pointer; }
.app { padding: 28px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.05rem; }
.topbar p { color: var(--muted); margin-top: 6px; }
.seo-scan { display: flex; gap: 10px; width: min(520px, 100%); }
.seo-scan input { background: #fff; }
.seo-scan button { width: 96px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metrics article, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px rgba(20, 32, 46, .06); }
.metrics article { padding: 18px; }
.metrics span { color: var(--muted); }
.metrics strong { display: block; margin-top: 8px; font-size: 2rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.panel { padding: 18px; margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.list-row small { display: block; color: var(--muted); margin-top: 3px; }
.list-row b { color: var(--accent-2); font-size: 1.1rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; }
.empty, .seo-result { color: var(--muted); line-height: 1.6; }
.seo-result strong { color: var(--ink); }
.article-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.article-form textarea, .article-form button { grid-column: 1 / -1; }
.lead-export-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.lead-export-form label span { color: var(--muted); }
.score-card { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.score-card strong { color: var(--accent); font-size: 3rem; line-height: 1; }
.score-card span { color: var(--muted); font-weight: 700; }
.api-note { color: var(--muted); font-size: .9rem; margin-top: 12px; }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .topbar, .seo-scan { flex-direction: column; }
  .metrics, .grid { grid-template-columns: 1fr; }
  .article-form, .lead-export-form { grid-template-columns: 1fr; }
}
