:root {
  --bg: #06111b;
  --panel: rgba(9, 24, 36, 0.84);
  --panel-border: rgba(121, 199, 255, 0.14);
  --muted: #a9c1d6;
  --text: #eef7ff;
  --accent: #79c7ff;
  --accent-strong: #1ea4ff;
  --warm: #ffd17a;
  --ok: #8ff0b9;
  --danger: #ff9f9f;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Vazirmatn", "Noto Sans Arabic", "Segoe UI", sans-serif;
  color: var(--text);
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
  background:
    radial-gradient(circle at top right, rgba(30, 164, 255, 0.16), transparent 28%),
    radial-gradient(circle at left center, rgba(255, 209, 122, 0.11), transparent 24%),
    linear-gradient(160deg, #07131f 0%, #0c2031 55%, #051018 100%);
}

.page-shell {
  width: min(1260px, calc(100% - 32px));
  margin: 24px auto 40px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.hero,
.panel,
.footer {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 28px;
  padding: 32px;
  border-radius: var(--radius);
}

.install-strip {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.install-copy {
  min-width: 0;
}

.install-strip h2 {
  font-size: clamp(1.3rem, 2vw, 1.9rem);
}

.install-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.9;
}

.install-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.15;
}

.lede,
.card-note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.95;
}

.hero-metrics {
  display: grid;
  gap: 16px;
}

.metric-card {
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(30, 67, 97, 0.62), rgba(7, 20, 32, 0.9));
  border: 1px solid rgba(121, 199, 255, 0.16);
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 1.2rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.panel {
  border-radius: var(--radius);
  padding: 28px;
}

.panel-wide {
  min-width: 0;
}

.panel-header,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tabs {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab,
.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.tab {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tab.is-active,
.primary-button {
  background: linear-gradient(120deg, var(--accent-strong), #63d2ff);
  color: #03111b;
  font-weight: 800;
}

.secondary-button {
  background: linear-gradient(120deg, rgba(255, 209, 122, 0.9), rgba(255, 240, 190, 0.96));
  color: #341f00;
  font-weight: 800;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tab:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.tab-panel {
  display: none;
  margin-top: 22px;
}

.tab-panel.is-active {
  display: block;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 18px;
}

.local-badge {
  background: rgba(143, 240, 185, 0.14);
  color: #c4f7dc;
  border: 1px solid rgba(143, 240, 185, 0.28);
}

.server-badge {
  background: rgba(255, 209, 122, 0.14);
  color: #ffe4b1;
  border: 1px solid rgba(255, 209, 122, 0.28);
}

.warning-badge {
  background: rgba(255, 159, 159, 0.12);
  color: #ffd4d4;
  border: 1px solid rgba(255, 159, 159, 0.24);
}

.action-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.result-grid {
  margin-top: 20px;
}

.retrieval-grid {
  margin-bottom: 18px;
}

.action-card,
.locale-card,
.support-card {
  background: linear-gradient(180deg, rgba(12, 31, 45, 0.82), rgba(5, 14, 22, 0.95));
  border-radius: 24px;
  border: 1px solid rgba(121, 199, 255, 0.12);
  padding: 20px;
}

.field,
.upload-field {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.field span,
.upload-field span {
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(121, 199, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  resize: vertical;
}

.field textarea {
  min-height: 140px;
}

.token-textarea,
.token-box {
  direction: ltr;
  text-align: left;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.helper-text {
  color: var(--muted);
  line-height: 1.8;
}

.upload-field {
  align-items: center;
  justify-items: center;
  text-align: center;
  min-height: 156px;
  padding: 22px;
  border: 1px dashed rgba(121, 199, 255, 0.3);
}

.upload-field input {
  width: 100%;
}

.upload-field small {
  color: var(--muted);
  line-height: 1.8;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.button-inline-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.full-button {
  margin-top: 18px;
  width: 100%;
}

.result-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(3, 11, 18, 0.62);
  border: 1px solid rgba(121, 199, 255, 0.12);
}

.result-box {
  margin-top: 14px;
  padding: 18px;
  min-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(121, 199, 255, 0.08);
  color: #dff0ff;
  line-height: 1.9;
}

.compact-box {
  min-height: 120px;
}

.file-box {
  min-height: 110px;
}

.warning-banner {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 209, 122, 0.12);
  border: 1px solid rgba(255, 209, 122, 0.36);
  color: #ffe4b1;
  line-height: 2;
}

.is-hidden {
  display: none !important;
}

.side-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.feature-list {
  margin: 12px 0 0;
  padding: 0 20px 0 0;
  color: var(--muted);
  line-height: 2;
}

.locale-card p,
.support-card p {
  color: var(--muted);
  line-height: 2;
  margin: 12px 0 0;
}

.footer {
  margin-top: 24px;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-radius: 22px;
  color: var(--muted);
}

.status-ok {
  color: var(--ok);
}

.status-error {
  color: var(--danger);
}

@media (max-width: 980px) {
  .hero,
  .install-strip,
  .main-grid,
  .action-grid,
  .result-grid,
  .button-row {
    grid-template-columns: 1fr;
  }

  .install-strip {
    display: grid;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .panel-header,
  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
