* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text-primary);
  overflow-x: clip;
}

a {
  color: var(--neon-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 159, 0.4);
}

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

.home-button {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  color: #f1f5f9;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(139, 0, 255, 0.14));
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 16px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-button:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.7);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 240, 255, 0.32);
}

.home-button svg {
  width: 18px;
  height: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 2px solid var(--border-color);
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 60;
}

.menu-toggle-btn {
  display: none;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 10px;
  background: rgba(2, 10, 34, 0.8);
  color: #e7f7ff;
  width: 42px;
  height: 42px;
  font-size: 20px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.top-actions {
  display: none;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.lang-mobile-wrap {
  display: none;
}

.lang-mobile-select {
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 6px;
  width: 54px;
  min-height: 40px;
  height: 40px;
}

.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 6, 20, 0.62);
  z-index: 55;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  min-width: 0;
  flex-wrap: wrap;
}

.identity-chip {
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid transparent;
  min-height: 34px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-chip-service {
  color: #ffe9c0;
  border-color: rgba(255, 178, 45, 0.55);
  background: linear-gradient(135deg, rgba(255, 145, 0, 0.18), rgba(255, 58, 58, 0.12));
  box-shadow: 0 0 12px rgba(255, 145, 0, 0.26);
  text-transform: none;
  letter-spacing: 0.01em;
}

.identity-chip-user {
  color: #e8f2ff;
  border-color: rgba(0, 218, 255, 0.62);
  background: linear-gradient(135deg, rgba(0, 188, 255, 0.2), rgba(14, 116, 255, 0.14));
  box-shadow: 0 0 12px rgba(0, 188, 255, 0.2);
  text-transform: none;
}

.menu-user-chip,
.menu-ecosystem-chip {
  display: none;
}

.logo-seal {
  position: relative;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-ring {
  position: absolute;
  inset: -7px;
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  animation: ring-spin 20s linear infinite;
}

.logo-ring-text {
  fill: rgba(0, 240, 255, 0.88);
  font-size: 8.4px;
  letter-spacing: 0.4px;
  font-family: "Noto Naskh Arabic", serif;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.22), 0 0 26px rgba(0, 240, 255, 0.16);
}

.brand {
  font-size: 34px;
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: var(--border-glow);
  letter-spacing: 0.02em;
  justify-self: center;
}

.brand-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 18px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.9)) padding-box,
    linear-gradient(120deg, rgba(0, 240, 255, 0.8), rgba(255, 0, 110, 0.85), rgba(0, 255, 159, 0.82)) border-box;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.22),
    0 0 18px rgba(0, 240, 255, 0.24),
    0 0 30px rgba(255, 0, 110, 0.12);
  overflow: hidden;
}

.brand-frame::before {
  content: "";
  position: absolute;
  inset: -120% -40%;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.16), transparent 60%);
  transform: rotate(8deg);
  animation: brand-shine 4s linear infinite;
  pointer-events: none;
}

.brand-ar {
  font-family: "Noto Naskh Arabic", serif;
  direction: rtl;
  line-height: 1;
  transform: perspective(420px) rotateX(13deg);
  background: linear-gradient(90deg, #cbf7ff 0%, #00f0ff 30%, #f8feff 55%, #00ff9f 80%, #cbf7ff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 #063149,
    0 2px 0 #063149,
    0 3px 0 #052235,
    0 4px 0 #031a2a,
    0 8px 18px rgba(0, 240, 255, 0.38),
    0 16px 34px rgba(0, 0, 0, 0.46);
  animation: brand-flow 6s ease-in-out infinite;
}

.header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-self: end;
  min-width: 0;
}

.project-meta {
  text-transform: none;
}

.project-jump {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.project-jump select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.74);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
  padding: 5px 25px 5px 9px;
  width: 98px;
  min-width: 98px;
  max-width: 98px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(163, 238, 255, 0.9) 50%),
    linear-gradient(135deg, rgba(163, 238, 255, 0.9) 50%, transparent 50%);
  background-position:
    calc(100% - 10px) calc(50% - 1px),
    calc(100% - 6px) calc(50% - 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  text-align: center;
  text-align-last: center;
}

.project-jump select:focus,
.pref-switch select:focus,
.chat-input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.12);
}

