@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/fonts/cairo-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(/fonts/cairo-arabic-600-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/fonts/cairo-arabic-700-normal.woff2) format('woff2'); }

:root {
  --bg: #0a0a0a;
  --card: #121212;
  --card-2: #181818;
  --line: rgba(212, 167, 58, 0.22);
  --line-soft: rgba(255, 255, 255, 0.06);
  --gold-1: #f7d98b;
  --gold-2: #d4a73a;
  --gold-3: #9c7420;
  --gold: var(--gold-2);
  --gold-grad: linear-gradient(135deg, var(--gold-1), var(--gold-2) 50%, var(--gold-3));
  --text: #f2f2f2;
  --muted: #8c8c8c;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --radius: 16px;
  --sidebar: 250px;
  --nav-h: 66px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Cairo, system-ui, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(212, 167, 58, 0.09), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(212, 167, 58, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.green { color: var(--green); }
.red { color: var(--red); }
.orange { color: var(--orange); }
.muted { color: var(--muted); }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- scorpion logo with periodic shine sweep ---------- */
.logo {
  width: 92px; aspect-ratio: 1; margin: 0 auto; flex: none;
  -webkit-mask: url(/assets/img/logo.svg) center / contain no-repeat;
          mask: url(/assets/img/logo.svg) center / contain no-repeat;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.95) 50%, transparent 62%) 0 0 / 300% 100% no-repeat,
    var(--gold-grad);
  animation: shine 5s ease-in-out infinite;
}
.logo.small { width: 44px; margin: 0; }
@keyframes shine {
  0%, 65% { background-position: 150% 0, 0 0; }
  100%    { background-position: -150% 0, 0 0; }
}
.logo-wrap { position: relative; display: grid; place-items: center; }
.logo-wrap::before { content: ''; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 167, 58, 0.28), transparent 70%); }

/* ---------- login / setup ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.brand { text-align: center; margin: 12px 0 2px; font-weight: 700; letter-spacing: 3px; font-size: 1.6rem;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: .95rem; }
.auth-card { max-width: 420px; padding: 32px 26px; }
.qr { display: block; margin: 12px auto; border-radius: 12px; background: #fff; padding: 8px; width: 200px; }
.secret { direction: ltr; text-align: center; font-family: ui-monospace, monospace; color: var(--gold-1); word-break: break-all; font-size: .85rem; }
.steps { color: var(--muted); padding-inline-start: 20px; line-height: 1.9; margin: 0; }
.msg { min-height: 1.5em; margin: 14px 0 0; text-align: center; font-size: .95rem; }
.msg.err { color: var(--red); animation: shake .35s; }
.msg.ok { color: var(--green); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- cards ---------- */
.card {
  position: relative;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 30, 30, 0.72), rgba(18, 18, 18, 0.72));
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.fade-up { animation: fadeUp .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ico { color: var(--gold); }
.link { color: var(--gold-1); font-size: .88rem; font-weight: 600; cursor: pointer; background: none; border: 0; padding: 4px; }

/* ---------- forms ---------- */
label, .label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .88rem; }
input, select {
  width: 100%; padding: 11px 14px;
  font-size: 1rem;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: 18px 50%, 13px 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 30px; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 167, 58, 0.18); }
input.ltr { direction: ltr; text-align: left; }
input.code { letter-spacing: 8px; text-align: center; font-size: 1.4rem; font-weight: 700; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.hint b { color: var(--gold-1); }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  font-weight: 700; font-size: 1rem;
  color: #1a1204;
  background: var(--gold-grad);
  border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(212, 167, 58, 0.22);
  transition: transform .12s, box-shadow .25s, filter .2s;
  user-select: none;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; margin-top: 22px; }
.btn.pulse { animation: pulse 3s ease-in-out infinite; }
.btn.ghost { background: transparent; color: var(--gold-1); border: 1px solid var(--line); box-shadow: none; }
.btn.dark { background: var(--card-2); color: var(--text); border: 1px solid var(--line-soft); box-shadow: none; }
.btn.green { background: linear-gradient(135deg, #4ade80, var(--green) 55%, #15803d); color: #03140a; box-shadow: 0 6px 18px rgba(34, 197, 94, 0.25); }
.btn.red { background: linear-gradient(135deg, #f87171, var(--red) 55%, #b91c1c); color: #fff; box-shadow: 0 6px 18px rgba(239, 68, 68, 0.25); }
.btn.sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn .ico { width: 20px; height: 20px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 6px 18px rgba(212, 167, 58, 0.2); } 50% { box-shadow: 0 6px 30px rgba(212, 167, 58, 0.5); } }
.btn.green.pulse { animation-name: pulseG; }
.btn.red.pulse { animation-name: pulseR; }
@keyframes pulseG { 0%, 100% { box-shadow: 0 6px 18px rgba(34, 197, 94, 0.2); } 50% { box-shadow: 0 6px 32px rgba(34, 197, 94, 0.5); } }
@keyframes pulseR { 0%, 100% { box-shadow: 0 6px 18px rgba(239, 68, 68, 0.2); } 50% { box-shadow: 0 6px 32px rgba(239, 68, 68, 0.5); } }

.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line-soft); color: var(--gold-1);
  overflow: hidden;
}
.icon-btn .ico { width: 22px; height: 22px; }

/* gold glow ripple on press (added by JS) */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  background: radial-gradient(circle, rgba(255, 236, 170, 0.75), rgba(212, 167, 58, 0.35) 45%, transparent 70%);
  animation: ripple .6s ease-out forwards;
}
@keyframes ripple { from { transform: scale(0); opacity: 1; } to { transform: scale(18); opacity: 0; } }
.pressed { box-shadow: 0 0 0 3px rgba(212, 167, 58, 0.35), 0 0 26px rgba(247, 217, 139, 0.55) !important; }

