/* ==========================================================================
   ASTROLABE — components: header/footer, кнопки, поля, карточки, бейджи,
   таблицы, алерты, орбита-прогресс, price/system cards
   ========================================================================== */

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .site-header {
    background: rgba(10, 14, 26, 0.88);
  }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: var(--fs-22);
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent-text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent-text-strong);
  background: radial-gradient(circle at 32% 28%, rgba(238, 217, 166, 0.18), transparent 60%);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list li+li {
  margin-top: 0;
}

.nav-list a {
  position: relative;
  color: var(--text-muted);
  font-size: var(--fs-14);
  letter-spacing: 0.04em;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 1px;
  background: var(--gold-400);
  transition: right var(--transition);
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--text-strong);
  text-decoration: none;
}

.nav-list a:hover::after,
.nav-list a[aria-current="page"]::after {
  right: 0;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--transition-fast);
}

.nav-toggle-bars {
  position: relative;
  margin-inline: auto;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    padding: var(--space-5) clamp(1rem, 4vw, 2.5rem) var(--space-6);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lift);
    display: none;
  }

  .nav.is-open {
    display: flex;
    animation: rise-in 180ms ease both;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list a {
    display: block;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-16);
  }

  .nav-list a::after {
    display: none;
  }

  .nav-auth {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------------------------------------------------------------- Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding-block: var(--space-7);
  background: linear-gradient(180deg, transparent, rgba(10, 14, 26, 0.55));
  color: var(--text-muted);
  font-size: var(--fs-14);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(140px, 1fr));
  gap: var(--space-6);
}

.footer-brand .brand {
  margin-bottom: var(--space-3);
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text-strong);
  margin-bottom: var(--space-3);
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li+li {
  margin-top: var(--space-2);
}

.footer-bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  justify-content: space-between;
  font-size: var(--fs-12);
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text-strong);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.68em 1.35em;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-text);
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition),
    background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  --btn-fg: var(--on-gold);
  --btn-border: transparent;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), var(--glow-gold);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #f6e6bd, var(--gold-400));
}

.btn-ghost {
  --btn-fg: var(--accent-text);
  background: rgba(201, 161, 90, 0.05);
}

.btn-ghost:hover {
  --btn-border: var(--accent-text-strong);
  background: rgba(201, 161, 90, 0.12);
}

.btn-quiet {
  --btn-fg: var(--text-muted);
  --btn-border: transparent;
  background: transparent;
}

.btn-quiet:hover {
  --btn-fg: var(--text-strong);
}

.btn-danger {
  --btn-fg: #fbeee6;
  --btn-border: transparent;
  background: linear-gradient(180deg, #d9876232, transparent), var(--ember);
}

.btn-danger:hover {
  background: #d87b55;
}

.btn-sm {
  padding: 0.45em 0.9em;
  font-size: var(--fs-12);
}

.btn-lg {
  padding: 0.85em 1.8em;
  font-size: var(--fs-16);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* ---------------------------------------------------------------- Fields */
.field {
  margin-bottom: var(--space-5);
}

.field__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-muted);
}

.field__label .req {
  color: var(--accent-text-strong);
  margin-left: 0.2em;
}

.field__control {
  width: 100%;
  padding: 0.65em 0.2em;
  color: var(--text-strong);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  font-family: var(--font-text);
  font-size: var(--fs-16);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field__control::placeholder {
  color: rgba(168, 159, 140, 0.6);
}

.field__control:focus {
  outline: none;
  border-bottom-color: var(--accent-text-strong);
  box-shadow: 0 1px 0 0 var(--gold-400);
}

.field__control:disabled {
  opacity: 0.55;
}

textarea.field__control {
  min-height: 6.5rem;
  padding: 0.6em 0.2em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
}

select.field__control {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.6em 0.5em;
  background: var(--surface);
}

.field__hint {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  color: var(--text-muted);
}

.field__error {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  color: var(--danger);
}

.field--error .field__control {
  border-bottom-color: var(--danger);
  box-shadow: 0 1px 0 0 var(--danger);
}

.field--check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.field--check .field__label {
  margin: 0;
  color: var(--text);
}

.field--check input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.2em;
  accent-color: var(--accent-text-strong);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-5);
}

