/* ==========================================================================
   Ayaz Sh. / серверы — Дизайн-система Warm Bento
   Палитра: #FAF8F5 (фон), #FFFFFF (карточки), #F3EFEA (песок),
            #1C1917 (текст), #0F766E (хвойно-изумрудный акцент), #E7E2DA (бордер)
   ========================================================================== */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-muted: #f3efea;
  --surface-hover: #eae3db;

  --ink: #1c1917;
  --ink-muted: #57534e;
  --ink-subtle: #78716c;

  --accent: #0f766e;
  --accent-hover: #0d625b;
  --accent-soft: #f0fdfa;
  --accent-pill-bg: #f3efea;

  --border: #e7e2da;
  --border-strong: #d6d0c6;

  --ok-bg: #ecfdf5;
  --ok-ink: #065f46;
  --ok-border: #a7f3d0;
  --ok-dot: #10b981;

  --warn-bg: #fffbeb;
  --warn-ink: #92400e;
  --warn-border: #fde68a;
  --warn-dot: #d97706;

  --danger-bg: #fef2f2;
  --danger-ink: #b91c1c;
  --danger-border: #fecaca;
  --danger-dot: #ef4444;

  --radius-card: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 2px 10px rgba(28, 25, 23, 0.035);
  --shadow-selected: 0 6px 16px rgba(15, 118, 110, 0.11);
  --shadow-btn: 0 4px 12px rgba(15, 118, 110, 0.22);
  --shadow-modal: 0 20px 50px rgba(28, 25, 23, 0.22);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.font-display {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

.font-mono {
  font-family: var(--font-mono);
}

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

.text-subtle {
  color: var(--ink-subtle);
}

/* ---------- Контейнеры ---------- */

.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 20px;
}

.container--narrow {
  max-width: 820px;
}

.container--auth {
  max-width: 460px;
}

.page-main {
  flex: 1 0 auto;
}

.page-section {
  padding-block: 44px;
}

.page-section--compact {
  padding-block: 32px;
}

.section-divider {
  border-top: 1px solid var(--border);
}

/* ---------- Шапка (Header) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-btn);
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.brand-sub {
  font-weight: 400;
  color: var(--ink-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.balance-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.balance-chip-label {
  color: var(--ink-subtle);
  font-weight: 500;
}

.balance-chip-plus {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.mobile-nav-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 20px 20px;
}

.mobile-nav-drawer.is-open {
  display: block;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.mobile-nav-link:hover,
.mobile-nav-link.is-active {
  background: var(--surface-muted);
  color: var(--accent);
}

.mobile-nav-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-actions .balance-chip {
  width: 100%;
  min-width: 0;
}

.mobile-nav-actions .balance-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav-actions .balance-chip .font-mono {
  flex-shrink: 0;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease,
    box-shadow 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--surface-muted);
}

.btn--soft {
  background: var(--surface-muted);
  color: var(--ink);
  border-color: var(--border);
}

.btn--soft:hover:not(:disabled) {
  background: var(--surface-hover);
}

.btn--danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-color: var(--danger-border);
}

.btn--danger:hover:not(:disabled) {
  background: #fee2e2;
}

.btn--ghost {
  background: transparent;
  color: var(--ink-muted);
  padding-inline: 10px;
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--ink);
}

.btn--sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: 13px 22px;
  font-size: 15px;
}

.btn--block {
  width: 100%;
}

/* ---------- Пилюли и бейджи ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-pill-bg);
  color: var(--accent);
  border: 1px solid var(--border-strong);
  font-size: 12.5px;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge--ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-color: var(--ok-border);
}

.badge--warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-color: var(--warn-border);
}

.badge--danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-color: var(--danger-border);
}

.badge--muted {
  background: var(--surface-muted);
  color: var(--ink-muted);
  border-color: var(--border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok-dot);
  flex-shrink: 0;
}

.status-dot--warn {
  background: var(--warn-dot);
}

.status-dot--danger {
  background: var(--danger-dot);
}

/* ---------- Bento-карточки ---------- */

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.bento-card--muted {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

/* ---------- Hero и конфигуратор на лендинге ---------- */

.hero-section {
  background: radial-gradient(circle at 85% 15%, rgba(15, 118, 110, 0.085), transparent 46%),
    var(--bg);
  padding-block: 48px 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 36px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 520px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.region-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.region-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08);
}

