:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1c2230; --line: #30363d; --line2: #21262d;
  --text: #e6edf3; --muted: #8b949e; --blue: #58a6ff;
  --green: #3fb950; --green-bg: rgba(63, 185, 80, .16); --green-hi: rgba(63, 185, 80, .34);
  --red: #f85149; --red-bg: rgba(248, 81, 73, .15); --red-hi: rgba(248, 81, 73, .33);
  --amber: #d29922; --amber-bg: rgba(210, 153, 34, .14);
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.pos { color: var(--green); } .neg { color: var(--red); } .muted { color: var(--muted); }
.small { font-size: 11px; } .r { text-align: right; } .c { text-align: center; }

/* header */
.top { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--panel);
       border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.logo { width: 22px; height: 22px; border-radius: 6px; display: inline-block;
        background: linear-gradient(135deg, var(--green) 0 50%, var(--red) 50% 100%); }
nav { display: flex; gap: 4px; }
nav a { color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 600; }
nav a:hover { color: var(--text); background: var(--line2); text-decoration: none; }
nav a.on { color: var(--text); background: #2d333b; }
.jump { margin-left: auto; }
.jump input, .search { background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 6px 10px; font-size: 13px; width: 210px; }
.jump input:focus, .search:focus { border-color: var(--blue); outline: none; }
.logout { color: var(--muted); font-size: 13px; }

/* health strip */
.health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 7px 20px;
  font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line2); background: #10151c; }
