/* المركز المعرفي — تصميم هادئ، RTL، متجاوب */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2530;
  --muted: #5c6b7a;
  --accent: #3d6b8f;
  --accent-soft: #e8eef3;
  --border: #dfe6ee;
  --shadow: 0 8px 24px rgba(28, 37, 48, 0.06);
  --radius: 14px;
  --sidebar-w: 260px;
  --font: "Segoe UI", "Tahoma", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* خلفية شبكة إلكترونات (canvas) — طبقة ثابتة خلف كل المحتوى */
.site-particles {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  z-index: 0;
  pointer-events: none;
  box-sizing: border-box;
}

body.has-site-particles {
  background-color: #04060b;
}

body.has-site-particles .app-shell {
  position: relative;
  z-index: 2;
  background: transparent;
}

/* نص فاتح فوق الخلفية المتحركة؛ البطاقات البيضاء تُعاد كتابة لونها */
body.has-site-particles .main {
  color: #cfd9e6;
  background: transparent;
}

body.has-site-particles .main :where(
  .card,
  .list-item,
  .file-row,
  .course-card,
  .article-block,
  .form-card,
  .kpi-tile,
  .admin-stat,
  .offer-card,
  .admin-tip-card,
  .alert,
  .consult-thread,
  .consult-msg,
  .consult-compose,
  .admin-consult-item,
  .admin-section-chip
) {
  color: var(--text);
}

body.has-site-particles
  .main
  :where(
    .card,
    .list-item,
    .file-row,
    .course-card,
    .article-block,
    .form-card,
    .kpi-tile,
    .admin-stat,
    .offer-card,
    .admin-tip-card,
    .alert,
    .consult-thread,
    .consult-msg,
    .consult-compose,
    .admin-consult-item,
    .admin-section-chip
  )
  .muted {
  color: var(--muted);
}

body.has-site-particles .page-title {
  color: #f0f6fc;
}

body.has-site-particles .page-lead {
  color: #94a8bc;
}

body.has-site-particles .section-title {
  color: #e8f1fa;
}

body.has-site-particles .auth-switch {
  color: #b8c5d6;
}

body.has-site-particles .auth-staff-links,
body.has-site-particles .auth-admin-links {
  color: #94a8bc;
}

@media (prefers-reduced-motion: reduce) {
  .site-particles {
    display: none !important;
  }
}

.news-ticker {
  position: relative;
  z-index: 4;
  background: var(--ticker-bg, #1d4ed8);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  white-space: nowrap;
  min-height: 2.25rem;
}

/* حركة مستمرة بدون نص: لمعة تتحرك من اليمين لليسار على الشريط الأزرق */
.news-ticker--empty {
  overflow: hidden;
}

.news-ticker--empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 42%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 58%,
    transparent 100%
  );
  width: 60%;
  animation: ticker-shine-rtl 3.2s linear infinite;
  pointer-events: none;
}

.news-ticker-track {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  width: max-content;
  gap: 2rem;
  padding: 0.55rem 0;
  color: #fff;
  animation: ticker-scroll-rtl 28s linear infinite;
  will-change: transform;
}

.news-ticker-track--idle {
  min-height: 2.25rem;
  animation: none;
}

