/* Crypto screener page */

.container-wide { max-width: 1400px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.scr-hero { padding: 28px 0 8px; }
.scr-hero h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; }
.scr-hero .lede { margin: 0; max-width: 820px; color: var(--muted); font-size: 16px; }
.scr { padding: 16px 0 8px; }

.scr-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.scr-presets .chip { cursor: pointer; font: 500 13px var(--font); padding: 5px 12px; }
.scr-presets .chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.scr-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.scr-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.scr-controls select, .scr-controls input[type="search"] {
  height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font: 13px var(--font);
}
.scr-controls input[type="search"] { width: 190px; }
.scr-controls select:focus, .scr-controls input:focus { outline: none; border-color: var(--accent); }
.scr-count { font-size: 13px; }
.scr-statusline { display: flex; align-items: center; gap: 12px; min-height: 28px; margin: 6px 0; }
.scr-statusline progress { width: 160px; height: 6px; accent-color: var(--accent); }

.scr-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); margin-bottom: 10px; }
.scr-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scr-table th {
  position: sticky; top: 0; z-index: 1; padding: 0; background: var(--panel-2);
  border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 500; text-align: left;
}
.scr-table th:not(:has(button)) { padding: 9px 12px; }
.scr-table th button {
  width: 100%; padding: 9px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer;
}
.scr-table th button:hover { color: var(--text); }
.scr-table th.num, .scr-table td.num { text-align: right; }
.scr-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); }
.scr-table tbody tr { cursor: pointer; }
.scr-table tbody tr:hover { background: var(--panel-2); }
.scr-table tbody tr:last-child td { border-bottom: 0; }
.scr-table td a { color: var(--text); text-decoration: none; }
.scr-table td a b { font-weight: 600; }
.scr-table .muted { color: var(--muted); }
.scr-table .up { color: var(--up); }
.scr-table .down { color: var(--down); }
.scr-table .hot { color: #e0a100; font-weight: 600; }
.scr-table .na { color: var(--muted); opacity: 0.6; }
.scr-empty { padding: 28px !important; text-align: center; color: var(--muted); }
.star-col { width: 34px; padding-right: 0 !important; }
.star { border: 0; background: none; color: var(--border-strong); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px; }
.star:hover { color: var(--muted); }
.star.on { color: #f0b429; }
.spark { width: 80px; height: 24px; display: block; }
.spark polyline { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark.up polyline { stroke: var(--up); }
.spark.down polyline { stroke: var(--down); }
.tag { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag-up { color: var(--up); background: rgba(8, 153, 129, 0.13); }
.tag-down { color: var(--down); background: rgba(242, 54, 69, 0.13); }
.tag-hot { color: #d49400; background: rgba(240, 180, 41, 0.15); }

@media (max-width: 760px) {
  .scr-controls input[type="search"] { width: 100%; order: 5; }
  .col-spark, .scr-table th:nth-child(3) { display: none; }
}

/* Chart widget builder */
.w-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.w-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.w-field { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; font-size: 13px; color: var(--muted); }
.w-field legend { padding: 0; margin-bottom: 4px; }
.w-field select, .w-field input {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text); font: 14px var(--font);
}
.w-field select:focus, .w-field input:focus { outline: none; border-color: var(--accent); }
.w-inds #w-inds { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.w-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.w-out { min-width: 0; }
.w-frame { display: block; width: 100%; height: 420px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.w-code-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 6px; font-size: 14px; }
.w-code { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); font: 12px/1.5 var(--mono); resize: vertical; }
@media (max-width: 860px) { .w-grid { grid-template-columns: 1fr; } }

/* Trading calculators */
.calc-toc { margin-top: 16px; }
.calcs { padding-bottom: 32px; }
.calc { padding: 28px 0 8px; scroll-margin-top: 72px; }
.calc h2 { margin: 0 0 4px; font-size: 22px; }
.calc > p { margin: 0 0 14px; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.calc-form, .calc-out { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.calc-field input, .calc-field select {
  height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text); font: 15px var(--font); font-variant-numeric: tabular-nums;
}
.calc-field input:focus, .calc-field select:focus { outline: none; border-color: var(--accent); }
.calc-out { min-height: 100%; font-variant-numeric: tabular-nums; }
.calc-out p { margin: 0; }
.calc-out-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.calc-out-row:last-child { border-bottom: 0; }
.calc-out-row span { color: var(--muted); }
.calc-out .up { color: var(--up); } .calc-out .down { color: var(--down); } .calc-out .warn { color: #e0a100; }
.calc-table { width: 100%; margin: 10px 0 0; border-collapse: collapse; font-size: 13.5px; }
.calc-table th, .calc-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.calc-table th:first-child, .calc-table td:first-child { text-align: left; color: var(--muted); }
.calc-table th { color: var(--muted); font-weight: 500; }
.calc-table tr.r td:not(:first-child) { color: var(--down); }
.calc-table tr.s td:not(:first-child) { color: var(--up); }
.calc-table tr.p td { font-weight: 700; }
@media (max-width: 860px) { .calc-grid, .calc-form { grid-template-columns: 1fr; } }

/* Crypto heatmap */
.hm-controls { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.hm-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.hm-controls .chip { cursor: pointer; font: 500 13px var(--font); padding: 5px 12px; }
.hm-controls .chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.hm-summary { margin: 6px 0 10px; font-size: 14px; color: var(--muted); min-height: 21px; }
.hm-summary .up { color: var(--up); } .hm-summary .down { color: var(--down); }
.hm { position: relative; height: min(72vh, 760px); min-height: 420px; border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.hm-cell {
  position: absolute; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.35); color: #fff; text-decoration: none; overflow: hidden; line-height: 1.15; text-align: center;
}
.hm-cell:hover { filter: brightness(1.18); z-index: 1; outline: 2px solid #fff; outline-offset: -2px; text-decoration: none; }
.hm-cell b { font-weight: 700; }
.hm-cell span { font-size: 0.72em; opacity: 0.95; }
.hm-cell small { font-size: 0.55em; opacity: 0.8; }
