/* طلا یار — پوسته تیره با تم طلایی، موبایل‌محور، RTL */
:root {
  --bg: #0a0d13;
  --bg2: #0e1219;
  --card: #131926;
  --card2: #1a2133;
  --line: #242d42;
  --txt: #e9edf6;
  --mut: #8d97ad;
  --gold: #f2c14e;
  --gold2: #ffd97a;
  --up: #22c98a;
  --down: #f0596a;
  --radius: 16px;
  --nav-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: Vazirmatn, "Vazirmatn UI", "IRANSans", Tahoma, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

body {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(1200px 400px at 50% -100px, rgba(242, 193, 78, 0.07), transparent 60%),
    var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

.hidden { display: none !important; }
.mut { color: var(--mut); }
.small { font-size: 12px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- هدر ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 6px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, var(--bg) 75%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand h1 {
  margin: 0;
  font-size: 18px;
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .sub { font-size: 11px; color: var(--mut); }
.top-right { display: flex; align-items: center; gap: 8px; }

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.b-demo { color: var(--gold); background: rgba(242, 193, 78, 0.1); border-color: rgba(242, 193, 78, 0.35); }
.b-live { color: var(--up); background: rgba(34, 201, 138, 0.1); border-color: rgba(34, 201, 138, 0.4); }

.dot { width: 10px; height: 10px; border-radius: 50%; background: #555; box-shadow: 0 0 0 3px rgba(255,255,255,0.04); }
.dot.ready { background: var(--up); box-shadow: 0 0 0 3px rgba(34,201,138,0.18); }
.dot.connecting { background: var(--gold); animation: blink 1s infinite; }
.dot.error { background: var(--down); }
.dot.off { background: #4b5468; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- بنر ---------- */
.banner {
  margin: 4px 14px 8px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  border: 1px solid transparent;
}
.banner.demo { background: rgba(242, 193, 78, 0.08); color: var(--gold2); border-color: rgba(242, 193, 78, 0.25); }
.banner.live { background: rgba(34, 201, 138, 0.08); color: var(--up); border-color: rgba(34, 201, 138, 0.25); }
.banner.wait { background: rgba(120, 140, 200, 0.08); color: #9db1e8; border-color: rgba(120, 140, 200, 0.3); }
.banner.err { background: rgba(240, 89, 106, 0.1); color: var(--down); border-color: rgba(240, 89, 106, 0.35); }

/* ---------- کارت‌ها ---------- */
main { padding: 0 12px; }
.view { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--mut);
  margin-bottom: 10px;
}
.pill {
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--gold);
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 8px;
}

/* ---------- کارت قیمت ---------- */
.price-card {
  background: linear-gradient(160deg, var(--card) 60%, #171d2e);
}
.price-head { display: flex; justify-content: space-between; align-items: center; }
.price-head .sym { font-weight: 700; font-size: 13px; color: var(--gold); letter-spacing: 0.4px; }
.price-row { display: flex; gap: 10px; margin-top: 8px; }
.pcol { flex: 1; }
.pcol .lbl { font-size: 11.5px; color: var(--mut); }
.big {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: right;
  transition: color 0.25s;
}
.big.flash-up { color: var(--up); }
.big.flash-down { color: var(--down); }
.change-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
#changeVal { font-weight: 700; font-size: 14px; direction: ltr; }
#changeVal.up { color: var(--up); }
#changeVal.down { color: var(--down); }
.src-line { margin-top: 6px; font-size: 11.5px; }

/* ---------- چارت ---------- */
.tf-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tf {
  background: var(--card2);
  color: var(--mut);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
}
.tf.active { color: #10131c; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.chart-wrap { position: relative; }
#chart { width: 100%; height: 260px; display: block; touch-action: pan-y; }
.chart-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mut);
  font-size: 13px;
  pointer-events: none;
}
.chart-tip {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(10, 13, 19, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  direction: ltr;
  text-align: left;
  pointer-events: none;
  z-index: 5;
}

/* ---------- دکمه‌ها ---------- */
.btn {
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 14px;
  cursor: pointer;
  color: #0b0e14;
  transition: filter 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.985); }
.btn.buy, .side.buy.active { background: linear-gradient(180deg, #2ee59d, #1cb87e); color: #06281c; }
.btn.sell, .side.sell.active { background: linear-gradient(180deg, #ff7082, #e04a5c); color: #2d060c; }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #241a02; }
.btn.big { font-size: 16px; padding: 14px; }
.btn.full { width: 100%; }
.btn:disabled { filter: grayscale(0.7) brightness(0.7); cursor: not-allowed; }

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 12px;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 14px;
  cursor: pointer;
}
.ghost-gold {
  background: transparent;
  border: 1px solid rgba(242, 193, 78, 0.5);
  color: var(--gold);
  border-radius: 12px;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 14px;
  cursor: pointer;
}
.danger-link {
  background: none;
  border: none;
  color: var(--down);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
}
.quick-row { display: flex; gap: 10px; margin-bottom: 8px; }
.quick-row .btn { flex: 1; }
.btn-row { display: flex; gap: 10px; align-items: center; }
.btn-row .btn, .btn-row .ghost { flex: 1; }
.hint { margin-top: 8px; text-align: center; }

/* ---------- فرم ---------- */
.side-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.side {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--mut);
  border-radius: 12px;
  padding: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.side.buy.active { border-color: transparent; }
.side.sell.active { border-color: transparent; }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--mut); margin-bottom: 5px; }
.field input, .field select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--txt);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
  direction: ltr;
  text-align: left;
}
.field input:focus, .field select:focus { border-color: var(--gold); }
.field select { direction: rtl; text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.vol-row { display: flex; gap: 8px; align-items: stretch; }
.vol-row input { text-align: center; font-weight: 700; }
.step {
  width: 46px;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--gold);
  border-radius: 10px;
  font-size: 20px;
  font-family: inherit;
  cursor: pointer;
}
.chips { display: flex; gap: 8px; margin-top: 8px; }
.chip {
  flex: 1;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--mut);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  padding: 5px 0;
  cursor: pointer;
}
.chip:active { border-color: var(--gold); color: var(--gold); }

.calc-rows { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 12px 0; }
.calc-rows .row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.calc-rows .row b { font-variant-numeric: tabular-nums; direction: ltr; }
.calc-rows .row + .row { border-top: 1px dashed var(--line); }

/* ---------- پوزیشن‌ها ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--mut); font-size: 13px; text-align: center; padding: 14px 0; }

.pos {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
}
.pos-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.side-chip {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
}
.side-chip.buy { background: rgba(34, 201, 138, 0.15); color: var(--up); }
.side-chip.sell { background: rgba(240, 89, 106, 0.15); color: var(--down); }
.pos-head .pl { font-weight: 800; font-size: 15.5px; direction: ltr; }
.pl.up { color: var(--up); }
.pl.down { color: var(--down); }
.pl.flat { color: var(--mut); }

.pos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pos-grid > div { background: var(--bg2); border-radius: 8px; padding: 5px 7px; }
.pos-grid span { display: block; font-size: 10.5px; color: var(--mut); }
.pos-grid b { font-size: 12.5px; font-variant-numeric: tabular-nums; direction: ltr; display: block; }
.pos-grid .time { grid-column: span 4; display: flex; justify-content: space-between; align-items: center; }
.pos-actions { display: flex; gap: 8px; margin-top: 9px; }
.pos-actions button {
  flex: 1;
  border-radius: 10px;
  padding: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.pos-actions .modify { background: transparent; border: 1px solid var(--line); color: var(--txt); }
.pos-actions .close { background: rgba(240, 89, 106, 0.14); border: 1px solid rgba(240, 89, 106, 0.4); color: var(--down); }

/* ---------- تاریخچه ---------- */
.hrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
}
.hrow .hr-l { display: flex; align-items: center; gap: 9px; min-width: 0; }
.hrow .meta b { display: block; font-size: 13px; }
.hrow .meta span { font-size: 11px; color: var(--mut); direction: ltr; display: block; text-align: right; }
.hrow .pl { font-weight: 800; font-size: 14.5px; direction: ltr; white-space: nowrap; }

/* ---------- حساب و عملکرد ---------- */
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acc {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
}
.acc span { font-size: 11.5px; color: var(--mut); display: block; }
.acc b { font-size: 16.5px; font-variant-numeric: tabular-nums; direction: ltr; display: block; text-align: right; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.stat span { font-size: 11.5px; color: var(--mut); display: block; }
.stat b { font-size: 16px; direction: ltr; display: block; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- تنظیمات ---------- */
.mode-pick { display: flex; gap: 10px; }
.mode-btn {
  flex: 1;
  background: var(--card2);
  border: 1.5px solid var(--line);
  color: var(--mut);
  border-radius: 14px;
  padding: 10px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.5;
}
.mode-btn small { font-size: 11px; font-weight: 400; }
.mode-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(242, 193, 78, 0.07); }
.conn-status { margin-top: 10px; font-size: 12.5px; color: var(--mut); word-break: break-word; }
.conn-status.ok { color: var(--up); }
.conn-status.err { color: var(--down); }
.conn-status.wait { color: var(--gold); }

.guide details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--bg2);
}
.guide summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--gold2); }
.guide p { margin: 8px 0 4px; font-size: 13px; color: #c3cbdc; }
.guide code {
  background: var(--card2);
  padding: 1px 6px;
  border-radius: 6px;
  direction: ltr;
  display: inline-block;
  font-size: 12px;
}

/* ---------- ناوبری پایین ---------- */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(14, 18, 25, 0.96);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 40;
  backdrop-filter: blur(10px);
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--mut);
  font-family: inherit;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
