/* Shared chrome, settings dialog, RTL + light-theme extras */

.ax6-chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.ax6-seg {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.ax6-chip {
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.ax6-seg .ax6-chip {
  border: none;
  border-radius: 0;
  background: transparent;
}

a.ax6-chip {
  text-decoration: none;
}

#lang-switcher {
  display: none !important;
}

.ax6-chip:hover,
.ax6-chip[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.ax6-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.ax6-dialog.hidden {
  display: none;
}

.ax6-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
}

.ax6-panel {
  position: relative;
  z-index: 1;
  width: min(36rem, 100%);
  max-height: min(86vh, 42rem);
  overflow: auto;
  padding: 1.35rem 1.35rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.ax6-panel h2 {
  margin: 0 2rem 0.5rem 0;
  font-size: 1.25rem;
}

html[dir="rtl"] .ax6-panel h2 {
  margin: 0 0 0.5rem 2rem;
}

.ax6-panel h3 {
  margin: 1.15rem 0 0.45rem;
  font-size: 0.95rem;
}

.ax6-panel p,
.ax6-help {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.ax6-fav-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 0.75rem;
}

@media (max-width: 560px) {
  .ax6-fav-list {
    grid-template-columns: 1fr;
  }
}

.ax6-fav-list label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0;
  font-size: 0.88rem;
  cursor: pointer;
}

.ax6-fav-list input {
  accent-color: var(--accent);
}

.ax6-code {
  width: 100%;
  min-height: 4.5rem;
  margin: 0.35rem 0 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input, rgba(0, 0, 0, 0.2));
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, Tahoma, monospace;
  font-size: 0.78rem;
  resize: vertical;
  word-break: break-all;
  direction: ltr;
  text-align: left;
}

.ax6-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.25rem 0 0.6rem;
}

html[lang="fa"] body {
  font-family: Vazirmatn, Inter, Tahoma, system-ui, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
}

:root {
  color-scheme: dark;
}

.info-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

html[dir="rtl"] .info-close {
  right: auto;
  left: 0.85rem;
}

.info-close:hover {
  color: var(--text);
}

.ax6-panel .btn {
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text);
}

.ax6-panel .btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.ax6-panel .btn-primary {
  background: var(--accent);
  color: #061210;
}

.ax6-panel .btn-ghost {
  border-color: var(--border);
  color: var(--text-muted);
}

.ax6-panel .btn-accent {
  background: var(--accent-soft);
  border-color: rgba(61, 214, 198, 0.3);
  color: var(--accent);
}

.ax6-panel .hint {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ax6-panel .hint.success {
  color: var(--accent);
}

.ax6-panel .hint.error {
  color: var(--danger, #ff6b6b);
}

body.modal-open {
  overflow: hidden;
}
