/* Ray Dar phone app. Colors come from the theme picked on this phone (CSS variables set by phone.js). */
:root {
  --bg: #0A0C10; --bg2: #0D1016; --surface: #12161E; --surface2: #172420; --border: #1E2430; --border2: #2A3240;
  --text: #E7EBF2; --muted: #8B95A7; --faint: #5D6779; --up: #19D3A2; --down: #FF6B6B; --hot: #FFB020; --accent: #19D3A2;
  --edge1: var(--accent); --edge2: var(--accent);
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --font: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
body.t-hardwave { --edge1: #FF3FD2; --edge2: #3DFF8F; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-variant-numeric: tabular-nums; }
body { min-height: 100vh; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--bg)) 0, var(--bg) 320px) fixed; }
button { font: inherit; color: inherit; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); } .mono { font-family: var(--mono); }
main { padding: calc(10px + var(--safe-t)) 12px calc(84px + var(--safe-b)); max-width: 640px; margin: 0 auto; }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border2); padding-bottom: var(--safe-b); z-index: 5; }
.tabs button { flex: 1; background: none; border: 0; padding: 8px 0 9px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs button span { font-size: 20px; filter: grayscale(.6); }
.tabs button.on { color: var(--accent); }
.tabs button.on span { filter: none; }

.banner { position: sticky; top: 0; z-index: 6; padding: calc(8px + var(--safe-t)) 14px 8px; font-size: 13px; background: color-mix(in srgb, var(--hot) 22%, var(--bg2)); border-bottom: 1px solid var(--hot); }
.banner.ok { background: color-mix(in srgb, var(--up) 18%, var(--bg2)); border-color: var(--up); }

/* header */
.top { display: flex; align-items: flex-end; justify-content: space-between; margin: 4px 2px 10px; }
.top .clock b { font-family: var(--mono); font-size: 30px; font-weight: 800; }
.top .clock small { display: block; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1.5px solid currentColor; }
.pill.open { color: var(--up); } .pill.ext { color: var(--hot); } .pill.closed { color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin-right: 5px; box-shadow: 0 0 8px var(--up); }
.dot.off { background: var(--down); box-shadow: none; }

/* cards */
.card { position: relative; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  background: linear-gradient(color-mix(in srgb, var(--edge1) 9%, var(--surface)), var(--surface)) padding-box, linear-gradient(135deg, var(--edge1), var(--edge2)) border-box;
  border: 1.5px solid transparent; box-shadow: 0 0 16px -6px color-mix(in srgb, var(--edge1) 60%, transparent); }
.card h2 { margin: 0 0 8px; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card h2 .r { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.idx { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: 0 2px 10px; flex-wrap: wrap; }
.idx b { font-family: var(--mono); margin-left: 4px; }

.now .sym { font-family: var(--mono); font-size: 30px; font-weight: 900; }
.now .px { font-family: var(--mono); font-size: 20px; font-weight: 700; margin-left: 8px; }
.now .why { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.35; }
.now .warn { color: var(--down); font-size: 13px; margin-top: 4px; font-weight: 700; }
.now.fast { outline: 2px solid var(--hot); }

.score { font-family: var(--mono); font-weight: 900; font-size: 14px; min-width: 40px; text-align: center; padding: 2px 6px; border-radius: 8px; border: 1.5px solid currentColor; }
.score.hot { box-shadow: 0 0 10px currentColor; }

/* rows */
.rows { margin: 0 -4px; }
.row { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.row .n { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.row .s b { font-family: var(--mono); font-size: 16px; font-weight: 900; }
.row .s small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.row .p { text-align: right; font-family: var(--mono); font-size: 13px; }
.row .p small { display: block; font-weight: 800; }
.row.open-d { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.det { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); line-height: 1.4; padding: 2px 2px 4px 34px; }
.badges { margin-top: 3px; letter-spacing: 2px; }

.seg { display: flex; gap: 6px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface); font-size: 13px; color: var(--muted); }
.seg button.on { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 800; }

/* bots */
.bots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bot { border-radius: 12px; padding: 9px 10px; background: var(--bg2); border: 1px solid var(--border); border-left: 4px solid var(--border2); }
.bot.g { border-left-color: var(--up); } .bot.r { border-left-color: var(--down); }
.bot.off { opacity: .5; }
.bot b { display: block; font-size: 13px; }
.bot .m { font-family: var(--mono); font-size: 17px; font-weight: 800; }
.bot small { color: var(--muted); font-size: 11px; display: block; }
.pos { font-size: 12px; font-family: var(--mono); display: flex; justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 3px; margin-top: 3px; }

/* alerts */
.al { padding: 9px 2px; border-top: 1px solid var(--border); font-size: 13.5px; line-height: 1.35; }
.al:first-child { border-top: 0; }
.al small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.al.quiet { opacity: .62; }
input.q { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border2); background: var(--surface); color: var(--text); font-size: 15px; margin-bottom: 10px; }

/* switches */
.sw { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; border-radius: 999px; background: var(--border2); transition: .2s; }
.sw span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: var(--text); transition: .2s; }
.sw input:checked + span { background: var(--accent); }
.sw input:checked + span::before { transform: translateX(20px); background: var(--bg); }
.line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.line:first-of-type { border-top: 0; }
.line .grow { flex: 1; }

.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.themes button { border-radius: 10px; padding: 10px 6px; border: 2px solid var(--border2); font-size: 12px; font-weight: 700; }
.themes button.on { border-color: var(--text); }
.btn { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border2); background: var(--surface2); font-weight: 700; }
.btn.bad { color: var(--down); border-color: var(--down); background: transparent; }
.empty { color: var(--muted); font-size: 13.5px; padding: 8px 0; line-height: 1.45; }
.hello { text-align: center; padding: 40px 18px; }
.hello img { width: 96px; height: 96px; border-radius: 22px; }
.hello h1 { margin: 14px 0 6px; }
.hello p { color: var(--muted); line-height: 1.5; }
.share { display: inline-block; padding: 2px 6px; border: 1px solid var(--border2); border-radius: 6px; }