.nav-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active { color: var(--gold); }

/* ---------- Toast و مودال ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #1d2536;
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13.5px;
  z-index: 60;
  max-width: 88%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.toast.ok { border-color: rgba(34, 201, 138, 0.5); }
.toast.err { border-color: rgba(240, 89, 106, 0.6); color: #ffb9c2; }

.modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  width: 100%;
  max-width: 400px;
}
.modal h3 { margin: 0 0 10px; font-size: 16px; color: var(--gold2); }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .ghost, .modal-actions .btn { flex: 1; }
.modal p { font-size: 13.5px; color: #c3cbdc; margin: 6px 0; }

@media (min-width: 560px) {
  .big { font-size: 34px; }
}

/* ---------- دستیار هوشمند ---------- */
.ai-mini {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: rgba(106, 90, 205, 0.12);
  border: 1px dashed rgba(157, 177, 232, 0.4);
  color: #b9c6f2;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 10px;
  cursor: pointer;
  text-align: right;
}
.ai-mini b { font-weight: 800; }

.micro { font-size: 11px; line-height: 1.7; margin-top: 10px; }

.consensus { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; }
.cons-top { display: flex; align-items: center; gap: 10px; }
.cons-meta { flex: 1; min-width: 0; }
.cons-meta b { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; }
.cons-score { font-size: 19px; font-weight: 800; direction: ltr; font-variant-numeric: tabular-nums; }