.news-ticker-item {
  flex-shrink: 0;
  display: inline-block;
  padding-inline-end: 2rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

@keyframes ticker-scroll-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes ticker-shine-rtl {
  0% {
    transform: translateX(170%);
  }
  100% {
    transform: translateX(-170%);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    min-height: auto;
    border-inline-end: none;
    border-bottom: 1px solid var(--border);
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-platform {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}

.sidebar-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-link {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-link.is-active {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}

.nav-link--muted {
  color: var(--muted);
  cursor: not-allowed;
}

.nav-link--admin {
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.85rem;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-auth {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-soft);
}

.user-pill {
  font-size: 0.85rem;
  background: var(--accent-soft);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: var(--accent);
}

.user-pill--admin {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar--admin .sidebar-logo {
  background: var(--accent-soft);
}

.nav-section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.85rem 0 0.35rem;
  padding-inline-start: 0.85rem;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.home-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.auth-switch {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
}

.auth-staff-tag,
.auth-admin-tag {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
}

.auth-staff-login .form-card,
.auth-admin-login .form-card {
  border-color: #c6d6eb;
}

.auth-staff-links,
.auth-admin-links {
  font-size: 0.92rem;
  color: var(--muted);
}

.main {
  padding: 1.75rem 2rem 3rem;
  max-width: 1100px;
}

@media (max-width: 600px) {
  .main {
    padding: 1.25rem 1rem 2rem;
  }
}

.main--narrow {
  max-width: 480px;
  margin-inline: auto;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.platform-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.platform-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: #c45c5c;
  color: #fff;
  border-radius: 999px;
}

.page-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.15rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card--with-notify {
  position: relative;
}

.card-notify-badge {
  position: absolute;
  top: 0.55rem;
  inset-inline-end: 0.55rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: #c62828;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.45);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(28, 37, 48, 0.1);
  border-color: var(--accent);
}

.card-icon {
  font-size: 2rem;
  line-height: 1;
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.card-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.card-count {
  font-size: 1.25rem;
  font-weight: 800;
  margin-inline-end: 0.25rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.back-link {
  margin-top: 2rem;
}

.back-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.back-link a:hover {
  text-decoration: underline;
}

.list-articles,
.list-files,
.courses-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item,
.file-row,
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.list-item-title,
.course-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.course-video-wrap {
  margin: 0 0 0.85rem;
}

.course-video {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #000;
  display: block;
}

.list-item-body {
  margin: 0;
  color: var(--muted);
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.article-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.article-title {
  margin: 0 0 0.5rem;
}

.article-excerpt {
  color: var(--muted);
  margin: 0 0 1rem;
}

.article-body {
  color: var(--text);
}

.article-cover-wrap {
  margin: 0 0 1rem;
}

.article-cover {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.offers-grid {
  display: grid;
  gap: 1rem;
}

.offer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.offer-title {
  margin: 0 0 0.5rem;
}

.offer-meta {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 560px;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fafbfc;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

textarea.input {
  resize: vertical;
  min-height: 120px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  max-width: 560px;
}

.alert-success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.alert-error {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.kpi-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

.admin-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.admin-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.section-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.link-list {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.link-list a {
  color: var(--accent);
}

code {
  background: var(--accent-soft);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
}

.tip-item-image-wrap {
  margin: 0 0 0.85rem;
}

.tip-item-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.admin-alert-wide {
  max-width: 42rem;
}

.admin-form-wide {
  max-width: 42rem;
}

.admin-section {
  margin-bottom: 2rem;
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-tip-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-tip-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}

.admin-tip-card-main {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex: 1;
  min-width: 200px;
}

.admin-tip-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.admin-tip-preview {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
}

.admin-tip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inline-form {
  display: inline;
}

.tag--draft {
  background: #fff3e0;
  color: #e65100;
}

.tag--pub {
  background: #e8f5e9;
  color: #2e7d32;
}

.page-lead a {
  color: var(--accent);
  font-weight: 600;
}

.cards-grid--tip-sections {
  margin-bottom: 0.5rem;
}

.card--tip-section .card-desc {
  display: none;
}

.admin-section-hint {
  margin-top: 0;
  margin-bottom: 1rem;
  max-width: 42rem;
}

.branding-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 0.35rem 0 1rem;
}

.branding-preview-img {
  border-radius: 12px;
  object-fit: contain;
  background: var(--accent-soft);
}

.field--inline-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.field--inline-check input {
  margin: 0;
}

.admin-inline-section-form .admin-inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.admin-inline-field-grow {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
}

.admin-sections-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  box-shadow: var(--shadow);
}

.admin-section-chip-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.tip-section-label {
  margin: 0.35rem 0 0;
}

.tag--section {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
}

/* محادثات الاستشارة */
.consult-thread {
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.consult-thread--admin {
  max-height: none;
}

.consult-msg {
  max-width: min(100%, 36rem);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  line-height: 1.55;
}

.consult-msg--user {
  align-self: flex-start;
  background: var(--accent-soft);
}

.consult-msg--admin {
  align-self: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.consult-msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.consult-msg-time {
  font-size: 0.78rem;
}

.consult-msg-body {
  font-size: 0.98rem;
  color: var(--text);
}

.consult-compose {
  margin-top: 0.5rem;
}

.admin-consult-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-consult-item {
  margin: 0;
}

.admin-consult-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, background 0.15s;
}

.admin-consult-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.admin-consult-user {
  grid-column: 1;
  font-weight: 700;
}

.consult-pending-label {
  grid-column: 2;
  justify-self: end;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: none;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.admin-consult-preview {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.admin-consult-time {
  grid-column: 1 / -1;
  font-size: 0.8rem;
}

.admin-form-divider {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 1.25rem 0;
}

/* زر اشتراك عائم + نافذة */
body.subscribe-modal-open {
  overflow: hidden;
}

.subscribe-fab-root {
  position: fixed;
  z-index: 800;
  right: max(1rem, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: max(6rem, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
  width: max-content;
  max-width: calc(100vw - 2rem);
  margin: 0;
  padding: 0;
}

.subscribe-fab {
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-contrast, #fff);
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  box-shadow: 0 10px 28px rgba(28, 37, 48, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.subscribe-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(28, 37, 48, 0.34);
}

.subscribe-fab:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

.subscribe-fab__icon {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.95;
}

.subscribe-modal {
  position: fixed;
  inset: 0;
  z-index: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.subscribe-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.subscribe-modal[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.subscribe-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.subscribe-modal__panel {
  position: relative;
  width: 100%;
  max-width: 22rem;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border);
  overflow: hidden;
}

.subscribe-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}

.subscribe-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}

.subscribe-modal__close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.subscribe-modal__close:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.subscribe-modal__body {
  padding: 1rem 1.1rem 1.15rem;
}

.subscribe-modal__price {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.subscribe-modal__price-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.subscribe-modal__price-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.subscribe-modal__currency {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.subscribe-modal__lead {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.subscribe-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subscribe-btn {
  flex: 1;
  min-width: 7rem;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.subscribe-btn--wa {
  background: #25d366;
  color: #fff;
  border: none;
}

.subscribe-btn--wa:hover {
  filter: brightness(1.05);
  color: #fff;
}

.subscribe-btn--tg {
  background: #229ed9;
  color: #fff;
  border: none;
}

.subscribe-btn--tg:hover {
  filter: brightness(1.05);
  color: #fff;
}

.subscribe-modal__empty {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .subscribe-fab-root {
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    bottom: max(5.25rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
  }

  .subscribe-fab {
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
  }
}