.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- pills, dots, badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-soft); }
.pill.ok { color: var(--green); background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); }
.pill.off { color: var(--red); background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.pill.warn { color: var(--orange); background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); }
.pill.gold { color: var(--gold-1); background: rgba(212, 167, 58, 0.1); border-color: var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; animation: ping 1.8s infinite; }
.dot.red { background: var(--red); animation-name: pingR; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); } 70%, 100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } }
@keyframes pingR { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); } 70%, 100% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } }
.badge { position: absolute; top: 4px; left: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.mt5 { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none;
  font-size: .72rem; font-weight: 700; color: var(--gold-1); background: rgba(212, 167, 58, 0.08); border: 1px solid var(--line); direction: ltr; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.main-col { min-width: 0; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(10, 10, 10, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar .titles { min-width: 0; flex: 1; }
.topbar .title { font-weight: 700; font-size: 1.15rem; letter-spacing: 2px; line-height: 1.2; }
.topbar .subtitle { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.topbar .actions { display: flex; align-items: center; gap: 8px; }
.tagline { text-align: center; font-size: .82rem; color: var(--gold-1); opacity: .8; letter-spacing: 1px; padding: 10px 0 0; }
.demo-chip { display: inline-block; margin-inline-start: 6px; padding: 0 8px; border-radius: 6px; font-size: .68rem; font-weight: 700; letter-spacing: 0;
  color: var(--orange); border: 1px solid rgba(245, 158, 11, 0.4); vertical-align: middle; }

.view { max-width: 1240px; margin: 0 auto; padding: 14px; display: grid; gap: 14px; }
.view.enter { animation: viewIn .35s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.page-title h2 { font-size: 1.3rem; }

/* bottom nav (mobile) */
.bottomnav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(12, 12, 12, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 4px 2px; color: var(--muted); font-size: .66rem; font-weight: 600; text-align: center; line-height: 1.2;
  transition: color .25s;
}
.nav-item .ico { width: 23px; height: 23px; transition: transform .25s var(--ease), filter .25s; }
.nav-item.active { color: var(--gold-1); }
.nav-item.active .ico { transform: translateY(-2px); filter: drop-shadow(0 0 6px rgba(247, 217, 139, 0.8)); }
.nav-item.active::before { content: ''; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--gold-grad); box-shadow: 0 0 12px rgba(247, 217, 139, 0.9); }

.sidebar { display: none; }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .main-col { padding-bottom: 24px; }
  .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px;
    position: sticky; top: 0; height: 100vh; padding: 20px 14px;
    background: rgba(12, 12, 12, 0.85); border-inline-end: 1px solid var(--line);
  }
  .sidebar .side-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 20px; }
  .sidebar .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: .95rem; text-align: start; }
  .sidebar .nav-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
  .sidebar .nav-item.active { background: rgba(212, 167, 58, 0.08); box-shadow: inset 0 0 0 1px var(--line), 0 0 20px rgba(212, 167, 58, 0.08); }
  .sidebar .nav-item.active::before { top: 10px; bottom: 10px; right: 0; width: 3px; height: auto; border-radius: 3px 0 0 3px; }
  .sidebar .nav-item.active .ico { transform: none; }
  .sidebar .spacer { flex: 1; }
  .topbar { padding-inline: 24px; }
  .topbar .menu-btn { display: none; }
  .view { padding: 22px 24px; gap: 18px; }
}

/* ---------- grids ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 720px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) { .grid-3.wide { grid-template-columns: repeat(6, 1fr); } }

/* stat cards */
.stat { display: flex; flex-direction: column; gap: 8px; padding: 14px; overflow: hidden; }
.stat .top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stat .label-s { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.stat .value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.stat .foot { font-size: .76rem; color: var(--muted); }
.stat-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: rgba(212, 167, 58, 0.1); color: var(--gold-1); border: 1px solid var(--line); }
.stat-ico.green { background: rgba(34, 197, 94, 0.1); color: var(--green); border-color: rgba(34, 197, 94, 0.3); }
.stat-ico.red { background: rgba(239, 68, 68, 0.1); color: var(--red); border-color: rgba(239, 68, 68, 0.3); }
.stat::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 167, 58, 0.12), transparent 70%); pointer-events: none; }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-actions .btn { padding: 16px 10px; font-size: 1rem; border-radius: 14px; }

.status-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 12px 6px; }
.status-strip > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 6px; text-align: center; min-width: 0; }
.status-strip > div + div { border-inline-start: 1px solid var(--line-soft); }
.status-strip .k { font-size: .74rem; color: var(--muted); }
.status-strip .v { font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }

/* chart */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #0d0d0d; border: 1px solid var(--line-soft); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font-size: .82rem; color: var(--muted); cursor: pointer; transition: all .25s; }
.seg button.on { background: var(--gold-grad); color: #1a1204; font-weight: 700; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .line { fill: none; stroke: url(#goldStroke); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease) forwards; filter: drop-shadow(0 0 4px rgba(247, 217, 139, 0.5)); }
.chart .area { fill: url(#goldFill); opacity: 0; animation: fadeIn .9s .7s ease forwards; }
.chart .grid line { stroke: rgba(255, 255, 255, 0.05); }
.chart .end { fill: var(--gold-1); opacity: 0; animation: fadeIn .3s 1.5s forwards; }
.chart .end-ring { fill: none; stroke: var(--gold-1); opacity: 0; transform-box: fill-box; transform-origin: center; animation: ring 1.8s 1.6s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes ring { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(3); } }
.chart-axis { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); padding-top: 4px; direction: ltr; }

/* tiles + shortcuts */
.tile { display: flex; align-items: center; gap: 10px; padding: 12px; }
.tile .t-k { font-size: .78rem; color: var(--muted); }
.tile .t-v { font-weight: 700; font-size: 1rem; }
.tile .t-s { font-size: .74rem; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; cursor: pointer; text-align: center; font-size: .82rem; font-weight: 600;
  overflow: hidden; transition: transform .2s var(--ease), border-color .2s; }
.shortcut:hover { transform: translateY(-2px); border-color: rgba(212, 167, 58, 0.5); }
.shortcut .sc-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--gold-1); border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 30%, rgba(212, 167, 58, 0.14), transparent 70%); }
.shortcut .sc-ico .ico { width: 24px; height: 24px; }

/* list rows */
.rows { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line-soft);
  transition: border-color .2s, background .2s; }