.region-flag svg {
  display: block;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--ink);
}

.hero-stat-label {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-subtle);
  margin-top: 3px;
}

/* Конфигуратор */

.configurator-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.configurator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.configurator-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.configurator-sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink-subtle);
}

.price-tag {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
  flex-shrink: 0;
}

.step-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.select-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  height: 100%;
  text-align: left;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.select-card:hover {
  border-color: var(--border-strong);
}

.select-card.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow-selected);
}

.select-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.select-card-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink);
}

.select-card-price {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--ink);
}

.select-card.is-selected .select-card-price {
  color: var(--accent);
}

.select-card-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-subtle);
}

.select-card-specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 5px;
}

.select-card-specs > span {
  white-space: nowrap;
}

.spec-dot {
  opacity: 0.55;
}

.select-card-ping {
  margin-top: auto;
  padding-top: 2px;
  white-space: nowrap;
}

.select-card-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.configurator-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.configurator-summary .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-spec {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.summary-sub {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-top: 2px;
}

/* ---------- Секции сетки Bento ---------- */

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 800;
  line-height: 1.2;
}

.section-lead {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: var(--ink-muted);
}

.bento-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.bento-grid-3 > .bento-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent-pill-bg);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.card-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* ---------- FAQ ---------- */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.faq-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  background: var(--accent-soft);
  color: var(--accent);
}

.faq-body {
  padding: 0 20px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* ---------- Код и SSH-блоки ---------- */

.code-box {
  background: var(--surface-muted);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-subtle);
}

.code-box-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.code-box code {
  min-width: 0;
  flex: 1 1 auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- Формы и авторизация ---------- */

.auth-wrap {
  padding-block: 48px 64px;
}

.auth-card {
  padding: 32px 28px;
}

.auth-head {
  margin-bottom: 24px;
}

.auth-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.auth-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-wrap .form-input {
  padding-right: 46px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
}

.password-toggle-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-subtle);
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.password-toggle-btn--icon .icon-eye-closed {
  display: none;
}

.password-toggle-btn--icon.is-revealed .icon-eye-open {
  display: none;
}

.password-toggle-btn--icon.is-revealed .icon-eye-closed {
  display: block;
}

.password-toggle-btn--icon:hover,
.password-toggle-btn--icon:focus-visible {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--accent);
  outline: none;
}

.form-hint {
  font-size: 12.5px;
  color: var(--ink-subtle);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-muted);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.inline-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: var(--accent-hover);
}

.auth-footer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

/* ---------- Уведомления (Alerts) ---------- */

.alert {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.alert--danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-color: var(--danger-border);
}

.alert--ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-color: var(--ok-border);
}

.alert--warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-color: var(--warn-border);
}

.alert--info {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #99f6e4;
}

/* ---------- Текстовые страницы (/guide, /terms) ---------- */

.doc-hero {
  margin-bottom: 28px;
}

.doc-title {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 800;
  line-height: 1.18;
}

.doc-lead {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-muted);
}

.doc-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guide-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.guide-step-head .step-num {
  margin-bottom: 0;
}

.guide-step-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.doc-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.65;
}

.doc-list li + li {
  margin-top: 6px;
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  align-items: stretch;
}

.os-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.os-card-title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 14px;
}

.os-card-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ---------- Модальные окна ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28, 25, 23, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  padding: 24px;
}

.modal-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}

.modal-body {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Тост ---------- */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #fafaf9;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(28, 25, 23, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  width: 16px;
  height: 16px;
  color: #34d399;
  flex-shrink: 0;
}

