:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1b1e23;
  --muted: #69707c;
  --border: #e2e5ea;
  --accent: #2f6fed;
  --accent-soft: #e9f0fe;
  --green: #12804a;
  --red: #c23a2f;
  --radius: 14px;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1a1d22;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --border: #2b3038;
    --accent: #6c9cff;
    --accent-soft: #1d2840;
    --green: #5fd296;
    --red: #ff7b72;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 1.9rem;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

a {
  color: var(--accent);
}

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 6px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 6px 0 24px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.error {
  color: var(--red);
}

.hidden {
  display: none !important;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.button,
button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  font-weight: 500;
}

button.ghost:hover {
  color: var(--red);
}

input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row input {
  flex: 1;
  min-width: 0;
}

.actions {
  margin: 16px 0 0;
}

.section-gap {
  margin-top: 14px;
}

.steps {
  margin: 0;
  padding-left: 20px;
}

.steps li + li {
  margin-top: 6px;
}

.counter {
  margin: 14px 0 0;
}

.counter b,
.big-number {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}

.link-box {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  overflow-wrap: anywhere;
  flex: 1;
}

.chart {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
  align-items: end;
  height: 72px;
  margin-top: 16px;
}

.bar {
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  opacity: 0.85;
}

.bar.empty {
  background: var(--border);
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.list li:first-child {
  border-top: none;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
}

.sample h1 {
  font-size: 1.6rem;
}

.sample h2 {
  margin-top: 18px;
}

.banner {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

footer {
  margin-top: 28px;
  font-size: 0.85rem;
}