.project-jump select option {
  text-align: center;
  background: #061631;
  color: #dff8ff;
  font-weight: 700;
}

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

.pref-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.pref-switch select {
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.65);
}

.lang-btn {
  border: 0;
  color: var(--text-secondary);
  background: transparent;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn + .lang-btn {
  border-left: 1px solid rgba(0, 240, 255, 0.2);
}

.lang-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.32), rgba(139, 0, 255, 0.28));
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

.data-badge {
  font-size: 11px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.data-badge.is-live {
  background: rgba(0, 255, 159, 0.18);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 12px rgba(0, 255, 159, 0.28);
}

.data-badge.is-loading {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.34);
  color: #d7deea;
}

.auth-btn,
.cabinet-chip,
.ghost-btn,
.primary-btn,
.action-link {
  border: 2px solid #06080f;
  border-radius: 10px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
}

.auth-btn,
.primary-btn,
.action-link.is-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(139, 0, 255, 0.18));
  color: #f4fbff;
  box-shadow: 0 0 0 1px rgba(6, 8, 15, 0.8), 0 0 14px rgba(0, 240, 255, 0.16);
}

.cabinet-chip {
  background: linear-gradient(135deg, rgba(0, 255, 159, 0.22), rgba(0, 166, 106, 0.2));
  color: #eafff8;
  box-shadow: 0 0 0 1px rgba(6, 8, 15, 0.8), 0 0 14px rgba(0, 255, 159, 0.18);
}

.ghost-btn,
.action-link.is-ghost {
  background: rgba(2, 6, 23, 0.72);
  color: #dff9ff;
  border-color: rgba(0, 240, 255, 0.35);
}

.auth-btn:hover,
.primary-btn:hover,
.ghost-btn:hover,
.cabinet-chip:hover,
.action-link:hover {
  border-color: rgba(0, 240, 255, 0.68);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.25), 0 0 18px rgba(0, 240, 255, 0.26);
  color: #fff;
}

.tabs-shell {
  border-bottom: 1px solid var(--border-color-soft);
  background: rgba(6, 11, 25, 0.88);
  padding: 10px 14px 12px;
}

.tabs {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.5) transparent;
}

.tabs::-webkit-scrollbar {
  height: 4px;
}

.tabs::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.45);
  border-radius: 999px;
}

.tab {
  background: rgba(2, 6, 23, 0.76);
  border: 1px solid var(--border-color-soft);
  color: var(--text-secondary);
  padding: 12px 18px;
  min-height: 46px;
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: all 0.22s ease;
}

.tab + .tab {
  border-left-width: 0;
}

.tab:first-child {
  border-radius: 10px 0 0 10px;
}

.tab:last-child {
  border-radius: 0 10px 10px 0;
}

.tab:hover {
  color: #e8fdff;
  border-color: rgba(0, 240, 255, 0.45);
}

.tab.active {
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 240, 255, 0.28), transparent 42%),
    radial-gradient(circle at 82% 24%, rgba(255, 170, 0, 0.22), transparent 38%),
    linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(255, 98, 0, 0.16), rgba(255, 0, 128, 0.16));
  border-color: rgba(0, 240, 255, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 20px rgba(0, 240, 255, 0.14),
    0 0 28px rgba(255, 98, 0, 0.08);
}

.dashboard-month-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.26);
  background: linear-gradient(135deg, rgba(4, 24, 42, 0.92), rgba(5, 34, 55, 0.82));
  color: rgba(217, 245, 255, 0.96);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px;
}

#section-root {
  display: grid;
  gap: 14px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink));
  opacity: 0.8;
}

.section-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.section-stack {
  display: grid;
  gap: 14px;
}

.section-heading {
  display: grid;
  gap: 8px;
}

.section-heading h1,
.section-heading h2,
.section-heading h3,
.panel h2,
.panel h3 {
  color: var(--neon-blue);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.section-heading p,
.panel p,
.muted,
.list-muted li {
  color: var(--text-secondary);
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 178, 45, 0.55);
  background: linear-gradient(135deg, rgba(255, 145, 0, 0.18), rgba(255, 58, 58, 0.12));
  box-shadow: 0 0 12px rgba(255, 145, 0, 0.26);
  color: #ffe9c0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.metric-card,
.status-card,
.profile-card,
.how-card,
.assistant-card,
.feature-card {
  border: 1px solid var(--border-color-soft);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(2, 6, 23, 0.45);
}

.metric-card strong,
.status-card strong,
.profile-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
  color: var(--text-primary);
  font-family: "JetBrains Mono", "Consolas", monospace;
}