.row:hover { border-color: var(--line); }
.row.selected { border-color: var(--gold); background: rgba(212, 167, 58, 0.06); }
.row .main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row .l1 { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .l2 { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .side { display: flex; align-items: center; gap: 10px; flex: none; }
.row .pl { font-weight: 700; font-size: .92rem; min-width: 58px; text-align: left; }
.row .arrow { color: var(--muted); width: 18px; height: 18px; }
.row .actions { display: flex; gap: 6px; }

/* switch */
.switch { position: relative; width: 44px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #2a2a2a; border: 1px solid var(--line-soft); transition: background .25s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: #777; transition: transform .25s var(--ease), background .25s; }
.switch input:checked + span { background: rgba(34, 197, 94, 0.25); border-color: rgba(34, 197, 94, 0.5); }
.switch input:checked + span::after { transform: translateX(-20px); background: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }

/* checkbox */
.check { width: 20px; height: 20px; flex: none; accent-color: var(--gold); cursor: pointer; padding: 0; }

/* table */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .76rem; text-align: start; padding: 8px 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: 0; }
.type { display: inline-block; padding: 2px 10px; border-radius: 6px; font-weight: 700; font-size: .78rem; }
.type.buy { color: var(--green); background: rgba(34, 197, 94, 0.12); }
.type.sell { color: var(--red); background: rgba(239, 68, 68, 0.12); }

/* accounts toolbar */
.toolbar { display: grid; gap: 10px; }
.search { position: relative; }
.search .ico { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { padding-right: 40px; }
.filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(3, 1fr); } .toolbar { grid-template-columns: 1fr; } }
.filters select { padding-top: 9px; padding-bottom: 9px; font-size: .88rem; }
.bulkbar { position: sticky; top: 70px; z-index: 10; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px;
  border-radius: 12px; background: rgba(212, 167, 58, 0.12); border: 1px solid var(--gold); animation: fadeUp .3s var(--ease); }
.bulkbar .count { font-weight: 700; color: var(--gold-1); margin-inline-end: auto; }
.sub-info { display: grid; gap: 1px; text-align: start; font-size: .76rem; flex: none; }
.sub-info b { font-size: .9rem; }

/* progress bars */
.bar { height: 8px; border-radius: 999px; background: #222; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold-grad); transition: width 1.1s var(--ease); }
.bar.green > i { background: linear-gradient(90deg, #15803d, var(--green)); }
.bar.red > i { background: linear-gradient(90deg, #b91c1c, var(--red)); }
.bar.orange > i { background: linear-gradient(90deg, #b45309, var(--orange)); }
.meter { display: grid; gap: 5px; }
.meter .mk { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.meter .mk b { color: var(--text); }

.server { display: grid; gap: 12px; }
.server .s-head { display: flex; align-items: center; gap: 10px; }
.server .s-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--gold-1); border: 1px solid var(--line); background: rgba(212, 167, 58, 0.08); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 10px; font-size: .85rem; direction: ltr;
  background: #0d0d0d; border: 1px solid var(--line); animation: fadeUp .3s var(--ease) both; }
.chip button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(239, 68, 68, 0.12); color: var(--red); cursor: pointer; }
.chip button .ico { width: 14px; height: 14px; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }

.lic-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lic-counts .card { text-align: center; padding: 14px 8px; }
.lic-counts .n { font-size: 1.6rem; font-weight: 700; }
.lic-counts .k { font-size: .8rem; color: var(--muted); }

/* bulk control */
.targets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.target { padding: 12px 6px; border-radius: 12px; text-align: center; cursor: pointer; font-weight: 600; font-size: .88rem; position: relative; overflow: hidden;
  background: #0d0d0d; border: 1px solid var(--line-soft); transition: border-color .2s, background .2s, color .2s; }
.target.on { border-color: var(--gold); background: rgba(212, 167, 58, 0.1); color: var(--gold-1); box-shadow: 0 0 18px rgba(212, 167, 58, 0.15); }
.affected { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(212, 167, 58, 0.06); font-weight: 600; }
.affected b { font-size: 1.3rem; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .action-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .action-grid { grid-template-columns: repeat(4, 1fr); } }
.action { display: flex; flex-direction: column; gap: 10px; cursor: pointer; overflow: hidden; transition: transform .2s var(--ease), border-color .2s; }
.action:hover { transform: translateY(-2px); border-color: rgba(212, 167, 58, 0.5); }
.action .a-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); color: var(--gold-1); background: rgba(212, 167, 58, 0.08); }
.action.g .a-ico { color: var(--green); border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.08); }
.action.r .a-ico { color: var(--red); border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.08); }
.action h4 { margin: 0; font-size: .95rem; }
.action p { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.action input { margin-top: auto; }
.action.wide { grid-column: 1 / -1; }

.emergency-card { display: grid; justify-items: center; gap: 12px; padding: 24px 16px; text-align: center; border-color: rgba(239, 68, 68, 0.35);
  background: radial-gradient(circle at 50% 40%, rgba(239, 68, 68, 0.12), transparent 65%), var(--card); }
.emergency { position: relative; width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 50% 35%, #f87171, var(--red) 55%, #7f1d1d); color: #fff;
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.12), 0 10px 40px rgba(239, 68, 68, 0.45); transition: transform .2s;
  animation: pulseR 2.4s ease-in-out infinite; -webkit-touch-callout: none; }
.emergency.holding { transform: scale(.95); }
.emergency .e-label { display: grid; justify-items: center; gap: 2px; font-weight: 700; font-size: 1.4rem; }
.emergency .e-label .ico { width: 34px; height: 34px; stroke-width: 2; }
.emergency svg.ring { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); transform: rotate(-90deg); pointer-events: none; }
.emergency .ring circle { fill: none; stroke-width: 5; }
.emergency .ring .track { stroke: rgba(255, 255, 255, 0.08); }
.emergency .ring .fill { stroke: #fff; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 6px #fff); }
.emergency.holding .ring .fill { stroke-dashoffset: 0; transition: stroke-dashoffset 3s linear; }

/* ---------- overlays: dialog + sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; justify-items: center;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn2 .25s ease; }
@keyframes fadeIn2 { from { opacity: 0; } }
.overlay.closing { animation: fadeOut .2s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.panel {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: #111; border: 1px solid var(--line); border-bottom: 0;
  box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.6);
  animation: sheetUp .35s var(--ease);
}
.panel::before { content: ''; display: block; width: 44px; height: 4px; border-radius: 4px; background: #333; margin: -8px auto 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.overlay.dialog { align-items: center; padding: 16px; }
.overlay.dialog .panel { max-width: 400px; border-radius: 20px; border-bottom: 1px solid var(--line); text-align: center; animation: pop .3s var(--ease); padding-bottom: 20px; }
.overlay.dialog .panel::before { display: none; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 16px; }
  .panel { border-radius: 20px; border-bottom: 1px solid var(--line); animation: pop .3s var(--ease); padding-bottom: 20px; }
  .panel::before { display: none; }
}
.panel h3 { font-size: 1.15rem; margin-bottom: 4px; }
.panel .p-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.panel .btns { display: flex; gap: 10px; margin-top: 20px; }
.panel .btns .btn { flex: 1; }
.dlg-ico { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; color: var(--gold-1); background: rgba(212, 167, 58, 0.1); border: 1px solid var(--line); }
.dlg-ico.red { color: var(--red); background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.35); }
.dlg-ico .ico { width: 30px; height: 30px; }
.dlg-text { color: var(--muted); line-height: 1.7; }
.dlg-count { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 10px; background: rgba(212, 167, 58, 0.1); color: var(--gold-1); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 520px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.expiry-preview { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.25); font-size: .88rem; }

/* notifications dropdown */
.notif { position: absolute; top: calc(100% + 8px); left: 0; width: min(320px, calc(100vw - 28px)); padding: 8px; z-index: 40;
  border-radius: 14px; background: #111; border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: pop .2s var(--ease); }
.notif .n-row { display: flex; gap: 10px; padding: 10px; border-radius: 10px; font-size: .85rem; }
.notif .n-row + .n-row { border-top: 1px solid var(--line-soft); }
.notif .n-row small { display: block; color: var(--muted); font-size: .74rem; }

/* toasts */
.toasts { position: fixed; z-index: 200; top: calc(14px + env(safe-area-inset-top, 0px)); inset-inline: 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; max-width: 460px;
  background: #151515; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); font-weight: 600; font-size: .9rem; animation: toastIn .35s var(--ease); }
.toast.out { animation: toastOut .3s ease forwards; }
.toast .ico { color: var(--gold-1); width: 20px; height: 20px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.empty { text-align: center; color: var(--muted); padding: 24px 10px; }
.more-list .row { cursor: pointer; padding: 14px; }

@media (max-width: 380px) {
  .topbar .status-pill .txt { display: none; }
  .stat .value { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* home layout details */
.grid-4 > .big-actions { grid-column: 1 / -1; }
@media (min-width: 720px) { .grid-4 > .big-actions { grid-column: span 2; } }
.grid-4.tiles-4 { grid-template-columns: repeat(2, 1fr); }
.notif .ico { color: var(--gold-1); }
.chart { height: auto; }
.servers-grid { grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .servers-grid { grid-template-columns: repeat(3, 1fr); } }
.ico.xs { width: 14px; height: 14px; vertical-align: -2px; }
.exp-title { margin: 16px 0 10px; font-size: .92rem; color: var(--orange); }
.server .main { flex: 1; min-width: 0; }
@media (max-width: 520px) {
  #list .mt5 { display: none; }
  #list .row { gap: 8px; padding: 10px; }
}
/* keep wide children (tables) from stretching grid tracks */
.view { grid-template-columns: minmax(0, 1fr); }
.grid-2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-2 > *, .grid-4 > *, .grid-3 > * { min-width: 0; }
.topbar .title { white-space: nowrap; }
@media (max-width: 520px) { .topbar .title { font-size: 1rem; letter-spacing: 1px; } .topbar { gap: 8px; padding-inline: 10px; } }
.stat .value { font-size: clamp(1.1rem, 4.6vw, 1.55rem); overflow-wrap: anywhere; }
td, th { padding-inline: 6px; }
@media (min-width: 1024px) { .tile .t-v { font-size: 1.35rem; } .tiles-4 .tile { padding: 18px; } }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4a73a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: 12px 50%; background-size: 16px 16px; padding-left: 36px;
}
.auth-card .logo-wrap { width: 92px; margin: 0 auto; }
/* phase 3 */
.dot.grey { background: #6b6b6b; animation: none; }
.switch-row { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 0; color: var(--text); cursor: pointer; }
.danger-text { color: var(--red) !important; margin-top: 0 !important; }
.expiry-preview.bad { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); }
.row.clickable { cursor: pointer; }
.demo-tag { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 6px; font-size: .64rem; font-weight: 700; color: var(--orange); border: 1px solid rgba(245, 158, 11, 0.4); vertical-align: middle; }
.stat .label-s .demo-tag { margin-inline-start: 4px; }

/* phase 4: bot library */
.upload-btn { cursor: pointer; }
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; border-style: dashed; color: var(--muted); transition: border-color .2s, background .2s; }
.dropzone > .ico { width: 34px; height: 34px; color: var(--gold-1); }
.dropzone.over { border-color: var(--gold); background: rgba(212, 167, 58, 0.08); }
.bot-list .row { padding: 14px; }
.back { display: inline-grid; place-items: center; vertical-align: middle; color: var(--gold-1); }
.ico.flip { transform: scaleX(-1); }
.bot-info .chips { margin-bottom: 8px; }
.versions { margin-top: 10px; color: var(--muted); font-size: .88rem; }
.versions summary { cursor: pointer; color: var(--gold-1); }
.v-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.settings { display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 720px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.input-field { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line-soft); transition: border-color .2s, background .2s; }
.input-field.changed { border-color: var(--gold); background: rgba(212, 167, 58, 0.06); }
.input-field.invalid { border-color: var(--red); background: rgba(239, 68, 68, 0.08); animation: shake .35s; }
.input-field.is-bool { grid-template-columns: 1fr auto; align-items: center; }
.input-field.is-bool .if-meta { grid-column: 1 / -1; }
.if-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.if-label { font-weight: 600; font-size: .92rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.if-reset { display: none; width: 26px; height: 26px; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--gold-1); cursor: pointer; flex: none; }
.if-reset .ico { width: 15px; height: 15px; }
.input-field.changed .if-reset { display: grid; }
.if-meta { font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.input-field input, .input-field select { padding: 9px 12px; }
.targets.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .targets.four { grid-template-columns: repeat(4, 1fr); } }

/* broker picker + broker list */
.step-n { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline-end: 4px; border-radius: 50%; font-size: .72rem; font-weight: 700; color: #1a1204; background: var(--gold-grad); }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 5; top: calc(100% + 4px); inset-inline: 0; max-height: 240px; overflow-y: auto; padding: 4px;
  border-radius: 12px; background: #151515; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(0, 0, 0, .6); animation: pop .15s var(--ease); }
.ac-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; }
.ac-item:hover, .ac-item.on { background: rgba(212, 167, 58, 0.12); }
.ac-item.add { color: var(--gold-1); justify-content: flex-start; }
.ac-item .ico { width: 18px; height: 18px; }
select:disabled { opacity: .5; }
.brokers { display: grid; gap: 10px; }
.broker { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line-soft); display: grid; gap: 10px; }
.broker .b-head { display: flex; align-items: center; justify-content: space-between; }
.broker .inline-form { margin-top: 0; }

/* phase 5: agent pairing */
.agent-line { font-size: .76rem; line-height: 1.6; }
.install-box { display: grid; gap: 6px; }
.cmd { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #0b0b0b; border: 1px solid var(--line); direction: ltr; }
.cmd code { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: .8rem; color: var(--gold-1); overflow-wrap: anywhere; text-align: left; }
.cmd .icon-btn { width: 34px; height: 34px; flex: none; }
.code-box { margin-top: 12px; }
.code-box code { font-size: .85rem; user-select: all; }
.server-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* phase 6: run status */
.spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.run-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.run-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; text-align: start; }
.run-steps .st-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-soft); font-size: .78rem; flex: none; }
.run-steps .st-ico .ico { width: 15px; height: 15px; }
.run-steps li.done { color: var(--green); } .run-steps li.done .st-ico { border-color: var(--green); background: rgba(34, 197, 94, 0.12); }
.run-steps li.now { color: var(--gold-1); } .run-steps li.now .st-ico { border-color: var(--gold); animation: pulse 1.6s infinite; }
.run-steps li.fail { color: var(--red); } .run-steps li.fail .st-ico { border-color: var(--red); background: rgba(239, 68, 68, 0.12); }
.run-msg { margin-top: 8px; font-size: .82rem; text-align: start; direction: ltr; }
.checks { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; line-height: 1.5; }
.checks li .ico { width: 18px; height: 18px; margin-top: 2px; }
.checks li.ok .ico { color: var(--green); } .checks li.bad { color: var(--red); } .checks li.warn { color: var(--orange); }
.confirm-row { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; padding: 12px; border-radius: 12px; color: var(--text);
  background: rgba(212, 167, 58, 0.06); border: 1px solid var(--line); cursor: pointer; line-height: 1.6; }
.mt5-box { margin-top: 14px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); display: grid; gap: 8px; }
.mt5-box .card-head { margin-bottom: 0; }
.chart-form select { width: 100px; flex: none; }
.chart-row { display: grid; grid-template-columns: 1fr 110px; gap: 0 10px; }
.chart-row .hint { grid-column: 1 / -1; }

/* Home: add-account button between the two bulk buttons — gold outline so it never looks like them */
.big-actions { grid-template-columns: 1fr 1fr 1fr; }
.big-actions .btn.add-acc { background: transparent; color: var(--gold-1); border: 1.5px solid var(--gold); box-shadow: inset 0 0 0 1px rgba(212, 167, 58, 0.15); }
.big-actions .btn.add-acc:hover { background: rgba(212, 167, 58, 0.08); }
/* the logo in a gold circle (owner's logo from Settings → الهوية, else the built-in scorpion) + a small "+" badge */
.big-actions .btn.add-acc { isolation: isolate; }
.acc-logo { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; background: #000;
  border: 1.5px solid var(--gold); box-shadow: 0 0 14px rgba(212, 167, 58, 0.35); }
.acc-logo::before { content: ""; position: absolute; inset: 6px; background: var(--gold-grad);
  -webkit-mask: url(/assets/img/logo.svg) center / contain no-repeat; mask: url(/assets/img/logo.svg) center / contain no-repeat; }
body[data-brand~="brand-logo"] .acc-logo { background: #000 url(/brand/logo-512.png) center / cover no-repeat; }
body[data-brand~="brand-logo"] .acc-logo::before { display: none; }
.acc-plus { position: absolute; inset-block-end: -3px; inset-inline-start: -3px; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--gold-grad); color: #0a0a0a; border: 2px solid #0a0a0a; }
.acc-plus .ico { width: 11px; height: 11px; stroke-width: 3; }
.big-actions .btn.add-acc:hover .acc-logo { box-shadow: 0 0 20px rgba(247, 217, 139, 0.55); }
@media (max-width: 520px) { .big-actions { gap: 8px; } .big-actions .btn { padding: 14px 6px; font-size: .9rem; flex-direction: column; gap: 4px; } }
.live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.live-grid > div { display: grid; gap: 2px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); font-size: .8rem; }
.live-grid b { font-size: .95rem; }
.demo-tag.wait { color: var(--muted); border-color: var(--line-soft); }
.form-grid > *, .mt5-box, .panel .table-wrap { min-width: 0; }
.panel { overflow-x: hidden; }
.form-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.live-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Accounts list: clear "renew subscription" button (gold outline, icon + word, fits on mobile) */
.btn.renew-btn { border: 1px solid var(--gold); color: var(--gold-1); background: transparent; gap: 4px; padding: 6px 10px; font-size: .8rem; white-space: nowrap; }
.btn.renew-btn .ico { width: 15px; height: 15px; }
@media (max-width: 520px) { .btn.renew-btn { padding: 5px 8px; font-size: .75rem; } #list .row .side { gap: 6px; } }
@media (max-width: 520px) {
  /* account rows: days + renew go on their own line so nothing overlaps */
  #list .row { flex-wrap: wrap; }
  #list .row .main { flex: 1 1 calc(100% - 40px); }
  #list .row .side { flex: 1 1 100%; justify-content: space-between; padding-inline-start: 28px; }
  #list .row .side .sub-info { display: flex; gap: 8px; align-items: baseline; }
}
.account-row { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.account-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mt5-box { grid-template-columns: minmax(0, 1fr); }
.mt5-box .card-head { flex-wrap: wrap; }

/* iPhone Safari: size the page to the SMALL viewport (toolbars shown), so the last card can always
   scroll above the fixed bottom nav instead of hiding under it */
.shell { min-height: 100vh; min-height: 100svh; }
.center { min-height: 100vh; min-height: 100svh; }
@media (max-width: 1023px) { .main-col { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 24px); } }

/* night work: dry-run banner, bell levels */
.dry-banner { display: flex; gap: 12px; align-items: flex-start; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.06); }
.dry-banner > .ico { color: var(--orange); width: 26px; height: 26px; margin-top: 2px; }
.badge.danger { background: var(--red); }
.notif { max-height: 70vh; overflow-y: auto; }
.notif .n-row.danger .ico { color: var(--red); }
.notif .n-row.warn .ico { color: var(--orange); }
.notif .n-row.ev { font-size: .8rem; color: var(--muted); }
.notif .n-sep { padding: 8px 10px 2px; font-size: .72rem; color: var(--gold-1); border-top: 1px solid var(--line); }
.loss-form { flex-wrap: wrap; }
.loss-form input { min-width: 110px; }
.loss-form select { width: auto; flex: 1; }

.bot-stopped { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.07); }
.bot-stopped > .ico { color: var(--red); width: 22px; height: 22px; }
.bot-stopped small { display: block; color: var(--muted); font-size: .76rem; }
.code-input { display: block; width: 100%; margin-top: 16px; text-align: center; font-size: 1.6rem; letter-spacing: .4em; }
button.row { width: 100%; text-align: start; color: inherit; font: inherit; cursor: pointer; }
.loss-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.loss-form label { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); }
.loss-form .btns-row { display: flex; gap: 8px; }
.loss-form .btns-row .btn { flex: 1; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.btns-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btns-row .btn { flex: 1; }
.day-row .main { gap: 4px; }
.day-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.day-bar i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .6s var(--ease); }
.day-bar.pos i { background: var(--green); }
.day-bar.neg i { background: var(--red); }
#hRange { margin-bottom: 12px; }
a.btn { text-decoration: none; }

/* ---------- owner branding (Settings → الهوية; server sets body[data-brand]) ---------- */
body[data-brand~="brand-logo"] .logo {
  -webkit-mask: none; mask: none; animation: none; border-radius: 50%;
  background: #000 url(/brand/logo-512.png) center / cover no-repeat;
  box-shadow: 0 0 18px rgba(212, 167, 58, 0.35);
}
body.login-page[data-brand~="brand-bg"]::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.55), rgba(5, 5, 5, 0.82)), url(/brand/login-bg.jpg) center / cover no-repeat;
}
body.login-page[data-brand~="brand-bg"] .auth-card { background: rgba(18, 18, 18, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.brand-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.brand-logo-prev { width: 84px; height: 84px; border-radius: 50%; background: #000; border: 1px solid var(--line); object-fit: cover; }
.brand-icon-prev { width: 60px; height: 60px; border-radius: 14px; background: #000; }
.brand-fav-prev { width: 32px; height: 32px; }
.brand-bg-prev { position: relative; width: 120px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.brand-bg-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-bg-prev::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 5, 5, 0.55), rgba(5, 5, 5, 0.82)); }
.brand-file { display: none; }

/* ==========================================================================
   iOS "liquid glass" design — DEFAULT on every screen (body.ui-glass, set by app.js unless the device chose
   the classic look in Settings). CSS only: no function changes.
   One palette, tuned to the background (deep blue night + soft gold): gold = identity / accents,
   blue-grey = neutral surfaces and lines, soft green / soft coral = profit-start / loss-stop only.
   iPhone performance: the moving background animates transform only; the photo option is a tiny image
   scaled up (no live filter); prefers-reduced-motion stops all motion.
   ========================================================================== */
.glass-bg { display: none; }
body.ui-glass {
  /* palette */
  --bg: #030303;
  --text: #f2f2f2;
  --muted: rgba(235, 235, 240, 0.6);
  --gold-1: #f3d27e;
  --gold-2: #dcaa3c;
  --gold-3: #a57a1e;
  --gold: var(--gold-2);
  --gold-grad: linear-gradient(135deg, #f7dc8c, #dcaa3c 52%, #a57a1e);
  --green: #27cc6a;
  --red: #f24a4a;
  --orange: #eaa64e;
  --blue: #8fa8e8;
  --line: rgba(214, 190, 135, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --card: rgba(18, 18, 20, 0.5);
  --card-2: rgba(255, 255, 255, 0.06);
  --t-gold: rgba(220, 170, 60, 0.17);
  --t-blue: rgba(120, 150, 225, 0.15);
  --t-green: rgba(39, 204, 106, 0.16);
  --t-red: rgba(242, 74, 74, 0.16);
  --t-orange: rgba(234, 166, 78, 0.15);
  /* glass */
  --g-tint: rgba(12, 12, 14, 0.52);
  --g-edge: rgba(255, 255, 255, 0.22);
  --g-hi: rgba(255, 255, 255, 0.46);
  --g-glow: inset 0 0 30px rgba(255, 255, 255, 0.03), inset 0 -14px 28px -10px rgba(212, 167, 58, 0.07);
  --g-blur: blur(18px) saturate(180%);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --soft: cubic-bezier(.22, 1, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic", "Segoe UI", Cairo, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;   /* no double-tap-zoom wait on taps */
}
/* moving background pauses while navigating / scrolling / in the background (app.js sets body.bg-paused) */
body.ui-glass.bg-paused .glass-bg i { animation-play-state: paused; }

/* ---------- background: deep blue night with a softer gold glow ---------- */
body.ui-glass .glass-bg {
  display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 85% at 50% 0%, #0d0c0a 0%, #060606 55%, #020202 100%);
}
body.ui-glass .glass-bg i { position: absolute; width: 75vmax; height: 75vmax; border-radius: 50%; will-change: transform; }
body.ui-glass .glass-bg i:nth-child(1) { top: -34vmax; inset-inline-start: 50%; margin-inline-start: -36vmax; width: 72vmax; height: 60vmax;
  background: radial-gradient(closest-side, rgba(212, 167, 58, 0.26), rgba(156, 116, 32, 0.07) 55%, transparent); animation: blobTop 30s ease-in-out infinite alternate; }
body.ui-glass .glass-bg i:nth-child(2) { top: 18vh; inset-inline-start: -32vmax; width: 85vmax; height: 85vmax;
  background: radial-gradient(closest-side, rgba(28, 46, 104, 0.20), rgba(18, 28, 70, 0.06) 55%, transparent); animation: blobB 34s ease-in-out infinite alternate; }
body.ui-glass .glass-bg i:nth-child(3) { bottom: -34vmax; inset-inline-end: -14vmax;
  background: radial-gradient(closest-side, rgba(24, 38, 90, 0.14), transparent 60%); animation: blobC 40s ease-in-out infinite alternate; }
body.ui-glass .glass-bg i:nth-child(4) { top: 45vh; inset-inline-end: -30vmax; width: 55vmax; height: 55vmax;
  background: radial-gradient(closest-side, rgba(212, 167, 58, 0.05), transparent 70%); animation: blobA 46s ease-in-out infinite alternate-reverse; }
@keyframes blobTop { to { transform: translate3d(6vw, 4vh, 0) scale(1.08); } }
@keyframes blobA { to { transform: translate3d(-18vw, 22vh, 0) scale(1.15); } }
@keyframes blobB { to { transform: translate3d(26vw, -12vh, 0) scale(.92); } }
@keyframes blobC { to { transform: translate3d(-22vw, -24vh, 0) scale(1.18); } }
body.ui-glass .glass-bg.photo i { display: none; }
body.ui-glass .glass-bg.photo::before { content: ""; position: absolute; inset: 0; background: var(--glass-photo, none) center / cover no-repeat; transform: translateZ(0); }
body.ui-glass .glass-bg.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 4, 12, 0.5), rgba(2, 4, 12, 0.72)); }

/* ---------- glass material ---------- */
body.ui-glass .card, body.ui-glass .panel, body.ui-glass .notif, body.ui-glass .toast {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03) 38%, rgba(255, 255, 255, 0.05)), var(--g-tint);
  border: 0.5px solid var(--g-edge);
  box-shadow: inset 0 1px 0 var(--g-hi), inset 0 -1px 0 rgba(255, 255, 255, 0.06), var(--g-glow), 0 22px 48px -18px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);   /* keeps text crisp on the more transparent glass */
}
body.ui-glass .card { border-radius: 26px; padding: 20px; transition: transform .18s ease-out; }
body.ui-glass .card .card, body.ui-glass .lic-counts .card { background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07); -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui-glass .card:active { transform: scale(.98); transition-duration: .08s; }
body.ui-glass .card.stat:active, body.ui-glass .card.tile:active, body.ui-glass .shortcut:active { transform: scale(.965); }
body.ui-glass .panel { background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01) 40%), rgba(14, 14, 16, 0.86); border-radius: 30px 30px 0 0; }
body.ui-glass .panel::before { background: rgba(255, 255, 255, 0.25); }
body.ui-glass .overlay { background: rgba(2, 4, 10, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.ui-glass .overlay.dialog .panel { border-radius: 28px; border-bottom: 0.5px solid var(--g-edge); }
@media (min-width: 720px) { body.ui-glass .panel { border-radius: 28px; } }
body.ui-glass .notif, body.ui-glass .toast { background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)), rgba(14, 14, 16, 0.9); border-radius: 18px; }
body.ui-glass .toast { border-radius: 999px; }