@media (max-width: 620px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- Cards */
.card {
  position: relative;
  padding: clamp(1.25rem, 2.4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.card--paper {
  background: var(--paper);
  color: var(--ink-800);
  border-color: rgba(120, 92, 40, 0.3);
}

.card--paper h1,
.card--paper h2,
.card--paper h3,
.card--paper h4 {
  color: var(--ink-800);
}

.card--flat {
  box-shadow: none;
  background: transparent;
}

.card--interactive {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card--interactive:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

/* Угловые тики-насечки */
.corner-ticks::before,
.corner-ticks::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent-text-strong);
  border-style: solid;
  opacity: 0.7;
  pointer-events: none;
}

.corner-ticks::before {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}

.corner-ticks::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1px 1px 0;
}

.card__title {
  margin-bottom: var(--space-2);
  font-size: var(--fs-22);
}

.card__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text-strong);
}

.card__body {
  color: var(--text-muted);
}

.card__foot {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.22em 0.7em;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(10, 14, 26, 0.35);
}

.badge--gold {
  color: var(--accent-text);
  border-color: var(--line-strong);
}

.badge--success {
  color: var(--success);
  border-color: rgba(127, 174, 148, 0.4);
}

.badge--danger {
  color: var(--danger);
  border-color: rgba(201, 111, 74, 0.45);
}

.badge--info {
  color: var(--nebula);
  border-color: rgba(124, 134, 217, 0.45);
}

/* ---------------------------------------------------------------- Alerts */
.flash-stack {
  position: fixed;
  top: calc(var(--header-height) + var(--space-3));
  right: var(--space-4);
  z-index: 150;
  width: min(360px, calc(100vw - 2rem));
  display: grid;
  gap: var(--space-3);
}

.alert {
  position: relative;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  color: var(--text);
  animation: rise-in 220ms ease both;
}

.alert__title {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 600;
  color: var(--text-strong);
}

.alert--success {
  border-left-color: var(--success);
}

.alert--error,
.alert--danger {
  border-left-color: var(--danger);
}

.alert--info {
  border-left-color: var(--info);
}

.alert--warning {
  border-left-color: var(--accent-text-strong);
}

.alert--inline {
  position: static;
  width: auto;
  animation: none;
  box-shadow: none;
  margin-bottom: var(--space-5);
}

/* ---------------------------------------------------------------- Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text-strong);
  background: rgba(10, 14, 26, 0.35);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: rgba(201, 161, 90, 0.05);
}

.table .num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- Orb */
.orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
}

.orb__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.orb__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
}

.orb__value {
  fill: none;
  stroke: var(--gold-400);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 600ms ease;
}

.orb__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.orb__percent {
  font-family: var(--font-display);
  font-size: var(--fs-22);
  color: var(--text-strong);
}

.orb__label {
  font-size: var(--fs-12);
  color: var(--text-muted);
}

.orb--sm {
  width: 64px;
  height: 64px;
}

.orb--sm .orb__percent {
  font-size: var(--fs-14);
}

/* ---------------------------------------------------------------- Price card */
.price-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.price-card__price {
  font-family: var(--font-display);
  font-size: var(--fs-36);
  color: var(--accent-text);
  line-height: 1;
}

.price-card__price small {
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  color: var(--text-muted);
}

.price-card__features {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: var(--fs-14);
}

.price-card__features li {
  position: relative;
  padding-left: 1.4em;
}

.price-card__features li::before {
  content: "·";
  position: absolute;
  left: 0.35em;
  color: var(--accent-text-strong);
}

