:root {
  --ink: #10211f;
  --muted: #5f716d;
  --line: #dbe7e4;
  --paper: #f5faf8;
  --white: #fff;
  --teal: #0f766e;
  --blue: #2457d6;
  --green: #138a54;
  --yellow: #c28a08;
  --orange: #d65a1f;
  --red: #c92d2d;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #eef8f6 0%, #fff 46%, #f6faf9 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: inherit; }
.wrap { width: min(100% - 32px, 1180px); margin: 0 auto; }
.narrow { max-width: 780px; }
.site-header {
  width: min(100% - 32px, 1180px);
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  position: sticky;
  top: 10px;
  z-index: 10;
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--teal); color: white; font-weight: 900; }
.brand small { display: block; color: var(--muted); font-size: .78rem; }
.nav { display: flex; gap: 16px; color: var(--muted); font-weight: 700; font-size: .94rem; }
.nav a { text-decoration: none; }
.hero {
  width: min(100% - 32px, 1180px);
  margin: 42px auto;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 30px;
  align-items: stretch;
}
.hero-copy { padding: 44px 0; }
.eyebrow { margin: 0 0 10px; color: var(--teal); text-transform: uppercase; font-weight: 900; font-size: .78rem; letter-spacing: 0; }
h1 { margin: 0 0 18px; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 1.35rem; letter-spacing: 0; }
h3 { margin: 0 0 8px; }
p { color: var(--muted); }
.source-file { margin-top: -8px; font-size: .96rem; }
.analyzer, .info-block, .warning, .score-panel, .grid-3 article, .ad-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 50px rgba(16,33,31,.08);
}
.analyzer { padding: 22px; }
label { display: block; font-weight: 900; margin-bottom: 10px; }
textarea {
  width: 100%;
  min-height: 380px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  font: inherit;
  color: var(--ink);
}
textarea:focus { outline: 3px solid rgba(15,118,110,.18); border-color: var(--teal); }
.file-upload {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.file-upload span { display: block; margin-bottom: 8px; }
.file-upload input { width: 100%; }
.file-upload small { display: block; color: var(--muted); margin-top: 8px; font-weight: 700; }
.counter, .actions, .footer, .result-head, .report-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.counter { color: var(--muted); font-weight: 800; margin-top: 10px; }
.notice { font-size: .95rem; }
.button {
  appearance: none;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 900;
  text-decoration: none;
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
}
.button-ghost { background: white; color: var(--teal); }
.button-small { padding: 9px 12px; min-height: 38px; font-size: .9rem; }
.warning { padding: 18px 20px; border-left: 5px solid var(--yellow); }
.warning strong { display: block; margin-bottom: 4px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; margin-bottom: 42px; }
.grid-3 article, .info-block { padding: 22px; }
.ad-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 28px; margin-bottom: 28px; }
.ad-card { padding: 18px; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.ad-card span { color: var(--blue); font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 36px; }
.result-main { display: grid; gap: 22px; }
.score-panel { padding: 22px; }
.score-panel span { color: var(--muted); font-weight: 800; }
.score-panel strong { display: block; font-size: 2.2rem; margin: 3px 0; }
.score-panel small { color: var(--muted); font-weight: 700; }
.bar { height: 14px; background: #edf2f1; border-radius: 999px; overflow: hidden; margin-top: 16px; }
.bar.small { height: 8px; margin: 4px 0 12px; }
.bar i { display: block; height: 100%; border-radius: inherit; }
.low { background: var(--green); }
.mid { background: var(--yellow); }
.high { background: var(--orange); }
.very-high { background: var(--red); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0; }
.score-pill { display: inline-flex; min-width: 42px; justify-content: center; color: white; border-radius: 999px; padding: 4px 9px; font-weight: 900; }
.fragment-bar-row td { padding-top: 0; }
.page { margin-top: 46px; margin-bottom: 56px; }
.page h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.report { margin-top: 32px; }
.footer {
  width: min(100% - 32px, 1180px);
  margin: 56px auto 24px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
}
.footer p { max-width: 720px; margin: 6px 0 0; }
.footer nav { display: flex; gap: 14px; color: var(--muted); font-weight: 700; }

@media (max-width: 900px) {
  .site-header, .hero, .result-layout { grid-template-columns: 1fr; }
  .site-header { align-items: flex-start; }
  .nav { flex-wrap: wrap; }
  .hero { margin-top: 24px; }
  .hero-copy { padding: 10px 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .ad-card { align-items: flex-start; flex-direction: column; }
}

@media print {
  .site-header, .footer, .print-hide, .actions { display: none !important; }
  body { background: white; }
  .wrap { width: 100%; }
  .score-panel, .warning, .info-block, .ad-card { box-shadow: none; }
}