/* Всплывающие flash-уведомления (не сдвигают верстку и автоматически скрываются) */

.flash-stack {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.flash-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.12);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  animation: flashSlideIn 0.22s ease both;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.flash-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.flash-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
}

.flash-toast--ok {
  border-color: var(--ok-border);
}

.flash-toast--ok .flash-toast-dot {
  background: var(--ok-dot);
}

.flash-toast--info {
  border-color: var(--border-strong);
}

.flash-toast--warn {
  border-color: var(--warn-border);
}

.flash-toast--warn .flash-toast-dot {
  background: var(--warn-dot);
}

.flash-toast--danger {
  border-color: var(--danger-border);
}

.flash-toast--danger .flash-toast-dot {
  background: var(--danger-dot);
}

.flash-toast-text {
  flex: 1 1 auto;
  min-width: 0;
}

.flash-toast-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-subtle);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.flash-toast-close:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

@keyframes flashSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Футер ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding-block: 26px;
  font-size: 13px;
  color: var(--ink-subtle);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

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

/* ---------- Биллинг (/billing, /billing/invoices/{id}) и покупка (/buy) ---------- */

.billing-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: stretch;
}

.billing-top-grid > .bento-card {
  height: 100%;
}

.billing-balance-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.billing-balance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.balance-hero-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.balance-hero-value {
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}

.balance-hero-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.autorenew-box {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.autorenew-box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.autorenew-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.autorenew-next {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-muted);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.preset-btn:hover,
.preset-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-selected);
}

.preset-btn-amount {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.preset-btn:hover .preset-btn-amount,
.preset-btn.is-selected .preset-btn-amount {
  color: var(--accent);
}

.preset-btn-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-subtle);
}

.inline-form-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.inline-form-row .form-input {
  flex: 1 1 auto;
}

.invoice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.invoice-list-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.invoice-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13.5px;
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.polling-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-subtle);
}

.polling-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  flex-shrink: 0;
  animation: spin 1s linear infinite;
}

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

/* Таблица операций */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.text-right {
  text-align: right;
}

.data-table th.text-right {
  text-align: right;
}

.tx-title {
  font-weight: 600;
  color: var(--ink);
}

.tx-sub {
  font-size: 12.5px;
  color: var(--ink-subtle);
  margin-top: 2px;
}

.tx-amount {
  font-weight: 700;
  white-space: nowrap;
}

.tx-amount--pos {
  color: var(--ok-ink);
}

.tx-amount--neg {
  color: var(--ink);
}

.empty-inline {
  padding: 24px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  text-align: center;
  font-size: 14px;
  color: var(--ink-muted);
}

/* Страница покупки /buy */

.buy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: start;
}

.buy-summary-card {
  position: sticky;
  top: 86px;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.summary-row--divider {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.summary-row--total {
  padding-top: 10px;
  font-weight: 700;
}

.buy-total-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.buy-cta-block {
  margin-top: 18px;
}

/* ---------- Личный кабинет: «Мои серверы» (/dashboard) ---------- */

.status-dot--muted {
  background: var(--ink-subtle);
}

.polling-spinner--sm {
  width: 11px;
  height: 11px;
  border-width: 1.8px;
}

.dashboard-account-card {
  margin-bottom: 24px;
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-account-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dashboard-account-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-subtle);
}

.dashboard-account-email {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.dashboard-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-dialog--form {
  max-width: 440px;
}

.dashboard-banners {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.dashboard-banner {
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-banner-body {
  flex: 1 1 320px;
}

.dashboard-banner-title {
  font-weight: 700;
  margin-bottom: 3px;
}

.dashboard-banner-text {
  font-size: 13.5px;
  line-height: 1.5;
}

.dashboard-banner-cta {
  flex-shrink: 0;
}

.dashboard-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-empty {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dashboard-empty-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.dashboard-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.server-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.server-card--overdue {
  border-color: var(--danger-border);
}

.server-card--pending {
  border-color: var(--warn-border);
}

.server-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.server-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.server-card-flag {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.server-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.server-card-id {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-subtle);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 7px;
}

.server-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 13px;
  color: var(--ink-muted);
}

.meta-sep {
  color: var(--border-strong);
}

.server-card-notice {
  margin-bottom: 0;
}

.server-card-notice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.server-pending-box {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.server-pending-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink);
}

.server-pending-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.server-overdue-box {
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.server-overdue-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 300px;
}

.server-access-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credentials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.credential-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  height: 100%;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.credential-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.credential-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-subtle);
}

.field-icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mini-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.mini-icon-btn:hover,
.mini-icon-btn:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.mini-icon-btn .icon-eye-closed {
  display: none;
}

.mini-icon-btn.is-revealed .icon-eye-open {
  display: none;
}

.mini-icon-btn.is-revealed .icon-eye-closed {
  display: block;
}

.credential-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.credential-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

.credential-value.is-highlighted {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 7px;
}

.server-billing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 13.5px;
}

