/* REGAL SYSTEMS — terminal styles
   Palette: royal navy ink + brass gold. One memorable element: the "Итог" verdict strip. */

:root {
  --bg: #0D1524;
  --bg2: #0F192B;
  --panel: #131E33;
  --panel2: #18253E;
  --line: #24324D;
  --line2: #2E3F5F;
  --text: #E4EAF4;
  --muted: #8796B0;
  --faint: #5D6C88;
  --gold: #C9A54C;
  --gold2: #E2C473;
  --gold-ink: #2A2110;
  --up: #27B58A;
  --down: #E05A4E;
  --warn: #E0A33A;
  --blue: #5B8DEF;
  --up-bg: rgba(39, 181, 138, .12);
  --down-bg: rgba(224, 90, 78, .12);
  --gold-bg: rgba(201, 165, 76, .10);
  --shadow: 0 10px 30px rgba(3, 8, 18, .45);
  --r: 10px;
  --r-s: 7px;
  --font: 'Onest', 'Noto Sans Armenian', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', 'Onest', 'Noto Sans Armenian', sans-serif;
  --rail: 76px;
  --wl: 300px;
  --top: 56px;
  color-scheme: dark;
}

.theme-light {
  --bg: #F3F6FB;
  --bg2: #EAF0F8;
  --panel: #FFFFFF;
  --panel2: #F5F8FD;
  --line: #D9E1EE;
  --line2: #C6D1E3;
  --text: #13213A;
  --muted: #5B6B87;
  --faint: #8D9AB2;
  --gold: #A7832B;
  --gold2: #8E6E20;
  --gold-ink: #FFF8E6;
  --up: #11946C;
  --down: #CC4136;
  --up-bg: rgba(17, 148, 108, .10);
  --down-bg: rgba(204, 65, 54, .09);
  --gold-bg: rgba(167, 131, 43, .10);
  --shadow: 0 10px 30px rgba(20, 40, 80, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0 0 .8em; }
code { background: var(--panel2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
::selection { background: var(--gold); color: var(--gold-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.gold { color: var(--gold2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nw { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.sp { height: 14px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: var(--r-s);
  border: 1px solid var(--gold); background: var(--gold); color: var(--gold-ink);
  font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--gold2); border-color: var(--gold2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line2); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold2); }
.btn.quiet { background: var(--panel2); color: var(--text); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--line2); }
.btn.danger { background: transparent; color: var(--down); border-color: var(--down); }
.btn.danger:hover { background: var(--down); color: #fff; }
.btn.buy { background: var(--up); border-color: var(--up); color: #fff; }
.btn.sell { background: var(--down); border-color: var(--down); color: #fff; }
.btn.sm { height: 29px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 29px; }
.btn.block { width: 100%; }

input, select, textarea {
  font: 14px var(--font); color: var(--text); background: var(--bg2);
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; min-height: 36px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--gold); }
.form { display: flex; flex-direction: column; gap: 11px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; }
.inline-input { display: flex; gap: 6px; }
.inline-input input, .inline-input select { min-width: 0; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; background: var(--bg2); }
.seg button { border: 0; background: transparent; color: var(--muted); font: 600 12.5px var(--font); padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--panel2); color: var(--gold2); }
.seg button:hover { color: var(--text); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.gold { color: var(--gold2); border-color: var(--gold); background: var(--gold-bg); }
.chip.up { color: var(--up); border-color: transparent; background: var(--up-bg); }
.chip.down { color: var(--down); border-color: transparent; background: var(--down-bg); }
.chip.warn { color: var(--warn); border-color: transparent; background: rgba(224, 163, 58, .12); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 9px 13px; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.tabs a.on, .tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.tabs a:hover, .tabs button:hover { color: var(--text); }

/* ---------- Panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card.flat { background: transparent; }
.card.tight { padding: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h3 { margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 20px; font-weight: 650; }
.stat span { font-size: 12px; color: var(--muted); }
.alert { padding: 10px 13px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--panel2); font-size: 13.5px; margin-bottom: 10px; }
.alert.warn { border-color: rgba(224, 163, 58, .5); background: rgba(224, 163, 58, .08); }
.alert.ok { border-color: rgba(39, 181, 138, .45); background: var(--up-bg); }
.alert.err { border-color: rgba(224, 90, 78, .45); background: var(--down-bg); }
.empty { padding: 26px 14px; text-align: center; color: var(--muted); }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); z-index: 1; }
table.t td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel2); }
table.t td.num, table.t th.num { text-align: right; }
.tscroll { overflow: auto; max-width: 100%; }

/* ---------- The verdict strip ("Итог") ---------- */
.verdict {
  position: relative; border: 1px solid var(--line); border-left: 3px solid var(--gold);
  background: linear-gradient(0deg, var(--gold-bg), var(--gold-bg)), var(--panel);
  border-radius: var(--r-s); padding: 11px 13px 11px 14px; font-size: 13.5px; line-height: 1.55;
}
.verdict-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.verdict-h b { color: var(--gold2); font-weight: 650; font-size: 13px; }
.verdict p { margin: 0 0 4px; }
.verdict p:last-child { margin-bottom: 0; }
.verdict.locked { border-left-color: var(--line2); color: var(--muted); }
.scale { display: inline-flex; gap: 3px; align-items: center; }
.scale i { width: 15px; height: 7px; border-radius: 2px; background: var(--line); }
.scale[data-b="strong_bear"] i:nth-child(1),
.scale[data-b="bear"] i:nth-child(2) { background: var(--down); }
.scale[data-b="neutral"] i:nth-child(3) { background: var(--muted); }
.scale[data-b="bull"] i:nth-child(4),
.scale[data-b="strong_bull"] i:nth-child(5) { background: var(--up); }
.scale-l { font-size: 12px; font-weight: 600; }
.bias-strong_bull, .bias-bull { color: var(--up); }
.bias-strong_bear, .bias-bear { color: var(--down); }
.bias-neutral { color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.meter > span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--wl); grid-template-rows: var(--top) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.app.wl-off { grid-template-columns: var(--rail) minmax(0, 1fr) 0; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg2); min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 14px; letter-spacing: .02em; white-space: nowrap; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--gold2); font-weight: 700; }
.logo-mark { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.markets { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.markets button { border: 0; background: none; color: var(--muted); font: 600 13px var(--font); padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.markets button.on { background: var(--gold); color: var(--gold-ink); }
.markets button:hover:not(.on) { color: var(--text); }
.cmd { position: relative; flex: 1 1 320px; max-width: 520px; min-width: 120px; }
.cmd input { padding-left: 34px; background: var(--panel); height: 36px; }
.cmd svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--faint); }
.cmd-pop { position: absolute; top: 40px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); z-index: 60; max-height: 380px; overflow: auto; padding: 5px; }
.cmd-pop a { display: flex; gap: 10px; justify-content: space-between; padding: 7px 9px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.cmd-pop a.on, .cmd-pop a:hover { background: var(--panel2); }
.cmd-pop small { color: var(--muted); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top .chip { cursor: default; }
.ubtn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px 3px 3px; color: var(--text); cursor: pointer; font: 600 13px var(--font); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--gold); color: var(--gold2); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }

.rail { border-right: 1px solid var(--line); background: var(--bg2); overflow-y: auto; padding: 8px 0; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; color: var(--muted); text-decoration: none; font-size: 10.5px; line-height: 1.15; text-align: center; border-left: 2px solid transparent; }
.rail a svg { width: 21px; height: 21px; }
.rail a:hover { color: var(--text); text-decoration: none; }
.rail a.on { color: var(--gold2); border-left-color: var(--gold); background: var(--gold-bg); }
.rail .sep { height: 1px; background: var(--line); margin: 6px 12px; }

.main { overflow: auto; position: relative; min-width: 0; }
.page { padding: 18px; max-width: 1500px; margin: 0 auto; }
.page.full { max-width: none; padding: 0; height: 100%; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 22px; }
.page-h p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }

.wl { border-left: 1px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.app.wl-off .wl { display: none; }
.wl-h { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }
.wl-h select { height: 30px; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.wl-list { overflow-y: auto; flex: 1; }
.wl-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.wl-row:hover { background: var(--panel); }
.wl-row.on { background: var(--panel); box-shadow: inset 2px 0 0 var(--gold); }
.wl-row .s { font-weight: 650; font-size: 13.5px; }
.wl-row .n { font-size: 11.5px; color: var(--muted); }
.wl-row .p { text-align: right; font-weight: 600; font-size: 13.5px; }
.wl-row .c { text-align: right; font-size: 12px; }
.wl-row .x { position: absolute; right: 4px; top: 4px; opacity: 0; border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 14px; }
.wl-row:hover .x { opacity: 1; }
.flash-up { animation: fu .9s ease-out; }
.flash-down { animation: fd .9s ease-out; }
@keyframes fu { from { background: var(--up-bg); } to { background: transparent; } }
@keyframes fd { from { background: var(--down-bg); } to { background: transparent; } }
.wl-add { padding: 10px 12px; border-top: 1px solid var(--line); }

.banners { position: sticky; top: 0; z-index: 30; }
.banner { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 18px; font-size: 13.5px; border-bottom: 1px solid var(--line); background: var(--panel); }
.banner.warn { background: #3A2E12; color: #F3D9A0; border-bottom-color: #5A4718; }
.banner.info { background: var(--panel2); }
.banner.ok { background: #0F3A2D; color: #BDEBD9; }
.banner.promo { background: var(--gold-bg); color: var(--gold2); }
.theme-light .banner.warn { background: #FFF3D6; color: #6B4C0B; border-bottom-color: #F0D9A0; }
.theme-light .banner.ok { background: #DFF5EC; color: #0C5A41; }
.banner button { flex: none; }

.bnav { display: none; }

/* ---------- Charts ---------- */
.chart-wrap { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 360px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.chart-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chart-bar .sym { font-weight: 700; font-size: 14px; padding: 0 6px; cursor: pointer; }
.chart-bar .px { font-weight: 650; }
.chart-bar select { height: 29px; min-height: 29px; padding: 2px 6px; width: auto; font-size: 12.5px; }
.chart-body { position: relative; flex: 1; min-height: 200px; }
.chart-main { position: absolute; inset: 0; }
.chart-sub { height: 130px; border-top: 1px solid var(--line); position: relative; flex: none; }
.chart-ovl { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.chart-ovl.draw { pointer-events: auto; cursor: crosshair; }
.chart-legend { position: absolute; left: 10px; top: 6px; z-index: 4; font-size: 12px; color: var(--muted); pointer-events: none; display: flex; gap: 10px; flex-wrap: wrap; }
.chart-legend b { color: var(--text); font-weight: 600; }
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 5; text-align: center; padding: 20px; }
.multi { display: grid; gap: 8px; height: calc(100vh - var(--top) - 90px); min-height: 520px; }
.multi.n1 { grid-template-columns: 1fr; }
.multi.n2 { grid-template-columns: 1fr 1fr; }
.multi.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.multi.n6 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.multi .chart-wrap { min-height: 0; }
.chart-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.replay { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-top: 1px solid var(--line); background: var(--panel2); }
.replay input[type=range] { flex: 1; min-height: 0; padding: 0; }

.spark { width: 100%; height: 34px; display: block; }
canvas.viz { width: 100%; display: block; }
.viz3d { position: relative; width: 100%; height: calc(100vh - var(--top) - 150px); min-height: 440px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: radial-gradient(ellipse at center, #15233D 0%, var(--bg) 75%); }
.theme-light .viz3d { background: radial-gradient(ellipse at center, #FFFFFF 0%, #E6EDF7 80%); }
.viz3d canvas { display: block; }
.viz-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line2); border-radius: 7px; padding: 6px 9px; font-size: 12.5px; z-index: 5; box-shadow: var(--shadow); white-space: nowrap; }
.viz-legend { position: absolute; left: 12px; bottom: 12px; z-index: 4; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 12.5px; max-width: 340px; }

/* ---------- Signals ---------- */
.sig-card { border-top: 3px solid var(--line2); }
.sig-card.buy { border-top-color: var(--up); }
.sig-card.sell { border-top-color: var(--down); }
.sig-dir { font-size: 26px; font-weight: 750; line-height: 1; }
.sig-dir.buy { color: var(--up); }
.sig-dir.sell { color: var(--down); }
.knees { display: flex; gap: 4px; flex-wrap: wrap; }
.knee { min-width: 30px; height: 22px; border-radius: 5px; display: grid; place-items: center; font-size: 11.5px; font-weight: 650; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); padding: 0 4px; }
.knee.W { background: var(--up-bg); color: var(--up); border-color: transparent; }
.knee.L { background: var(--down-bg); color: var(--down); border-color: transparent; }
.knee.S { color: var(--faint); text-decoration: line-through; }
.knee.P, .knee.A { border-color: var(--gold); color: var(--gold2); }
.big-tp { font-size: 22px; font-weight: 700; color: var(--up); }
.countdown { font-weight: 700; color: var(--gold2); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); display: inline-block; box-shadow: 0 0 0 0 rgba(39, 181, 138, .6); animation: pd 1.6s infinite; }
@keyframes pd { 70% { box-shadow: 0 0 0 8px rgba(39, 181, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(39, 181, 138, 0); } }

/* ---------- Global picture ---------- */
.gp-ov { font-size: 15px; line-height: 1.6; }
.gp-ov p { margin: 0 0 6px; }
.asset { cursor: pointer; }
.asset .score { font-size: 22px; font-weight: 700; }
.reason { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n s" "t t"; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.reason .rn { grid-area: n; color: var(--muted); font-size: 12px; }
.reason .rs { grid-area: s; text-align: right; font-weight: 650; font-size: 12.5px; }
.reason > span:nth-child(2) { grid-area: t; line-height: 1.5; }

/* ---------- News ---------- */
.news-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-item h4 { margin: 0 0 4px; font-size: 14.5px; }
.news-item h4 a { color: var(--text); }
.ev-row { display: grid; grid-template-columns: 62px 50px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.impact { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.impact.high { background: var(--down); }
.impact.medium { background: var(--warn); }
.impact.low { background: var(--faint); }
.impact.holiday { background: var(--blue); }

/* ---------- AI chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--top) - 150px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 4px 2px 10px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--gold-bg); border: 1px solid var(--gold); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg ul { margin: 4px 0; padding-left: 18px; }
.msg p { margin: 0 0 6px; }
.msg .who { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.chat-in { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.chat-in textarea { min-height: 44px; height: 44px; max-height: 160px; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 3px; animation: tp 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes tp { 50% { opacity: .2; } }

/* ---------- Video ---------- */
.vid { cursor: pointer; padding: 0; overflow: hidden; }
.vid .th { aspect-ratio: 16/9; background: var(--panel2) center/cover no-repeat; position: relative; display: grid; place-items: center; }
.vid .th .play { width: 52px; height: 52px; border-radius: 50%; background: rgba(13, 21, 36, .78); border: 2px solid var(--gold); display: grid; place-items: center; color: var(--gold2); }
.vid .th .lock { color: var(--muted); text-align: center; font-size: 13px; padding: 10px; }
.vid .vb { padding: 11px 13px 13px; }
.vid h4 { margin: 0 0 4px; }
.player { position: relative; aspect-ratio: 16/9; width: 100%; background: #000; border-radius: var(--r-s); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Community ---------- */
.cmsg { display: flex; gap: 10px; padding: 7px 0; }
.cmsg .avatar { flex: none; }
.cmsg b { font-size: 13px; }
.cmsg .txt { font-size: 14px; overflow-wrap: anywhere; }
.idea img { width: 100%; border-radius: var(--r-s); border: 1px solid var(--line); margin: 8px 0; }

/* ---------- Plans ---------- */
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan.cur { border-color: var(--gold); }
.plan .price { font-size: 30px; font-weight: 700; }
.plan ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.plan li { padding: 4px 0; display: flex; gap: 8px; }
.plan li.no { color: var(--faint); }
.addr { word-break: break-all; font-size: 13px; background: var(--bg2); border: 1px dashed var(--line2); padding: 8px 10px; border-radius: var(--r-s); }

/* ---------- Lock ---------- */
.lock-card { text-align: center; padding: 34px 18px; }
.lock-card svg { width: 34px; height: 34px; color: var(--gold); margin-bottom: 8px; }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 9, 18, .66); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; position: relative; }
.modal.wide { max-width: 860px; }
.modal-x { position: absolute; right: 10px; top: 10px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; width: 32px; height: 32px; }
.modal h2 { padding-right: 30px; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--panel); border: 1px solid var(--line2); border-left: 3px solid var(--gold); border-radius: 9px; padding: 10px 13px; box-shadow: var(--shadow); font-size: 13.5px; animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--down); }
.toast.ok { border-left-color: var(--up); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.menu { position: absolute; right: 12px; top: 50px; z-index: 70; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); min-width: 230px; padding: 6px; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: 13.5px var(--font); cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--panel2); text-decoration: none; }
.loader { width: 22px; height: 22px; border: 2px solid var(--line2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: var(--panel2); border-radius: 6px; min-height: 16px; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { 50% { opacity: .5; } }

.overlay-full { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; text-align: center; padding: 20px; }

/* heat colors for tables */
.heat { border-radius: 4px; padding: 3px 6px; display: inline-block; min-width: 46px; text-align: center; font-weight: 600; font-size: 12.5px; }

/* ---------- Command center (TV mode) ---------- */
.cc { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: 1fr 1fr auto; gap: 10px; height: calc(100vh - var(--top) - 24px); padding: 12px; }
.cc .card { overflow: hidden; display: flex; flex-direction: column; }
.cc .viz3d { height: 100%; min-height: 0; border: 0; }
.tape { overflow: hidden; white-space: nowrap; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 8px 0; grid-column: 1 / -1; }
.tape-in { display: inline-block; padding-left: 100%; animation: tape 80s linear infinite; }
.tape-in span { margin-right: 28px; font-size: 14px; }
@keyframes tape { to { transform: translateX(-100%); } }

/* ---------- Landing ---------- */
.land { min-height: 100vh; display: flex; flex-direction: column; }
.land-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; gap: 12px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 30px; align-items: center; padding: 30px 28px 50px; max-width: 1320px; margin: 0 auto; width: 100%; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 4.4vw, 54px); line-height: 1.08; letter-spacing: -.01em; margin-bottom: 18px; }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 52ch; margin-bottom: 24px; line-height: 1.6; }
.hero-globe { position: relative; aspect-ratio: 1 / 1; max-height: 620px; width: 100%; }
.hero-globe canvas { width: 100% !important; height: 100% !important; }
.hero-card { position: absolute; right: 4%; bottom: 8%; max-width: 330px; }
.ticker { display: flex; gap: 26px; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 28px; white-space: nowrap; font-size: 13.5px; }
.feat { max-width: 1320px; margin: 0 auto; padding: 40px 28px; width: 100%; }
.feat h2 { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin-bottom: 20px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.feat-grid > div { padding: 18px 20px 20px 0; border-bottom: 1px solid var(--line); }
.feat-grid h3 { font-size: 15px; margin-bottom: 6px; }
.feat-grid p { color: var(--muted); margin: 0; font-size: 14px; }
.foot { margin-top: auto; padding: 22px 28px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  :root { --wl: 260px; }
  .chart-side { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--rail) minmax(0, 1fr) 0; }
  .wl { display: none; }
  .app.wl-on .wl { display: flex; position: fixed; right: 0; top: var(--top); bottom: 0; width: 300px; z-index: 50; box-shadow: var(--shadow); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-side { grid-template-columns: 1fr; }
  .cc { grid-template-columns: 1fr 1fr; grid-template-rows: auto; height: auto; }
  .cc .viz3d { height: 380px; }
}
@media (max-width: 900px) {
  :root { --top: 52px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top) minmax(0, 1fr) 58px; }
  .rail { display: none; }
  .top { padding: 0 10px; gap: 8px; }
  .top .brand span.txt { display: none; }
  .markets button { padding: 5px 7px; font-size: 12px; }
  .cmd { flex: 1 1 0; min-width: 0; }
  .cmd input { padding-left: 30px; font-size: 13px; }
  .top-r { flex: none; }
  .top-r .hide-m { display: none; }
  .ubtn > span:not(.avatar) { display: none; }
  .ubtn { padding: 2px; }
  .bnav { display: flex; grid-column: 1 / -1; border-top: 1px solid var(--line); background: var(--bg2); padding-bottom: env(safe-area-inset-bottom); }
  .bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 10.5px; text-decoration: none; }
  .bnav a svg { width: 21px; height: 21px; }
  .bnav a.on { color: var(--gold2); }
  .app.wl-on .wl { top: var(--top); bottom: 58px; width: 100%; }
  .page { padding: 12px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .multi { height: auto; }
  .multi.n2, .multi.n4, .multi.n6 { grid-template-columns: 1fr; grid-template-rows: none; }
  .multi .chart-wrap { height: 420px; }
  .chart-wrap { min-height: 420px; }
  .viz3d { height: 62vh; }
  .chat { height: calc(100dvh - var(--top) - 58px - 120px); }
  .msg { max-width: 92%; }
  .ev-row { grid-template-columns: 52px 1fr auto; }
  .ev-row .evc { display: none; }
  .hero { grid-template-columns: 1fr; padding: 16px; }
  .hero-card { position: static; max-width: none; margin-top: 10px; }
  .land-top { padding: 12px 16px; }
  .feat { padding: 26px 16px; }
  .feat-grid { grid-template-columns: 1fr; }
  .cc { grid-template-columns: 1fr; }
  .toasts { bottom: 70px; }
  .modal { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .tape-in { animation: none; padding-left: 0; }
}

/* ---------- Armenian: words are long and the script is wide — give them more room ---------- */
html:lang(hy) .app { --rail: 104px; }
html:lang(hy) .rail a { font-size: 10px; padding-left: 4px; padding-right: 4px; }
.rail a span { max-width: 100%; overflow-wrap: break-word; }
html:lang(hy) .card-h h3, html:lang(hy) .card h3 { overflow-wrap: break-word; }
html:lang(hy) .bnav a { font-size: 9.8px; text-align: center; line-height: 1.15; padding: 0 2px; }
