/* ============================================================
   ProfitData — market pages (index / ideas / news / heatmap)
   Block composition follows the MetaTrader reference layout.
   Tokens come from common.css; nothing is redefined here.
   ============================================================ */

body.mt-page {
  padding-top: calc(var(--header-h) + 36px);   /* header + sub-bar */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.mt-wrap { max-width: 1560px; margin: 0 auto; padding: 0 16px 40px; }
body.mt-page.no-sub { padding-top: var(--header-h); }

/* ── Secondary nav bar, pinned under the main header ── */
.mt-subbar {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 199;
  height: 36px; background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; overflow-x: auto; scrollbar-width: none;
}
.mt-subbar::-webkit-scrollbar { display: none; }
.mt-subbar-inner {
  max-width: 1560px; width: 100%; margin: 0 auto; padding: 0 16px;
  display: flex; gap: 18px; white-space: nowrap;
}
.mt-sublink { font-size: 12px; color: var(--text2); }
.mt-sublink:hover { color: var(--text); }

/* ── Page head: title + asset-class tabs + timeframe pills ── */
.mt-head { padding: 18px 0 12px; }
.mt-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 4px; }
.mt-head p  { font-size: 13px; color: var(--text2); max-width: 720px; line-height: 1.6; }

.mt-controls {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.mt-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mt-tabs::-webkit-scrollbar { display: none; }
.mt-tab {
  padding: 6px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 500;
  color: var(--text2); background: none; border: none; cursor: pointer;
  white-space: nowrap; font-family: var(--font); transition: all .12s;
}
.mt-tab:hover { color: var(--text); background: var(--bg2); }
.mt-tab.active { color: var(--text); background: var(--bg3); font-weight: 600; }

.mt-tf { display: flex; gap: 2px; margin-left: auto; background: var(--bg2); border-radius: 7px; padding: 2px; }
.mt-tf button {
  padding: 4px 10px; border-radius: 5px; font-size: 11.5px; font-weight: 500;
  color: var(--text2); background: none; border: none; cursor: pointer; font-family: var(--font);
}
.mt-tf button:hover { color: var(--text); }
.mt-tf button.active { background: var(--bg4); color: var(--text); font-weight: 600; }

/* ── Featured instrument strip ── */
.mt-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr);
  gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 14px;
}
.mt-strip::-webkit-scrollbar { display: none; }
.mt-fav {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; cursor: pointer; transition: border-color .12s;
}
.mt-fav:hover { border-color: var(--text3); }
.mt-fav-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.mt-fav-badge {
  width: 22px; height: 22px; border-radius: 50%; background: var(--bg4);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: var(--text2); flex-shrink: 0;
}
.mt-fav-name { font-size: 12px; font-weight: 600; }
.mt-fav-price { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-fav-chg { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Main 3-column grid: screener | chart + ideas | side widgets ── */
.mt-grid {
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 14px; align-items: start;
}
.mt-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ── Panel ── */
.mt-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.mt-panel-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.mt-panel-hd h2 { font-size: 12.5px; font-weight: 600; letter-spacing: .1px; }
.mt-panel-hd a  { font-size: 11.5px; color: var(--text2); }
.mt-panel-hd a:hover { color: var(--accent); }
.mt-panel-bd { padding: 4px 0; }
.mt-panel-bd.pad { padding: 12px; }

.mt-mini-tabs { display: flex; gap: 2px; }
.mt-mini-tabs button {
  padding: 3px 8px; border-radius: 5px; font-size: 11px; color: var(--text2);
  background: none; border: none; cursor: pointer; font-family: var(--font);
}
.mt-mini-tabs button.active { background: var(--bg4); color: var(--text); font-weight: 600; }

/* ── Tables (screener, watchlist) ── */
.mt-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.mt-tbl th {
  text-align: right; font-weight: 500; color: var(--text3); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .4px; padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.mt-tbl th:first-child, .mt-tbl td:first-child { text-align: left; padding-left: 12px; }
.mt-tbl td {
  text-align: right; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mt-tbl tbody tr { cursor: pointer; }
.mt-tbl tbody tr:hover { background: var(--bg3); }
.mt-tbl tbody tr:last-child td { border-bottom: none; }
.mt-sym { display: flex; align-items: center; gap: 8px; }
.mt-sym-badge {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg4);
  display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; color: var(--text2); flex-shrink: 0;
}
.mt-sym-name { font-weight: 600; font-size: 12px; }
.mt-sym-sub  { font-size: 10px; color: var(--text3); }
.mt-snap { color: var(--text3); font-size: 11px; }

/* ── Centre chart block ── */
.mt-chart-hd {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.mt-chart-sym { font-size: 15px; font-weight: 700; }
.mt-chart-price { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-chart-chg { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mt-chart-picker {
  margin-left: auto; background: var(--bg3); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px; font-size: 11.5px; font-family: var(--font); cursor: pointer;
}
.mt-chart-canvas { width: 100%; height: 340px; display: block; }

.mt-chip {
  font-size: 10px; font-weight: 600; letter-spacing: .2px; padding: 2px 7px;
  border-radius: 4px; background: var(--bg4); color: var(--text2); white-space: nowrap;
}
.mt-chip.sym { background: var(--bg4); color: var(--text); }
.mt-chip.signal   { background: rgba(23,199,132,.14); color: var(--green); }
.mt-chip.forecast { background: rgba(59,130,246,.14); color: var(--accent); }
.mt-chip.macro    { background: rgba(232,184,75,.14); color: var(--yellow); }
.mt-chip.event    { background: rgba(234,58,75,.14);  color: var(--red); }
.mt-chip.tech     { background: rgba(255,255,255,.06); color: var(--text2); }
.mt-chip.pulse    { background: rgba(255,255,255,.06); color: var(--text2); }
.mt-chip.flows    { background: rgba(59,130,246,.10); color: var(--accent); }
.mt-chip.news     { background: rgba(232,184,75,.14); color: var(--yellow); }

/* ── News wire ── */
.mt-sources {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.mt-sources::-webkit-scrollbar { display: none; }
.mt-source {
  display: flex; align-items: center; gap: 7px; padding: 5px 11px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 20px;
  font-size: 11.5px; color: var(--text2); cursor: pointer; white-space: nowrap; font-family: var(--font);
}
.mt-source:hover { color: var(--text); border-color: var(--text3); }
.mt-source.active { background: var(--bg4); color: var(--text); font-weight: 600; }
.mt-source-dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--bg4);
  display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700;
}

.mt-newsrow {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.mt-newsrow:hover { background: var(--bg3); }
.mt-newsrow:last-child { border-bottom: none; }
.mt-news-time { font-size: 11.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.mt-news-main { min-width: 0; }
.mt-news-title { font-size: 13px; font-weight: 500; line-height: 1.45; color: var(--text); }
.mt-news-title:hover { color: var(--accent); }
.mt-news-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.mt-news-src { font-size: 11px; color: var(--text3); }
.mt-news-sum {
  font-size: 12px; color: var(--text2); line-height: 1.5; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mt-badge-breaking {
  font-size: 9.5px; font-weight: 700; letter-spacing: .3px; padding: 2px 6px;
  border-radius: 3px; background: rgba(234,58,75,.16); color: var(--red);
}
.mt-impact { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: var(--bg4); color: var(--text2); }
.mt-impact.high { background: rgba(232,184,75,.16); color: var(--yellow); }

/* ── Heatmap ── */
.mt-hm { display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; }
.mt-tile {
  position: relative; border-radius: 4px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px; text-align: center; min-width: 0;
}
.mt-tile:hover { outline: 1px solid var(--text2); outline-offset: -1px; }
.mt-tile.neutral { background: var(--bg3); border: 1px solid var(--border); }
.mt-tile.neutral .mt-tile-sym,
.mt-tile.neutral .mt-tile-pct { color: var(--text); }
.mt-tile.neutral .mt-tile-pct.sub { color: var(--text3); }
.mt-tile-sym { font-weight: 700; color: #fff; line-height: 1.1; }
.mt-tile-pct { color: rgba(255,255,255,.9); font-variant-numeric: tabular-nums; line-height: 1.2; }
.mt-hm-legend {
  display: flex; align-items: center; gap: 10px; padding: 12px 0 0;
  font-size: 11px; color: var(--text3);
}
.mt-hm-scale { display: flex; height: 10px; border-radius: 3px; overflow: hidden; width: 220px; }
.mt-hm-scale i { flex: 1; }

/* ── Shared bits ── */
.mt-note {
  font-size: 11.5px; color: var(--text3); line-height: 1.6;
  padding: 10px 12px; background: var(--bg2); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.mt-empty { padding: 22px 12px; text-align: center; color: var(--text3); font-size: 12px; }
.mt-skel { padding: 22px 12px; text-align: center; color: var(--text3); font-size: 12px; }

/* ── Footer ── */
.mt-footer { border-top: 1px solid var(--border); background: var(--bg2); margin-top: 30px; }
.mt-footer-cols {
  max-width: 1560px; margin: 0 auto; padding: 26px 16px 18px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px;
}
.mt-footer-cols h4 {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text3); margin-bottom: 9px;
}
.mt-footer-cols a { display: block; font-size: 12.5px; color: var(--text2); padding: 3px 0; }
.mt-footer-cols a:hover { color: var(--text); }
.mt-footer-legal {
  max-width: 1560px; margin: 0 auto; padding: 12px 16px 26px;
  border-top: 1px solid var(--border); display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text3);
}
.mt-footer-legal p { max-width: 760px; line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════
   Market-page surface — the palette itself lives in pd-theme.css,
   shared with the platform. Only what is specific to these content
   pages stays here: the wider radius and the ambient wash.
   ══════════════════════════════════════════════════════════════ */
body.mt-page { --radius: 14px; }

/* The draft's signature ambient wash — content pages only, not the workspace */
body.mt-page::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 12% -8%, rgba(99,102,241,.14), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(34,211,238,.10), transparent 55%);
}

body.mt-page .mt-subbar {
  background: var(--surface);
  backdrop-filter: blur(14px);
}

/* Cards lift off the ground rather than sinking into it */
.mt-panel { box-shadow: var(--shadow); transition: border-color .16s; }
.mt-panel:hover { border-color: var(--border-hi); }
.mt-fav {
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .16s, border-color .16s;
}
.mt-fav:hover { border-color: var(--border-hi); transform: translateY(-2px); }

/* Pills go fully round and take the gradient when active */
.mt-tab { border-radius: 999px; }
.mt-tab:hover:not(.active) { background: var(--bg2); color: var(--text); }
.mt-tab.active { background: var(--grad); color: #fff; }
.mt-tf { background: var(--bg2); border: 1px solid var(--border); border-radius: 999px; }
.mt-tf button { border-radius: 999px; }
.mt-tf button.active { background: var(--grad); color: #fff; }
.mt-source.active { background: var(--grad); color: #fff; border-color: transparent; }
.mt-source.active .mt-source-dot { background: rgba(255, 255, 255, .22); color: #fff; }

/* Chip colours follow the draft's tag vocabulary */
.mt-chip.sym      { color: #0d8ba1; background: rgba(34,184,207,.1); font-weight: 700; }
.mt-chip.signal   { color: #15803d; background: rgba(22,163,74,.12); }
.mt-chip.forecast,
.mt-chip.flows    { color: var(--accent); background: rgba(109,94,252,.1); }
.mt-chip.macro,
.mt-chip.news     { color: #b45309; background: rgba(234,179,8,.14); }
.mt-chip.event    { color: #be123c; background: rgba(225,29,72,.12); }
.mt-chip.tech,
.mt-chip.pulse    { color: var(--text2); background: var(--bg4); }

/* Rows tint faintly and headlines pick up the accent, as in the draft */
.mt-newsrow:hover,
.mt-tbl tbody tr:hover { background: var(--hover); }
.mt-newsrow:hover .mt-news-title { color: var(--accent); }

/* Hero type */
.mt-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.mt-head p  { font-size: 14.5px; }

.mt-footer { background: var(--surface); }
.mt-note { background: var(--bg2); border-style: solid; box-shadow: var(--shadow); }

/* ══════════════════════════════════════════════════════════════
   Home layout — two columns, left one wider
   ══════════════════════════════════════════════════════════════ */
.mt-two {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px; align-items: start; padding-top: 16px;
}
.mt-side { position: sticky; top: calc(var(--header-h) + 46px); }

/* Markets bar sits inside the chart card */
.mt-mkt-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.mt-mkt-bar .mt-tabs { gap: 2px; }
.mt-tf.small button { padding: 3px 9px; font-size: 11px; }

/* Featured strip becomes a row of selectable buttons */
.mt-strip {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  padding: 0; border-bottom: 1px solid var(--border);
}
.mt-fav {
  flex: 1 0 auto; min-width: 150px; text-align: left; cursor: pointer;
  background: none; border: none; border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none;
  padding: 10px 14px; font-family: var(--font); transition: background .14s;
}
.mt-fav:hover { background: var(--bg3); transform: none; border-color: var(--border); border-bottom-color: transparent; }
.mt-fav.active { border-bottom-color: var(--accent); background: rgba(109,94,252,.05); }
.mt-fav-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.mt-fav-chg { margin-left: auto; font-size: 11px; }
.mt-fav-price { display: block; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Screener ── */
.mt-scr-wrap { overflow-x: auto; }
.mt-scr { min-width: 780px; font-size: 12.5px; }
.mt-scr th.num, .mt-scr td.num { width: 34px; text-align: left; color: var(--text3); }
.mt-scr th.spark, .mt-scr td.spark { width: 124px; text-align: right; }
.mt-scr td.spark canvas { width: 110px; height: 30px; vertical-align: middle; }
.mt-sym-icon { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.mt-scr .mt-sym-name { font-size: 12.5px; }

/* ── Heatmap (platform treemap) ── */
.hm2 { position: relative; }
.hm2-grid { position: relative; width: 100%; height: 100%; }
/* Cell chrome copied from the platform (.hm-cell in css/platform.css):
   labels pinned top-left, hairline separators, size/position animated. */
.hm2-cell {
  position: absolute; overflow: hidden;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-start;
  padding: 3px 5px; border: 0.5px solid #ccc;
  transition: left .4s, top .4s, width .4s, height .4s, background .4s;
}
.hm2-cell:hover { filter: brightness(1.25); z-index: 2; }
.hm2-sym   { font-weight: 700; color: #fff; line-height: 1.2; white-space: nowrap; }
.hm2-pct   { font-weight: 600; color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }
.hm2-price { color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; }
.hm2-tip {
  position: absolute; z-index: 20; min-width: 210px; pointer-events: none;
  background: var(--bg2); border: 1px solid var(--border-hi); border-radius: 9px;
  padding: 9px 11px; box-shadow: var(--shadow); opacity: 0; transition: opacity .12s;
}
.hm2-tip.show { opacity: 1; }
.hm2-tip-sym { font-size: 13px; font-weight: 700; }
.hm2-tip-sym span { font-weight: 500; color: var(--text2); font-size: 11.5px; }
.hm2-tip-price { font-size: 15px; font-weight: 600; margin: 3px 0 5px; font-variant-numeric: tabular-nums; }
.hm2-tip-row { display: flex; gap: 10px; font-size: 11px; font-variant-numeric: tabular-nums; }
.hm2-tip-row.muted { color: var(--text3); margin-top: 3px; }

/* ── Watchlist (ported from the platform widget) ── */
.wl2-tabs { display: flex; gap: 2px; padding: 8px 10px 6px; border-bottom: 1px solid var(--border); }
.wl2-tab {
  padding: 4px 11px; border-radius: 999px; border: none; background: none;
  font-size: 11.5px; font-weight: 500; color: var(--text2);
  cursor: pointer; font-family: var(--font);
}
.wl2-tab:hover { color: var(--text); }
.wl2-tab.active { background: var(--grad); color: #fff; font-weight: 600; }
.wl2-head, .wl2-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 50px 74px 62px;
  align-items: center; gap: 8px; padding: 7px 12px;
}
.wl2-head {
  font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text3); border-bottom: 1px solid var(--border);
}
.wl2-head span:not(:first-child), .wl2-row > span:not(:first-child) { text-align: right; }
.wl2-row { border-bottom: 1px solid var(--border); transition: background .12s; }
.wl2-row:last-child { border-bottom: none; }
.wl2-row:hover { background: var(--hover); }
.wl2-sym { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wl2-sym img { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.wl2-sym b { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.wl2-sym i {
  display: block; font-style: normal; font-size: 10px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 118px;
}
.wl2-spark { width: 50px; height: 24px; }
.wl2-last { font-size: 12px; font-variant-numeric: tabular-nums; }
.wl2-chg  { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Sidebar news ── */
.mt-side-news { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.mt-side-news:last-child { border-bottom: none; }
.mt-side-news:hover { background: var(--hover); }
.mt-side-news-title { display: block; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--text); }
.mt-side-news:hover .mt-side-news-title { color: var(--accent); }
.mt-side-news-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.mt-side-news-time { margin-left: auto; font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }

/* ── Community placeholder ── */
.mt-forum-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 12px; border-bottom: 1px solid var(--border);
}
.mt-forum-icon { font-size: 13px; opacity: .45; line-height: 1.4; }
.mt-forum-main { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.mt-skel-bar { height: 9px; border-radius: 5px; background: var(--bg3); display: block; }
.mt-skel-bar.sm { height: 7px; background: var(--bg4); }
.mt-forum-note { padding: 11px 12px; font-size: 11.5px; color: var(--text3); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   Idea tiles — cover is the article's own chart
   ══════════════════════════════════════════════════════════════ */
.mt-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px;
}
/* Home page: two ideas side by side, as in the reference's Charts & Ideas block */
.mt-tiles.home { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 14px; }

.mt-tile-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.mt-tile-card:hover {
  border-color: var(--border-hi); box-shadow: 0 12px 30px rgba(20,20,60,.08); transform: translateY(-2px);
}
.mt-tile-cover {
  display: block; aspect-ratio: 2 / 1; overflow: hidden;
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
.mt-tile-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.mt-tile-cover.blank { display: grid; place-items: center; }
.mt-tile-cover.blank::after {
  content: "no chart"; font-size: 11px; color: var(--text3); letter-spacing: .04em;
}

.mt-tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.mt-tile-inst { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.mt-tile-icon { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.mt-tile-icon.badge {
  display: grid; place-items: center; background: var(--bg4);
  font-size: 9px; font-weight: 700; color: var(--text2);
}
/* Имя жмётся, цена — нет. Без этого на узкой плитке цена наезжала на тикер:
   у флекса по умолчанию оба элемента ужимаются, но текст внутри не переносится. */
.mt-tile-names { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.mt-tile-names b {
  display: block; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-tile-names i {
  display: block; font-style: normal; font-size: 10.5px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-tile-price {
  margin-left: auto; flex: 0 0 auto; font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--text2);
}
.mt-side {
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.mt-side.long  { color: #15803d; background: rgba(22,163,74,.12); }
.mt-side.short { color: #be123c; background: rgba(225,29,72,.12); }

.mt-tile-title {
  display: block; font-size: 15px; font-weight: 600; line-height: 1.34;
  letter-spacing: -.01em; color: var(--text);
}
.mt-tile-card:hover .mt-tile-title { color: var(--accent); }
.mt-tile-text {
  margin: 8px 0 0; font-size: 12.5px; color: var(--text2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mt-tile-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; padding-top: 12px;
}
.mt-tile-avatar {
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .3px;
  flex-shrink: 0;
}
.mt-tile-author { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.mt-tile-author b {
  display: block; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-tile-author i { display: block; font-style: normal; font-size: 10.5px; color: var(--text3); }
.mt-tile-foot .mt-chip { margin-left: auto; flex: 0 0 auto; }

/* ── Ideas page: category rail + tiles ── */
.mt-ideas-layout {
  display: grid; grid-template-columns: 210px minmax(0, 1fr);
  gap: 26px; align-items: start; padding-top: 18px;
}
.mt-rail { position: sticky; top: calc(var(--header-h) + 48px); display: flex; flex-direction: column; gap: 18px; }
.mt-rail-link {
  display: block; padding: 7px 11px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text2);
}
.mt-rail-link:hover { background: var(--bg2); color: var(--text); }
.mt-rail-link.active { background: var(--bg2); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.mt-rail-link.sm { font-size: 12px; padding: 5px 11px; }
.mt-rail-block h4 {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text3); padding: 0 11px 6px;
}

/* ══════════════════════════════════════════════════════════════
   TradingView-shaped surfaces: markets rails, symbol page, watchlist
   ══════════════════════════════════════════════════════════════ */
.mt-wrap.narrow { max-width: 1120px; }

/* ── Section header + segmented control ── */
.tv-sec { padding: 26px 0 4px; }
.tv-sec-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px;
}
.tv-sec-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.tv-sec-head h2 a { color: var(--text); }
.tv-sec-head h2 a:hover { color: var(--accent); }
.tv-chev { color: var(--text3); font-weight: 400; }
.tv-seg {
  display: flex; gap: 2px; margin-left: auto; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px;
}
.tv-seg button {
  padding: 4px 12px; border: none; border-radius: 999px; background: none;
  font: 500 12px var(--font); color: var(--text2); cursor: pointer; white-space: nowrap;
}
.tv-seg button:hover { color: var(--text); }
.tv-seg button.active { background: var(--grad); color: #fff; font-weight: 600; }

/* ── Horizontal instrument rail ── */
.tv-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 186px;
  gap: 10px; overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: 8px; scrollbar-width: thin;
}
.tv-rail.wide { grid-auto-columns: 320px; }
.tv-rail::-webkit-scrollbar { height: 6px; }
.tv-rail::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

.tv-card {
  display: flex; flex-direction: column; gap: 4px; scroll-snap-align: start;
  padding: 12px 13px 8px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: border-color .16s, transform .16s;
}
.tv-card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.tv-card-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tv-card-icon {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: var(--bg4);
  font-size: 8.5px; font-weight: 700; color: var(--text2); overflow: hidden;
}
.tv-card-icon img { width: 100%; height: 100%; display: block; }
.tv-card-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-card-price { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-card-price small { font-size: 10px; font-weight: 500; color: var(--text3); margin-left: 4px; }
.tv-card-chg { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tv-card-spark { width: 100%; height: 42px; display: block; margin-top: 2px; }

/* ── News rows ── */
.tv-news { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tv-news:last-of-type { border-bottom: none; }
.tv-news-meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text3); margin-bottom: 5px;
}
.tv-news-title { display: block; font-size: 15px; font-weight: 500; line-height: 1.42; color: var(--text); }
.tv-news:hover .tv-news-title { color: var(--accent); }

/* News thumbnail — only rendered when the article actually publishes one.

   Картинка дописывается в конец ссылки уже после отрисовки, поэтому у сетки
   ОБЯЗАТЕЛЬНО должны быть именованные области. Без них автопоток раскладывал
   детей по порядку: заголовок уезжал в узкую колонку под картинку и рвался по
   одному слову в строке, а сама картинка падала на вторую строку. */
.tv-news { position: relative; }
.tv-news.has-thumb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  grid-template-areas: "meta  thumb"
                       "title thumb";
  gap: 4px 14px; align-items: start; align-content: start;
}
.tv-news.has-thumb > .tv-news-meta  { grid-area: meta; margin-bottom: 0; }
.tv-news.has-thumb > .tv-news-title { grid-area: title; }
.tv-news.has-thumb > .tv-news-thumb { grid-area: thumb; align-self: start; }

.tv-news-thumb {
  width: 108px; height: 68px; border-radius: 8px; object-fit: cover; display: block;
  background: var(--bg3); border: 1px solid var(--border);
}

/* Лента новостей: время · текст · «сколько назад» · картинка */
.mt-newsrow { grid-template-areas: "time main ago"; }
.mt-newsrow.has-thumb {
  grid-template-columns: 52px minmax(0, 1fr) 108px auto;
  grid-template-areas: "time main thumb ago";
}
.mt-newsrow > .mt-news-time:first-child   { grid-area: time; }
.mt-newsrow > .mt-news-main               { grid-area: main; }
.mt-newsrow > .mt-news-time:last-of-type  { grid-area: ago; }
.mt-newsrow > .tv-news-thumb              { grid-area: thumb; align-self: center; }

@media (max-width: 620px) {
  .tv-news.has-thumb { grid-template-columns: minmax(0, 1fr) 92px; gap: 4px 12px; }
  .tv-news-thumb { width: 92px; height: 58px; }
}

/* ── Economic calendar rows ── */
.tv-cal {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--border);
}
.tv-cal-when b { display: block; font-size: 12.5px; font-weight: 600; }
.tv-cal-when i {
  display: block; font-style: normal; font-size: 11.5px; color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.tv-cal-main b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.tv-cal-main i { font-style: normal; font-size: 12.5px; color: var(--text2); line-height: 1.5; }
.tv-cal-impact {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 5px; background: var(--bg4); color: var(--text2);
}
.tv-cal-impact.high { background: rgba(225,29,72,.12); color: var(--red); }
.tv-cal-impact.medium { background: rgba(212,150,10,.14); color: #b45309; }
.tv-cal-note { padding: 12px 0 0; font-size: 11.5px; color: var(--text3); line-height: 1.6; }

/* ══════════════ Symbol page ══════════════ */
.tv-head { display: flex; align-items: center; gap: 12px; padding: 24px 0 6px; }
.tv-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.tv-head-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center; background: var(--bg4);
  font-size: 12px; font-weight: 700; color: var(--text2);
}
.tv-head-icon img { width: 100%; height: 100%; display: block; }
.tv-head-sub { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text3); margin-top: 2px; }
.tv-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.tv-dot.off { background: var(--text3); }
.tv-cta { margin-left: auto; }

.tv-price { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; padding: 6px 0 10px; }
.tv-price-main { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tv-price-cur { font-size: 13px; color: var(--text3); font-weight: 500; }
.tv-price-chg { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-price-period { font-size: 13px; color: var(--text3); }

.tv-chart { width: 100%; height: 320px; display: block; }
.tv-ranges { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 6px 0 14px; }
.tv-ranges::-webkit-scrollbar { display: none; }
.tv-ranges button {
  padding: 5px 13px; border: none; border-radius: 8px; background: none;
  font: 500 12.5px var(--font); color: var(--text2); cursor: pointer;
}
.tv-ranges button:hover { color: var(--text); background: var(--bg2); }
.tv-ranges button.active { background: var(--bg3); color: var(--text); font-weight: 600; }

.tv-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tv-tab {
  padding: 9px 15px; border: none; background: none; border-bottom: 2px solid transparent;
  font: 500 14px var(--font); color: var(--text2); cursor: pointer;
}
.tv-tab:hover { color: var(--text); }
.tv-tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.tv-pane { padding-bottom: 30px; }
.tv-flash {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin-bottom: 20px;
  background: rgba(109,94,252,.07); border: 1px solid rgba(109,94,252,.18);
  border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--text);
}
.tv-flash:hover { border-color: var(--accent); }
.tv-flash-bolt { flex-shrink: 0 }

.tv-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.tv-h2 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; }

.tv-kv-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.tv-kv-row span { color: var(--text2); }
.tv-kv-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-range { padding-top: 14px; }
.tv-range-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 8px; }
.tv-range-head span { color: var(--text2); }
.tv-range-head b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-range-bar {
  position: relative; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--red), var(--bg4), var(--green));
}
.tv-range-bar i {
  position: absolute; top: -4px; width: 3px; height: 12px; border-radius: 2px;
  background: var(--text); transform: translateX(-50%);
}

.tv-gauge { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.tv-tech-counts { display: flex; justify-content: center; gap: 26px; margin: 4px 0 12px; }
.tv-tech-counts span { text-align: center; font-size: 11.5px; color: var(--text3); }
.tv-tech-counts b { display: block; font-size: 17px; font-weight: 700; color: var(--text); }
.tv-tech-counts .sell b { color: var(--red); }
.tv-tech-counts .buy b  { color: var(--green); }
.tv-tech-note { font-size: 11.5px; color: var(--text3); line-height: 1.6; margin-bottom: 12px; }
.tv-tech-detail { border-top: 1px solid var(--border); }
.tv-tech-detail summary {
  padding: 10px 0; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text2);
}
.tv-tech-detail summary:hover { color: var(--text); }
.tv-tech-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 74px;
  gap: 10px; padding: 6px 0; font-size: 12.5px; align-items: center;
}
.tv-tech-row span { color: var(--text2); }
.tv-tech-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-tech-row i {
  font-style: normal; text-align: right; font-size: 11px; font-weight: 700;
  text-transform: capitalize;
}
.tv-tech-row i.buy { color: var(--green); }
.tv-tech-row i.sell { color: var(--red); }
.tv-tech-row i.neutral { color: var(--text3); }

/* ══════════════ Watchlist ══════════════ */
.tv-wl { padding-top: 6px; }
.tv-wl-group { margin-bottom: 8px; }
.tv-wl-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 2px; border: none; background: none; cursor: pointer;
  font: 600 13px var(--font); color: var(--text2); text-align: left;
}
.tv-wl-head:hover { color: var(--text); }
.tv-wl-caret { display: inline-block; transition: transform .16s; color: var(--text3); }
.tv-wl-caret.closed { transform: rotate(-90deg); }
.tv-wl-count { margin-left: auto; font-weight: 500; color: var(--text3); }
.tv-wl-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--border);
}
.tv-wl-row:hover { background: var(--hover); }
.tv-wl-icon {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--bg4);
  font-size: 10px; font-weight: 700; color: var(--text2);
}
.tv-wl-icon img { width: 100%; height: 100%; display: block; }
.tv-wl-names b { display: block; font-size: 15px; font-weight: 600; }
.tv-wl-names i {
  display: block; font-style: normal; font-size: 12.5px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-wl-nums { text-align: right; }
.tv-wl-nums b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-wl-nums i {
  display: block; font-style: normal; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.tv-wl-nums i.up { color: var(--green); }
.tv-wl-nums i.down { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   Watchlist settings + the platform chart's bottom sheet
   ══════════════════════════════════════════════════════════════ */
.wl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.wl-settings-btn {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; margin-top: 8px;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-hi); background: var(--bg2); color: var(--text);
  font: 600 13px var(--font); box-shadow: var(--shadow);
}
.wl-settings-btn:hover { border-color: var(--accent); color: var(--accent); }
.wl-settings-btn svg { flex-shrink: 0; }

.wl-settings {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.wl-settings-grid {
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 26px; align-items: start;
}
.wl-settings h3 {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text3); margin-bottom: 9px;
}
.wl-toggle { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; cursor: pointer; }
.wl-toggle input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.wl-add { display: flex; gap: 8px; }
.wl-add input {
  flex: 1; min-width: 0; padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: 400 13px var(--font); outline: none;
}
.wl-add input:focus { border-color: var(--accent); }
.wl-add .btn { cursor: pointer; }

.wl-suggest { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.wl-suggest-item {
  display: flex; align-items: baseline; gap: 9px; padding: 6px 10px; border: none;
  border-radius: 8px; background: none; text-align: left; cursor: pointer;
  font: 600 13px var(--font); color: var(--text);
}
.wl-suggest-item:hover { background: var(--bg3); }
.wl-suggest-item i { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--text3); }

.wl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wl-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 10px;
  border-radius: 999px; background: var(--bg3); font-size: 11.5px; font-weight: 600; color: var(--text2);
}
.wl-chip button {
  border: none; background: none; cursor: pointer; color: var(--text3);
  font-size: 14px; line-height: 1; padding: 0 2px;
}
.wl-chip button:hover { color: var(--red); }
.wl-reset {
  margin-top: 14px; border: none; background: none; cursor: pointer; padding: 0;
  font: 500 12px var(--font); color: var(--text3); text-decoration: underline;
}
.wl-reset:hover { color: var(--text2); }

/* Watchlist rows gain a sparkline column when the setting is on */
.tv-wl-row { grid-template-columns: 36px minmax(0, 1fr) 62px auto; }
.tv-wl-spark { width: 58px; height: 26px; }
.tv-wl-names u { display: block; text-decoration: none; font-size: 11px; color: var(--text3); }

/* ── Bottom sheet ── */
.pchart-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(17, 22, 36, .42); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
}
.pchart-overlay[hidden] { display: none; }
.pchart-sheet {
  width: 100%; max-width: 880px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px 16px 0 0; box-shadow: 0 -12px 44px rgba(16,24,40,.24);
  animation: pchart-up .22s ease-out;
}
@keyframes pchart-up { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.pchart-handle {
  width: 38px; height: 4px; border-radius: 2px; background: var(--bg4);
  margin: 9px auto 4px; flex-shrink: 0;
}
.pchart-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 16px 10px; border-bottom: 1px solid var(--border);
}
.pchart-sym { font-size: 16px; font-weight: 700; }
.pchart-price { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pchart-pct { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pchart-pct.up { color: var(--green); }
.pchart-pct.down { color: var(--red); }
.pchart-close {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--text3); padding: 0 4px;
}
.pchart-close:hover { color: var(--text); }
.pchart-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
}
.pchart-tfs { display: flex; gap: 2px; background: var(--bg); border-radius: 999px; padding: 2px; }
.pchart-tfs button {
  padding: 4px 11px; border: none; border-radius: 999px; background: none; cursor: pointer;
  font: 500 11.5px var(--font); color: var(--text2);
}
.pchart-tfs button.active { background: var(--grad); color: #fff; font-weight: 600; }
.pchart-full { margin-left: auto; font-size: 12px; color: var(--text2); }
.pchart-full + .pchart-full { margin-left: 0; }
.pchart-full:hover { color: var(--accent); }
.pchart-body { flex: 1; min-height: 340px; height: 46vh; position: relative; }
.pchart-loading {
  display: grid; place-items: center; height: 100%; padding: 20px;
  font-size: 12.5px; color: var(--text3); text-align: center; line-height: 1.6;
}
body.pchart-open { overflow: hidden; }


/* The platform's chart panel, hosted on the symbol page */
.sym-workspace { height: 420px; display: flex; margin-bottom: 8px; }
.sym-workspace .ws-panel { flex: 1; min-width: 0; }
@media (max-width: 780px) { .sym-workspace { height: 320px; } }

/* Chart tab: the platform panel fills the viewport under the header */
#workspace.chart-only {
  display: flex; padding: 8px;
  height: calc(100vh - var(--header-h) - 8px);
}
#workspace.chart-only .ws-panel { flex: 1; min-width: 0; }


/* ── Indicator library ── */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lib-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 13px; box-shadow: var(--shadow);
}
.lib-card:hover { border-color: var(--border-hi); }
.lib-card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.lib-card h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.lib-card-top .mt-chip { margin-left: auto; }
.lib-card p { font-size: 13px; line-height: 1.55; color: var(--text2); min-height: 40px; }
.lib-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lib-cat {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: rgba(109,94,252,.12); padding: 3px 8px; border-radius: 5px;
}
[data-theme="black"] .lib-cat { background: rgba(30,124,199,.18); color: #6ab4ee; }
.lib-param {
  font-size: 10.5px; color: var(--text3); background: var(--bg3);
  padding: 3px 8px; border-radius: 5px; font-variant-numeric: tabular-nums;
}

/* ── Calendar page ── */
.cal-day { margin-bottom: 26px; }
.cal-day h3 {
  display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text2);
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.cal-today {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: none;
  color: var(--green); background: rgba(22,163,74,.14); padding: 2px 8px; border-radius: 999px;
}

/* ── Responsive ── */
@media (max-width: 1180px) {
  .mt-two { grid-template-columns: minmax(0, 1fr); }
  .mt-side { position: static; }
}
@media (max-width: 780px) {
  .tv-two { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .tv-price-main { font-size: 27px; }
  .tv-chart { height: 240px; }
  .tv-head h1 { font-size: 17px; }
  .tv-rail.wide { grid-auto-columns: 270px; }
}
@media (max-width: 900px) {
  /* Боковой фильтр на телефоне складывался в столбик из четырнадцати строк:
     прежде чем показать первую идею, страница прокручивала целый экран
     фильтров. Разворачиваем каждую группу в одну прокручиваемую полосу. */
  .mt-ideas-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .mt-rail { position: static; flex-direction: column; gap: 10px; }
  .mt-rail nav, .mt-rail-block, .mt-rail-block > div {
    display: flex; flex-wrap: nowrap; gap: 6px;
    overflow-x: auto; scrollbar-width: none;
  }
  /* Полоса тянется до краёв экрана, но не обрезает первую и последнюю кнопку. */
  .mt-rail nav, .mt-rail-block { margin: 0 -16px; padding: 2px 16px; }
  .mt-rail nav::-webkit-scrollbar,
  .mt-rail-block::-webkit-scrollbar,
  .mt-rail-block > div::-webkit-scrollbar { display: none; }
  .mt-rail-block { align-items: center; }
  .mt-rail-block > div { flex: 1 1 auto; min-width: 0; padding: 2px 0; }
  .mt-rail-block h4 { width: auto; flex: 0 0 auto; padding: 0 6px 0 0; white-space: nowrap; }
  .mt-rail-link {
    flex: 0 0 auto; white-space: nowrap;
    background: var(--bg2); border: 1px solid var(--border); border-radius: 999px;
    padding: 6px 13px;
  }
  .mt-rail-link.sm { padding: 5px 12px; }
  .mt-rail-link.active { border-color: var(--accent); color: var(--accent); }
  .mt-rail .mt-note { display: none; }
}
@media (max-width: 1280px) {
  .mt-grid { grid-template-columns: 268px minmax(0, 1fr); }
  .mt-col-right { grid-column: 1 / -1; }
  .mt-col-right { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
}
@media (max-width: 860px) {
  .mt-grid { grid-template-columns: minmax(0, 1fr); }
  .mt-col-right { grid-template-columns: minmax(0, 1fr); }
  .mt-tf { margin-left: 0; }
  .mt-chart-canvas { height: 260px; }
  .mt-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* «14:32» слева и «2h ago» справа — на узком экране это одно и то же
     дважды, и второе съедает ширину у заголовка. Оставляем часы. */
  .mt-newsrow { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "time main"; }
  .mt-newsrow.has-thumb {
    grid-template-columns: 44px minmax(0, 1fr) 84px;
    grid-template-areas: "time main thumb";
  }
  .mt-newsrow > .mt-news-time:last-of-type { display: none; }
}

/* ── Плитки идей на телефоне ──
   .mt-tiles.home держит две колонки жёстко: на 390 px это два обрезанных
   столбца вместо одной читаемой плитки. Ниже 720 px — одна колонка. */
@media (max-width: 720px) {
  .mt-tiles { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .mt-tiles.home { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 12px; }
  .mt-tile-title { font-size: 14.5px; }
  .mt-tile-foot { padding-top: 10px; }
}
