:root {
  color-scheme: light;
  --bg: #f6f4ee;
  --ink: #1c2430;
  --muted: #5c6672;
  --panel: #ffffff;
  --line: #d9ded6;
  --accent: #1f8a70;
  --accent-dark: #116452;
  --warn: #b84a36;
  --ready: #2457a6;
  --soft: #e8f3ef;
  --shadow: 0 18px 45px rgba(28, 36, 48, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f7f9fb 0%, #eef3f2 100%);
  color: var(--ink);
}

button,
input,
select,
.button-link {
  font: inherit;
}

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

.workspace {
  display: grid;
  gap: 18px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 20px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.intro-copy {
  margin-bottom: 4px;
  color: var(--muted);
  line-height: 1.7;
}

.checker {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.input-panel,
.output-panel,
.headers-panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.78rem;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}

input[type="url"],
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

input[type="url"]:focus,
select:focus,
button:focus-visible,
pre:focus {
  outline: 3px solid rgba(31, 138, 112, 0.28);
  outline-offset: 2px;
}

.choice-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 800;
}

.choice-group label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.45;
}

.choice-group input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.actions,
.copy-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.actions {
  margin-top: 18px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  background: var(--soft);
}

.small {
  min-height: 36px;
  padding: 0 12px;
}

.score-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: #f9fbfb;
  border: 1px solid var(--line);
}

.score-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.score-label {
  color: var(--muted);
  font-weight: 800;
}

#score {
  color: var(--ready);
  font-size: 2.2rem;
}

.meter {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe6ea;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ready));
  transition: width 160ms ease;
}

.status {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 800;
  line-height: 1.45;
}

.status.warn {
  background: #fff1ed;
  color: var(--warn);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.result-block {
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

ul {
  margin: 0;
  padding-left: 19px;
}

li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.checklist-box {
  margin-top: 14px;
}

.copy-row {
  justify-content: space-between;
  margin-bottom: 8px;
}

pre {
  width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17202b;
  color: #edf7f3;
  line-height: 1.55;
  font-size: 0.88rem;
}

.copy-feedback {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.headers-panel {
  max-width: 100%;
}

.not-found {
  max-width: 760px;
  margin: 12vh auto 0;
  padding: 24px;
}

@media (max-width: 860px) {
  .intro,
  .checker,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 20px, 720px);
    padding: 18px 0;
  }

  .input-panel,
  .output-panel,
  .headers-panel {
    padding: 16px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .copy-row button {
    width: auto;
  }
}
