.profile-card__avatar {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--accent-foreground);
  font-size: 1.8rem;
  font-weight: 800;
}

.profile-details {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.profile-details div {
  padding: 1rem;
  border-radius: 18px;
  background: var(--bg-soft);
}

.profile-details dt {
  margin-bottom: 0.35rem;
  color: var(--text-faint);
  font-size: 0.92rem;
}

.profile-details dd {
  margin: 0;
  font-weight: 600;
}

.quick-actions {
  display: grid;
  gap: 0.9rem;
}

.quick-action {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.quick-action strong,
.quick-action span {
  display: block;
}

.quick-action span {
  margin-top: 0.35rem;
  color: var(--text-faint);
  font-size: 0.95rem;
}

.quick-action:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.quick-action:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.55);
  outline-offset: 3px;
}

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

.device-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.device-card__header,
.detail-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.device-card__title {
  font-size: 1.2rem;
  font-weight: 700;
}

.device-card__meta,
.device-card__summary,
.back-link {
  color: var(--text-support);
}

.device-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.device-stats span {
  display: block;
  color: var(--text-minor);
  font-size: 0.9rem;
}

.device-stats strong {
  display: block;
  margin-top: 0.25rem;
}

.usage-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.usage-track__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.tag-chip--hero {
  background: var(--control-bg);
  border: 1px solid var(--border-subtle);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.device-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-top: auto;
  color: var(--text-minor);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill--online {
  color: var(--accent-foreground);
  background: rgba(196, 181, 253, 0.95);
}

.status-pill--syncing {
  color: #3a2400;
  background: rgba(251, 191, 36, 0.92);
}

.status-pill--maintenance {
  color: #3f0d18;
  background: rgba(251, 113, 133, 0.9);
}

.detail-card {
  display: grid;
  gap: 1.25rem;
}

.secret-key-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border-radius: 18px;
  background: var(--bg-soft);
}

.secret-key-box code {
  flex: 1 1 280px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--accent);
}

.not-found-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem;
}

.hero-panel__cta {
  display: block;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.14), rgba(167, 139, 250, 0.06));
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.hero-panel__cta:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.22), rgba(167, 139, 250, 0.08));
}

.hero-panel__cta:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: 3px;
}

.section-block--muted {
  background: linear-gradient(180deg, var(--section-muted-fade), rgba(255, 255, 255, 0));
}

.not-found-code {
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 1rem;
}

.site-footer {
  padding: 1rem 0 3rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.site-footer__title {
  font-size: 1rem;
  margin: 0 0 0.8rem;
}

.site-footer__copy,
.site-footer__links a {
  color: var(--text-soft);
}

.site-footer__links {
  display: grid;
  gap: 0.5rem;
}

@media (max-width: 991.98px) {
  :root {
    --glass-blur: 8px;
  }

  .hero-grid,
  .auth-grid,
  .dashboard-shell,
  .device-layout,
  .feature-grid,
  .pricing-grid,
  .site-footer__grid,
  .hero-metrics,
  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .hero-section,
  .auth-section,
  .dashboard-section,
  .not-found-section {
    padding-top: 2rem;
  }

  .site-header__inner {
    min-height: 72px;
  }

  .cta-banner,
  .device-card__footer,
  .detail-card__header,
  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 575.98px) {
  .app-toast-stack {
    top: 84px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .glass-panel,
  .feature-card,
  .cta-banner,
  .not-found-card {
    padding: 1.2rem;
    border-radius: 22px;
  }

  .display-title {
    font-size: 2.35rem;
  }

  .auth-form-grid,
  .social-auth-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid--landing {
    min-height: auto;
  }

  .device-stats {
    grid-template-columns: 1fr;
  }
}

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

.devices-grid--dense {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dashboard-shell--profile {
  grid-template-columns: 1.5fr 1fr;
}

.status-bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
}

.status-bar--success {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.35), rgba(16, 185, 129, 0.85));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-panel__pulse {
    animation: none;
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.35);
  }

  .app-toast {
    transition: none;
  }

  .site-nav__link,
  .menu-toggle span {
    transition: none;
  }

  .cloud-card__step,
  .cloud-card__benefit,
  .cloud-card__btn {
    transition: none;
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(167, 139, 250, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0);
  }
}

/* Фикс для иконок в профиле */

/* Иконка в аватаре */
.profile-avatar svg {
  width: 48px;
  height: 48px;
}

/* Иконка статуса (зелёная точка) */
.profile-status-badge svg {
  width: 16px;
  height: 16px;
}

/* Иконки в заголовках карточек */
.info-card__icon svg {
  width: 20px;
  height: 20px;
}

/* Иконка редактирования в кнопке */
.profile-edit-btn svg {
  width: 18px;
  height: 18px;
}

/* Иконки в быстрых действиях */
.quick-action__icon svg {
  width: 22px;
  height: 22px;
}

.quick-action__arrow svg {
  width: 18px;
  height: 18px;
}

/* Иконки в заголовках секций */
.section-heading h2 svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 6px;
}

/* Иконки в статусах */
.status-item__label svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
}

.status-item__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.status-item__label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.status-item__value {
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
}

/* Иконка в подвале статусов */
.status-note svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
}

/* Убираем возможные гигантские размеры у всех SVG внутри profile-компонентов */
.profile-glass-panel svg,
.profile-grid svg,
.info-card svg,
.quick-actions--modern svg,
.status-panel svg {
  max-width: 100%;
  height: auto;
}

/* ===== Profile page layout polish ===== */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}

.profile-avatar {
  position: relative;
}

.profile-edit-fab {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-well);
  border: 1px solid var(--border);
  color: var(--text-on-glass);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  text-decoration: none;
}

.profile-edit-fab svg {
  width: 18px;
  height: 18px;
  display: block;
}

.profile-edit-fab__tooltip {
  position: absolute;
  top: -10px;
  right: 42px;
  transform: translateY(-50%);
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.profile-edit-fab:hover .profile-edit-fab__tooltip,
.profile-edit-fab:focus-visible .profile-edit-fab__tooltip {
  opacity: 1;
  visibility: visible;
}

.info-card--full {
  grid-column: 1 / -1;
}

.info-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.info-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.info-card__header h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.info-card__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: rgba(226, 232, 240, 0.95);
  flex: 0 0 auto;
}

html[data-theme="light"] .info-card__icon {
  color: var(--text);
  background: rgba(15, 118, 110, 0.10);
  border-color: rgba(15, 118, 110, 0.18);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border: 1px solid var(--border-subtle);
  background: var(--surface-well);
}

.status-pill--success {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.10);
}

.status-pill--danger {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.10);
}

.status-pill--warning {
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.10);
}

.info-card__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.glass-panel.profile-edit-panel {
  padding-bottom: 2.6rem;
}

.profile-edit-actions {
  margin-bottom: 1.1rem;
}

.info-card__body {
  display: grid;
  gap: 0.65rem;
}

.info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.9rem;
}

.info-label {
  color: var(--text-faint);
  font-size: 0.95rem;
  white-space: nowrap;
}

.info-value {
  color: var(--text);
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

.info-card__body--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
}

.info-card__body--inline .info-row {
  flex: 1 1 260px;
  min-width: 240px;
}

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

  .info-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .info-value {
    text-align: left;
  }
}