.price-card--featured {
  border-color: var(--line-strong);
  box-shadow: var(--glow-gold);
}

.price-card__badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

/* ---------------------------------------------------------------- System card */
.system-card {
  display: block;
  height: 100%;
}

.system-card .card__glyph {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-text-strong);
}

.system-card .card__glyph svg {
  width: 26px;
  height: 26px;
}

.system-card__more {
  display: inline-block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--accent-text-strong);
}

.system-card:hover .system-card__more {
  color: var(--accent-text);
}

/* ---------------------------------------------------------------- Compass tabs */
.compass {
  display: grid;
  gap: var(--space-2);
}

.compass a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-left: 2px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: var(--fs-14);
}

.compass a:hover {
  color: var(--text-strong);
  text-decoration: none;
  background: rgba(201, 161, 90, 0.06);
}

.compass a[aria-current="page"] {
  color: var(--text-strong);
  border-left-color: var(--accent-text-strong);
  background: rgba(201, 161, 90, 0.1);
}

/* ---------------------------------------------------------------- Misc */
.divider-constellation {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--accent-text-strong);
  margin-block: var(--space-6);
  opacity: 0.7;
}

.divider-constellation::before,
.divider-constellation::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.empty-state {
  padding: var(--space-7) var(--space-5);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.progress-line {
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(201, 161, 90, 0.15);
  overflow: hidden;
}

.progress-line__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge-list li+li {
  margin-top: 0;
}

/* ---------------------------------------------------------------- Footer */
.site-footer a {
  color: var(--accent-text-strong);
}

.site-footer a:hover {
  color: var(--accent-text);
}

.site-footer .brand {
  color: var(--text-strong);
}

[data-theme="light"] .site-footer {
  background: var(--paper-2);
  border-top-color: var(--line-strong);
  color: #443d2d;
}

[data-theme="light"] .site-footer .text-muted {
  color: #5b5340;
}

[data-theme="light"] .site-footer a {
  color: #6b4f14;
}

[data-theme="light"] .site-footer a:hover {
  color: #4a3708;
}

/* ---------------------------------------------------------------- Blog */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.blog-card__cover-link {
  display: block;
}

.blog-card__cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.blog-card .card__body {
  flex: 1;
  padding: clamp(1.1rem, 2vw, 1.6rem);
}

.blog-card .card__title {
  font-size: var(--fs-20);
  overflow-wrap: anywhere;
}

.blog-card .card__foot {
  margin-top: auto;
  padding: var(--space-4) clamp(1.1rem, 2vw, 1.6rem);
}

.blog-toc-block {
  position: static;
  margin-bottom: var(--space-5);
}

.blog-toc-block .card {
  padding: var(--space-4) var(--space-5);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.prose pre {
  overflow-x: auto;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* --------------------------------------------------------- Analysis status */
.analysis-status {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

.analysis-status__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.analysis-status__spinner {
  flex: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent-text-strong);
  border-radius: 50%;
  animation: analysis-status-spin 0.8s linear infinite;
}

.analysis-status__title {
  color: var(--text-strong);
  font-weight: 500;
}

.analysis-status__timer {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  color: var(--text-muted);
}

.analysis-status__stages {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.analysis-status__stage {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.analysis-status__stage::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}

.analysis-status__stage.is-active {
  color: var(--text);
}

.analysis-status__stage.is-active::before {
  border-color: var(--accent-text-strong);
  background: var(--accent-text-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 22%, transparent);
}

.analysis-status__hint {
  margin-top: var(--space-4);
  font-size: var(--fs-14);
  color: var(--text-muted);
}

.analysis-status__error {
  color: var(--accent-text);
  font-weight: 500;
}

.analysis-status__error-detail {
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--fs-12);
  color: var(--text-muted);
}

@keyframes analysis-status-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-status__spinner {
    animation: none;
  }
}

/* Language switcher (i18n): компактный выпадающий список с флагами */
.lang-switcher {
  position: relative;
}

.lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.5rem;
  padding: 0.25em 0.55em;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill, 999px);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  line-height: 1.2;
}

