:root {
  --bg-top: #08121b;
  --bg-bottom: #060a10;
  --panel-border: rgba(103, 156, 186, 0.22);
  --text-main: #eef5fa;
  --text-soft: #aac1d1;
  --text-dim: #7f97a8;
  --accent: #49d9cb;
  --accent-strong: #25b7a8;
  --accent-warm: #d9b05a;
  --good: #51d78a;
  --good-soft: rgba(81, 215, 138, 0.16);
  --moderate: #f0c36d;
  --moderate-soft: rgba(240, 195, 109, 0.16);
  --poor: #ff8686;
  --poor-soft: rgba(255, 134, 134, 0.16);
  --neutral-soft: rgba(123, 160, 184, 0.16);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(73, 217, 203, 0.12), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(217, 176, 90, 0.16), transparent 20%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text-main);
  font-family: Aptos, "Segoe UI", system-ui, sans-serif;
}

a {
  color: inherit;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(129, 179, 204, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 179, 204, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.92), transparent 88%);
}

.page {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero,
.panel,
.result-card,
details.technical-panel {
  background: linear-gradient(180deg, rgba(15, 26, 37, 0.96), rgba(10, 17, 26, 0.88));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 32px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(73, 217, 203, 0.2), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

h1,
h2,
h3,
summary {
  font-family: Bahnschrift, "Trebuchet MS", Aptos, sans-serif;
  letter-spacing: 0.02em;
}

h1 {
  width: min(760px, 100%);
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.hero-copy {
  width: min(700px, 100%);
  margin: 18px 0 0;
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--text-soft);
}

.hero-copy a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(73, 217, 203, 0.4);
}

.hero-copy a:hover {
  border-bottom-color: var(--accent);
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
}

.lang-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(7, 13, 20, 0.52);
  border: 1px solid rgba(103, 156, 186, 0.18);
}

.lang-button {
  padding: 10px 14px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.lang-button.active {
  color: var(--text-main);
  background: rgba(73, 217, 203, 0.16);
  border-color: rgba(73, 217, 203, 0.32);
}

.lang-button:hover:enabled {
  box-shadow: none;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  color: #031015;
  background: linear-gradient(135deg, var(--accent), #6ce6db);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  box-shadow: 0 14px 28px rgba(37, 183, 168, 0.22);
}

button:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37, 183, 168, 0.28);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
  box-shadow: none;
}

.secondary-button {
  color: var(--text-main);
  background: rgba(108, 135, 155, 0.12);
  border: 1px solid rgba(108, 135, 155, 0.22);
  box-shadow: none;
}

.copy-feedback {
  min-height: 1.3em;
  margin-top: 14px;
  color: var(--accent-warm);
  font-size: 0.92rem;
}

.status-line {
  min-height: 1.5em;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.progress-shell {
  margin-top: 22px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(7, 13, 20, 0.65);
  border: 1px solid rgba(103, 156, 186, 0.16);
}

.progress-track {
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(135, 158, 175, 0.12);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent-warm));
  transition: width 100ms linear;
}

.progress-meta {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

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

.result-card {
  border-radius: var(--radius);
  padding: 22px;
  min-height: 188px;
}

.result-card[data-tone="neutral"] {
  border-color: rgba(123, 160, 184, 0.24);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.26);
}

.result-card[data-tone="good"] {
  border-color: rgba(81, 215, 138, 0.45);
  background: linear-gradient(180deg, rgba(15, 31, 24, 0.96), rgba(10, 18, 16, 0.92));
}

.result-card[data-tone="moderate"] {
  border-color: rgba(240, 195, 109, 0.42);
  background: linear-gradient(180deg, rgba(34, 28, 15, 0.96), rgba(20, 17, 10, 0.92));
}

.result-card[data-tone="poor"] {
  border-color: rgba(255, 134, 134, 0.44);
  background: linear-gradient(180deg, rgba(36, 19, 19, 0.96), rgba(22, 11, 11, 0.92));
}

.card-label {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-value {
  margin: 12px 0 10px;
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
}

.card-note {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
  font-size: 0.96rem;
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  border-radius: var(--radius);
  padding: 24px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}

.verdict-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.verdict-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.badge-row,
.signal-grid,
.help-grid {
  display: grid;
  gap: 12px;
}

.badge-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.signal-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

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

.signal-grid .status-badge {
  justify-content: center;
  min-height: 60px;
  line-height: 1.35;
  text-align: center;
}

.mini-panel {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(103, 156, 186, 0.18);
  background: rgba(6, 11, 17, 0.58);
}

.mini-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid transparent;
  background: var(--neutral-soft);
  color: var(--text-main);
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
}

.status-badge.good {
  color: var(--good);
  background: var(--good-soft);
  border-color: rgba(81, 215, 138, 0.36);
}

.status-badge.moderate {
  color: var(--moderate);
  background: var(--moderate-soft);
  border-color: rgba(240, 195, 109, 0.32);
}

.status-badge.poor {
  color: var(--poor);
  background: var(--poor-soft);
  border-color: rgba(255, 134, 134, 0.32);
}

.status-badge.neutral {
  color: var(--text-soft);
  background: var(--neutral-soft);
  border-color: rgba(123, 160, 184, 0.24);
}

.warning-list,
.error-list {
  padding-left: 20px;
  margin: 16px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.warning-list li + li,
.error-list li + li {
  margin-top: 10px;
}

.help-copy {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

details.technical-panel {
  margin-top: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

details summary {
  cursor: pointer;
  list-style: none;
  padding: 24px;
  font-size: 1.15rem;
  font-weight: 700;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  border-bottom: 1px solid rgba(103, 156, 186, 0.18);
}

.technical-content {
  padding: 0 24px 24px;
}

.technical-copy {
  margin: 0 0 16px;
  color: var(--text-soft);
  line-height: 1.65;
}

.technical-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.technical-stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(6, 11, 17, 0.58);
  border: 1px solid rgba(103, 156, 186, 0.18);
}

.technical-stat strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.raw-title {
  margin: 18px 0 10px;
  font-size: 1rem;
  color: var(--text-main);
}

pre {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(4, 8, 12, 0.88);
  border: 1px solid rgba(103, 156, 186, 0.16);
  color: #d8e8f4;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.disclaimer {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 0.93rem;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 980px) {
  .summary-grid,
  .signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .insights-grid,
  .technical-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1000px);
    padding-top: 20px;
  }

  .hero-top {
    flex-direction: column;
  }

  .hero,
  .panel,
  .result-card,
  details summary,
  .technical-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .summary-grid,
  .badge-row,
  .signal-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }

  .progress-meta {
    flex-direction: column;
  }
}
