/* Tokens shared with the crypto-trader page (public/index.html), dark and light. */
:root {
  --bg: #070b12; --bg2: #0c1220; --panel: #0f1623; --panel2: #131c2e;
  --border: #1e2d47; --border2: #243450;
  --cyan: #00d4ff; --cyan-dim: #00d4ff26;
  --green: #00e676; --green-dim: #00e67622;
  --red: #ff3d71; --red-dim: #ff3d7122;
  --amber: #ffb300; --amber-dim: #ffb30022;
  --text: #e2eaf8; --muted: #5d7598; --muted2: #8198ba;
  --mono: 'Space Mono', monospace; --sans: 'Syne', sans-serif;
  --chart-grid: rgba(30,45,71,0.55); --chart-axis: rgba(110,132,168,0.85);
  --shadow: 0 12px 32px rgba(0,0,0,.45);
}
html[data-theme="light"] {
  --bg: #f0f3fa; --bg2: #e7ecf7; --panel: #ffffff; --panel2: #f7f9fd;
  --border: #d5ddf0; --border2: #b8c6e0;
  --cyan: #005fd4; --cyan-dim: #005fd420;
  --green: #0a9e5c; --green-dim: #0a9e5c20;
  --red: #d62b47; --red-dim: #d62b4720;
  --amber: #a86800; --amber-dim: #c0780020;
  --text: #0c1529; --muted: #6e84aa; --muted2: #3d5278;
  --chart-grid: rgba(100,130,185,0.18); --chart-axis: rgba(61,82,120,0.65);
  --shadow: 0 12px 32px rgba(40,60,110,.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono, .num, code, td.num, input.mono, textarea { font-family: var(--mono); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted2); }
.ok { color: var(--green); }
.err { color: var(--red); }
.warn { color: var(--amber); }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  max-width: 1080px; width: 100%; margin: 0 auto; padding: 18px 20px 6px;
}
body.expert:not(.at-start):not(.at-day) .top { max-width: 1400px; }
.top-badges { display: flex; gap: 8px; flex-wrap: wrap; flex-basis: 100%; }
.top-links { display: flex; gap: 18px; align-items: center; margin-left: auto; }
/* The three traders. Same rules as on the crypto page (public/index.html). */
.apps { display: grid; grid-auto-flow: column; grid-auto-columns: auto; gap: 2px; border: 1px solid var(--border2); border-radius: 24px; padding: 3px; background: var(--bg2); }
.apps a { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted2); text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.2; padding: 8px 16px; border-radius: 20px; }
.apps a:hover { color: var(--text); text-decoration: none; }
.apps a[aria-current="page"] { background: var(--cyan-dim); color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.apps a:focus-visible { border-radius: 20px; }
.linklike, button.linklike {
  background: none; border: 0; color: var(--muted2); cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-weight: 400; font-size: 14px; letter-spacing: 0; padding: 4px 0; border-radius: 0;
}
.linklike:hover, button.linklike:hover { color: var(--cyan); text-decoration: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* Light / dark switch */
.theme-switch { display: inline-flex; border: 1px solid var(--border2); border-radius: 20px; padding: 2px; background: var(--bg2); }
.theme-switch button {
  border: 0; background: none; color: var(--muted2); font-family: var(--sans); font-weight: 600; font-size: 13px;
  letter-spacing: 0; padding: 4px 12px; border-radius: 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--border2); }
.theme-switch svg { width: 14px; height: 14px; flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--border2); color: var(--muted2); white-space: nowrap;
}
.badge.ok { color: var(--green); border-color: var(--green); background: var(--green-dim); }
.badge.err { color: var(--red); border-color: var(--red); background: var(--red-dim); }
.badge.warn { color: var(--amber); border-color: var(--amber); background: var(--amber-dim); }
.badge.info { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-dim); }

/* Tabs */
.tabs {
  display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); background: var(--bg2);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: 0.04em;
  background: none; border: none; color: var(--muted2); cursor: pointer;
  padding: 12px 14px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

main { flex: 1; padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }
body.at-start main, body.at-day main { max-width: 1080px; padding: 10px 20px 60px; }
body:not(.expert) .tabs, body:not(.expert) .top-badges, body:not(.expert) .foot { display: none; }
/* The day trader has no expert tabs. Its extras open below the page, as on the crypto page. */
body.at-day .tabs, body.at-day .top-badges, body.at-day .foot, body.at-day #to-simple { display: none; }
.tabs { margin-top: 8px; border-top: 1px solid var(--border); }
.banner { margin: 12px 20px 0; padding: 10px 14px; border-radius: 6px; border: 1px solid var(--red); background: var(--red-dim); color: var(--red); }
.banner.warn { border-color: var(--amber); background: var(--amber-dim); color: var(--amber); }
.foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--border); }

