[hidden] {
  display: none !important;
}

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --subtle: #eaeef1;
  --ink: #101518;
  --muted: #4b5563;
  --line: #d5dce2;
  --red: #c81e1e;
  --red-hover: #a51717;
  --teal: #0d9488;
  --teal-tint: #f0fdfa;

  --text-heading: 1.375rem;
  --text-body: 0.9375rem;
  --text-sm: 0.8125rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

.site-header {
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.mark-box {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--teal);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 800;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: var(--text-sm);
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.pro-btn {
  background: var(--surface);
  border: 1px solid #94a3b8;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 5px;
  cursor: pointer;
}

.pro-btn.is-pro {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.mast {
  max-width: 820px;
  margin-bottom: 24px;
}

.mast h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}

.mast p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--muted);
  max-width: 64ch;
}

.scanner-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: start;
}

.editor-card, .report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.head-title {
  font-size: var(--text-body);
  font-weight: 700;
}

.head-btns {
  display: flex;
  gap: 8px;
}

textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: var(--text-body);
  line-height: 1.5;
  resize: vertical;
  color: var(--ink);
}

textarea:focus {
  outline: 2px solid var(--teal);
  border-color: var(--teal);
}

.editor-foot {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.local-note {
  font-size: var(--text-sm);
  color: var(--muted);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-size: var(--text-body);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}

.btn-primary:hover {
  background: var(--red-hover);
}

.btn-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-size: var(--text-body);
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid #cbd5e1;
  color: var(--ink);
  border-radius: 6px;
  padding: 9px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.btn-sm {
  padding: 6px 11px;
}

.full-w {
  width: 100%;
}

.empty-report {
  padding: 36px 16px;
  text-align: center;
}

.empty-report h2 {
  margin: 0 0 8px;
  font-size: var(--text-heading);
}

.empty-report p {
  margin: 0 auto;
  font-size: var(--text-body);
  color: var(--muted);
  max-width: 44ch;
}

.web-score {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  margin-bottom: 14px;
}

.web-score.danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.web-score-num {
  font-size: var(--text-heading);
  font-weight: 800;
  color: #065f46;
}

.web-score.danger .web-score-num {
  color: var(--red);
}

.web-score-label {
  font-size: var(--text-body);
  font-weight: 800;
}

.web-score-sub {
  font-size: var(--text-sm);
  color: var(--muted);
}

.web-findings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.web-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 6px;
  padding: 12px 14px;
}

.web-item-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-body);
  font-weight: 700;
  margin-bottom: 4px;
}

.web-item-reason {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: 6px;
}

.web-item-safe {
  font-size: var(--text-sm);
  color: #0f766e;
  font-weight: 700;
}

.web-locked {
  background: var(--bg);
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}

.web-paywall {
  margin-top: 16px;
  padding: 18px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fffafa;
}

.web-paywall h3 {
  margin: 0 0 6px;
  font-size: var(--text-body);
}

.web-paywall p {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.key-inline {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.key-inline input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: var(--text-sm);
}

.key-feedback {
  margin: 8px 0 0;
  font-size: var(--text-sm);
  color: var(--red);
}

.key-feedback.ok {
  color: #065f46;
}

.rewrite-panel {
  margin-top: 14px;
}

.editorial-block {
  margin-top: 64px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
}

.split-2 {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 36px;
  align-items: start;
}

.split-2 h2 {
  font-family: Georgia, serif;
  font-size: var(--text-heading);
  margin: 0 0 10px;
}

.split-2 p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--muted);
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.trap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: left;
}

.trap-table th, .trap-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.trap-table tr:last-child td {
  border-bottom: none;
}

.trap-table th {
  background: var(--subtle);
  font-weight: 700;
}

.safe-col {
  background: var(--teal-tint);
  font-weight: 600;
  color: #0f766e;
}

.site-footer {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 20px 44px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

@media (max-width: 900px) {
  .scanner-grid, .split-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hide-sm {
    display: none;
  }
  .key-inline {
    flex-direction: column;
  }
}
