:root {
  --blue: #1557d6;
  --deep: #0b2f73;
  --soft-blue: #eef5ff;
  --gold: #d8a31a;
  --green: #18b77b;
  --ink: #17223b;
  --muted: #788195;
  --line: #dfe8f6;
  --card: #ffffff;
  --bg: #f5f8fd;
  --shadow: 0 18px 45px rgba(11, 47, 115, 0.12);
}

*,
*::before,
*::after { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea { text-align: right; }
html[dir="rtl"] .top-title { text-align: center; }
html[dir="rtl"] .top-actions { justify-content: flex-start; }
html[dir="rtl"] .telegram-float { right: auto; left: max(18px, env(safe-area-inset-left)); }
button, input, select, textarea { font: inherit; max-width: 100%; min-width: 0; }
button { cursor: pointer; border: 0; overflow-wrap: anywhere; }
a, p, h1, h2, h3, strong, small, span, label { max-width: 100%; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; width: 100%; max-width: 100%; overflow-x: hidden; }

.session-loading-view {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(21,87,214,.17), transparent 34%),
    linear-gradient(180deg, #fff, #edf5ff);
}
.session-loading-card {
  width: min(430px, 92vw);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 22px;
  border-radius: 24px;
  background: white;
  color: var(--deep);
  text-align: center;
  box-shadow: var(--shadow);
}
.session-loading-card h1 {
  margin: 0;
  font-size: clamp(20px, 5vw, 26px);
  letter-spacing: .5px;
}
.session-loading-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}
.session-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid #dfe8f6;
  border-top-color: var(--blue);
  animation: sessionSpin .8s linear infinite;
}
@keyframes sessionSpin {
  to { transform: rotate(360deg); }
}