/* Panels and tiles */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid > .panel.panel { margin-top: 0; }           /* tiles in one row start at the same height */
.tile h3 { overflow-wrap: anywhere; }
.tile button { white-space: normal; max-width: 100%; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  min-width: 0;
}
.panel h2, .panel h3 {
  margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted2);
}
.panel + .panel, .grid + .panel, .panel + .grid { margin-top: 14px; }
.tile-value { font-family: var(--mono); font-size: 26px; font-weight: 700; line-height: 1.2; }
.tile-sub { margin-top: 6px; font-size: 12px; color: var(--muted2); }
.tile.ok { border-color: var(--green); }
.tile.err { border-color: var(--red); background: linear-gradient(var(--red-dim), var(--panel)); }
.tile.warn { border-color: var(--amber); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border2); white-space: nowrap;
}
th.num { text-align: right; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: var(--panel2); }
td.wrap { white-space: normal; word-break: break-word; }
.small { font-size: 11px; }
.stats { font-family: var(--mono); font-size: 11px; color: var(--muted2); max-width: 340px; white-space: normal; word-break: break-word; }

/* Controls */
button, .btn {
  font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.04em;
  background: var(--panel2); color: var(--text); border: 1px solid var(--border2);
  padding: 7px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
button:hover { border-color: var(--cyan); color: var(--cyan); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
button.danger { border-color: var(--red); color: var(--red); background: var(--red-dim); }
button.toggle-on { border-color: var(--green); color: var(--green); background: var(--green-dim); }
button.toggle-off { color: var(--muted2); }
input, select, textarea {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2); border-radius: 6px;
  padding: 7px 10px; font-size: 13px; font-family: var(--sans);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); }
input.cron { font-family: var(--mono); width: 150px; font-size: 12px; }
input.cron.invalid { border-color: var(--red); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 180px; }
textarea.yaml {
  width: 100%; min-height: 60vh; font-size: 12px; line-height: 1.55; tab-size: 2; resize: vertical; white-space: pre;
}
.msg { font-size: 12px; margin-left: 4px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); white-space: pre-wrap; font-family: var(--mono); }
.bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 4px; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--cyan); }
.chip { display: inline-block; font-family: var(--mono); font-size: 10px; padding: 1px 6px; margin: 1px; border-radius: 3px; border: 1px solid var(--amber); color: var(--amber); }
.denied { max-width: 520px; margin: 12vh auto; text-align: center; }
.denied h1 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.empty { color: var(--muted2); padding: 20px 0; text-align: center; }

/* Views: pipeline funnel, candidates, positions, costs, evaluation */
.note { font-size: 12px; padding: 8px 12px; margin-bottom: 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--panel2); }
.note.warn { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
table.funnel tr.stage td { border-top: 1px solid var(--border2); padding-top: 10px; color: var(--text); }
table.funnel tr.sub td { color: var(--muted2); font-size: 12px; }
.indent { padding-left: 14px; display: inline-block; }
svg.spark { width: 100%; height: 90px; display: block; }
svg.spark path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
svg.spark.up path { stroke: var(--green); }
svg.spark.down path { stroke: var(--red); }
.spark-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted2); margin-top: 4px; }
svg.bars { width: 100%; height: 80px; display: block; margin-bottom: 12px; }
svg.bars rect { fill: var(--cyan); opacity: 0.8; }
svg.bars rect:hover { opacity: 1; }
pre.report { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 12px; margin: 12px 0; max-height: 520px; overflow: auto; }
tr.clickable { cursor: pointer; }
tr.detail > td { background: var(--bg2); white-space: normal; }
.cand-detail p { margin: 0 0 8px; line-height: 1.5; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; margin: 8px 0; }
.lineage h3 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted2); margin: 12px 0 6px; }
.lineage .src { padding: 6px 0; border-top: 1px solid var(--border); line-height: 1.5; }
.lineage .src .small { display: block; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 24px; }
.rules-grid h3 { margin: 12px 0 6px; }
dl.rules { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 12px; }
dl.rules dt { color: var(--muted2); }
dl.rules dd { margin: 0; text-align: right; }

td.actions { white-space: nowrap; text-align: right; }
td.actions button + button { margin-left: 6px; }

