:root {
  --typography-scale: 1;
  --typography-letter-spacing: 0px;
}

html.typography-readable {
  --typography-letter-spacing: 0.025em;
}

html.typography-readable body,
html.typography-readable button,
html.typography-readable input,
html.typography-readable select,
html.typography-readable textarea {
  line-height: 1.8;
}

html.typography-readable p,
html.typography-readable label,
html.typography-readable small {
  max-width: 75ch;
}

body,
button,
input,
select,
textarea {
  letter-spacing: var(--typography-letter-spacing);
}

body {
  font-size: calc(16px * var(--typography-scale));
}

html[data-typography-scale="0.85"] body { zoom: 0.85; }
html[data-typography-scale="0.9"] body { zoom: 0.9; }
html[data-typography-scale="0.95"] body { zoom: 0.95; }
html[data-typography-scale="1.05"] body { zoom: 1.05; }
html[data-typography-scale="1.1"] body { zoom: 1.1; }
html[data-typography-scale="1.15"] body { zoom: 1.15; }
html[data-typography-scale="1.2"] body { zoom: 1.2; }
html[data-typography-scale="1.25"] body { zoom: 1.25; }

.typography-controls {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.typography-controls__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.typography-controls__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.typography-controls button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: inherit;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.typography-controls button[aria-pressed="true"] {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.16);
}
