:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #fff;
  --text: #172033;
  --muted: #667085;
  --border: #d0d5dd;
  --accent: #2563eb;
  --accent-pressed: #1d4ed8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101828;
    --card: #1d2939;
    --text: #f2f4f7;
    --muted: #98a2b3;
    --border: #344054;
    --accent: #60a5fa;
    --accent-pressed: #3b82f6;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
}

header,
main,
footer {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

header {
  padding: 28px 0 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

header nav,
.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.2;
}

h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

ul {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: 17px;
  max-width: 760px;
}

.info-panel,
.content-block,
.tool {
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 12px 0 24px;
}

.home-section {
  margin: 24px 0;
}

.card {
  display: block;
  min-height: 124px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
}

.card-note,
.tool-note {
  color: var(--muted);
  font-size: 14px;
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
}

.example-table th,
.example-table td {
  padding: 10px;
  border: 1px solid var(--border);
  text-align: left;
}

label {
  display: block;
  margin: 0 0 8px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 168px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

button {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  transition: background-color 120ms ease, transform 120ms ease;
}

button.secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

button.button-pressed,
button.secondary.button-pressed {
  background: var(--accent-pressed);
  color: white;
  transform: translateY(1px);
}

.summary {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
}

.error {
  display: none;
}

footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.copyright {
  margin-top: 4px;
}

@media (max-width: 520px) {
  button {
    width: 100%;
  }

  .actions {
    display: grid;
  }
}