/* ---------- floating glass header, tab bar, sidebar ---------- */
body.ui-glass .topbar, body.ui-glass .bottomnav {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 45%), rgba(10, 10, 12, 0.66);
  border: 0.5px solid rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), var(--g-glow), 0 18px 40px -16px rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
}
body.ui-glass .topbar { top: calc(env(safe-area-inset-top, 0px) + 6px); margin: 6px 10px 0; padding: 9px 12px; border-radius: 24px; }
body.ui-glass .bottomnav { inset-inline: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); height: var(--nav-h); padding: 6px; border-radius: 30px; }
body.ui-glass .main-col { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 30px); }
body.ui-glass .nav-item { border-radius: 22px; color: var(--muted); transition: transform .15s ease-out, background .15s, color .15s; }
body.ui-glass .nav-item.active { color: var(--gold-1); background: rgba(255, 255, 255, 0.09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
body.ui-glass .nav-item.active::before { display: none; }
body.ui-glass .nav-item.active .ico { filter: drop-shadow(0 0 6px rgba(236, 214, 162, 0.55)); }
body.ui-glass .nav-item:active, body.ui-glass .icon-btn:active { transform: scale(.9); }
body.ui-glass .sidebar { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent), rgba(8, 8, 10, 0.6); border-color: var(--g-edge);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur); }
body.ui-glass .sidebar .nav-item.active { background: rgba(255, 255, 255, 0.08); border-color: transparent; }
body.ui-glass .tagline { color: var(--gold-1); opacity: .75; }