.auth-view {
  min-height: 100vh;
  padding: 32px 18px;
  display: grid;
  align-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at top left, rgba(21,87,214,.17), transparent 34%),
    linear-gradient(180deg, #fff, #edf5ff);
}
.brand-panel {
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--deep), var(--blue));
  color: white;
  box-shadow: var(--shadow);
}
.brand-logo, .mini-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: white;
  color: var(--blue);
  font-weight: 900;
  letter-spacing: .5px;
}
.brand-panel h1 { font-size: 22px; margin: 0; letter-spacing: .5px; }
.brand-panel p { margin: 3px 0 0; font-size: 12px; letter-spacing: 1.6px; opacity: .86; }
.auth-card {
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  padding: 18px;
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--soft-blue);
  padding: 6px;
  border-radius: 16px;
}
.language-control,
.language-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-width: 0;
  color: var(--muted);
  letter-spacing: .2px;
}
.auth-language {
  justify-content: flex-end;
  margin-bottom: 12px;
}
.language-control select,
.language-pill select {
  width: auto;
  min-width: 96px;
  max-width: 140px;
  padding: 9px 28px 9px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.tab {
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}
.tab.active { background: white; color: var(--blue); box-shadow: 0 6px 18px rgba(21,87,214,.12); }
.auth-form { display: grid; gap: 13px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .4px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(21,87,214,.08); }
.micro { color: var(--muted); font-size: 12px; margin: 0; text-align: center; }
.muted { color: var(--muted); margin: 0; line-height: 1.45; }

.dashboard-view { min-height: 100vh; width: 100%; max-width: 100%; padding-bottom: 86px; overflow-x: hidden; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 18px 16px;
  background: linear-gradient(135deg, var(--deep), var(--blue) 70%, #2b78ff);
  color: white;
}
.mini-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 15px;
  box-shadow: inset 0 0 0 2px rgba(216,163,26,.35);
}
.top-title { text-align: center; min-width: 0; }
.top-title strong { display: block; font-size: 18px; letter-spacing: .8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title span { display: block; font-size: 10px; letter-spacing: 1.7px; opacity: .82; margin-top: 3px; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.language-pill {
  height: 40px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.25);
  color: white;
}
.language-pill select {
  min-width: 74px;
  max-width: 96px;
  height: 30px;
  padding: 4px 20px 4px 8px;
  border: 0;
  background: white;
  color: var(--deep);
}
.icon-btn, .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: white;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  font-weight: 900;
}
.avatar { background: white; color: var(--blue); }

.page-content { width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; }
.page { display: none; animation: rise .22s ease; }
.page.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.activity-card {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  z-index: 70;
  width: min(360px, calc(100vw - 40px));
  min-height: 96px;
  margin: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 20px;
  color: white;
  background: linear-gradient(135deg, #047857, #10b981);
  box-shadow: 0 22px 54px rgba(6, 78, 59, .34), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 1;
  transform: translateX(0);
  transition: opacity .38s ease, transform .38s cubic-bezier(.2,.8,.2,1);
}
.activity-card.activity-hidden {
  opacity: 0;
  transform: translateX(-28px);
  pointer-events: none;
}
.activity-card.activity-investment {
  background: linear-gradient(135deg, #b45309, #f59e0b);
  box-shadow: 0 22px 54px rgba(180, 83, 9, .34), inset 0 1px 0 rgba(255,255,255,.2);
}
.activity-card.activity-withdrawal {
  background: linear-gradient(135deg, #065f46, #10b981);
  box-shadow: 0 22px 54px rgba(6, 95, 70, .34), inset 0 1px 0 rgba(255,255,255,.18);
}
.activity-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #064e3b;
  background: rgba(255,255,255,.94);
  font-weight: 950;
  font-size: 20px;
}
.activity-investment .activity-avatar { color: #92400e; }
.activity-withdrawal .activity-avatar { color: #064e3b; }
.activity-card strong {
  display: block;
  font-size: 15px;
  letter-spacing: .1px;
}
.activity-card p {
  margin: 4px 0 3px;
  color: rgba(255,255,255,.92);
  line-height: 1.25;
  font-size: 13px;
}
.activity-card b {
  display: block;
  margin-top: 2px;
  color: white;
  font-size: 18px;
  letter-spacing: .2px;
}
.activity-card small {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 700;
}
body:has(.modal[open]) .activity-card,
body:has(#adminPage.active) .activity-card {
  opacity: 0;
  transform: translateX(-28px);
  pointer-events: none;
}

.portfolio-card {
  margin: 0 0 20px;
  padding: 30px 18px 22px;
  text-align: center;
  border-radius: 26px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  border-top: 7px solid #2fb7ff;
  box-shadow: var(--shadow);
}
.portfolio-label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2.8px;
  font-weight: 800;
}
.portfolio-card h2 {
  margin: 22px 0 28px;
  color: var(--blue);
  font-size: clamp(34px, 11vw, 64px);
  line-height: 1;
  letter-spacing: .2px;
}
.portfolio-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.primary-btn, .outline-btn {
  min-height: 56px;
  border-radius: 18px;
  padding: 0 18px;
  font-weight: 900;
  letter-spacing: .8px;
  max-width: 100%;
  white-space: normal;
  line-height: 1.15;
}
.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--blue), #123f9d);
  box-shadow: 0 12px 28px rgba(21,87,214,.25);
}
.outline-btn {
  color: var(--blue);
  background: white;
  border: 2px solid #59bff3;
}
.outline-btn.small { min-height: 42px; border-radius: 12px; padding: 0 14px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.stat-card, .plan-card, .record-card, .simple-card, .admin-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(11,47,115,.06);
}
.stat-card {
  min-height: 154px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.stat-icon.blue { background: #eaf3ff; color: var(--blue); }
.stat-icon.green { background: #eafaf4; color: var(--green); }
.stat-icon.gold { background: #fff6dc; color: var(--gold); }
.stat-card small { color: var(--muted); font-weight: 900; letter-spacing: 1.1px; }
.stat-card strong { font-size: 20px; word-break: break-word; }

.section-heading { margin: 6px 0 16px; }
.section-heading h2, .simple-card h2, .admin-head h2 { margin: 0 0 6px; color: var(--deep); }
.section-heading p, .simple-card p, .admin-head p { margin: 0; color: var(--muted); line-height: 1.5; }
.plans-list { display: grid; gap: 14px; }
.plan-card { padding: 18px; }
.plan-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.plan-card h3 { margin: 0 0 5px; color: var(--deep); }
.plan-min { color: var(--gold); font-weight: 900; white-space: nowrap; }
.plan-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.plan-meta div { background: var(--soft-blue); border-radius: 14px; padding: 12px; }
.plan-meta small { display: block; color: var(--muted); font-weight: 800; }
.plan-meta strong { color: var(--deep); }
.plan-actions {
  display: flex;
  justify-content: center;
}
.plan-actions .primary-btn {
  width: min(260px, 100%);
}
.benefits { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); }
.benefits li::before { content: "✓"; color: var(--green); font-weight: 900; margin-right: 8px; }

.records-list { display: grid; gap: 12px; }
.record-card { padding: 15px; display: grid; gap: 7px; }
.record-row { display: flex; justify-content: space-between; gap: 12px; }
.record-row > * { min-width: 0; }
.badge { display: inline-grid; place-items: center; min-width: 84px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.badge.pending { background: #fff6dc; color: #a26e00; }
.badge.pending_verification { background: #eaf3ff; color: var(--blue); }
.badge.approved, .badge.active, .badge.completed { background: #eafaf4; color: #12835b; }
.badge.rejected, .badge.expired, .badge.suspended, .badge.banned, .badge.deleted, .badge.blocked_due_to_rejected_investments { background: #ffedef; color: #b42336; }
.rejection-note { color: #b42336; font-weight: 800; }
.rejection-warning-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #ffd3a3;
  border-left: 5px solid var(--gold);
  border-radius: 18px;
  background: #fff8ec;
  color: #6f4300;
  box-shadow: 0 12px 28px rgba(178, 116, 0, .12);
}
.rejection-warning-card.compact {
  margin: 8px 0;
  padding: 12px;
  border-radius: 14px;
}
.rejection-warning-card.restricted {
  border-color: #ffc4ca;
  border-left-color: #d92d20;
  background: #fff1f3;
  color: #9f1f2f;
}
.rejection-warning-card strong {
  color: inherit;
  font-size: 15px;
  font-weight: 950;
}
.rejection-warning-card p {
  margin: 0;
  color: inherit;
  line-height: 1.45;
}
.rejection-warning-card small {
  color: inherit;
  font-weight: 800;
}
.app-install-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(11, 77, 184, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f4f8ff);
  box-shadow: 0 16px 34px rgba(11, 77, 184, 0.1);
}
.app-install-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  font-weight: 950;
  letter-spacing: 0.04em;
}
.app-install-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.app-install-copy p,
.app-install-copy small {
  margin: 0;
}
.app-install-copy p {
  color: #526070;
  line-height: 1.45;
}
.app-install-copy small {
  color: var(--blue);
  font-weight: 800;
}
.ios-install-help {
  color: #8a5b00 !important;
}
.app-install-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
}
.app-install-actions button {
  width: 100%;
}
.inline-error {
  padding: 11px 12px;
  border-radius: 12px;
  background: #ffedef;
  color: #b42336;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.proof-lock-status {
  display: grid;
  gap: 6px;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fbbf24;
}
.proof-lock-status strong {
  color: #78350f;
}
.proof-lock-status small,
.proof-lock-status span {
  color: #92400e;
  line-height: 1.35;
}
.inline-warning {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff6dc;
  color: #8b6100;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.inline-success {
  padding: 11px 12px;
  border-radius: 12px;
  background: #eafaf4;
  color: #12835b;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}
.guided-notice {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px;
  border-radius: 20px;
  background: #fff6dc;
  border: 1px solid rgba(216, 163, 26, .35);
  box-shadow: 0 12px 30px rgba(11,47,115,.06);
}
.guided-notice strong { color: var(--deep); font-size: 18px; }
.guided-notice p { margin: 0; color: #8b6100; line-height: 1.45; font-weight: 800; }
.support-action {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}
.is-disabled {
  cursor: not-allowed;
  opacity: .62;
  box-shadow: none;
}
.minimum-hint {
  display: block;
  margin-top: -6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}
.active-investments { margin-top: 20px; }
.forex-chart-section {
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
}
.forex-chart-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 10%, rgba(34, 158, 217, .28), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(216, 163, 26, .18), transparent 26%),
    linear-gradient(145deg, #071833, #0b2f73 52%, #09214e);
  color: white;
  box-shadow: 0 18px 45px rgba(7, 24, 51, .22);
}
.forex-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}
.forex-chart-head h2 {
  margin: 8px 0 4px;
  color: white;
  font-size: clamp(20px, 5vw, 28px);
}
.forex-chart-head p {
  margin: 0;
  color: rgba(255,255,255,.72);
  line-height: 1.4;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(24, 183, 123, .16);
  color: #5df3ad;
  border: 1px solid rgba(93, 243, 173, .35);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
}
.live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5df3ad;
  box-shadow: 0 0 0 6px rgba(93, 243, 173, .14);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { transform: scale(.9); opacity: .75; }
  50% { transform: scale(1.18); opacity: 1; }
}
.pair-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(330px, 42%);
}
.pair-tabs button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.13);
  font-size: 12px;
  font-weight: 900;
}
.pair-tabs button.active {
  color: #071833;
  background: linear-gradient(135deg, #ffffff, #d9ecff);
}
.market-info-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.market-info-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.58);
  font-size: 11px;
  font-weight: 800;
}
.market-info-row b {
  color: white;
  font-size: 13px;
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: clamp(230px, 46vw, 360px);
  min-height: 220px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(5, 16, 36, .55), rgba(8, 26, 58, .88));
  background-size: 100% 46px, 58px 100%, 100% 100%;
  border: 1px solid rgba(255,255,255,.12);
}
.chart-canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(34,158,217,.12), transparent 20%, transparent 80%, rgba(216,163,26,.08));
}
#forexChartCanvas {
  display: block;
  width: 100%;
  height: 100%;
}
.chart-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 18px;
  color: rgba(255,255,255,.82);
  font-weight: 900;
  text-align: center;
  background: rgba(7, 24, 51, .62);
}
.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transition: width .35s ease;
}
.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.check-row input {
  width: auto;
  accent-color: var(--blue);
}
.support-details {
  display: grid;
  gap: 10px;
}
.telegram-float {
  position: fixed;
  right: 16px;
  bottom: 92px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  max-width: min(360px, calc(100vw - 28px));
  padding: 0 18px;
  border-radius: 999px;
  background: #229ed9;
  color: white;
  text-decoration: none;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 14px 32px rgba(34, 158, 217, .35);
}
.telegram-float span { font-size: 18px; }