@media (max-width: 640px) {
  main { padding: 12px; }
  .top-links { gap: 12px; }
  .theme-switch button span { display: none; }
  .theme-switch button { padding: 5px 9px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.wide { grid-template-columns: 1fr; }
  .tile-value { font-size: 20px; }
  td, th { padding: 7px 6px; }
  .hide-sm { display: none; }
}

/* ------------------------------------------------------------------------
 * Start page: the simple view. Own class names (s-), so the expert tabs keep
 * their look.
 * ---------------------------------------------------------------------- */
.start { display: grid; gap: 16px; font-size: 15px; line-height: 1.5; }
.start .panel { border-radius: 16px; padding: 20px 22px; margin: 0; }
.start .panel h2 { font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text); margin: 0 0 14px; }
.start [data-tip] { cursor: help; }
.s-label { font-size: 13px; color: var(--muted2); }
.s-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.s-pos { color: var(--green); } .s-neg { color: var(--red); } .s-quiet { color: var(--muted2); }
.s-sub { font-size: 13px; color: var(--muted2); margin-top: 2px; }
.s-msg { font-size: 13px; min-height: 18px; margin-top: 6px; }
.s-tag { font-size: 12px; color: var(--amber); border: 1px solid var(--amber); border-radius: 6px; padding: 1px 6px; margin-left: 8px; vertical-align: 2px; }
.s-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.s-head h2 { margin: 0 !important; }
.s-empty { color: var(--muted2); }

.s-alert { border: 1px solid var(--red); background: var(--red-dim); color: var(--red); border-radius: 12px; padding: 12px 16px; }

/* Depot curve */
.s-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.s-chart-value { font-family: var(--mono); font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.s-chart-delta { font-family: var(--mono); font-size: 14px; margin-top: 4px; }
.s-ranges { display: flex; gap: 6px; }
.s-ranges button { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: 0; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border2); background: transparent; color: var(--muted2); }
.s-ranges button:hover { border-color: var(--cyan); color: var(--cyan); }
.s-ranges button.active { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }
.s-chart-box { position: relative; height: 230px; }
.s-chart-box canvas { width: 100%; height: 100%; display: block; }
.s-chart-empty { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--muted2); font-size: 14px; }
.s-chart-tip { position: absolute; background: var(--panel2); border: 1px solid var(--border2); border-radius: 8px; padding: 7px 11px; pointer-events: none; opacity: 0; transition: opacity .1s; white-space: nowrap; font-family: var(--mono); font-size: 12px; z-index: 5; }
.s-chart-tip b { color: var(--cyan); font-size: 14px; display: block; }

