:root {
  --accent: #ff8f1f;
  --text: #000000;
  --muted: #f4f4f4;
  --line: #ffffff;
  --grid-gap: 4px;
}

* {
  box-sizing: border-box;
}

html {
  background: #ffffff;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #ffffff;
  font-family: "Comfortaa", sans-serif;
  font-size: 17px;
  font-weight: 350;
  line-height: 1.15;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.page {
  width: min(100% - 32px, 432px);
  margin: 34px auto 64px;
}

.intro {
  display: grid;
  gap: var(--grid-gap);
  margin-bottom: var(--grid-gap);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  padding: 8px 10px 7px;
  background: #f4f4f4;
  color: var(--text);
  font-size: clamp(22px, 6.25vw, 29px);
  font-weight: 350;
  line-height: 1.18;
  text-align: center;
}

h1 span,
.intro p span,
h2 span,
.link-row span,
.footer span {
  display: block;
}

h1 span,
.intro p span,
.folder-tab span,
.footer span {
  white-space: nowrap;
}

h1 span[dir="rtl"] {
  font-size: clamp(22px, 6.25vw, 31px);
}

.intro p {
  padding: 7px 12px 9px;
  background: var(--muted);
  color: var(--accent);
  font-size: clamp(15px, 4.5vw, 21px);
  line-height: 1.22;
  text-align: center;
}

.folder-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-top: 0;
}

.folder-tab {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 4px 3px;
  border: 0;
  border-bottom: 4px solid var(--line);
  background: var(--muted);
  color: var(--text);
  cursor: pointer;
  font-size: clamp(8px, 2.9vw, 14px);
  font-weight: 350;
  line-height: 1.18;
  text-align: center;
}

.folder-tab span {
  display: block;
  min-width: 0;
}

.folder-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

.link-section {
  margin-top: 0;
}

h2 {
  display: none;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 31px;
  padding: 3px 12px;
  background: var(--muted);
  color: var(--accent);
  font-size: 18px;
  font-weight: 350;
}

h2 span:last-child {
  text-align: right;
}

.link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap);
  margin-top: 0;
}

.link-grid.two-col {
  grid-template-columns: 1fr 1fr;
  column-gap: var(--grid-gap);
  row-gap: var(--grid-gap);
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  min-height: 29px;
  padding: 3px 12px;
  background: var(--muted);
  transition: color 120ms ease, background-color 120ms ease;
}

.link-row:hover,
.link-row:focus-visible {
  background: #e7e7e7;
  color: #5f5f64;
}

.link-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.link-row span:first-child {
  text-align: left;
  overflow-wrap: anywhere;
}

.link-row span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
}

.footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 17px 12px 0;
  font-size: clamp(12px, 3.65vw, 17px);
}

.footer span:last-child {
  text-align: right;
}

[lang="fa"] {
  font-family: "Vazirmatn", sans-serif;
  font-weight: 220;
  direction: rtl;
  unicode-bidi: plaintext;
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .page {
    width: min(100% - 24px, 432px);
    margin-top: 30px;
  }

  h1 {
    padding-inline: 10px;
  }

  h2 {
    font-size: 17px;
  }

  .folder-tab {
    min-height: 42px;
  }

  .link-row {
    min-height: 28px;
    padding-inline: 10px;
  }
}

@media (max-width: 380px) {
  .link-grid.two-col {
    grid-template-columns: 1fr;
  }
}