.simple-card { padding: 22px; display: grid; gap: 16px; }
.support-link { color: var(--blue); font-weight: 900; text-decoration: none; }
.telegram-growth-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(34, 158, 217, .24);
  border-radius: 18px;
  background: #eef8ff;
}
.telegram-growth-card h3 {
  margin: 0 0 6px;
  color: var(--deep);
}
.telegram-growth-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.telegram-growth-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #229ed9;
  color: white;
  font-size: 20px;
  font-weight: 900;
}
.telegram-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  background: #229ed9;
  color: white;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(34, 158, 217, .25);
}
.telegram-copy-btn:disabled {
  cursor: not-allowed;
  opacity: .6;
  box-shadow: none;
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 58px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.bottom-nav span { font-size: 22px; }
.bottom-nav button.active { background: #eef5ff; color: var(--blue); }

.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.admin-content { display: grid; gap: 14px; }
.admin-card { padding: 16px; overflow: hidden; }
.admin-card h3 { margin: 0 0 12px; color: var(--deep); }
.admin-grid { display: grid; gap: 10px; }
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-summary-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(11,47,115,.06);
}
.admin-summary-card small {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .7px;
}
.admin-summary-card strong {
  color: var(--deep);
  font-size: 24px;
}
.user-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.country-stat-card {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
}
.country-stat-card > strong {
  color: var(--deep);
}
.country-stat-list {
  display: grid;
  gap: 8px;
}
.country-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.country-stat-row:last-child {
  border-bottom: 0;
}
.country-stat-row span,
.country-stat-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-folder {
  padding: 0;
}
.admin-folder summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}
.admin-folder summary::-webkit-details-marker { display: none; }
.admin-folder summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.admin-folder summary strong {
  color: var(--deep);
  font-size: 18px;
}
.admin-folder summary small {
  color: var(--muted);
  line-height: 1.35;
}
.admin-folder summary b {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
}
.admin-folder[open] summary {
  background: var(--soft-blue);
  border-bottom: 1px solid var(--line);
}
.admin-folder[open] summary b::before { content: "Close "; }
.admin-folder:not([open]) summary b::before { content: ""; }
.admin-folder-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}
.admin-subsection {
  display: grid;
  gap: 10px;
}
.admin-subsection h3 {
  margin: 0;
  color: var(--deep);
}
.history-toolbar {
  justify-content: flex-end;
}
.history-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}
.history-section-head .muted {
  margin: 4px 0 0;
}
.history-section-head .mini-btn {
  flex: 0 0 auto;
}
.history-section-body {
  display: grid;
  gap: 10px;
}
.history-search-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--deep);
}
.admin-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #fbfdff;
  border: 1px solid var(--line);
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-tools {
  align-items: center;
  margin-bottom: 12px;
}
.user-tools input,
.user-tools select {
  min-height: 42px;
  flex: 1 1 180px;
}
.user-result-note {
  display: block;
  margin: 0 0 8px;
}
.user-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.user-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  background: white;
}
.user-table th,
.user-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}
.user-table th {
  color: var(--muted);
  font-weight: 900;
  background: #fbfdff;
}
.country-settings-table {
  min-width: 860px;
}
.table-input {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
}
.table-check {
  margin: 0;
  white-space: nowrap;
}
.compact-actions {
  min-width: 260px;
}
.guided-admin-status {
  display: grid;
  gap: 4px;
}
.mini-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}
.danger { background: #b42336; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.modal {
  width: min(440px, calc(100vw - 28px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(11, 25, 54, .45); backdrop-filter: blur(3px); }
.modal-panel { padding: 20px; display: grid; gap: 14px; }
.modal-panel h3 { margin: 0; color: var(--deep); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-box {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: 16px;
  background: var(--soft-blue);
  border: 1px solid var(--line);
}
.investment-payment-modal {
  gap: 12px;
}
.payment-section {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(11, 47, 115, .06);
}
.investment-summary-card {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.investment-summary-card > strong {
  color: var(--deep);
  font-size: 17px;
}
.expected-return-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: var(--soft-blue);
  border: 1px solid #d6eaff;
}
.expected-return-card span,
.section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.expected-return-card b {
  color: #09875b;
  font-size: 22px;
}
.payment-detail-list {
  display: grid;
  gap: 8px;
}
.payment-detail-row {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.payment-detail-row:last-child {
  border-bottom: 0;
}
.payment-detail-row span {
  color: var(--muted);
  font-weight: 800;
}
.payment-detail-row b {
  color: var(--deep);
  text-align: right;
  overflow-wrap: anywhere;
  font-size: 15px;
}
.payment-method-name {
  display: block;
  color: var(--deep);
  font-size: 18px;
  overflow-wrap: anywhere;
}
.copy-chip {
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  background: #eaf3ff;
  color: var(--blue);
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}
.reference-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbfdff;
  color: var(--deep);
  box-shadow: none;
  text-align: left;
}
.reference-card span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  opacity: .85;
  white-space: nowrap;
}
.reference-card strong {
  color: var(--deep);
  font-size: 17px;
  letter-spacing: .5px;
  margin-right: auto;
}
.reference-card .copy-chip {
  background: #eef4ff;
  color: var(--blue);
}
.receipt-review-modal {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  box-shadow: 0 24px 70px rgba(7, 24, 51, .18);
}
.receipt-review-modal p {
  margin: 0;
  color: var(--deep);
  line-height: 1.5;
}
.receipt-review-modal small {
  color: var(--muted);
  line-height: 1.45;
  max-width: 390px;
}
.review-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid #e7f8ef;
  border-top-color: var(--green);
  animation: receiptSpin .85s linear infinite;
}
.review-progress {
  position: relative;
  width: min(100%, 320px);
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7f8ef;
}
.review-progress span {
  position: absolute;
  inset-block: 0;
  left: -45%;
  width: 45%;
  border-radius: inherit;
  background: linear-gradient(90deg, #11b879, #2ed889, #11b879);
  animation: receiptProgress 1.35s ease-in-out infinite;
}
@keyframes receiptSpin {
  to { transform: rotate(360deg); }
}
@keyframes receiptProgress {
  0% { left: -45%; }
  55% { left: 72%; }
  100% { left: 100%; }
}
.proof-upload {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed #8fcdf2;
  background: #fbfdff;
}
.proof-upload strong { color: var(--deep); }
.proof-upload small { color: var(--muted); }
.upload-tile {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 900;
}
.upload-tile input { display: none; }
.proof-preview {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
}
.proof-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 12px;
  background: #f4f7fb;
}
.pdf-proof {
  padding: 14px;
  border-radius: 12px;
  background: #fff6dc;
  color: #8b6100;
  font-weight: 900;
}
.proof-link {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}
.approval-reversal-note {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef6ff;
  color: var(--deep);
  border: 1px solid var(--line);
  line-height: 1.4;
}
.support-mode-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding:
    calc(10px + env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    10px
    max(14px, env(safe-area-inset-left));
  background: #fff6dc;
  color: #6b4b00;
  border-bottom: 1px solid rgba(162, 110, 0, .28);
  box-shadow: 0 12px 28px rgba(10, 31, 68, .14);
}
.support-mode-banner div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.support-mode-banner strong {
  color: var(--deep);
}
.support-mode-banner span {
  font-weight: 800;
  line-height: 1.35;
}
.support-mode-active .dashboard-view {
  padding-top: 78px;
}
.primary-btn:disabled,
.outline-btn:disabled {
  cursor: not-allowed;
  opacity: .6;
  box-shadow: none;
}
.timer { color: #b42336; font-weight: 900; font-size: 24px; text-align: center; }
.waiting { text-align: center; color: var(--blue); font-weight: 900; letter-spacing: 1.4px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(18px);
  z-index: 50;
  max-width: calc(100vw - 32px);
  width: max-content;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--deep);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.copy-toast {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 80;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  color: white;
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 16px 34px rgba(10, 31, 68, .22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .18s ease, transform .18s ease;
}
.copy-toast.success { background: #12835b; }
.copy-toast.error { background: #b42336; }
.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 760px) {
  .topbar { border-radius: 0 0 28px 28px; padding-inline: calc((100vw - 960px) / 2 + 18px); }
  .page-content { padding: 24px 18px 120px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .plans-list { grid-template-columns: repeat(2, 1fr); }
  .bottom-nav { left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); bottom: 14px; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
  .admin-content { grid-template-columns: 1fr 1fr; align-items: start; }
  .admin-summary-grid, .admin-folder { grid-column: 1 / -1; }
  .admin-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 759px) {
  .support-mode-banner {
    display: grid;
    justify-items: stretch;
    text-align: left;
  }
  .support-mode-banner .outline-btn {
    width: 100%;
  }
  .support-mode-active .dashboard-view {
    padding-top: 150px;
  }

  .copy-toast {
    left: 50%;
    right: auto;
    top: calc(12px + env(safe-area-inset-top));
    transform: translateX(-50%) translateY(-10px);
  }
  .copy-toast.show {
    transform: translateX(-50%) translateY(0);
  }

  html,
  body,
  .app-shell,
  .auth-view,
  .dashboard-view {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .auth-view {
    min-height: 100svh;
    min-height: 100dvh;
    align-content: start;
    padding:
      calc(18px + env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      calc(24px + env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .brand-panel,
  .auth-card {
    width: min(100%, 430px);
    max-width: 100%;
    border-radius: 20px;
  }

  .brand-panel {
    padding: clamp(14px, 4vw, 20px);
    gap: 10px;
  }

  .brand-logo {
    width: clamp(44px, 14vw, 56px);
    height: clamp(44px, 14vw, 56px);
    border-radius: 14px;
    flex: 0 0 auto;
  }

  .brand-panel h1 {
    font-size: clamp(17px, 5vw, 22px);
    line-height: 1.12;
  }

  .brand-panel p {
    font-size: clamp(9px, 3vw, 12px);
    letter-spacing: clamp(.7px, .35vw, 1.4px);
  }

  .auth-card {
    padding: clamp(14px, 4vw, 18px);
  }

  .auth-tabs {
    gap: 6px;
    padding: 5px;
  }

  .tab {
    min-height: 44px;
    padding: 8px 6px;
    font-size: clamp(12px, 3.6vw, 14px);
    letter-spacing: 0;
  }

  .auth-form {
    gap: 11px;
  }

  label {
    min-width: 0;
  }

  input,
  select {
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    border-radius: 13px;
  }

  .auth-form .primary-btn,
  .auth-form .outline-btn,
  .modal-panel .primary-btn,
  .modal-panel .outline-btn,
  .portfolio-actions .primary-btn,
  .portfolio-actions .outline-btn,
  .guided-notice .primary-btn,
  .guided-notice .outline-btn,
  .telegram-copy-btn {
    width: 100%;
  }

  .app-install-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    text-align: left;
  }

  .app-install-icon {
    width: 46px;
    height: 46px;
  }

  .app-install-actions {
    min-width: 0;
    width: 100%;
  }

  .dashboard-view {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .topbar {
    grid-template-columns: clamp(42px, 12vw, 56px) minmax(0, 1fr) auto;
    gap: 6px;
    padding:
      calc(12px + env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      12px
      max(10px, env(safe-area-inset-left));
  }

  .topbar > *,
  .top-actions,
  .page,
  .portfolio-card,
  .stat-card,
  .plan-card,
  .record-card,
  .simple-card,
  .admin-card,
  .modal-panel,
  .bottom-nav button {
    min-width: 0;
  }

  .mini-logo {
    width: clamp(38px, 10.5vw, 46px);
    height: clamp(38px, 10.5vw, 46px);
    border-radius: 12px;
    font-size: clamp(12px, 3.7vw, 15px);
  }

  .top-title strong {
    font-size: clamp(14px, 4.4vw, 18px);
    letter-spacing: .35px;
  }

  .top-title span {
    font-size: clamp(8px, 2.8vw, 10px);
    letter-spacing: clamp(.7px, .35vw, 1.5px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-actions {
    gap: 5px;
  }

  .icon-btn,
  .avatar {
    width: clamp(34px, 9.8vw, 40px);
    height: clamp(34px, 9.8vw, 40px);
  }

  .language-pill {
    height: clamp(34px, 9.8vw, 40px);
    padding: 0 6px;
    gap: 4px;
  }

  .language-pill select {
    min-width: 58px;
    max-width: 72px;
    height: 28px;
    padding: 3px 16px 3px 6px;
    font-size: 11px;
  }

  .page-content {
    width: 100%;
    max-width: 100%;
    padding: clamp(10px, 3.4vw, 16px) clamp(10px, 3.4vw, 16px) calc(118px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }

  .activity-card {
    top: calc(12px + env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    width: min(90vw, 340px);
    gap: 9px;
    min-height: 88px;
    padding: 12px 13px;
    border-radius: 16px;
  }

  .activity-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 14px;
  }

  .activity-card strong {
    font-size: 13px;
  }

  .activity-card p {
    font-size: 12px;
  }

  .activity-card b {
    font-size: 16px;
  }

  .activity-card small {
    font-size: 11px;
  }

  .portfolio-card {
    width: 100%;
    max-width: 100%;
    margin: 0 0 clamp(14px, 4vw, 20px);
    padding: clamp(22px, 6vw, 30px) clamp(12px, 4vw, 18px) clamp(18px, 5vw, 22px);
    border-radius: 22px;
    border-top-width: 6px;
  }

  .portfolio-label {
    font-size: clamp(10px, 3.2vw, 13px);
    letter-spacing: clamp(1.2px, .55vw, 2.8px);
  }

  .portfolio-card h2 {
    margin: clamp(16px, 5vw, 22px) 0 clamp(20px, 6vw, 28px);
    font-size: clamp(28px, 9vw, 46px);
    line-height: 1.08;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .portfolio-actions,
  .modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .primary-btn,
  .outline-btn {
    min-height: clamp(48px, 13vw, 56px);
    padding: 0 clamp(12px, 4vw, 18px);
    border-radius: 16px;
    font-size: clamp(13px, 3.8vw, 16px);
    letter-spacing: .55px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 3vw, 14px);
  }

  .stat-card {
    min-height: clamp(132px, 36vw, 154px);
    padding: clamp(12px, 3.7vw, 18px);
    border-radius: 18px;
  }

  .stat-icon {
    width: clamp(40px, 12vw, 48px);
    height: clamp(40px, 12vw, 48px);
    border-radius: 14px;
  }

  .stat-card small {
    font-size: clamp(10px, 2.9vw, 12px);
    letter-spacing: .65px;
    overflow-wrap: anywhere;
  }

  .stat-card strong {
    font-size: clamp(15px, 4.8vw, 20px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .plan-top,
  .record-row,
  .admin-head {
    flex-wrap: wrap;
  }

  .plan-card,
  .record-card,
  .simple-card,
  .admin-card,
  .forex-chart-card,
  .payment-box,
  .payment-section,
  .reference-card,
  .proof-upload,
  .proof-preview,
  .telegram-growth-card,
  .guided-notice {
    width: 100%;
    max-width: 100%;
  }

  .admin-card {
    overflow: visible;
  }

  .admin-folder-body {
    padding: clamp(12px, 3.7vw, 16px);
  }

  .admin-summary-grid,
  .user-stat-grid,
  .admin-content,
  .admin-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .admin-item,
  .admin-subsection,
  .admin-folder,
  .admin-folder-body {
    min-width: 0;
    max-width: 100%;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .history-toolbar {
    justify-content: stretch;
  }

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

  .admin-actions .mini-btn,
  .admin-actions .primary-btn,
  .admin-actions .outline-btn,
  .mini-btn {
    width: 100%;
    min-height: 42px;
  }

  .user-tools {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .user-tools input,
  .user-tools select {
    width: 100%;
    flex-basis: auto;
  }

  .user-table-wrap {
    max-width: 100%;
    touch-action: pan-x pan-y;
  }

  .user-table {
    min-width: 920px;
  }

  .country-settings-table {
    min-width: 0;
    display: block;
    background: transparent;
  }

  .country-settings-table thead {
    display: none;
  }

  .country-settings-table tbody,
  .country-settings-table tr,
  .country-settings-table td {
    display: block;
    width: 100%;
  }

  .country-settings-table tbody {
    display: grid;
    gap: 12px;
  }

  .country-settings-table tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    box-shadow: 0 12px 30px rgba(11,47,115,.06);
  }

  .country-settings-table td {
    position: relative;
    display: grid;
    grid-template-columns: minmax(94px, 36%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border: 0;
    font-size: 13px;
  }

  .country-settings-table td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .5px;
    text-transform: uppercase;
  }

  .country-settings-table td:nth-child(1)::before { content: "Country"; }
  .country-settings-table td:nth-child(2)::before { content: "Code"; }
  .country-settings-table td:nth-child(3)::before { content: "Currency"; }
  .country-settings-table td:nth-child(4)::before { content: "Symbol"; }
  .country-settings-table td:nth-child(5)::before { content: "Minimum Investment"; }
  .country-settings-table td:nth-child(6)::before { content: "Status"; }
  .country-settings-table td:nth-child(7)::before { content: "Action"; }

  .country-settings-table .table-input {
    width: 100%;
    min-height: 44px;
  }

  .country-settings-table .table-check {
    display: flex;
    justify-content: flex-start;
    min-width: 0;
    white-space: normal;
  }

  .country-settings-table .mini-btn {
    width: 100%;
  }

  .plan-min,
  .badge {
    white-space: normal;
  }

  .telegram-float {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(92px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    min-height: 44px;
    padding: 0 14px;
  }

  .bottom-nav {
    padding:
      8px
      max(8px, env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .bottom-nav button {
    min-height: clamp(52px, 15vw, 58px);
    border-radius: 14px;
    font-size: clamp(9px, 2.8vw, 11px);
    letter-spacing: 0;
  }

  .bottom-nav span {
    font-size: clamp(18px, 5.8vw, 22px);
  }

  .modal {
    width: min(440px, 92vw);
    max-width: 92vw;
    max-height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100svh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: hidden;
    overscroll-behavior: contain;
  }

  .modal-panel {
    max-height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100svh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: clamp(14px, 4vw, 20px);
    padding-bottom: calc(clamp(14px, 4vw, 20px) + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 4px;
    background: linear-gradient(180deg, rgba(255,255,255,0), white 28%);
  }

  .modal-panel > #proofSubmitBtn {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 2px;
    box-shadow: 0 -10px 22px rgba(245, 248, 253, .92);
  }

  .payment-box,
  .payment-section,
  .reference-card,
  .proof-upload,
  .proof-preview {
    min-width: 0;
  }

  .proof-preview img {
    max-height: min(180px, 32vh);
  }

  .forex-chart-card {
    padding: clamp(14px, 4vw, 18px);
    border-radius: 20px;
  }

  .forex-chart-head {
    display: grid;
    gap: 12px;
  }

  .pair-tabs {
    justify-content: flex-start;
    min-width: 0;
  }

  .pair-tabs button {
    flex: 1 1 calc(50% - 6px);
    padding-inline: 8px;
  }

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

  .chart-canvas-wrap {
    height: clamp(260px, 66vw, 320px);
    min-height: 260px;
  }

  body:has(.modal[open]) {
    overflow: hidden;
  }

  .timer {
    font-size: clamp(20px, 6vw, 24px);
  }

  .toast {
    width: auto;
    max-width: min(90vw, 420px);
    bottom: calc(96px + env(safe-area-inset-bottom));
    border-radius: 18px;
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .auth-view {
    padding-inline: max(10px, env(safe-area-inset-left));
  }

  .brand-panel,
  .auth-card {
    width: min(100%, 92vw);
  }

  .language-control select {
    min-width: 0;
    width: min(126px, 42vw);
  }

  .topbar {
    grid-template-columns: clamp(38px, 10.8vw, 46px) minmax(0, 1fr) auto;
  }

  .top-actions {
    gap: 4px;
  }

  .icon-btn,
  .avatar {
    width: clamp(32px, 8.8vw, 36px);
    height: clamp(32px, 8.8vw, 36px);
  }

  .language-pill {
    padding-inline: 4px;
  }

  .language-pill select {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
  }

  .portfolio-actions,
  .modal-actions,
  .field-grid {
    grid-template-columns: 1fr;
  }

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

  .simple-card {
    padding: 16px;
    border-radius: 18px;
  }

  .market-info-row {
    gap: 7px;
  }

  .payment-detail-row {
    grid-template-columns: 1fr auto;
  }

  .payment-detail-row span {
    grid-column: 1 / -1;
  }

  .payment-detail-row b {
    text-align: left;
  }

  .reference-card {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .reference-card span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 390px) {
  .topbar { grid-template-columns: 44px 1fr auto; padding-inline: 10px; }
  .top-title strong { font-size: 15px; }
  .language-pill { font-size: 0; }
  .portfolio-actions, .field-grid, .plan-meta { grid-template-columns: 1fr; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; min-height: 142px; }
}

@media (max-width: 360px) {
  .auth-view {
    padding-inline: 8px;
  }

  .brand-panel,
  .auth-card {
    width: 100%;
    border-radius: 18px;
  }

  .auth-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .tab {
    font-size: 11px;
    padding-inline: 4px;
  }

  .top-title span {
    display: none;
  }

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

  .stat-card {
    min-height: auto;
    gap: 12px;
  }

  .bottom-nav {
    gap: 1px;
    padding-inline: 4px;
  }

  .bottom-nav button {
    font-size: 8.5px;
    border-radius: 12px;
  }

  .telegram-float {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    max-width: none;
    width: auto;
  }

  .pair-tabs button {
    flex-basis: 100%;
  }

  .market-info-row {
    grid-template-columns: 1fr;
  }

  .chart-canvas-wrap {
    height: 260px;
    min-height: 260px;
  }

  .country-settings-table td {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .admin-folder summary {
    align-items: flex-start;
    padding: 14px;
  }

  .admin-folder summary b {
    font-size: 11px;
  }

  .admin-summary-card strong {
    font-size: 20px;
  }
}

@media (max-width: 340px) {
  .topbar {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding-inline: max(8px, env(safe-area-inset-left));
  }

  .top-title strong {
    font-size: 13px;
  }

  .language-pill select {
    min-width: 52px;
    max-width: 58px;
  }

  .page-content {
    padding-inline: 10px;
  }

  .stat-grid,
  .portfolio-actions,
  .modal-actions,
  .field-grid,
  .plan-meta {
    grid-template-columns: 1fr;
  }

  .bottom-nav button {
    font-size: 9px;
  }
}
