@font-face {
  font-family: Vazirmatn;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
}

@font-face {
  font-family: Vazirmatn;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Vazirmatn-Bold.woff2") format("woff2");
}

body {
  font-family: Vazirmatn, system-ui, sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  color: #1c2833;
}

button, input {
  font: inherit;
}

#presets {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-inline-end: 12px;
}

.chip {
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 4px 12px;
  background: #fff;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: #2c3e50;
  color: #fff;
  border-color: #2c3e50;
}

#controls label {
  margin-inline-end: 12px;
}

#controls small {
  display: block;
  margin-top: 6px;
  color: #666;
}

input {
  direction: ltr;
  text-align: center;
  width: 9em;
}

.num {
  direction: ltr;
  unicode-bidi: isolate;
}

#figure {
  margin: 16px 0 8px;
}

#chart {
  width: 100%;
  height: auto;
  display: block;
}

#notes {
  font-size: 0.85em;
  color: #555;
}

#error {
  color: #c0392b;
}

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

th, td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  text-align: right;
}

th:not(:first-child), td:not(:first-child) {
  text-align: center;
}

footer {
  font-size: 0.8em;
  color: #666;
}

@media (max-width: 600px) {
  #controls label {
    display: block;
    margin-top: 8px;
  }

  table {
    font-size: 0.8em;
  }
}