.lang-switcher__trigger::-webkit-details-marker {
  display: none;
}

.lang-switcher__trigger::marker {
  content: "";
}

.lang-switcher__trigger::after {
  content: "▾";
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.lang-switcher[open] .lang-switcher__trigger::after {
  transform: rotate(180deg);
}

.lang-switcher__trigger:hover {
  border-color: var(--line-strong, var(--line));
}

.lang-switcher__trigger:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.lang-switcher__flag {
  font-size: 1.05rem;
  line-height: 1;
}

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 3.4rem;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-lift);
}

.lang-switcher__item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35em 0.6em;
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  cursor: pointer;
}

.lang-switcher__item:hover {
  background: var(--surface-2);
}

.lang-switcher__item:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.lang-switcher__item.is-active {
  background: color-mix(in srgb, var(--accent-soft) 18%, transparent);
  cursor: default;
}

/* ---------------------------------------------------------- Rating / feedback */
.rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}

.rating-row__label {
  min-width: 7.5rem;
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-muted);
}

.rating-stars {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-1);
}

.rating-stars__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
}

.rating-stars__label {
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--line-strong);
  border-radius: var(--radius-xs);
  transition: color var(--transition, 0.15s ease), transform var(--transition, 0.15s ease);
}

.rating-stars__label:hover {
  color: var(--accent-text-strong);
}

.rating-stars__input:checked + .rating-stars__label {
  color: var(--gold-500);
}

.rating-stars__input:focus-visible + .rating-stars__label {
  outline: none;
  box-shadow: var(--ring-focus);
}

.report-rating {
  margin-top: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.report-rating h2 {
  margin-top: 0;
}

.report-rating__thanks {
  color: var(--accent-text);
  font-weight: 500;
}

.report-rating__comment {
  font-style: italic;
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 720px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}

.support-contacts {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.support-contacts h2 {
  margin-top: 0;
  font-size: var(--fs-20, 1.25rem);
}

.support-contacts__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.support-contacts__list li {
  display: grid;
  gap: var(--space-1);
}

.support-contacts__label {
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fb-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.fb-kpi {
  display: grid;
  gap: var(--space-2);
}

.fb-kpi__label {
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fb-kpi__value {
  font-size: var(--fs-24, 1.5rem);
  font-weight: 600;
}

.fb-scales {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.fb-scale h3 {
  margin-top: 0;
  margin-bottom: var(--space-3);
  font-size: var(--fs-16);
}

.fb-bar {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) 5.5rem;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--fs-14);
}

.fb-bar__value {
  color: var(--text-muted);
}

.fb-bar__track {
  display: block;
  height: 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.fb-bar__fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.fb-bar__count {
  color: var(--text-muted);
  text-align: right;
}

.fb-message {
  max-width: 34ch;
  white-space: normal;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--space-4);
  z-index: 60;
  width: min(34rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-lift);
}

.cookie-banner p {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-14);
  color: var(--text-muted);
}

/* Telegram Mini App: компактный режим */
body.tg-app .site-header,
body.tg-app .site-footer {
  display: none;
}

body.tg-app {
  padding-bottom: env(safe-area-inset-bottom);
}

body.tg-app .site-main {
  min-height: 0;
  padding-block: var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));
}

body.tg-app .container {
  padding-inline: max(var(--space-4), env(safe-area-inset-left)) max(var(--space-4), env(safe-area-inset-right));
}

.tg-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-7) var(--space-4);
  text-align: center;
}

.tg-loader {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: tg-spin 900ms linear infinite;
}

.tg-status {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-16);
}

.tg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

@keyframes tg-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tg-loader {
    animation-duration: 1800ms;
  }
}
