.profile-account-settings { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.profile-session-status { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.profile-account-settings[hidden] { display: none; }
.profile-account-settings:hover { background: var(--control-hover); }
.profile-account-settings:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
:root {
  color-scheme: dark;
  --page: #000000;
  --surface: #080b0e;
  --ink: #f0f2f4;
  --muted: #8d969f;
  --rule: #1b1f22;
  --control: #0d1114;
  --control-hover: #12171b;
  --focus: #a9bacb;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #18212b;
  --muted: #56616e;
  --rule: #dce2e8;
  --control: #FFFFFF;
  --control-hover: #dfe5eb;
  --focus: #465f78;
}

* {
  box-sizing: border-box;
}

.avs-page-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  z-index: 20;
}
.avs-page-loader > span {
  display: block;
  width: 42px;
  height: 42px;
  border: 3px solid var(--rule);
  border-top-color: #ff9029;
  border-radius: 50%;
  animation: avs-page-spin .85s linear infinite;
}
@keyframes avs-page-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .avs-page-loader > span { animation: none; border-right-color: #ff9029; }
}

html {
  /* Fixed page scale (owner request 2026-11-03): no double-tap zoom. */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

.workspace-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
}

.site-header,
.site-footer {
  width: 100%;
  padding-inline: clamp(22px, 5.2vw, 76px);
}

.site-header {
  padding-inline: 16px;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--rule);
}

.desktop-site-nav { display: flex; flex: 1; justify-content: flex-start; align-items: center; gap: 8px; margin-left: 20px; }
.desktop-site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 550; text-decoration: none; }
.desktop-site-nav a:hover { color: var(--ink); background: var(--control-hover); }
.desktop-site-nav a[aria-current="page"] { color: #ff9c2e; background: rgb(255 156 46 / 10%); }
:root[data-theme="light"] .desktop-site-nav a[aria-current="page"] { color: #9b4607; }
.desktop-site-nav a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.brand {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 42px;
  border-radius: 9px;
  background: #000000;
}

.brand-mark img {
  display: block;
  object-fit: contain;
}

.brand-wordmark {
  display: grid;
  gap: 6px;
}

.brand-wordmark strong {
  font-size: 12px;
  letter-spacing: .15em;
}

.brand-wordmark small {
  color: #FF9C2E;
  font-size: 8px;
  letter-spacing: .28em;
}

.profile {
  position: relative;
  margin-left: auto;
}

.profile-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--control);
  color: #FF9C2E;
  cursor: pointer;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(232px, calc(100vw - 44px));
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 32px #00000026;
  z-index: 20;
}

[hidden] {
  display: none !important;
}

.profile-sign-in,
.profile-sign-out,
.theme-toggle {
  width: 100%;
  text-align: left;
}

