.app-header {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.language-switcher {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 950;
}

.language-switcher a.is-active,
.language-switcher a:hover,
.language-switcher a:focus-visible {
  color: var(--ink);
  background: var(--panel);
  outline: none;
}

.quota-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 920px;
  margin: 0 0 16px;
  padding: 14px;
  background: #eef4ff;
  border: 1px solid #cadcff;
  border-radius: var(--radius);
}

.quota-panel strong,
.quota-panel span {
  display: block;
}

.quota-panel strong {
  color: var(--ink);
  font-size: 17px;
}

.quota-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.quota-panel.is-locked {
  background: #fff7ed;
  border-color: #fed7aa;
}

.quota-panel.is-active {
  background: #e8f7f1;
  border-color: #c7ebdc;
}

[dir="rtl"] body {
  font-family: Tahoma, Arial, ui-sans-serif, system-ui, sans-serif;
}

[dir="rtl"] .thread-row {
  text-align: right;
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  .language-switcher {
    order: 4;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .language-switcher a {
    flex: 1;
  }

  .quota-panel {
    align-items: stretch;
    flex-direction: column;
  }
}