/* Switch and tiles */
.s-facts { display: grid; gap: 16px; grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.s-switch-card { display: flex; align-items: center; gap: 20px; }
button.s-switch { position: relative; flex: none; width: 124px; height: 64px; padding: 0; border-radius: 40px; border: 2px solid var(--border2); background: var(--bg2); cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s; }
button.s-switch::after { content: ''; position: absolute; top: 6px; left: 6px; width: 48px; height: 48px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
button.s-switch[aria-checked="true"] { background: var(--green-dim); border-color: var(--green); box-shadow: 0 0 28px var(--green-dim); }
button.s-switch[aria-checked="true"]::after { transform: translateX(60px); background: var(--green); }
button.s-switch.stop { border-color: var(--red); background: var(--red-dim); }
button.s-switch.stop::after { background: var(--red); }
button.s-switch:disabled { opacity: .5; cursor: wait; }
.s-switch-state { font-size: 26px; font-weight: 800; line-height: 1.15; }
.s-tile-value { font-family: var(--mono); font-size: 24px; font-weight: 700; line-height: 1.25; margin-top: 6px; }

/* Day trader: open buys, one row each, and the stock symbol as a chip (crypto page: .holding, .coin) */
.s-holding { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; align-items: end; }
.s-holding + .s-holding { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.s-big { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.s-coin { display: inline-flex; align-items: baseline; gap: 8px; cursor: help; }
.s-coin b { font-family: var(--mono); font-size: 13px; padding: 3px 9px; border-radius: 7px; background: var(--cyan-dim); color: var(--cyan); border: 1px solid transparent; }
.s-coin:hover b, .s-coin:focus b { border-color: var(--cyan); }
.s-why { font-size: 13px; max-width: 420px; }
.s-more-box { display: grid; gap: 16px; }
/* Tables with several number columns: keep a gap between them */
.s-more-box .s-table th.r, .s-more-box .s-table td.r { padding-right: 16px; }
.s-more-box .s-table tr > :last-child { padding-right: 0; }
.s-more-box .s-why { min-width: 260px; }
.s-table tr.s-top td { vertical-align: top; }
.s-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.s-fact { font-family: var(--mono); font-size: 14px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.s-intro { max-width: 80ch; margin: 0 0 14px; }
.s-small { font-size: 13px; }
.s-nowrap { white-space: nowrap; }
@media (min-width: 861px) { .s-holding { grid-template-columns: 1.5fr 1fr 1fr 1.1fr 1fr; } }
.s-cands { line-height: 1.9; min-width: 240px; }
.s-cand { white-space: nowrap; margin-right: 10px; }

/* Buttons on the start page */
.start .s-btn { border: 1px solid var(--border2); background: var(--panel2); border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 600; letter-spacing: 0; white-space: normal; }
.start .s-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.start .s-btn.primary { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.start .s-btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.start .s-btn.s-sell:hover { border-color: var(--red); color: var(--red); }
.start .s-btn.danger { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.s-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.s-edit { color: var(--cyan) !important; font-size: 13px !important; }

/* Proposal that waits for a decision */
.start .panel.s-decide { border-color: var(--amber); }
.s-proposal + .s-proposal { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px; }
.s-proposal-name { font-size: 18px; font-weight: 700; }
.s-proposal p { margin: 8px 0 0; max-width: 70ch; }
.s-proposal ul { margin: 2px 0 0; padding-left: 18px; max-width: 70ch; color: var(--muted2); }
.s-proposal .s-row { margin-top: 14px; }

/* Stocks */
.s-table { width: 100%; border-collapse: collapse; }
.s-table th { text-align: left; font-weight: 400; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted2); padding: 0 12px 8px 0; border: 0; white-space: normal; vertical-align: bottom; }
.s-table td { padding: 11px 12px 11px 0; border: 0; border-top: 1px solid var(--border); vertical-align: middle; }
.s-table tr:hover td { background: none; }
.s-table th.r, .s-table td.r { text-align: right; padding-right: 0; }
.s-table .s-num { white-space: nowrap; }
.s-scroll { overflow-x: auto; }
.s-stock { font-weight: 700; border-bottom: 1px dotted var(--muted); }
/* Dotted line: here is an explanation on hover or tap. */
.s-tipped { border-bottom: 1px dotted var(--muted); }
.s-switch-state.s-tipped { border-bottom: 0; text-decoration: underline dotted var(--muted) 1px; text-underline-offset: 6px; }

/* Themes */
.s-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.s-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border2); background: var(--panel2); }
.s-chip:hover, .s-chip:focus { border-color: var(--cyan); }
.s-chip.held { border-color: var(--green); background: var(--green-dim); font-weight: 700; }
.s-chip.held::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.s-chip.off { color: var(--muted2); border-style: dashed; background: none; }
.s-chip button { border: 0; background: none; padding: 0 0 0 2px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted2); cursor: pointer; }
.s-chip button:hover { color: var(--red); }
.s-chip.off button:hover { color: var(--green); }
.s-legend { font-size: 13px; color: var(--muted2); margin-top: 12px; display: flex; align-items: center; gap: 7px; }
.s-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.s-suggest { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; display: grid; gap: 10px; }
.s-suggest-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.s-theme-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.s-theme-add input { flex: 1 1 220px; min-width: 0; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.s-group-label { font-size: 13px; color: var(--muted2); margin: 16px 0 8px; }

/* What happened lately */
.s-events { display: grid; }
.s-event { display: grid; grid-template-columns: 96px 1fr auto; gap: 4px 14px; padding: 11px 0; border-top: 1px solid var(--border); align-items: baseline; }
.s-event:first-child { border-top: 0; padding-top: 0; }
.s-event-when { font-family: var(--mono); font-size: 12px; color: var(--muted2); }
.s-event-title { font-weight: 700; }
.s-event-text { color: var(--muted2); font-size: 14px; }

.s-more { justify-self: center; }

/* Tooltip */
#tip { position: fixed; z-index: 50; max-width: 340px; background: var(--panel2); border: 1px solid var(--border2); border-radius: 10px; padding: 10px 13px; font-size: 13px; line-height: 1.45; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .12s; }
#tip.show { opacity: 1; }
#tip b { display: block; margin-bottom: 3px; }
#tip p { margin: 6px 0 0; }

@media (max-width: 860px) {
  .s-facts { grid-template-columns: 1fr 1fr; }
  .s-switch-card { grid-column: 1 / -1; }
  .s-chart-value { font-size: 30px; }
}
@media (max-width: 520px) {
  .start .panel { padding: 16px; }
  .s-why { max-width: none; }
  .s-holding > :first-child { grid-column: 1 / -1; }
  .s-big { font-size: 17px; }
  .s-facts { gap: 12px; }
  .s-facts .s-wide { grid-column: 1 / -1; }
  .s-tile-value { font-size: 19px; }
  .s-hide-s { display: none; }
  .s-event { grid-template-columns: 1fr auto; }
  .s-event-when { grid-column: 1 / -1; }
  #tip { max-width: calc(100vw - 16px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (max-width: 480px) {
  .top, body.at-start main, body.at-day main { padding-left: 14px; padding-right: 14px; }
  .apps { width: 100%; grid-auto-columns: 1fr; }
  .apps a { font-size: 13px; padding: 7px 4px; }
}

/* Way back from the expert tabs to the simple view */
body:not(.expert) #to-simple { display: none; }
button#to-simple { color: var(--cyan); }