.dashboard-flow {
  gap: 18px;
}

.dashboard-step {
  display: grid;
  gap: 12px;
}

.dashboard-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color-soft);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
}

.dashboard-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  table-layout: fixed;
}

.dashboard-table th,
.dashboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color-soft);
  text-align: left;
  vertical-align: middle;
}

.dashboard-table th {
  color: var(--neon-blue);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

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

.dashboard-row-fallback td {
  background: linear-gradient(90deg, rgba(255, 178, 45, 0.08), rgba(0, 240, 255, 0.06));
}

.dashboard-input {
  width: 100%;
  min-width: 132px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color-soft);
  background: rgba(8, 20, 44, 0.92);
  color: var(--text-primary);
  font: inherit;
}

.dashboard-table th:nth-child(1),
.dashboard-table td:nth-child(1) {
  width: 44px;
}

.dashboard-table th:nth-child(2),
.dashboard-table td:nth-child(2) {
  width: 22%;
}

.dashboard-table th:nth-child(3),
.dashboard-table td:nth-child(3) {
  width: 16%;
}

.dashboard-table th:nth-child(4),
.dashboard-table td:nth-child(4),
.dashboard-table th:nth-child(5),
.dashboard-table td:nth-child(5) {
  width: 31%;
}

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

.dashboard-card-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border-color-soft);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
  color: var(--text-primary);
  cursor: pointer;
}

.dashboard-card-option input {
  width: 16px;
  height: 16px;
}

.referral-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.referral-mini-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  background: linear-gradient(135deg, rgba(8, 20, 44, 0.92), rgba(5, 16, 34, 0.86));
  text-decoration: none;
  color: var(--text-primary);
}

.referral-mini-thumb {
  width: 64px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.16);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.referral-mini-thumb span {
  color: var(--accent-primary);
  font-weight: 700;
}

.referral-mini-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.referral-mini-copy strong {
  color: #f8fbff;
}

.referral-mini-copy span {
  color: var(--text-muted);
  font-size: 13px;
}

.referral-mini-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(0, 153, 255, 0.18));
  border: 1px solid rgba(0, 240, 255, 0.28);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.dashboard-table-wrap::-webkit-scrollbar {
  height: 12px;
}

.dashboard-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.28);
}

.status-grid,
.profile-grid,
.how-grid,
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-card.is-highlight {
  border-color: rgba(0, 255, 159, 0.4);
  box-shadow: 0 0 14px rgba(0, 255, 159, 0.12);
}

.card-list {
  display: grid;
  gap: 10px;
}

.card-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-color-soft);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
}

.compact-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.danger-btn {
  border-color: rgba(255, 118, 146, 0.35);
  color: #ffd7df;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: #d6e3f5;
  background: rgba(8, 20, 44, 0.92);
  font-size: 11px;
  font-weight: 700;
}

.pill.is-good {
  color: #dcfff1;
  border-color: rgba(0, 255, 159, 0.4);
  background: rgba(0, 255, 159, 0.12);
}

.pill.is-warn {
  color: #ffe9c0;
  border-color: rgba(255, 178, 45, 0.45);
  background: rgba(255, 145, 0, 0.12);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color-soft);
  background: rgba(2, 6, 23, 0.45);
}

.timeline-index {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f7fdff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(139, 0, 255, 0.24));
  border: 1px solid rgba(0, 240, 255, 0.3);
  font-weight: 700;
}

.timeline-copy {
  display: grid;
  gap: 4px;
}

.how-flow-shell {
  gap: 16px;
}

.how-flow-table {
  display: grid;
  border: 1px solid var(--border-color-soft);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 22, 48, 0.92), rgba(5, 13, 32, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(0, 240, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.24);
}

.how-flow-head,
.how-flow-row {
  display: grid;
  grid-template-columns: 72px 240px minmax(0, 1fr);
}