.server-billing-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.server-billing-rel {
  color: var(--ink-muted);
  font-size: 13px;
}

.server-billing-rel.is-warn {
  color: var(--warn-ink);
  font-weight: 600;
}

.server-billing-rel.is-danger {
  color: var(--danger-ink);
  font-weight: 700;
}

.autorenew-toggle-form {
  margin: 0;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.toggle-pill:hover {
  border-color: var(--accent);
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  transition: background-color 0.18s ease;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.22);
  transition: transform 0.18s ease;
}

.toggle-pill.is-on {
  border-color: #99f6e4;
  background: var(--accent-soft);
  color: var(--ink);
}

.toggle-pill.is-on .toggle-track {
  background: var(--accent);
}

.toggle-pill.is-on .toggle-thumb {
  transform: translateX(14px);
}

.server-card-head-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.server-head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.server-head-actions form {
  margin: 0;
}

.icon-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-muted);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.icon-action-btn:hover:not(:disabled),
.icon-action-btn:focus-visible:not(:disabled) {
  background: var(--surface-muted);
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.icon-action-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.icon-action-btn--accent {
  background: var(--accent-soft);
  border-color: #99f6e4;
  color: var(--accent);
}

.icon-action-btn--accent:hover:not(:disabled),
.icon-action-btn--accent:focus-visible:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.icon-action-btn--danger {
  border-color: var(--danger-border);
  color: var(--danger-ink);
}

.icon-action-btn--danger:hover:not(:disabled),
.icon-action-btn--danger:focus-visible:not(:disabled) {
  background: var(--danger-bg);
  border-color: var(--danger-ink);
  color: var(--danger-ink);
}

.icon-action-btn--soft {
  background: var(--surface-muted);
  border-color: var(--border);
}

.icon-action-btn:disabled,
.btn.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.server-head-actions-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: var(--border);
}

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

.htmx-request button[type="submit"],
.htmx-request.icon-action-btn,
.htmx-request .icon-action-btn {
  opacity: 0.65;
  cursor: wait;
}

/* Блок неактивных (архивных) серверов на /dashboard */

.archived-servers {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.archived-servers-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.14s ease;
}

.archived-servers-summary::-webkit-details-marker {
  display: none;
}

.archived-servers-summary:hover {
  background: var(--surface-muted);
}

.archived-servers-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.archived-servers-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-muted);
}

.archived-servers[open] .faq-chevron {
  transform: rotate(180deg);
}

.archived-servers-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.archived-server-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.archived-server-row:last-child {
  border-bottom: none;
}

.archived-server-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.archived-server-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.archived-server-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.archived-server-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-subtle);
}

.archived-server-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.archived-server-date {
  font-size: 12px;
  color: var(--ink-subtle);
}

.rename-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-subtle);
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.rename-btn:hover,
.rename-btn:focus-visible {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--accent);
  outline: none;
}