.health b { color: var(--text); }
.health em { font-style: normal; }
.health .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.health.ok .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.health.warn { background: var(--amber-bg); } .health.warn .dot { background: var(--amber); }
.health.bad { background: var(--red-bg); } .health.bad .dot { background: var(--red); }
.health .shown { color: #f2cc60; }
.health .eng { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.errs summary { cursor: pointer; color: var(--amber); }
.errs ul { margin: 6px 0; padding-left: 18px; color: var(--text); font-family: ui-monospace, monospace; font-size: 11.5px; }

main { padding: 18px 20px 30px; max-width: 1500px; margin: 0 auto; }
footer { color: var(--muted); font-size: 11.5px; text-align: center; padding: 16px 20px 26px; border-top: 1px solid var(--line2); }
h1 { font-size: 21px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 15px; color: var(--muted); margin: 26px 0 10px; font-weight: 600; }
.head .sub { color: var(--muted); margin: 0 0 14px; max-width: 900px; }
.arrow { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; }
.arrow.up { border-bottom: 13px solid var(--green); } .arrow.down { border-top: 13px solid var(--red); }

/* toolbar + chips */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 4px 0 12px; }
.chips { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.chips button { background: none; border: 0; color: var(--muted); padding: 5px 11px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.chips button span { color: var(--muted); font-weight: 400; margin-left: 3px; }
.chips button:hover { color: var(--text); }
.chips button.on { background: #2d333b; color: var(--text); }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
     padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
     position: sticky; top: 0; background: var(--panel); }
th[data-sort] { cursor: pointer; } th[data-sort]:hover { color: var(--text); }
th.asc::after { content: " \25B2"; font-size: 9px; } th.desc::after { content: " \25BC"; font-size: 9px; }
td { padding: 7px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
tbody tr:hover { background: var(--panel2); }
tbody tr:last-child td { border-bottom: 0; }
.sym { color: var(--text); font-weight: 700; }
.badge { font-size: 10px; font-weight: 700; color: var(--blue); border: 1px solid #1f6feb; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.badge.watch { color: var(--amber); border-color: var(--amber); }
.tf { display: inline-block; min-width: 30px; text-align: center; background: #2d333b; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.empty { color: var(--muted); padding: 34px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

/* mtf strip */
.mtf { display: inline-flex; align-items: center; gap: 3px; }
.mtf i { width: 11px; height: 14px; border-radius: 3px; background: #30363d; display: inline-block; }
.mtf i.bull { background: var(--green); } .mtf i.bear { background: var(--red); }
.mtf i.stale { opacity: .35; }
.mtf b { min-width: 26px; text-align: right; margin-left: 5px; }

/* grid cells */
table.grid td.cell { text-align: center; padding: 0; min-width: 66px; }
table.grid td.cell a { display: block; padding: 7px 6px; color: inherit; font-weight: 600; }
table.grid td.cell a:hover { text-decoration: none; filter: brightness(1.25); }
td.cell.bull { background: var(--green-bg); color: #7ee787; }
td.cell.bear { background: var(--red-bg); color: #ffa198; }
td.cell.neu { color: var(--muted); }
td.cell.fresh.bull { background: var(--green-hi); box-shadow: inset 0 0 0 2px var(--green); color: #fff; }
td.cell.fresh.bear { background: var(--red-hi); box-shadow: inset 0 0 0 2px var(--red); color: #fff; }
td.cell.stale { opacity: .45; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.05) 6px 12px); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; }
.card-h { font-weight: 700; margin-bottom: 7px; }
.split { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: #30363d; }
.split i.bull { background: var(--green); } .split i.bear { background: var(--red); }
.card-n { display: flex; gap: 12px; font-size: 12.5px; margin-top: 7px; }

/* coin page */
.coin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.coin-head h1 { font-size: 26px; margin-top: 4px; }
.coin-head .pair { color: var(--muted); font-size: 15px; font-weight: 400; }
.back { font-size: 12.5px; }
.back::before { content: "\2190  "; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; color: var(--muted); }
.facts .big { color: var(--text); font-size: 22px; font-weight: 700; }
.facts b { color: var(--text); }
.mtf-box { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 12px; }
.mtf-box .mtf i { width: 16px; height: 20px; } .mtf-box .mtf b { font-size: 18px; }
.tfpills { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pill { display: flex; flex-direction: column; gap: 1px; padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.pill:hover { text-decoration: none; border-color: var(--muted); }
.pill b { font-size: 15px; } .pill span { font-weight: 600; } .pill em { font-style: normal; color: var(--muted); font-size: 12px; }
.pill.bull span { color: var(--green); } .pill.bear span { color: var(--red); }
.pill.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.pill.fresh em { color: var(--amber); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); margin: 2px 4px 8px; align-items: center; }
.legend .lg { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.lg.bull { background: var(--green); } .lg.bear { background: var(--red); }
.tri { display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; margin-right: 6px; vertical-align: middle; }
.tri.up { border-bottom: 8px solid var(--green); } .tri.down { border-top: 8px solid var(--red); }
.chartbox { position: relative; }
#chart { width: 100%; display: block; }
.tip { position: absolute; top: 6px; left: 8px; background: rgba(13, 17, 23, .92); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 9px; font-size: 12px; pointer-events: none; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.stats > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; }
.stats label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.stats b { font-size: 15px; }
.dir { font-weight: 700; } .dir.bull { color: var(--green); } .dir.bear { color: var(--red); }
.note { color: var(--muted); font-size: 12px; margin: 8px 2px; }

/* login */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-box { background: var(--panel); padding: 30px; border-radius: 12px; width: 330px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.login-box .brand { justify-content: center; margin-bottom: 4px; }
.login-box .tag { color: var(--muted); font-size: 12.5px; text-align: center; margin: 0 0 18px; }
.login-box .err { color: var(--red); margin: 0 0 12px; font-size: 13px; }
.login-box input { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 14px; }
.login-box input:focus { border-color: var(--blue); outline: none; }
.login-box button { width: 100%; padding: 10px; background: #238636; color: #fff; border: 0; border-radius: 6px; font-size: 15px; cursor: pointer; font-weight: 600; }
.login-box button:hover { background: #2ea043; }

tr.dead td { opacity: .55; }

/* round 2: hearts, TradingView, filters, trend pills, Money Line panel */
.heart { background: none; border: 0; cursor: pointer; font-size: 17px; line-height: 1; color: #484f58; padding: 2px 4px; }
.heart:hover { color: #db61a2; } .heart.on { color: #f778ba; }
h1 .heart { font-size: 22px; }
.tvbtn { display: inline-block; font-size: 11px; font-weight: 700; color: var(--text); border: 1px solid var(--line);
  background: #21262d; border-radius: 5px; padding: 2px 7px; }
.tvbtn:hover { border-color: var(--blue); text-decoration: none; }
.tvbtn.big { font-size: 12.5px; padding: 4px 10px; margin-left: 8px; font-weight: 600; }
.badge.q { color: #d2a8ff; border-color: #8957e5; }
.qsuf { color: var(--muted); font-weight: 400; font-size: 12px; }
.trend { font-size: 11px; font-weight: 800; letter-spacing: .04em; border-radius: 4px; padding: 2px 7px; }
.trend.bull { color: #7ee787; background: var(--green-bg); } .trend.bear { color: #ffa198; background: var(--red-bg); }
.trend.neu { color: var(--muted); background: #21262d; }
.conf { font-size: 11px; font-weight: 700; color: var(--amber); } .conf.bull { color: var(--green); } .conf.bear { color: var(--red); }
h2.sect { color: var(--text); font-size: 16px; margin: 22px 0 8px; }
.more { font-size: 13px; }
.filters { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 4px 0 10px;
  display: grid; gap: 8px; }
.frow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.frow > label { width: 140px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.filters .chips { background: none; border: 0; padding: 0; flex-wrap: wrap; }
.chip { color: var(--muted); padding: 4px 11px; border-radius: 6px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
.chip:hover { color: var(--text); text-decoration: none; border-color: var(--muted); }
.chip.on { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.chip.off { opacity: .45; cursor: not-allowed; }
.count { color: var(--muted); font-size: 12.5px; margin: 4px 2px 8px; }
.coin-main { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
.mlpanel-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 8px; }
table.mlpanel { font-size: 13px; }
.mlpanel caption { text-align: left; font-weight: 700; padding: 6px 2px 8px; }
.mlpanel th { position: static; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--muted); font-weight: 600;
  padding: 5px 4px; border-bottom: 1px solid var(--line2); background: none; }
.mlpanel td { padding: 5px 4px; white-space: normal; }
.mlpanel tr.sep th, .mlpanel tr.sep td { border-top: 1px solid var(--line); }
.mlpanel td.warn { color: var(--amber); }
.warnbox { background: var(--amber-bg); border: 1px solid var(--amber); color: #f2cc60; border-radius: 10px;
  padding: 9px 14px; margin: 0 0 12px; font-size: 13px; }

/* Turtle page and the coin page's Turtle table (same look as the Money Line tables) */
.tstate { font-size: 11px; font-weight: 800; letter-spacing: .04em; border-radius: 4px; padding: 2px 7px; }
.tstate.long { color: #7ee787; background: var(--green-bg); } .tstate.flat { color: var(--muted); background: #21262d; }
.freshtag { display: inline-block; font-size: 11px; font-weight: 800; color: #111; background: #ffb300; border-radius: 4px;
  padding: 1px 6px; margin-right: 3px; }
td.freshcell { background: rgba(255, 179, 0, .18); box-shadow: inset 3px 0 0 #ffb300; }
td.bt { white-space: normal; min-width: 170px; max-width: 280px; font-size: 11.5px; line-height: 1.3; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
table.tcoin td b { font-size: 13px; }

@media (max-width: 760px) {
  nav { flex-wrap: wrap; }
  .top { padding: 8px 12px; gap: 8px; } main { padding: 12px; }
  .logout { order: 1; margin-left: auto; } nav { order: 2; width: 100%; } .jump { order: 3; margin-left: 0; width: 100%; }
  .jump input { width: 100%; }
  .health { padding: 6px 12px; font-size: 12px; } .health .wide { display: none; }
  .opt { display: none; }
  .coin-main { grid-template-columns: 1fr; }
  nav { gap: 2px; } nav a { padding: 5px 7px; font-size: 13px; white-space: nowrap; }
  .frow > label { width: 100%; }
  .tvbtn.big { margin: 6px 0 0; }
  td, th { padding: 7px 5px; }
  .mtf { gap: 2px; } .mtf i { width: 7px; height: 13px; } .mtf b { min-width: 20px; margin-left: 3px; }
  .head .sub { font-size: 13px; }
}