.how-flow-head {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.14), rgba(255, 145, 0, 0.1));
  color: var(--neon-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.how-flow-head > div,
.how-flow-row > div {
  padding: 16px 18px;
  border-right: 1px solid rgba(120, 158, 210, 0.14);
}

.how-flow-head > div:last-child,
.how-flow-row > div:last-child {
  border-right: none;
}

.how-flow-row {
  align-items: stretch;
  border-top: 1px solid rgba(120, 158, 210, 0.12);
}

.how-flow-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.how-flow-index {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f6fcff;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 1.05rem;
  font-weight: 800;
  background:
    radial-gradient(circle at center, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.02) 72%);
}

.how-flow-word {
  display: flex;
  align-items: center;
  color: #ffd87a;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.how-flow-copy {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  line-height: 1.6;
}

.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 560px;
  min-height: 420px;
  max-height: 620px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color-soft);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #00d8ff, #3567ff);
}

.chat-header-info h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00d084;
  box-shadow: 0 0 0 rgba(0, 208, 132, 0.55);
  animation: status-pulse 1.8s ease-out infinite;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  gap: 8px;
}

.chat-msg.user {
  flex-direction: row-reverse;
}

.chat-msg-typing .msg-bubble {
  min-width: 58px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #00d8ff, #3567ff);
  flex-shrink: 0;
}

.msg-bubble {
  max-width: 78%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color-soft);
  background: rgba(2, 6, 23, 0.56);
  color: var(--text-primary);
  line-height: 1.45;
  font-size: 14px;
}

.chat-msg.user .msg-bubble {
  background: linear-gradient(135deg, rgba(0, 216, 255, 0.18), rgba(53, 103, 255, 0.15));
}

.msg-time {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color-soft);
}

.chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border-radius: 10px;
  border: 1px solid var(--border-color-soft);
  background: rgba(2, 6, 23, 0.56);
  color: var(--text-primary);
  padding: 9px 10px;
  font: inherit;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #00d8ff, #3567ff);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-welcome {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 10px 0;
}

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 18px;
}

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
}

.typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(198, 235, 255, 0.86);
  display: inline-block;
  animation: typingDots 1.1s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 0.32s;
}

.assistant-chat-wrap .assistant-logo-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-image: url("/assets/logos/HayatiBank.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  border: 1px solid rgba(91, 216, 243, 0.8);
  box-shadow:
    0 0 0 2px rgba(6, 17, 47, 0.85),
    0 0 18px rgba(0, 224, 255, 0.38),
    0 0 30px rgba(0, 224, 255, 0.2);
  overflow: hidden;
}

.assistant-chat-wrap .assistant-logo-avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.28), transparent 42%);
  pointer-events: none;
}

.assistant-chat-wrap .assistant-logo-avatar::after {
  content: "";
  position: absolute;
  inset: -65% -120%;
  background: linear-gradient(120deg, transparent 36%, rgba(255, 255, 255, 0.35), transparent 64%);
  transform: translateX(-45%) rotate(12deg);
  animation: assistantLogoShimmer 4.6s ease-in-out infinite;
  pointer-events: none;
}

.assistant-chat-wrap .assistant-logo-avatar-msg {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-image: url("/assets/logos/HayatiBank.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(91, 216, 243, 0.72);
  box-shadow: 0 0 10px rgba(0, 224, 255, 0.3);
  color: transparent;
}

.assistant-chat-wrap .msg-avatar-user {
  background: linear-gradient(135deg, #00d8ff, #3567ff);
}

.assistant-chat-wrap .msg-avatar-user-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}

.trinket-editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 240px;
  gap: 16px;
}

.trinkets-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trinkets-subtabs-shell {
  flex: 1;
}

.trinkets-subtabs {
  max-width: none;
}

.trinkets-subtabs .tab {
  min-height: 34px;
  padding: 7px 16px;
  font-size: 12px;
}

.trinkets-subtabs .tab + .tab {
  border-left-width: 0;
}

.trinkets-scroll-list {
  display: grid;
  gap: 12px;
  max-height: min(68vh, 760px);
  overflow-y: auto;
  padding-right: 6px;
}

.trinkets-scroll-list::-webkit-scrollbar {
  width: 10px;
}

.trinkets-scroll-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.28);
}

.trinket-add-btn {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(255, 145, 0, 0.16));
  color: #f8fdff;
  font-size: 1.9rem;
  line-height: 1;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.trinket-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.trinket-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: grid;
  place-items: center;
  padding: 24px;
}