/* Всплывающие подписи для иконочных кнопок */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: #fafaf9;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 30;
  box-shadow: 0 6px 16px rgba(28, 25, 23, 0.18);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.server-cooldown-hint {
  font-size: 12.5px;
  color: var(--ink-subtle);
}

/* ---------- Адаптивность ---------- */

@media (max-width: 920px) {
  .hero-grid,
  .billing-top-grid,
  .buy-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .buy-summary-card {
    position: static;
  }

  .bento-grid-3,
  .os-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 16px;
  }

  .hero-section {
    padding-block: 28px 36px;
  }

  .page-section {
    padding-block: 32px;
  }

  .bento-card,
  .bento-card--muted,
  .auth-card {
    padding: 20px;
    border-radius: 20px;
  }

  .option-grid,
  .invoice-meta-grid,
  .credentials-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-empty-actions .btn,
  .dashboard-banner-cta,
  .dashboard-banner-cta .btn,
  .dashboard-banner-cta form {
    width: 100%;
  }

  .modal-backdrop {
    padding: 16px;
  }

  .modal-dialog {
    padding: 20px;
    border-radius: 20px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions form,
  .modal-actions .btn {
    width: 100%;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-form-row {
    flex-direction: column;
  }

  .inline-form-row .btn,
  .invoice-actions .btn,
  .invoice-actions form {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .hero-cta-row .btn {
    width: 100%;
  }

  .configurator-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .configurator-summary .btn {
    width: 100%;
  }

  .dashboard-banner-cta .btn,
  .modal-actions .btn,
  .configurator-summary .btn,
  .buy-cta-block .btn {
    white-space: normal;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
  }

  .flash-stack {
    top: 76px;
    left: 16px;
    right: 16px;
    width: auto;
  }

  .server-card-head-right {
    width: 100%;
    justify-content: space-between;
  }

  .server-head-actions {
    width: 100%;
    padding-left: 0;
    border-left: none;
    gap: 6px;
  }

  .server-head-actions-sep {
    display: none;
  }

  .icon-action-btn {
    width: auto;
    height: 34px;
    padding: 0 10px;
    gap: 6px;
  }

  .icon-action-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    font-size: 12px;
    font-weight: 600;
  }

  .archived-server-row {
    padding: 13px 16px;
  }
}

@media (hover: none) {
  [data-tooltip]::after {
    display: none;
  }
}

/* ---------- Выбор криптосети и прямая оплата USDT (/billing) ---------- */

.network-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.network-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  height: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.network-option:hover {
  border-color: var(--accent);
  background: var(--surface-muted);
}

.network-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.network-option-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.network-option.is-selected .network-option-title {
  color: var(--accent);
}

.network-option-meta {
  font-size: 11.5px;
  color: var(--ink-subtle);
}

.crypto-pay-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--surface-muted);
}

.crypto-pay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.crypto-pay-network {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.crypto-pay-warning {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 12.5px;
  line-height: 1.45;
}

.crypto-pay-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.crypto-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.crypto-qr-img {
  display: block;
  width: 176px;
  height: 176px;
  border-radius: 8px;
}

.crypto-pay-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.crypto-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.crypto-pay-box .code-box {
  background: var(--surface);
}

.crypto-address-code {
  word-break: break-all;
}

.crypto-addr-edge {
  color: var(--accent);
  font-weight: 800;
}

.crypto-addr-mid {
  color: var(--ink-muted);
  font-weight: 500;
}

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

  .crypto-pay-grid {
    grid-template-columns: 1fr;
  }

  .crypto-qr-wrap {
    justify-self: center;
  }
}

@media (max-width: 420px) {
  .brand-title {
    font-size: 14.5px;
  }

  .hero-stat-value {
    font-size: 15px;
  }

  .hero-stat-label {
    font-size: 11.5px;
  }

  .dashboard-account-actions {
    width: 100%;
  }

  .dashboard-account-actions .btn {
    width: 100%;
  }
}