.profile-sign-in,
.profile-sign-out {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.profile-sign-out { gap: 10px; color: var(--ink); }
.profile-sign-out svg { color: #ff9c2e; }
.profile-summary { display: grid; gap: 5px; padding: 12px; }
.profile-summary > strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.profile-balance-label { margin-top: 3px; color: var(--muted); font-size: 11px; }
.profile-summary > b { color: var(--ink); font-size: 21px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.profile-summary > small { color: var(--muted); font-size: 10px; }
.profile-kyc { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 8px; color: var(--muted); font-size: 11px; text-decoration: none; }
.profile-kyc[hidden] { display: none; }
.profile-kyc b { font-size: 11px; font-weight: 700; }
.profile-kyc[data-status="verified"] b { color: #22c55e; }
.profile-kyc[data-status="pending"] b { color: #ff9c2e; }
.profile-kyc[data-status="rejected"] b { color: #ef4444; }
.profile-kyc:hover, .profile-kyc:focus-visible { border-color: #ff9c2e; }
.profile-theme-icon { display: grid; place-items: center; color: #ff9c2e; }

.profile-sign-in:hover,
.profile-sign-out:hover {
  background: var(--control-hover);
  color: var(--ink);
}

.profile-sign-in:focus-visible,
.profile-sign-out:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.profile-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--rule);
}

.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.theme-toggle:hover {
  background: var(--control-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.profile-toggle:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.theme-switch {
  width: 32px;
  height: 19px;
  padding: 3px;
  border-radius: 20px;
  background: var(--rule);
}

.theme-switch::before {
  content: "";
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
}

.theme-toggle[aria-pressed="true"] .theme-switch {
  background: #FF9C2E;
}

.theme-toggle[aria-pressed="true"] .theme-switch::before {
  background: #000000;
  transform: translateX(13px);
}

#main-content {
  flex: 1;
}

.mobile-site-nav { display: none; }
@media (max-width: 760px) {
  .desktop-site-nav { display: none; }
  body[data-avs-page="dashboard"] .site-header { min-height: 56px; padding-inline: 12px; }
  body[data-avs-page="dashboard"] .brand-mark { width: 34px; height: 34px; }
  body[data-avs-page="dashboard"] .brand-mark img { width: 28px; height: 27px; }
  body[data-avs-page="dashboard"] .brand-wordmark strong { font-size: 10px; }
  body[data-avs-page="dashboard"] .brand-wordmark small { font-size: 8px; }
  /* No footer on mobile (owner request 2026-11-03); the page keeps room for the fixed bottom menu instead. */
  .workspace-shell .site-footer { display: none; }
  body:is([data-avs-page="dashboard"], [data-avs-page="home"], [data-avs-page="buy-avs"], [data-avs-page="trade-avs"], [data-avs-page="bot-rounds"], [data-avs-page="auth"], [data-avs-page="trading-agents"]) .workspace-shell { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  body:is([data-avs-page="dashboard"], [data-avs-page="home"], [data-avs-page="buy-avs"], [data-avs-page="trade-avs"], [data-avs-page="bot-rounds"], [data-avs-page="auth"], [data-avs-page="trading-agents"]) .mobile-site-nav {
    position: fixed;
    z-index: 20;
    inset: auto 0 0;
    min-height: calc(74px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr)); /* Home, Trade AVS, Bot Rounds, Dashboard (Buy AVS hidden 2026-11-14) */
    align-items: center;
    gap: 8px;
    padding: 7px 16px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule);
    background: color-mix(in srgb, var(--page) 94%, transparent);
    backdrop-filter: blur(14px);
  }
  .mobile-site-nav a {
    min-width: 0;
    min-height: 48px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
  }
  .mobile-site-nav a[aria-current="page"] { color: #ff9c2e; background: rgb(255 156 46 / 11%); }
  :root[data-theme="light"] .mobile-site-nav a[aria-current="page"] { color: #774006; }
  .mobile-site-nav svg { width: 21px; height: 21px; }
}

.site-footer {
  min-height: 60px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--rule);
}

.footer-brand {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .site-header {
    min-height: 68px;
  }

  .site-footer {
    min-height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Remembrance bubble (owner request 2026-11-09): every page, every 30–60 seconds, top-right below the header. */
.dhikr-bubble {
  position: fixed;
  z-index: 30;
  right: 24px;
  top: calc(88px + env(safe-area-inset-top));
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px 15px 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #ff9c2e 34%, var(--rule));
  border-radius: 18px 6px 18px 18px;
  color: var(--ink);
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(255 156 46 / 14%), transparent 60%),
    color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: 0 14px 38px rgb(0 0 0 / 38%), 0 0 0 1px rgb(255 255 255 / 3%) inset;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-18px) scale(0.94);
  transform-origin: top right;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.2);
}
.dhikr-bubble.is-visible { opacity: 1; transform: none; }
.dhikr-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 50%;
  color: #ff9c2e;
  background: rgb(255 156 46 / 12%);
  box-shadow: 0 0 18px rgb(255 156 46 / 22%);
}
.dhikr-mark svg { width: 17px; height: 17px; }
.dhikr-text {
  margin: 0;
  font-family: "Noto Sans Arabic", "Segoe UI", "Geeza Pro", "SF Arabic", Tahoma, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.75;
  text-align: right;
}
.dhikr-progress {
  position: absolute;
  inset: auto 14px 6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ff9c2e);
  opacity: 0.55;
  transform-origin: right;
  transform: scaleX(0);
}
.dhikr-bubble.is-visible .dhikr-progress { animation: dhikr-progress var(--dhikr-duration, 6000ms) linear forwards; }
@keyframes dhikr-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
:root[data-theme="light"] .dhikr-bubble { box-shadow: 0 14px 34px rgb(37 54 72 / 16%); }
:root[data-theme="light"] .dhikr-mark { color: #b85a0c; }
@media (max-width: 760px) {
  .dhikr-bubble { left: 12px; right: 12px; top: calc(84px + env(safe-area-inset-top)); width: auto; max-width: none; }
  body[data-avs-page="dashboard"] .dhikr-bubble { top: calc(64px + env(safe-area-inset-top)); }
  .dhikr-text { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .dhikr-bubble { transform: none; transition: opacity 0.3s ease; }
  .dhikr-bubble.is-visible .dhikr-progress { animation: none; }
}

/* Site upgrade banner (owner request 2026-11-11), shown while the server maintenance switch is on. */
.site-maintenance {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #6b4310;
  background: #1f1406;
  color: #f3d7a6;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.site-maintenance strong { color: #ffb347; font-weight: 700; }
:root[data-theme="light"] .site-maintenance { border-bottom-color: #e9c48f; background: #fff3df; color: #5a3507; }
:root[data-theme="light"] .site-maintenance strong { color: #9b4607; }
@media (max-width: 600px) {
  .site-maintenance { padding: 8px 12px; font-size: 12px; }
}

/* Frozen account (owner request 2026-11-14): balances only, plus cancelling open orders in the Sell and Buy tabs. */
.site-frozen {
  position: sticky;
  top: 0;
  z-index: 1001;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #7a1f1f;
  background: #240b0b;
  color: #f5c9c9;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.site-frozen strong { color: #ff7a7a; font-weight: 700; }
:root[data-theme="light"] .site-frozen { border-bottom-color: #efb4b4; background: #fff0f0; color: #5c1414; }
:root[data-theme="light"] .site-frozen strong { color: #a31b1b; }
html[data-account-frozen] :is([data-nav-home], [data-nav-buy-avs], [data-nav-trade-avs], [data-nav-trading-agents], [data-profile-kyc], .avs-guide),
html[data-account-frozen] :is(#avs-tab-1, #avs-tab-avs-trade, #avs-tab-4, #avs-panel-1, #avs-panel-avs-trade, #avs-panel-4),
html[data-account-frozen] :is(.avs-quick-actions, .avs-mobile-secondary-actions, .avs-deposit-reminder, .avs-account-tools, .avs-account-options > .avs-create-account, .avs-mobile-profit-card button),
html[data-account-frozen] :is(#avs-panel-2, #avs-panel-3) [data-testid^="button-fund-"] { display: none !important; }
html[data-account-frozen] .mobile-site-nav { grid-template-columns: 1fr !important; }
@media (max-width: 600px) {
  .site-frozen { padding: 8px 12px; font-size: 12px; }
}

/* Full exit tab (owner plan approved 2026-11-14; owner review: same layout as the other tabs, shares only, no prices). */
.avs-fx .avs-fx-tag { font-size: 11px; font-weight: 600; }
.avs-fx .avs-fx-tag.ok { color: var(--profit-green, #30b879); }
.avs-fx .avs-fx-tag.warn { color: #e9a25a; }
.avs-fx .avs-fx-tag.muted { color: var(--profit-muted, #a3a3a1); }
.avs-fx .avs-fx-table table { min-width: 560px; }
.avs-fx .avs-profit-history { min-height: 0; }
.avs-fx-confirm, .avs-fx-progress, .avs-fx-sign { display: grid; gap: 14px; }
.avs-fx-confirm .avs-profit-section-head, .avs-fx-progress .avs-profit-section-head, .avs-fx-sign .avs-profit-section-head { margin: 0; }
.avs-fx-sign { border-color: color-mix(in srgb, var(--profit-orange, #ff9c2e) 50%, var(--profit-line, #292a2b)); }
.avs-fx-ack { display: flex; gap: 10px; align-items: flex-start; color: var(--profit-text, #f1f0ed); font-size: 12px; line-height: 1.6; cursor: pointer; }
.avs-fx-ack input { flex: none; width: 16px; height: 16px; margin-top: 3px; accent-color: var(--profit-orange, #ff9c2e); }
.avs-fx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.avs-fx-actions .avs-profit-redeem { width: auto; min-width: 150px; min-height: 36px; padding: 0 18px; }
.avs-fx-secondary, .avs-fx-retry, .avs-fx-row-action { min-height: 36px; padding: 0 16px; border: 1px solid var(--profit-line, #292a2b); border-radius: 6px; background: transparent; color: var(--profit-text, #f1f0ed); font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.avs-fx-retry { min-height: 28px; padding: 0 12px; color: var(--profit-orange, #ff9c2e); }
.avs-fx-row-action { min-height: 28px; padding: 0 12px; border-color: color-mix(in srgb, var(--profit-orange, #ff9c2e) 55%, var(--profit-line, #292a2b)); color: var(--profit-orange, #ff9c2e); }
.avs-fx-row-action.danger { border-color: #8a3a3a; color: #ff8f8f; }
.avs-fx-secondary:disabled, .avs-fx-retry:disabled, .avs-fx-row-action:disabled, .avs-fx-link:disabled { opacity: .5; cursor: not-allowed; }
.avs-fx-link { justify-self: start; align-self: flex-start; margin-top: 10px; padding: 4px 0; border: 0; background: transparent; color: var(--profit-orange, #ff9c2e); font: inherit; font-size: 11px; cursor: pointer; }
.avs-fx-small { margin: 0; color: var(--profit-muted, #a3a3a1); font-size: 11px; line-height: 1.5; }
.avs-fx-field { display: grid; gap: 6px; max-width: 420px; color: var(--profit-muted, #a3a3a1); font-size: 11px; }
.avs-fx-field input { min-height: 40px; padding: 0 12px; border: 1px solid var(--profit-line, #292a2b); border-radius: 6px; background: var(--profit-raised, #171819); color: var(--profit-text, #f1f0ed); font: inherit; font-size: 13px; }
.avs-fx-progress-top { display: flex; justify-content: space-between; gap: 12px; color: var(--profit-muted, #a3a3a1); font-size: 12px; }
.avs-fx-progress-top strong { color: var(--profit-orange, #ff9c2e); font-size: 14px; }
.avs-fx-bar { height: 8px; border-radius: 6px; background: var(--profit-raised, #171819); overflow: hidden; }
.avs-fx-bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #f4a22e, #df821e); transition: width .4s ease; }
.avs-profit-light.avs-fx .avs-fx-tag.ok { color: #00794d; }
.avs-profit-light.avs-fx .avs-fx-tag.warn { color: #9b4607; }
@media (max-width: 760px) {
  .avs-fx-actions .avs-profit-redeem, .avs-fx-actions .avs-fx-secondary { flex: 1 1 auto; }
}