/* ---------- page motion ---------- */
/* fast: everything is fully shown in < 200 ms (content is visible from the first frame) */
body.ui-glass .view.enter { animation: glassView .14s ease-out both; }
@keyframes glassView { from { opacity: .55; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.ui-glass .fade-up { animation: glassIn .15s ease-out both; animation-delay: calc(min(var(--i, 0), 4) * 10ms); }
@keyframes glassIn { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.ui-glass .panel { animation: glassSheet .18s cubic-bezier(.2, .9, .3, 1); }
@keyframes glassSheet { from { transform: translateY(28px); opacity: .6; } }
body.ui-glass .overlay { animation-duration: .12s; }
body.ui-glass .overlay.dialog .panel { animation: glassPop .16s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes glassPop { from { transform: scale(.94); opacity: .5; } }

/* ---------- controls ---------- */
body.ui-glass input, body.ui-glass select { background-color: rgba(255, 255, 255, 0.055); border: 0.5px solid rgba(255, 255, 255, 0.14); border-radius: 14px; color: var(--text); }
body.ui-glass input.check { background-color: transparent; }
body.ui-glass input:focus, body.ui-glass select:focus { border-color: rgba(200, 164, 92, 0.7); box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.18); }
body.ui-glass select option { background: #121214; }
body.ui-glass .btn { border-radius: 16px; color: #1c1508; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 24px -10px rgba(200, 164, 92, 0.45);
  transition: transform .15s ease-out, filter .15s; }
body.ui-glass .btn:active { transform: scale(.95); transition-duration: .06s; }
body.ui-glass .btn.sm { border-radius: 12px; }
body.ui-glass .btn.ghost { background: rgba(255, 255, 255, 0.04); color: var(--gold-1); border: 0.5px solid rgba(200, 164, 92, 0.45); box-shadow: none; }
body.ui-glass .btn.dark { background: rgba(255, 255, 255, 0.07); color: var(--text); border: 0.5px solid rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
body.ui-glass .btn.green { background: linear-gradient(180deg, #5fdb9c, #2f9e66); color: #04170d; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 26px -12px rgba(79, 207, 142, 0.6); }
body.ui-glass .btn.red { background: linear-gradient(180deg, #f6857e, #cf4740); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 26px -12px rgba(242, 103, 95, 0.6); }
body.ui-glass .btn.pulse { animation: none; }
body.ui-glass .icon-btn { background: rgba(255, 255, 255, 0.06); border: 0.5px solid rgba(255, 255, 255, 0.14); border-radius: 14px; color: var(--gold-1); transition: transform .15s ease-out; }
body.ui-glass .seg { background: rgba(120, 120, 128, 0.24); border: 0; border-radius: 12px; padding: 2px; }
body.ui-glass .seg button { color: var(--muted); }
body.ui-glass .seg button.on { background: rgba(255, 255, 255, 0.16); color: #fff; border-radius: 10px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }
body.ui-glass .switch span { background: rgba(120, 120, 128, 0.32); border: 0; }
body.ui-glass .switch span::after { background: #f2f4fa; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
body.ui-glass .switch input:checked + span { background: var(--green); }
body.ui-glass .switch input:checked + span::after { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
body.ui-glass .check { accent-color: var(--gold-2); }
body.ui-glass .ripple { background: radial-gradient(circle, rgba(255, 245, 220, 0.55), rgba(200, 164, 92, 0.22) 45%, transparent 70%); }
body.ui-glass .pressed { box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.3), 0 0 22px rgba(236, 214, 162, 0.35) !important; }

/* ---------- icon circles, pills, badges ---------- */
body.ui-glass .stat-ico, body.ui-glass .server .s-ico, body.ui-glass .shortcut .sc-ico, body.ui-glass .dlg-ico, body.ui-glass .action .a-ico {
  border: 0; border-radius: 50%; color: var(--gold-1); background: var(--t-gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10); }
body.ui-glass .shortcut .sc-ico, body.ui-glass .server .s-ico { border-radius: 16px; background: linear-gradient(160deg, rgba(243, 210, 126, 0.22), rgba(212, 167, 58, 0.06)); }
body.ui-glass .stat-ico.green, body.ui-glass .action.g .a-ico { color: var(--green); background: var(--t-green); }
body.ui-glass .stat-ico.red, body.ui-glass .action.r .a-ico, body.ui-glass .dlg-ico.red { color: var(--red); background: var(--t-red); }
body.ui-glass .stat::after { display: none; }
body.ui-glass .mt5 { border: 0; border-radius: 14px; color: var(--gold-1); background: linear-gradient(160deg, rgba(243, 210, 126, 0.18), rgba(212, 167, 58, 0.05)); }
body.ui-glass .pill { border: 0; background: rgba(255, 255, 255, 0.07); color: var(--muted); }
body.ui-glass .pill.ok { color: var(--green); background: var(--t-green); }
body.ui-glass .pill.off { color: var(--red); background: var(--t-red); }
body.ui-glass .pill.warn { color: var(--orange); background: var(--t-orange); }
body.ui-glass .pill.gold { color: var(--gold-1); background: var(--t-gold); }
body.ui-glass .badge { background: var(--red); border-color: rgba(12, 12, 14, 0.9); }
body.ui-glass .dot { background: var(--green); animation-name: pingG2; }
body.ui-glass .dot.red { background: var(--red); animation-name: pingR2; }
@keyframes pingG2 { 0% { box-shadow: 0 0 0 0 rgba(79, 207, 142, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(79, 207, 142, 0); } }
@keyframes pingR2 { 0% { box-shadow: 0 0 0 0 rgba(242, 103, 95, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(242, 103, 95, 0); } }
body.ui-glass .demo-tag, body.ui-glass .demo-chip { border-color: rgba(234, 166, 78, 0.35); }
body.ui-glass .dlg-count { background: var(--t-gold); color: var(--gold-1); }
body.ui-glass .type.buy { color: var(--green); background: var(--t-green); }
body.ui-glass .type.sell { color: var(--red); background: var(--t-red); }
body.ui-glass .chip { background: rgba(255, 255, 255, 0.05); border: 0.5px solid rgba(255, 255, 255, 0.14); }
body.ui-glass .chip button { background: var(--t-red); color: var(--red); }

/* ---------- lists, tables, bars, banners ---------- */
body.ui-glass .row { background: rgba(255, 255, 255, 0.035); border: 0.5px solid rgba(255, 255, 255, 0.08); border-radius: 16px; }
body.ui-glass .row:hover { border-color: rgba(255, 255, 255, 0.16); }
body.ui-glass .row.selected { border-color: rgba(200, 164, 92, 0.7); background: var(--t-gold); }
body.ui-glass th { color: var(--muted); font-weight: 500; border-bottom: 0.5px solid rgba(255, 255, 255, 0.12); }
body.ui-glass td { border-bottom: 0.5px solid rgba(255, 255, 255, 0.07); }
body.ui-glass .bar { background: rgba(255, 255, 255, 0.08); }
body.ui-glass .bar > i { background: linear-gradient(90deg, #957744, #ecd6a2); }
body.ui-glass .bar.green > i { background: linear-gradient(90deg, #2f9e66, var(--green)); }
body.ui-glass .bar.red > i { background: linear-gradient(90deg, #cf4740, var(--red)); }
body.ui-glass .bar.orange > i { background: linear-gradient(90deg, #b9782f, var(--orange)); }
body.ui-glass .bulkbar { background: linear-gradient(165deg, rgba(243, 210, 126, 0.16), rgba(212, 167, 58, 0.04)), rgba(12, 12, 14, 0.84); border: 0.5px solid rgba(200, 164, 92, 0.55);
  border-radius: 18px; -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur); }
body.ui-glass .expiry-preview { background: var(--t-green); border: 0; border-radius: 14px; }
body.ui-glass .expiry-preview.bad { background: var(--t-red); }
body.ui-glass .cmd, body.ui-glass .code-box, body.ui-glass .install-box, body.ui-glass .mt5-box, body.ui-glass .live-grid > div,
body.ui-glass .confirm-row, body.ui-glass .input-field, body.ui-glass .broker, body.ui-glass .target, body.ui-glass .action, body.ui-glass .dropzone {
  background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.10); border-radius: 16px; }
body.ui-glass .target.on, body.ui-glass .input-field.changed { border-color: rgba(200, 164, 92, 0.6); background: var(--t-gold); }
body.ui-glass .bot-stopped, body.ui-glass .dry-banner { background: var(--t-orange); border-color: rgba(234, 166, 78, 0.3); border-radius: 16px; }
body.ui-glass .ac-list { background: rgba(14, 14, 16, 0.96); border-color: rgba(255, 255, 255, 0.14); border-radius: 14px; }

/* ---------- charts ---------- */
body.ui-glass .chart #goldStroke stop:nth-child(1) { stop-color: #a57a1e; }
body.ui-glass .chart #goldStroke stop:nth-child(2) { stop-color: #c8a45c; }
body.ui-glass .chart #goldStroke stop:nth-child(3) { stop-color: #f0dcab; }
body.ui-glass .chart #goldFill stop:nth-child(1) { stop-color: #c8a45c; stop-opacity: .26; }
body.ui-glass .chart #goldFill stop:nth-child(2) { stop-color: #d4a73a; stop-opacity: 0; }
body.ui-glass .chart .line { filter: drop-shadow(0 0 5px rgba(236, 214, 162, 0.35)); }
body.ui-glass .chart .grid line { stroke: rgba(255, 255, 255, 0.07); }

/* ---------- Home ---------- */
body.ui-glass #view { gap: 16px; }
body.ui-glass #view .grid-4, body.ui-glass #view .grid-2, body.ui-glass #view .grid-3 { gap: 14px; }
body.ui-glass .stat { gap: 6px; padding: 18px; }
body.ui-glass .stat .label-s { font-size: .78rem; font-weight: 500; color: var(--muted); }
body.ui-glass .stat .value { font-size: clamp(1.25rem, 5.6vw, 2.1rem); font-weight: 600; letter-spacing: -0.03em; white-space: nowrap; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45); }
body.ui-glass .stat .foot { color: var(--muted); }
body.ui-glass .big-actions { gap: 10px; }
body.ui-glass .big-actions .btn { border-radius: 24px; font-weight: 600; }
body.ui-glass .big-actions .btn:active { transform: scale(.93); filter: brightness(1.1); }
body.ui-glass .big-actions .btn.add-acc { background: linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)), var(--g-tint);
  color: var(--gold-1); border: 0.5px solid rgba(200, 164, 92, 0.6); box-shadow: inset 0 1px 0 var(--g-hi); -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur); }
body.ui-glass .acc-logo { border-color: rgba(200, 164, 92, 0.8); box-shadow: 0 0 14px rgba(200, 164, 92, 0.3); }
body.ui-glass .status-strip .v { white-space: nowrap; font-size: .8rem; }
body.ui-glass .status-strip > div + div { border-inline-start: 0.5px solid rgba(255, 255, 255, 0.12); }
body.ui-glass .tile .t-v { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
body.ui-glass .shortcut { padding: 16px 6px; font-weight: 500; }
body.ui-glass .shortcut:hover { transform: none; }
body.ui-glass .card-head h3 { font-weight: 600; letter-spacing: -0.01em; }
body.ui-glass .page-title h2 { font-weight: 700; letter-spacing: -0.02em; }

/* emergency stays unmistakably red */
body.ui-glass .emergency-card { border-color: rgba(242, 103, 95, 0.35); }

@media (prefers-reduced-motion: reduce) {
  body.ui-glass .glass-bg i, body.ui-glass .fade-up, body.ui-glass .view.enter, body.ui-glass .panel { animation: none; }
  body.ui-glass .card, body.ui-glass .btn, body.ui-glass .nav-item, body.ui-glass .icon-btn { transition: none; }
}

/* ---------- strong, saturated action buttons + numbers (glass design) ---------- */
body.ui-glass .btn:not(.ghost):not(.dark):not(.green):not(.red):not(.add-acc) {
  background: linear-gradient(180deg, #f6cf62, #dcaa3c 50%, #a8791a); color: #1a1000;
  box-shadow: inset 0 1px 0 rgba(255, 245, 200, 0.6), 0 10px 26px -8px rgba(220, 170, 60, 0.65); }
body.ui-glass .btn.green, body.ui-glass .big-actions .btn.green {
  background: linear-gradient(180deg, #27cc6a, #128a42); color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 30px -8px rgba(39, 204, 106, 0.7); }
body.ui-glass .btn.red, body.ui-glass .big-actions .btn.red {
  background: linear-gradient(180deg, #f24a4a, #b11e1e); color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 30px -8px rgba(242, 74, 74, 0.7); }
body.ui-glass .big-actions .btn.add-acc {
  background: linear-gradient(165deg, rgba(243, 210, 126, 0.16), rgba(220, 170, 60, 0.05) 55%), rgba(20, 15, 6, 0.6);
  color: #f3d27e; border: 1.5px solid #dcaa3c;
  box-shadow: inset 0 1px 0 rgba(255, 236, 170, 0.32), 0 0 20px rgba(220, 170, 60, 0.4), 0 12px 28px -10px rgba(0, 0, 0, 0.8); }
body.ui-glass .big-actions .btn.add-acc .acc-logo { border-color: #e9bd57; box-shadow: 0 0 14px rgba(233, 189, 87, 0.5); }
body.ui-glass .acc-plus { background: linear-gradient(135deg, #f7dc8c, #dcaa3c); }
/* emergency: the strongest red */
body.ui-glass .emergency-card { border-color: rgba(255, 30, 30, 0.55);
  background: radial-gradient(circle at 50% 40%, rgba(255, 30, 30, 0.22), transparent 65%), var(--g-tint); }
body.ui-glass .emergency { background: radial-gradient(circle at 50% 32%, #ff4a3d, #e00b0b 50%, #7a0505); color: #fff;
  box-shadow: 0 0 0 8px rgba(255, 20, 20, 0.18), 0 0 50px rgba(255, 20, 20, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
/* numbers: profits strong green, losses strong red, main numbers bold and bright */
body.ui-glass .green:not(.btn) { color: #2fdc76; }
body.ui-glass .red:not(.btn) { color: #ff5555; }
body.ui-glass .stat .value { font-weight: 700; color: #fff; text-shadow: 0 0 18px rgba(255, 255, 255, 0.12), 0 1px 10px rgba(0, 0, 0, 0.5); }
body.ui-glass .stat .value.green { color: #2fdc76; text-shadow: 0 0 16px rgba(47, 220, 118, 0.3); }
body.ui-glass .stat .value.red { color: #ff5555; text-shadow: 0 0 16px rgba(255, 85, 85, 0.3); }
body.ui-glass .tile .t-v, body.ui-glass .lic-counts .n, body.ui-glass .meter .mk b { font-weight: 700; color: #fff; }
body.ui-glass .row .pl, body.ui-glass td.num b { font-weight: 700; }
body.ui-glass .card-head h3 .ico, body.ui-glass .link, body.ui-glass .hint b { color: var(--gold-1); }
/* fast content animations in the glass design (chart draws and bars fill quickly) */
body.ui-glass .chart .line { animation-duration: .5s; }
body.ui-glass .chart .area { animation-duration: .3s; animation-delay: .2s; }
body.ui-glass .chart .end { animation-delay: .45s; }
body.ui-glass .chart .end-ring { animation-delay: .5s; }
body.ui-glass .bar > i { transition-duration: .35s; }
body.ui-glass .day-bar i { transition-duration: .35s; }
/* a quiet redraw (fresh data replacing the instantly shown cached data) has no entry animations */
.view.quiet .fade-up, .view.quiet .chart .line, .view.quiet .chart .area, .view.quiet .chart .end { animation: none; opacity: 1; stroke-dashoffset: 0; }
.view.quiet .bar > i { transition: none; }

/* big numbers: centred, comfortable side padding, auto-shrink to fit (ui.js fitNumbers) — every theme */
.stat .value { display: block; width: 100%; text-align: center; white-space: nowrap; padding-inline: 6px; }
.stat .foot { text-align: center; }
.tile .t-v, .lic-counts .n, .live-grid b { white-space: nowrap; }
body.ui-glass .stat { padding: 18px 16px; }
/* very small phones (320 px): header must fit, page never wider than the screen */
@media (max-width: 359px) {
  .topbar { gap: 6px; padding-inline: 8px; }
  .topbar .subtitle, .status-pill .txt { display: none; }
  .topbar .title { font-size: 1rem; letter-spacing: 1px; }
  body.ui-glass .topbar { margin-inline: 6px; }
}
/* narrow phones: headers with segmented controls and the server-subscription rows wrap instead of widening the page */
.card-head { flex-wrap: wrap; row-gap: 8px; }
#subs .row { flex-wrap: wrap; }
#subs .row .main { min-width: 55%; }
body.ui-glass .nav-item, body.ui-glass .topbar { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }

/* ---------- login screen in the liquid-glass design (owner's background photo + gold glow + subtle blue) ---------- */
body.login-page.ui-glass .glass-bg { z-index: -1; }
body.login-page.ui-glass[data-brand~="brand-bg"] .glass-bg { background: transparent; }   /* the photo shows through the glows */
body.login-page.ui-glass[data-brand~="brand-bg"]::before {
  z-index: -2;
  background:
    radial-gradient(90% 55% at 50% -8%, rgba(212, 167, 58, 0.24), transparent 70%),
    radial-gradient(70% 50% at 0% 100%, rgba(28, 46, 104, 0.28), transparent 70%),
    linear-gradient(180deg, rgba(3, 3, 3, 0.64), rgba(3, 3, 3, 0.9)),
    url(/brand/login-bg.jpg) center / cover no-repeat;
}
body.login-page.ui-glass .auth-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 42%, rgba(255, 255, 255, 0.05)), rgba(12, 12, 14, 0.4);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-radius: 30px; padding: 30px 24px;
  animation: loginIn .45s cubic-bezier(.2, .9, .3, 1) both;
}
body.login-page.ui-glass .auth-card .logo-wrap { animation: loginLogo .55s .08s cubic-bezier(.34, 1.4, .64, 1) both; }
@keyframes loginIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes loginLogo { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
body.login-page.ui-glass .brand { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
body.login-page.ui-glass .sub { color: var(--muted); }
body.login-page.ui-glass .btn.block { margin-top: 24px; padding: 14px 18px; border-radius: 18px; font-size: 1.05rem; }
body.login-page.ui-glass .msg.err { color: #ff6b6b; }
@media (prefers-reduced-motion: reduce) { body.login-page.ui-glass .auth-card, body.login-page.ui-glass .auth-card .logo-wrap { animation: none; } }