.scorebar { height: 7px; background: var(--card2); border-radius: 99px; overflow: hidden; margin-top: 7px; direction: ltr; }
.scorebar i { display: block; height: 100%; border-radius: 99px; transition: width 0.5s; }
.scorebar i.buy { background: linear-gradient(90deg, #1cb87e, #2ee59d); }
.scorebar i.sell { background: linear-gradient(90deg, #e04a5c, #ff7082); }
.scorebar i.neutral { background: linear-gradient(90deg, #b9a44a, #f2c14e); }
.scorebar.slim { margin-top: 7px; height: 5px; }

.sig-badge { font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.sig-badge.buy { background: rgba(34, 201, 138, 0.14); color: var(--up); border: 1px solid rgba(34, 201, 138, 0.4); }
.sig-badge.sell { background: rgba(240, 89, 106, 0.14); color: var(--down); border: 1px solid rgba(240, 89, 106, 0.4); }
.sig-badge.neutral { background: rgba(242, 193, 78, 0.1); color: var(--gold); border: 1px solid rgba(242, 193, 78, 0.35); }

.tf-signals { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.tf-group-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(242, 193, 78, 0.06);
  border: 1px dashed rgba(242, 193, 78, 0.3);
  border-radius: 9px;
  padding: 5px 10px;
  margin-top: 4px;
}
.tfsig { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.tfsig-head { display: flex; align-items: center; gap: 9px; }
.tf-name { font-weight: 700; font-size: 13.5px; flex: 1; }
.tfsig-score { font-weight: 800; font-size: 15px; direction: ltr; font-variant-numeric: tabular-nums; }
.tfsig-sub { font-size: 11px; color: var(--mut); margin-top: 3px; }

.plan-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 9px; }
.plan-row > div { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 5px 7px; }
.plan-row span { display: block; font-size: 10px; color: var(--mut); }
.plan-row b { font-size: 12px; direction: ltr; display: block; text-align: right; font-variant-numeric: tabular-nums; }
.plan-row .neg b { color: var(--down); }
.plan-row .pos b { color: var(--up); }

.ghost.mini {
  width: 100%;
  margin-top: 9px;
  padding: 8px;
  font-size: 12.5px;
  border-color: rgba(242, 193, 78, 0.45);
  color: var(--gold);
}
.why { margin-top: 9px; }
.why summary { cursor: pointer; font-size: 12px; color: #9db1e8; }
.why ul { margin: 8px 0 0; padding: 0 18px 0 0; font-size: 12px; color: #c3cbdc; line-height: 1.9; }
.why li.up { color: var(--up); }
.why li.down { color: var(--down); }
.why .sr-line { margin-top: 8px; font-size: 11.5px; color: var(--mut); direction: ltr; text-align: right; }

.trade-btn { margin-top: 10px; padding: 10px; font-size: 13px; }

/* ---------- چت ---------- */
.chat-card { padding-bottom: 12px; }
.chat-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  min-height: 140px;
  overflow-y: auto;
  padding: 4px 2px;
  scroll-behavior: smooth;
}
.msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.8; word-break: break-word; }
.msg.bot { background: var(--card2); border: 1px solid var(--line); align-self: flex-start; border-top-right-radius: 5px; }
.msg.bot b { color: var(--gold2); }
.msg.user { background: linear-gradient(180deg, #2b3a5e, #243350); align-self: flex-end; border-top-left-radius: 5px; }
.msg .trade-btn { margin-top: 9px; }

.chat-chips { display: flex; gap: 7px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chat-chips::-webkit-scrollbar { display: none; }
.chat-chips .chip { flex: 0 0 auto; padding: 5px 12px; font-size: 12px; }

.chat-input { display: flex; gap: 8px; margin-top: 8px; }
.chat-input input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}
.chat-input input:focus { border-color: var(--gold); }
.chat-input .btn { padding: 10px 16px; }

@media (max-width: 360px) {
  .nav-btn { font-size: 10px; }
  .nav-btn svg { width: 20px; height: 20px; }
}

/* ---------- معامله‌گر خودکار ---------- */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  font-size: 13.5px;
  font-weight: 700;
}
.switch-row.live { color: var(--down); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
  position: absolute;
  inset: 0;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: 0.2s;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8d97ad;
  transition: 0.2s;
}
.switch input:checked + i { background: rgba(34, 201, 138, 0.25); border-color: var(--up); }
.switch input:checked + i::after { background: var(--up); transform: translateX(-20px); }
.up-pill { color: var(--up) !important; border-color: rgba(34, 201, 138, 0.45) !important; }
.at-cfg { margin: 8px 0 4px; }
.gold-txt { color: var(--gold); border-color: rgba(242, 193, 78, 0.45); width: 100%; margin-top: 8px; }
.at-log { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.at-line {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 11.5px;
  line-height: 1.7;
}
.at-line span { color: var(--mut); margin-left: 7px; font-size: 10px; direction: ltr; display: inline-block; }
.at-line.k-entry { border-color: rgba(34, 201, 138, 0.35); }
.at-line.k-stop, .at-line.k-err { border-color: rgba(240, 89, 106, 0.45); color: #ffb9c2; }
.at-line.k-toggle { border-color: rgba(242, 193, 78, 0.4); }
.at-line.k-day { color: var(--mut); }

/* ---------- کریپتو ---------- */
#crCoins { margin-top: 6px; }
#crCoins .crcoin { flex: 0 0 auto; padding: 5px 13px; font-weight: 700; }
#crCoins .crcoin.active { background: var(--gold); color: #10131c; border-color: var(--gold); }
#crChange.up { color: var(--up); }
#crChange.down { color: var(--down); }
#crChart { width: 100%; height: 220px; display: block; touch-action: pan-y; }

/* ناوبری ۶تایی */
.nav-btn { font-size: 10.5px; }
@media (max-width: 390px) {
  .nav-btn { font-size: 9.5px; }
  .nav-btn svg { width: 19px; height: 19px; }
}

/* ---------- سازنده استراتژی ---------- */
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.strow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 10px;
  margin-bottom: 7px;
  opacity: 0.55;
}
.strow.on { opacity: 1; border-color: rgba(242, 193, 78, 0.35); }
.stmain { flex: 1; min-width: 0; }
.stmain b { font-size: 13px; }
.stparams { font-size: 11px; color: var(--mut); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.stparams input, .stparams select {
  width: 56px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--txt);
  font-family: inherit;
  font-size: 12px;
  padding: 3px 5px;
  direction: ltr;
  text-align: center;
}
.stparams select { width: 78px; direction: rtl; }
.stw {
  width: 52px !important;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--gold);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px;
  text-align: center;
  direction: ltr;
}
#stTfs .chip.active { background: var(--gold); color: #10131c; border-color: var(--gold); }
#stPreviewBox { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
#stText { resize: vertical; outline: none; }

#stRsiChart { width: 100%; height: 190px; display: block; touch-action: pan-y; }

/* ═══════ اسپلش ═══════ */
#splash { position: fixed; inset: 0; z-index: 9800; display: flex; flex-direction: column; gap: 26px; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, #111a2e 0%, #0a0d13 55%, #06080c 100%);
  transition: opacity .6s ease, visibility .6s; }
#splash.bye { opacity: 0; visibility: hidden; pointer-events: none; }
#splash .besm { color: #7d8698; font-size: .85rem; letter-spacing: .05em; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 13px; }
.splash-coin { width: 150px; height: 150px; opacity: 0;
  animation: gyPop .75s .15s cubic-bezier(.2,.9,.3,1.3) forwards;
  filter: drop-shadow(0 14px 40px rgba(242,193,78,.35)); }
.sp-arr { clip-path: inset(100% 0 0 0); animation: gyClip 1.05s .8s cubic-bezier(.45,0,.4,1) forwards; }
.sp-arr-g { will-change: transform; animation: gyRise 1.05s .8s cubic-bezier(.45,0,.4,1) forwards; }
.splash-name { font-size: 1.75rem; font-weight: 800; color: var(--gold); opacity: 0; animation: gyUp .6s 1.85s ease forwards; }
.splash-sub { font-size: .85rem; color: var(--mut); opacity: 0; animation: gyUp .6s 2.05s ease forwards; }
@keyframes gyPop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
@keyframes gyUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gyDraw { to { stroke-dashoffset: 0; } }
@keyframes gyRise { from { transform: translateY(30px); opacity: .35; } to { transform: translateY(0); opacity: 1; } }
@keyframes gyClip { to { clip-path: inset(0 0 0 0); } }

/* ═══════ صفحهٔ قفل ═══════ */
.lockwrap { position: fixed; inset: 0; z-index: 9600; display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(130% 100% at 50% 0%, #141d33 0%, #0b0f18 58%, #06080c 100%);
  padding: max(22px, env(safe-area-inset-top)) 20px 26px; }
.lockwrap.bye { opacity: 0; visibility: hidden; transition: opacity .38s ease, visibility .38s; }
.lock-clock { margin-top: 8vh; text-align: center; }
.lock-time { font-size: 3.5rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.lock-date { color: var(--mut); font-size: 1rem; }
.lock-mid { margin-top: auto; margin-bottom: 4vh; display: flex; flex-direction: column; align-items: center; gap: 13px; width: 100%; }
.lock-dots { display: flex; gap: 18px; }
.lock-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #46536f; transition: all .15s; }
.lock-dot.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(242,193,78,.55); }
.lock-err { min-height: 22px; color: var(--down); font-size: .88rem; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px 22px; width: min(272px, 78vw); }
.key { height: 62px; border-radius: 50%; border: 1px solid #2c3752; background: rgba(38,48,74,.45); color: var(--txt);
  font-size: 1.55rem; font-weight: 700; font-family: inherit; display: flex; align-items: center; justify-content: center;
  transition: transform .08s, background .15s; user-select: none; cursor: pointer; }
.key:active { transform: scale(.9); background: rgba(242,193,78,.18); }
.key.fn { font-size: 1.2rem; color: var(--mut); }
.key.fp { border-color: rgba(242,193,78,.5); background: rgba(242,193,78,.08); }
.key.fp svg { width: 30px; height: 30px; stroke: var(--gold); fill: none; stroke-width: 1.6; stroke-linecap: round; }
.lockwrap.shake { animation: gyShake .42s; }
@keyframes gyShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(4px)} }

/* ═══════ فیکس سرریز افقی (کریپتو) ═══════ */
html, body { overflow-x: hidden; }
.view { max-width: 100%; }
.tf-row { flex-wrap: wrap; }
#crCoins { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
#crCoins::-webkit-scrollbar { display: none; }
.src-line { word-break: break-word; }

/* ═══════ بخش‌های جمع‌شونده ═══════ */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 700; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '▾'; color: var(--mut); font-size: .95rem; flex: none; }
details.fold[open] > summary::after { content: '▴'; }

/* ═══════ کیپد دایره‌ای و بسمه‌تعالی قفل ═══════ */
.lockwrap .besm { margin: max(10px, env(safe-area-inset-top)) 0 0; }
.lock-clock { margin-top: 3.5vh; }
.keypad { display: grid; grid-template-columns: repeat(3, min(64px, 18vw)); gap: 13px 20px; justify-content: center; width: auto; }
.key { width: min(64px, 18vw); height: min(64px, 18vw); padding: 0; }
.key.fn { font-size: 1.15rem; }

/* ═══════ دکمهٔ شناور دستیار ═══════ */
#fabAssist { position: fixed; z-index: 880; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); left: 16px;
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(255,233,168,.45); cursor: pointer;
  background: radial-gradient(circle at 32% 28%, #ffe9a8, #f2c14e 48%, #c8952b);
  box-shadow: 0 6px 22px rgba(242,193,78,.4), inset 0 1px 2px rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center; transition: transform .15s; }
#fabAssist:active { transform: scale(.88); }
#fabAssist svg { width: 27px; height: 27px; fill: #10131c; stroke: none; }
#fabAssist::after { content: ''; position: absolute; inset: -1px; border-radius: 50%;
  border: 2px solid rgba(242,193,78,.55); animation: gyPulse 2.4s ease-out infinite; }
@keyframes gyPulse { 0% { transform: scale(1); opacity: .9; } 70% { transform: scale(1.45); opacity: 0; } 100% { transform: scale(1.45); opacity: 0; } }

/* ═══════ دیالوگ شناور دستیار ═══════ */
#assistSheet { position: fixed; inset: 0; z-index: 890; display: flex; align-items: flex-end; justify-content: center; }
#assistSheet.hidden { display: none; }
.as-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 9, .68); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.as-panel { position: relative; width: 100%; max-width: 560px; height: min(80vh, 660px);
  background: linear-gradient(180deg, #141b2c, #0c1019); border: 1px solid var(--line); border-bottom: none;
  border-radius: 24px 24px 0 0; display: flex; flex-direction: column; padding: 8px 14px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .55); transform: translateY(100%); transition: transform .34s cubic-bezier(.2, .9, .3, 1); }
#assistSheet.open .as-backdrop { opacity: 1; }
#assistSheet.open .as-panel { transform: translateY(0); }
.as-grab { width: 46px; height: 4px; border-radius: 99px; background: #3a4560; margin: 2px auto 8px; flex: none; }
.as-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex: none; }
.as-title { font-weight: 800; font-size: 1.02rem; }
#asClose { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2);
  color: var(--txt); font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: transform .12s; }
#asClose:active { transform: scale(.88); }
#assistSheet .chat-box { flex: 1; max-height: none; min-height: 180px; }
#assistSheet .chat-input { flex: none; }

/* ═══════ ضد نشتی اسکرول دیالوگ ═══════ */
#assistSheet .chat-box, #assistSheet .as-panel { overscroll-behavior: contain; }
