/* =========================================================
   سهم‌نیوز — زبان بصری «شب بازار» (بوم طراحی: «زبان بصری شب بازار»)
   طلایی یعنی خبر و کار اصلی صفحه؛ سبز و قرمز فقط مال قیمت، همیشه با ▲▼.
   تم روشن برای تلگرام روشن (رنگ‌های کارت قیمت فعلی ربات).
   ========================================================= */

@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url("/fonts/Vazirmatn-Regular.ttf") format("truetype"); }
@font-face { font-family: Vazirmatn; font-weight: 500; font-display: swap; src: url("/fonts/Vazirmatn-Medium.ttf") format("truetype"); }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url("/fonts/Vazirmatn-Bold.ttf") format("truetype"); }
@font-face { font-family: Vazirmatn; font-weight: 900; font-display: swap; src: url("/fonts/Vazirmatn-Black.ttf") format("truetype"); }

:root {
  --bg: #0B1120;
  --surface: #121A2B;
  --raised: #18233A;
  --overlay: rgba(11, 17, 32, 0.94);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.24);
  --text: #F1F5F9;
  --text-soft: #DCE3EE;
  --text2: #A9B6CB;
  --muted: #8A98B0;
  --gold: #F5B83D;
  --gold-text: #F5B83D;
  --gold-ink: #0B1120;
  --gold-tint: rgba(245, 184, 61, 0.10);
  --gold-line: rgba(245, 184, 61, 0.26);
  --up: #34D399;
  --up-bg: rgba(52, 211, 153, 0.14);
  --down: #FB7185;
  --down-bg: rgba(251, 113, 133, 0.14);
  --blue: #7DB4FF;
  --blue-bg: rgba(125, 180, 255, 0.14);
  --tooltip: #1E2A44;
  --track: rgba(148, 163, 184, 0.22);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius-l: 22px;
  --radius-m: 16px;
  --radius-s: 12px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F0F2F5;
  --surface: #FFFFFF;
  --raised: #F3F5F8;
  --overlay: rgba(240, 242, 245, 0.95);
  --line: rgba(24, 28, 34, 0.09);
  --line-strong: rgba(24, 28, 34, 0.16);
  --text: #181C22;
  --text-soft: #2B313B;
  --text2: #4A5263;
  --muted: #5F6776;
  --gold: #F5B83D;
  --gold-text: #8F5B00;
  --gold-ink: #181C22;
  --gold-tint: rgba(245, 184, 61, 0.14);
  --gold-line: rgba(176, 112, 0, 0.28);
  --up: #0B7D55;
  --up-bg: rgba(14, 156, 106, 0.12);
  --down: #C7323D;
  --down-bg: rgba(218, 60, 70, 0.10);
  --blue: #2F64A8;
  --blue-bg: rgba(55, 105, 165, 0.10);
  --tooltip: #FFFFFF;
  --track: rgba(24, 28, 34, 0.12);
  --shadow: 0 8px 24px rgba(24, 28, 34, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: var(--gold-text); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
svg { display: block; }
[hidden] { display: none !important; }
/* جداکننده‌ی خط متا: «·» کنار رقم فارسی شبیه صفر (۰) دیده میشه */
.sep { display: inline-block; width: 1px; height: 12px; background: var(--line-strong); flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- قاب */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.page { display: flex; flex-direction: column; gap: 16px; padding: 14px 16px 104px; }
.page.with-action { padding-bottom: 112px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.soft { color: var(--text2); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px;
}
.card.tight { padding: 6px; border-radius: 20px; }
.card.flush { padding: 0; overflow: hidden; border-radius: 20px; }

/* ---------------------------------------------------------------- سربرگ */
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.brand-name { font-size: 18px; font-weight: 900; letter-spacing: -0.2px; }
.brand-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); line-height: 1.4; }
.dot { width: 7px; height: 7px; border-radius: 4px; background: var(--up); flex: none; }
.dot.closed { background: var(--muted); }
h1.page-title { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.4px; line-height: 1.4; }
.page-sub { font-size: 13px; color: var(--text2); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 900; }
.section-title svg { color: var(--gold); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  padding: 0;
}
.icon-btn.gold { background: var(--gold); border-color: transparent; color: var(--gold-ink); }
.icon-btn.active { color: var(--gold-text); border-color: var(--gold-line); background: var(--gold-tint); }

.link-btn { background: none; border: 0; padding: 10px 0; color: var(--gold-text); font-size: 13px; font-weight: 700; }

/* ---------------------------------------------------------------- جست‌وجو */
.search-pill {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px;
  border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 15px;
}
.search-field {
  flex: 1; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px;
  border-radius: var(--radius-m); background: var(--surface);
  border: 1.5px solid var(--gold); box-shadow: 0 0 0 4px var(--gold-tint);
}
.search-field svg { color: var(--gold-text); flex: none; }
.search-field input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; font-weight: 700;
}
.search-field input::placeholder { color: var(--muted); font-weight: 400; }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.clear-btn {
  width: 28px; height: 28px; border-radius: 14px; border: 0; padding: 0; flex: none;
  background: var(--raised); color: var(--text2); display: inline-flex; align-items: center; justify-content: center;
}
.result {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 10px;
  border-radius: 14px; color: var(--text);
}
.result:active, .result.first { background: var(--raised); }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--raised);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; color: var(--gold-text);
}
.mark { color: var(--gold-text); }
.history-row {
  display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--text-soft); font-size: 15px;
  border-bottom: 1px solid var(--line);
}