.trinket-modal-panel {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.trinket-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trinket-editor-form,
.trinket-preview,
.trinket-preview-copy,
.trinket-actions {
  display: grid;
  gap: 12px;
}

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

.trinket-field {
  display: grid;
  gap: 6px;
}

.trinket-field span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.trinket-field input {
  border-radius: 10px;
  border: 1px solid var(--border-color-soft);
  background: rgba(2, 6, 23, 0.56);
  color: var(--text-primary);
  padding: 10px 12px;
  font: inherit;
}

.trinket-field-wide {
  grid-column: 1 / -1;
}

.trinket-preview {
  align-content: start;
}

.trinket-preview-thumb,
.trinket-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid var(--border-color-soft);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(139, 0, 255, 0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f4fbff;
  font-size: 32px;
  font-weight: 700;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.trinket-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trinket-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-color-soft);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.45);
}

.trinket-thumb {
  width: 72px;
  min-width: 72px;
  border-radius: 14px;
  font-size: 24px;
}

.trinket-copy {
  display: grid;
  gap: 6px;
}

.trinket-link {
  font-size: 12px;
}

.trinket-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
}

.wallet-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wallet-chip-label {
  font-size: 13px;
  opacity: 0.84;
}

.wallet-chip {
  border: 1px solid rgba(123, 255, 182, 0.5);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(12, 67, 47, 0.4);
  color: #d8fff0;
  font-size: 13px;
}

.wallet-chip-active {
  border-color: rgba(154, 255, 206, 0.95);
  background: linear-gradient(135deg, rgba(21, 129, 88, 0.84), rgba(13, 93, 64, 0.9));
  box-shadow: 0 0 0 1px rgba(154, 255, 206, 0.32), 0 0 24px rgba(62, 215, 146, 0.5);
  animation: walletPulseRoyal 3.6s ease-in-out infinite;
}

.list-muted {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.empty-guest {
  display: grid;
  gap: 14px;
}

.empty-guest-hero {
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(0, 240, 255, 0.16), transparent 30%),
    linear-gradient(160deg, rgba(2, 10, 34, 0.98), rgba(4, 14, 44, 0.98));
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1;
  max-width: 11ch;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fact-card {
  border: 1px solid var(--border-color-soft);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(2, 6, 23, 0.45);
}

.fact-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
  font-family: "JetBrains Mono", "Consolas", monospace;
}

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

.toast-chip {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: min(460px, calc(100vw - 40px));
}

.toast-chip.is-info {
  color: #e8f2ff;
  border-color: rgba(0, 218, 255, 0.62);
  background: linear-gradient(135deg, rgba(0, 188, 255, 0.2), rgba(14, 116, 255, 0.14));
  box-shadow: 0 0 12px rgba(0, 188, 255, 0.2);
}

.toast-chip.is-success {
  color: #ebfff4;
  border-color: rgba(74, 222, 128, 0.72);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(16, 185, 129, 0.18));
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.24);
}

.toast-chip.is-error {
  color: #fff0f0;
  border-color: rgba(248, 113, 113, 0.72);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(190, 24, 93, 0.18));
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.22);
}

@keyframes brand-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes brand-shine {
  0% { transform: translateX(-140%) rotate(8deg); }
  100% { transform: translateX(140%) rotate(8deg); }
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes assistantLogoShimmer {
  0% { transform: translateX(-70%) rotate(12deg); opacity: 0.05; }
  28% { transform: translateX(28%) rotate(12deg); opacity: 0.35; }
  55% { transform: translateX(90%) rotate(12deg); opacity: 0.05; }
  100% { transform: translateX(90%) rotate(12deg); opacity: 0.05; }
}

@keyframes status-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 208, 132, 0.55);
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 9px rgba(0, 208, 132, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 208, 132, 0);
  }
}