/* ---------------------------------------------------------------- تراشه‌ها */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-soft);
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.chip.big { height: 40px; }
.chip[aria-pressed="true"], .chip.on { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 900; }
.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap;
  background: var(--raised); color: var(--text-soft);
}
.tag.gold { background: var(--gold-tint); color: var(--gold-text); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.solid { background: var(--gold); color: var(--gold-ink); font-weight: 900; }

.change {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px;
  font-size: 13px; font-weight: 900; white-space: nowrap; direction: rtl;
}
.change.lg { padding: 6px 10px; border-radius: 10px; font-size: 15px; }
.change.up { background: var(--up-bg); color: var(--up); }
.change.down { background: var(--down-bg); color: var(--down); }
.change.flat { background: var(--raised); color: var(--text2); }
.change.bare { background: none; padding: 0; }
.up-text { color: var(--up); }
.down-text { color: var(--down); }

.segmented {
  display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.segmented button {
  min-height: 40px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text2); font-size: 14px; font-weight: 500; line-height: 1.3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.segmented button[aria-selected="true"] { background: var(--gold); color: var(--gold-ink); font-weight: 900; }
.segmented.trades button[aria-selected="true"].buy { background: var(--up-bg); color: var(--up); }
.segmented.trades button[aria-selected="true"].sell { background: var(--down-bg); color: var(--down); }
.segmented.trades button[aria-selected="true"].other { background: var(--blue-bg); color: var(--blue); }
.segmented small { font-size: 11px; font-weight: 500; }

/* ---------------------------------------------------------------- بازار */
.metric-label { font-size: 13px; color: var(--text2); }
.metric-big { font-size: 28px; font-weight: 900; letter-spacing: -0.5px; line-height: 1.3; }
.breadth { display: flex; gap: 3px; height: 8px; }
.breadth span { border-radius: 4px; min-width: 4px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--raised);
}
.mini .k { font-size: 12px; color: var(--text2); }
.mini .v { font-size: 16px; font-weight: 900; }
.insight {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; width: 100%;
  background: var(--gold-tint); border: 1px solid var(--gold-line); color: var(--text); text-align: right;
}
.insight svg { flex: none; margin-top: 2px; }
.insight .text { flex: 1; font-size: 13px; line-height: 1.8; color: var(--text-soft); }
.bullets { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bullets li { display: flex; gap: 10px; font-size: 14px; line-height: 1.85; color: var(--text-soft); }
.bullets li::before {
  content: ""; flex: none; width: 6px; height: 6px; margin-top: 11px; border-radius: 3px; background: var(--gold);
}

/* ---------------------------------------------------------------- داغ‌ها */
.hot {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.rank { width: 22px; flex: none; text-align: center; font-size: 15px; font-weight: 900; color: var(--muted); }
.sym { font-size: 16px; font-weight: 900; }
.co { font-size: 12px; color: var(--muted); }
.hot .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text2); line-height: 1.5; }
.heat { display: flex; align-items: flex-end; gap: 3px; direction: ltr; }
.heat span { width: 5px; border-radius: 2px; background: var(--track); }
.heat span.on { background: var(--gold); }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }

/* ---------------------------------------------------------------- نماد */
.sym-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.sym-title h1 { margin: 0; font-size: 32px; font-weight: 900; letter-spacing: -0.5px; line-height: 1.3; }
.price { font-size: 36px; font-weight: 900; letter-spacing: -0.8px; line-height: 1.2; }
.unit { font-size: 13px; color: var(--text2); }
.legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text2); }
.legend i { display: inline-block; vertical-align: middle; margin-left: 6px; border-radius: 2px; }
.chart-box { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-box svg { width: 100%; height: 210px; overflow: visible; }
.chart-tip {
  position: absolute; top: 0; padding: 8px 10px; border-radius: 12px; pointer-events: none;
  background: var(--tooltip); border: 1px solid var(--gold-line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; min-width: 120px; transform: translateX(-50%); white-space: nowrap;
}
.chart-tip .d { font-size: 11px; color: var(--text2); }
.chart-tip .v { font-size: 13px; font-weight: 900; }
.chart-tip .n { font-size: 12px; font-weight: 700; color: var(--gold-text); }
.chart-empty { height: 160px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 13px; padding: 0 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.stat .k { font-size: 12px; color: var(--text2); }
.stat .v { font-size: 15px; font-weight: 900; }
.ai-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-l);
  background: var(--gold-tint); border: 1px solid var(--gold-line);
}
.ai-card .foot { font-size: 11px; line-height: 1.7; color: var(--text2); padding-top: 10px; border-top: 1px solid var(--gold-line); }
.ai-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px;
  border: 1px solid var(--gold-line); background: transparent; color: var(--gold-text); font-weight: 900; font-size: 15px;
}

/* ---------------------------------------------------------------- خبر */
.news { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.news summary { list-style: none; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.news summary::-webkit-details-marker { display: none; }
.news .t { font-size: 15px; font-weight: 700; line-height: 1.85; }
.news .m { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--text2); }
.news .body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.9; color: var(--text-soft); white-space: pre-line; overflow-wrap: anywhere; }
.news .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.news .links a, .news .links button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--raised); color: var(--text-soft); font-size: 13px; border: 0;
}
.news .links .primary { background: var(--gold-tint); color: var(--gold-text); font-weight: 700; }
.more-btn {
  min-height: 48px; border-radius: 14px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--text-soft); font-weight: 700;
}

/* ---------------------------------------------------------------- دیده‌بان */
.watch-row {
  display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 10px 14px;
  color: var(--text); border-bottom: 1px solid var(--line);
}
.watch-row:last-child { border-bottom: 0; }
.watch-row .px { width: 84px; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.watch-row .px b { font-size: 15px; font-weight: 900; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 24px; text-align: center; color: var(--text2); }
.empty svg { color: var(--gold); }
.empty b { color: var(--text); font-size: 17px; }

/* ---------------------------------------------------------------- معاملات */
.trade {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; display: flex; }
.bar span { height: 100%; border-radius: 3px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); font-size: 12px; line-height: 1.8; color: var(--text2); }
.note svg { flex: none; margin-top: 3px; }

/* ---------------------------------------------------------------- پایین صفحه */
.tabbar {
  position: fixed; right: 0; left: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
  max-width: 560px; margin: 0 auto;
  padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  background: var(--overlay); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; color: var(--text2); font-size: 11px; font-weight: 500;
}
.tabbar a[aria-current="page"] { color: var(--gold-text); font-weight: 900; }
.action-bar {
  position: fixed; right: 0; left: 0; bottom: 0; z-index: 10; max-width: 560px; margin: 0 auto;
  display: flex; gap: 10px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--overlay); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.primary-btn {
  flex: 1; min-height: 52px; border: 0; border-radius: var(--radius-m); background: var(--gold); color: var(--gold-ink);
  font-size: 16px; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.primary-btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }

/* ---------------------------------------------------------------- وضعیت‌ها */
.skeleton { border-radius: 14px; background: linear-gradient(90deg, var(--surface) 0%, var(--raised) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.spinner { width: 18px; height: 18px; border-radius: 9px; border: 2px solid currentColor; border-left-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }
.toast {
  position: fixed; right: 16px; left: 16px; bottom: 100px; z-index: 20; max-width: 528px; margin: 0 auto;
  padding: 12px 16px; border-radius: 14px; background: var(--tooltip); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 14px; text-align: center;
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.gate { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 32px 24px; text-align: center; }
.gate h1 { margin: 0; font-size: 22px; font-weight: 900; }
.gate p { margin: 0; color: var(--text2); line-height: 1.9; }

/* ---------------------------------------------------------------- جعبه‌ابزار (tools.js) */
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; min-height: 92px; padding: 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: right;
}
.tile svg { color: var(--gold-text); margin-bottom: 4px; }
.tile b { font-size: 15px; font-weight: 900; }
.tile span { font-size: 12px; color: var(--text2); line-height: 1.6; }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; min-height: 64px; }
.tile.wide svg { margin: 0; flex: none; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; font-size: 14px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--text2); }
.kv b { font-weight: 900; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.field input, .field select {
  height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 700;
}
.field input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-tint); }
.field small { font-size: 12px; color: var(--muted); }
.unit-switch { display: flex; gap: 6px; }
.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-width: 0 0 1px; text-align: right; color: var(--text); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .grow span { display: block; font-size: 12px; color: var(--text2); }
.switch { width: 48px; height: 28px; flex: none; border-radius: 14px; background: var(--track); position: relative; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: right 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
[aria-pressed="true"] .switch { background: var(--gold); }
[aria-pressed="true"] .switch::after { right: 23px; }
.alloc { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.alloc span { min-width: 3px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.light { width: 12px; height: 12px; border-radius: 6px; flex: none; margin-top: 6px; }
.light.green { background: var(--up); }
.light.yellow { background: var(--gold); }
.light.red { background: var(--down); }
.light.gray { background: var(--track); }
.check-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item b { display: block; font-size: 14px; font-weight: 900; }
.check-item span { font-size: 13px; line-height: 1.8; color: var(--text-soft); }
.medal { width: 30px; height: 30px; flex: none; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; background: var(--raised); color: var(--text2); }
.medal.m1 { background: #F5B83D; color: #0B1120; }
.medal.m2 { background: #C9D2DF; color: #0B1120; }
.medal.m3 { background: #D9915F; color: #0B1120; }
.outcome { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.outcome.mine { border-color: var(--gold-line); background: var(--gold-tint); }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.preset { min-height: 56px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.5; }
.preset b { font-size: 15px; font-weight: 900; }
.preset small { font-size: 11px; color: var(--text2); }
.alert-row { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row .grow { font-size: 14px; line-height: 1.7; }
.danger-btn { min-height: 48px; border-radius: 14px; border: 1px solid var(--down-bg); background: transparent; color: var(--down); font-weight: 700; }
.danger-btn.confirm { background: var(--down); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.open { background: var(--up-bg); color: var(--up); }
.badge.closed { background: var(--raised); color: var(--text2); }
.card-img { width: 100%; border-radius: 18px; display: block; background: var(--surface); min-height: 240px; }
.board-row { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); font-size: 14px; }
.board-row:last-child { border-bottom: 0; }
.board-row.me { color: var(--gold-text); font-weight: 900; }

/* ---------------------------------------------------------------- ابزارهای تحلیلی (هم‌شکل کارت‌های جعبه‌ابزار) */
/* مختصات SVG چپ‌به‌راسته؛ بدون این، text-anchor در صفحه‌ی راست‌به‌چپ برعکس میشه */
.gauge, .ring, .spark, .ratio-chart { direction: ltr; }
.stat .s { font-size: 11px; color: var(--muted); line-height: 1.6; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-grid.three .stat { padding: 10px; }
.stat-grid.three .v { font-size: 16px; }
.metric-huge { font-size: 34px; font-weight: 900; letter-spacing: -0.5px; line-height: 1.25; }

.gauge { width: 100%; max-width: 320px; display: block; margin: 0 auto; overflow: visible; }
.gauge.compact { max-width: 150px; }
.mood-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px 18px;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--heat) 16%, transparent), transparent 70%), var(--surface); }
.mood-label { padding: 6px 18px; border-radius: 999px; font-weight: 900; font-size: 17px;
  color: var(--heat); background: color-mix(in srgb, var(--heat) 16%, transparent); }
:root[data-theme="light"] .mood-label { color: color-mix(in srgb, var(--heat) 70%, #000); }
.mood-label.sm { font-size: 12px; padding: 2px 10px; align-self: center; margin-top: -6px; }
.mood-teaser { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-height: 72px; }
.mood-teaser > svg:first-child { color: var(--gold-text); flex: none; }
.mood-teaser > svg:last-child { color: var(--muted); flex: none; }
.mood-teaser b { font-size: 15px; font-weight: 900; }
.mood-teaser .soft { font-size: 12px; line-height: 1.6; }
.mood-dot { width: 48px; height: 48px; flex: none; border-radius: 24px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #0B1120; box-shadow: 0 0 0 5px var(--track); }
.breadth { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.breadth span { height: 100%; min-width: 2px; }
.flow-row { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; border-bottom: 1px solid var(--line); }
.flow-row:last-child { border-bottom: 0; }
.flow-row .grow { min-width: 0; flex: 1 1 0; }
.flow-row .bar { flex: 0 0 64px; height: 5px; }
.flow-row b { font-weight: 900; font-size: 13px; white-space: nowrap; min-width: 112px; text-align: left; }

.hero-row { display: flex; align-items: center; gap: 16px; }
.ring { flex: none; display: block; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--raised); color: var(--text2); }
.pill .light { width: 8px; height: 8px; margin: 0; }
.pill.green { background: var(--up-bg); color: var(--up); }
.pill.yellow { background: var(--gold-tint); color: var(--gold-text); }
.pill.red { background: var(--down-bg); color: var(--down); }
.check-card { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.check-card .light { width: 14px; height: 14px; border-radius: 7px; margin-top: 5px; }
.check-card .light.green { box-shadow: 0 0 0 4px var(--up-bg); }
.check-card .light.yellow { box-shadow: 0 0 0 4px var(--gold-tint); }
.check-card .light.red { box-shadow: 0 0 0 4px var(--down-bg); }
.check-card b { display: block; font-size: 15px; font-weight: 900; }
.check-card span { font-size: 13px; line-height: 1.8; color: var(--text-soft); }
.check-card.gray span { color: var(--muted); }

.ratio-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.zone { display: inline-flex; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.zone.up { background: var(--up-bg); color: var(--up); }
.zone.down { background: var(--down-bg); color: var(--down); }
.zone.blue { background: var(--blue-bg); color: var(--blue); }
.chart-card { padding: 10px 8px 4px; }
.ratio-chart { width: 100%; height: auto; display: block; overflow: visible; }
.window-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.window:last-child:nth-child(odd) { grid-column: 1 / -1; }
.window { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.window .k { font-size: 14px; font-weight: 900; }
.window .s { font-size: 11px; color: var(--muted); line-height: 1.6; }

.tm-hero .metric-huge { font-size: 30px; }
.tm-hero .change { align-self: flex-start; }
.medal.xl { width: 64px; height: 64px; border-radius: 32px; font-size: 26px; }
.bar.thick { height: 8px; border-radius: 4px; flex: none; width: 100%; }
.bar.thick span { border-radius: 4px; }
.outcome.mine { border-color: var(--blue); background: var(--blue-bg); }
.gold-note { padding: 14px 16px; border-radius: var(--radius-m); background: var(--gold-tint); border: 1px solid var(--gold-line); color: var(--gold-text); font-size: 14px; font-weight: 700; line-height: 1.8; }

.tool-legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text2); }
.tool-legend span { display: flex; align-items: center; gap: 8px; }
.tool-legend svg { color: var(--gold-text); flex: none; }
.tool-legend b { color: var(--text); }
.pick-row { gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }

.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.insight-grid .wide, .insight.wide { grid-column: 1 / -1; }
.insight { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius-m); background: var(--surface);
  border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
.insight:active { transform: scale(0.98); }
.insight > svg, .insight .row > svg { color: var(--gold-text); flex: none; }
.insight b { font-size: 15px; font-weight: 900; }
.insight .pills { flex-direction: column; gap: 4px; }
.insight .between { justify-content: space-between; }
.spark { width: 120px; height: 36px; flex: none; }