@keyframes typingDots {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@keyframes walletPulseRoyal {
  0% {
    box-shadow: 0 0 0 1px rgba(154, 255, 206, 0.22), 0 0 18px rgba(62, 215, 146, 0.34), 0 0 34px rgba(36, 181, 124, 0.2);
    filter: saturate(1.02) brightness(1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(175, 255, 217, 0.52), 0 0 36px rgba(98, 245, 177, 0.72), 0 0 58px rgba(56, 199, 141, 0.38);
    filter: saturate(1.18) brightness(1.08);
    transform: scale(1.035);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(154, 255, 206, 0.22), 0 0 18px rgba(62, 215, 146, 0.34), 0 0 34px rgba(36, 181, 124, 0.2);
    filter: saturate(1.02) brightness(1);
    transform: scale(1);
  }
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .brand-frame {
    justify-content: flex-start;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    justify-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    align-items: center;
  }

  .brand-wrap {
    justify-self: start;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .brand-wrap .identity-chip {
    display: none;
  }

  .brand-frame {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    justify-self: center;
    padding: 8px 12px;
    z-index: 1;
    pointer-events: none;
  }

  .brand-ar {
    font-size: 28px;
  }

  .top-actions {
    display: inline-flex;
    justify-self: end;
    align-items: center;
  }

  .lang-mobile-wrap {
    display: inline-flex;
    position: static;
    transform: none;
    z-index: 62;
  }

  .menu-toggle-btn {
    display: inline-flex;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 62;
  }

  .header-meta {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(340px, 88vw);
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 11px;
    padding: 16px 14px 18px;
    background: linear-gradient(160deg, rgba(2, 10, 34, 0.98), rgba(4, 14, 44, 0.98));
    border-left: 1px solid rgba(0, 240, 255, 0.22);
    right: -110vw;
    transition: right 0.24s ease;
    pointer-events: none;
    visibility: hidden;
    overflow-y: auto;
  }

  .menu-user-chip,
  .menu-ecosystem-chip {
    display: inline-flex;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    justify-content: center;
    align-self: stretch;
    text-align: center;
  }

  .header-meta .lang-switch {
    display: none;
  }

  .pref-switchers {
    width: 100%;
    display: grid;
    gap: 10px;
  }

  .pref-switch {
    width: 100%;
    justify-content: space-between;
  }

  .project-jump {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .project-jump select {
    width: 124px;
    min-width: 124px;
    max-width: 124px;
    min-height: 38px;
    margin-left: auto;
    font-size: 12px;
    padding: 9px 10px;
  }

  .pref-switch select,
  .auth-btn,
  .cabinet-chip {
    width: 100%;
    min-height: 42px;
  }

  .pref-switch select {
    min-width: 124px;
    max-width: 124px;
  }

  body.menu-open .header-meta {
    right: 0;
    pointer-events: auto;
    visibility: visible;
  }

  body.menu-open .menu-backdrop {
    display: block;
  }

  .data-badge {
    display: inline-flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 12px;
  }

  .container {
    padding: 14px 12px 30px;
  }

  .tabs-shell {
    padding: 8px 10px 10px;
  }

  .tabs {
    justify-content: flex-start;
  }

  .tab {
    flex: 0 0 220px;
    min-width: 220px;
  }

  .status-grid,
  .profile-grid,
  .how-grid,
  .action-grid,
  .stats-grid,
  .quick-facts,
  .dashboard-card-grid,
  .dashboard-result-grid {
    grid-template-columns: 1fr;
  }

  .trinket-editor-shell,
  .trinket-columns,
  .trinket-form-grid {
    grid-template-columns: 1fr;
  }

  .trinkets-toolbar,
  .trinket-modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .trinket-add-btn {
    width: 100%;
  }

  .chat-send-btn {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .how-flow-head,
  .how-flow-row {
    grid-template-columns: 56px 160px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .brand-logo,
  .logo-seal {
    width: 44px;
    height: 44px;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: 2.35rem;
  }

  .timeline-step {
    grid-template-columns: 1fr;
  }

  .timeline-index {
    width: 38px;
    height: 38px;
  }

  .how-flow-head {
    display: none;
  }

  .how-flow-row {
    grid-template-columns: 1fr;
  }

  .how-flow-row > div {
    border-right: none;
    border-bottom: 1px solid rgba(120, 158, 210, 0.12);
  }

  .how-flow-row > div:last-child {
    border-bottom: none;
  }

  .how-flow-index,
  .how-flow-word,
  .how-flow-copy {
    justify-content: flex-start;
    text-align: left;
  }

  .how-flow-index {
    padding-bottom: 8px;
  }

  .chat-wrap {
    height: 460px;
    min-height: 360px;
    max-height: 520px;
  }

  .msg-bubble {
    max-width: 92%;
  }
}
