/* palette: TradingView-style chart colors -- themed via CSS variables.
   Fixed accents (work on both themes): bull #26a69a | bear #ef5350 |
   amber #ff9800 | deep red #e53935 | hover green #1b7d72 */
:root {
  color-scheme: light;
  --bg: #fff;          /* page */
  --card: #fff;        /* inputs, tiles, popovers */
  --panel: #f0f3fa;    /* section boxes, table heads */
  --ink: #131722;      /* text */
  --mid: #434651;      /* secondary text */
  --dim: #787b86;      /* tertiary text */
  --faint: #bbb;       /* line numbers etc */
  --border: #e0e3eb;
  --blue: #2962ff;     --blue-hover: #1e4ed8;
  --tint: #e6eeff;     --tint2: #f5f8ff;    --tint3: #d8e4ff;
  --tintred: #fdeaea;  --tintred-b: #f5c6c4;
  --tintamber: #fffbea; --tintamber2: #fff3bf;
  --tintgreen: #e6f4ea; --green-deep: #188038; --tintbull: #e0f2ef;
  --code-kw: #00f; --code-str: #a31515; --code-cmt: #008000;
  --code-num: #098658; --code-op: #666;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131722;
  --card: #1e222d;
  --panel: #1a1f2b;
  --ink: #d1d4dc;
  --mid: #b2b5be;
  --dim: #8a8f9c;
  --faint: #565b66;
  --border: #2a2e39;
  --blue: #6b96ff;     --blue-hover: #85a8ff;
  --tint: #1c2742;     --tint2: #182136;    --tint3: #28365c;
  --tintred: #3a2228;  --tintred-b: #5c3136;
  --tintamber: #2e2a18; --tintamber2: #46401f;
  --tintgreen: #1b3226; --green-deep: #4cc38a; --tintbull: #16302b;
  --code-kw: #6c9ef8; --code-str: #ce9178; --code-cmt: #6a9955;
  --code-num: #b5cea8; --code-op: #9aa0aa;
}


* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* logo */
.logo { font-size: inherit; font-weight: 600; letter-spacing: -2px; }
.l-ink { color: var(--ink); }
.l-bull { color: #26a69a; }
.beta {
  font-size: .18em;
  font-weight: 400;
  color: #26a69a;
  letter-spacing: 0;
  margin-left: .15em;
  vertical-align: super;
}

/* homepage doji: the green "l" is a candlestick, a sparkline draws in below */
.candle {
  position: relative;
  display: inline-block;
  width: .30em;
  height: .74em;
  margin: 0 .03em;
  vertical-align: baseline;
}
.candle-wick {
  position: absolute;
  left: 50%;
  top: -.08em;
  bottom: 0;
  width: .05em;
  margin-left: -.025em;
  background: #1b7d72;
  border-radius: .03em;
}
.candle-box {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .09em;
  height: .48em;
  background: #26a69a;
  border-radius: .06em;
  transform-origin: bottom;
  animation: candle-grow .8s cubic-bezier(.2, .8, .3, 1.15) both;
}
/* dashed red stoploss line at the candle's base -- doubles as the L's foot */
.candle-stop {
  position: absolute;
  left: 0;  /* flush with the candle so the foot reads as an L */
  bottom: 0;
  width: .52em;
  height: .045em;
  background: repeating-linear-gradient(90deg, #ef5350 0 .09em, transparent .09em .15em);
  animation: tip-pop .3s ease-out 1s both;
}
.doji-spark {
  display: block;
  width: 320px;
  max-width: 70vw;
  margin: 4px auto 0;
}
.spark-line {
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: spark-draw 1.3s ease-out .15s forwards;
}
.spark-tip {
  fill: #26a69a;
  transform-box: fill-box;
  transform-origin: center;
  animation: tip-pop .35s cubic-bezier(.2, .8, .3, 1.4) 1.35s both;
}
@keyframes candle-grow { from { transform: scaleY(0); } }
@keyframes spark-draw { to { stroke-dashoffset: 0; } }
@keyframes tip-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .candle-box, .spark-line, .spark-tip { animation: none; }
  .spark-line { stroke-dashoffset: 0; }
}

/* doji of the day banner */
.doji-day {
  background: var(--tint);
  color: var(--blue);
  border-radius: 18px;
  padding: 8px 18px;
  font-size: 14px;
  margin: -4px 0 20px;
  max-width: 640px;
  text-align: center;
}
.doji-day b { font-weight: 600; }
.doji-emoji { margin-right: 4px; }

/* development-status / roadmap page */
.roadmap-page { max-width: 1100px; margin: 0 auto; }
.roadmap-intro { max-width: 720px; margin-top: 4px; }
.roadmap-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  align-items: start;
  margin: 22px 0;
}
.roadmap-col {
  background: var(--panel);
  border-radius: 10px;
  padding: 14px 18px;
}
.roadmap-col h2 { font-size: 15px; margin: 0 0 10px; }
.roadmap-col ul { margin: 0; padding-left: 18px; }
.roadmap-col li { font-size: 13px; line-height: 1.5; margin: 6px 0; color: var(--fg); }
.roadmap-cta { margin: 8px 0 4px; font-size: 14px; }

/* free-beta announcement banner (home + register) -- a quiet notice line, not
   a callout box, so it doesn't compete with the actual page content */
.betabanner {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 auto 16px;
  max-width: 640px;
  text-align: center;
}
.betabanner b { font-weight: 600; color: var(--fg); }
.betabanner a { font-weight: 600; white-space: nowrap; }

/* admin free-mode toggles */
.flaggrid { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.flagtoggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
.flagtoggle input { width: 16px; height: 16px; }
.flagbeta { display: flex; max-width: 680px; margin: 8px 0; align-items: flex-start; }
.flagbeta span { font-size: 13px; color: var(--dim); line-height: 1.5; }
.flagbeta b { color: var(--fg); }
.doji-years { color: var(--dim); white-space: nowrap; }

/* homepage */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
.home-logo { font-size: 88px; margin: 18vh 0 24px; font-weight: normal; }
.betabanner + .home-logo { margin-top: 6vh; }
.searchform { width: 100%; max-width: 580px; text-align: center; }
.searchwrap { position: relative; }
.searchbox.padded { padding-left: 48px; }
.searchbox.padded-right { padding-right: 132px; }
.aitoggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.aitoggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.aitoggle:hover { border-color: #d1d4dc; }
.aitoggle:has(input:checked) { background: var(--tint); border-color: var(--blue); color: var(--blue); }
.aihints { display: none; margin: 10px auto 0; max-width: 460px; text-align: left; }
.searchform:has(.aitoggle input:checked) .aihints { display: block; }
.aihints-label { font-size: 12px; color: var(--dim); margin: 0 0 4px 12px; }
.aihints a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--mid);
  border-radius: 8px;
}
.aihints a:hover { background: var(--tint2); text-decoration: none; }
.uploadbtn {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--dim);
  font-size: 24px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 50%;
}
.uploadbtn:hover { color: var(--blue); background: var(--tint); text-decoration: none; }
.indexcount { color: var(--dim); font-size: 13px; margin-top: 16px; }
.uploadpriv { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; text-align: left; }
.uploadpriv input { width: auto; margin: 2px 0 0; }
.searchbox {
  width: 100%;
  padding: 13px 24px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  outline: none;
}
.searchbox:hover { box-shadow: 0 1px 6px rgba(19, 23, 34, .16); }
.searchbox:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(41, 98, 255, .15); }
.buttons { margin-top: 24px; }
.buttons button, .topbar-form button, .filters button {
  background: var(--panel);
  border: 1px solid var(--panel);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  margin: 0 4px;
  padding: 9px 16px;
  cursor: pointer;
}
.buttons button:hover { border-color: #d1d4dc; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }

/* chips */
.chips, .quickfilters { margin-top: 22px; max-width: 640px; text-align: center; }
.chip {
  display: inline-block;
  margin: 4px;
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--panel);
  color: var(--mid);
  font-size: 13px;
}
.chip:hover { background: var(--border); text-decoration: none; }
.chip-alt { background: var(--tint); color: var(--blue); }
.chip-alt:hover { background: var(--tint3); }
.chip-ai { background: var(--tint3); color: var(--blue); font-weight: 600; }
.chip-ai:hover { background: var(--blue); color: #fff; }

/* latest section */
.homelists { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px 40px; align-items: start; margin: 48px 0 24px; width: 100%; max-width: 1320px; }
.homelists .latest { margin: 0; max-width: none; }
.latest { margin: 48px 0 24px; width: 100%; max-width: 640px; }
.latest h2 { font-size: 16px; font-weight: 500; color: var(--dim); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.latest ul { list-style: none; padding: 0; margin: 0; }
.latest li { padding: 4px 0; font-size: 14px; }
.latest .meta { color: var(--dim); font-size: 12px; margin-left: 8px; }

/* results page */
.topbar { display: flex; align-items: center; gap: 24px; padding: 0 28px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar-logo { font-size: 28px; text-decoration: none; }
.topbar-logo:hover { text-decoration: none; }
.topbar-form { flex: 1; display: flex; gap: 8px; max-width: 640px; }
.topbar-searchwrap { flex: 1; }
/* subtle Forum button beside Search -- outline, not a solid CTA */
.topbar-forum { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  color: var(--mid); font-size: 14px; }
.topbar-forum:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.searchbox.small { padding: 9px 20px; font-size: 15px; }
.searchbox.small.padded-right-sm { padding-right: 108px; }
.aitoggle-sm { padding: 5px 11px; font-size: 12px; right: 5px; }
/* locked (non-paid) AI Search: a link to pricing, styled like the toggle */
.aitoggle-locked, .aitoggle-locked:hover { text-decoration: none; }
.aitoggle-locked:hover { border-color: var(--blue); color: var(--blue); }

.tabs { display: flex; gap: 26px; padding: 0 28px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 2px; color: var(--dim); font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--blue); text-decoration: none; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tabpage { padding: 16px 28px; }

.results-layout { display: flex; flex: 1; gap: 24px; padding: 16px 28px; }
.filters { width: 180px; flex-shrink: 0; font-size: 13px; }
.filters h3 { font-size: 12px; text-transform: uppercase; color: var(--dim); margin: 16px 0 6px; }
.filters label { display: block; padding: 3px 0; color: var(--mid); }
.filters select { width: 100%; padding: 4px; }

.results { flex: 1; max-width: 700px; }
.result-count { color: var(--dim); font-size: 13px; }
.smartline { color: var(--dim); font-size: 13px; display: flex; flex-wrap: wrap;
  gap: 6px; align-items: center; }
.hometip { background: var(--tint2); color: var(--dim); border-radius: 12px;
  padding: 9px 16px; font-size: 13px; line-height: 1.5; margin: 14px auto 0;
  max-width: 560px; text-align: center; }
.hometip a { color: var(--blue); }
.result { margin-bottom: 26px; }
.result-title { font-size: 19px; }
.result-url { color: #26a69a; font-size: 13px; margin: 2px 0; word-break: break-all; }
.result-url a { color: inherit; }
.result-url a:hover { color: var(--blue); }
.result-snippet { font-size: 14px; color: var(--mid); line-height: 1.45; }
.result-snippet mark { background: none; font-weight: bold; color: var(--ink); }

.tag {
  display: inline-block;
  font-size: 11px;
  background: var(--tint);
  color: var(--blue);
  border-radius: 10px;
  padding: 2px 9px;
  margin: 3px 3px 0 0;
}
.tag-warn { background: var(--tintred); color: #e53935; }
.tag-dim { background: var(--panel); color: var(--dim); }
a.tag:hover { background: var(--tint3); text-decoration: none; }
/* grouped tag pills (strategy detail page): Basics/Settings/Indicators/
   Concepts/Methods/Other, each its own row -- a flat wall of "key: value"
   pills was unreadable once a strategy had 20+ method tags mixed in with
   everything else */
.tag-groups { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 4px; }
.tag-group { display: flex; align-items: baseline; gap: 8px; }
.tag-group-label {
  flex: 0 0 auto; width: 68px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--dim);
  padding-top: 4px;
}
.tag-group-pills { flex: 1 1 auto; min-width: 0; }
.tag-group-pills .tag { font-size: 12px; padding: 3px 10px; }
@media (max-width: 560px) {
  .tag-group { flex-direction: column; gap: 2px; }
  .tag-group-label { width: auto; padding-top: 0; }
}
/* jumped-to code line (methods: tags link to #L-n): highlighted + kept clear
   of the viewport edge so it's always easy to spot */
.codehl span[id^="L-"] { scroll-margin-top: 120px; }
/* paint-only highlight: no display/margin changes, so long pre lines never
   split or reflow -- the band covers the line's text incl. indentation */
.codehl span[id^="L-"]:target {
  background: var(--tintamber2);
  box-shadow: -6px 0 0 #ff9800, 6px 0 0 var(--tintamber2);
}
/* persistent red mark on lines the lookahead analysis flagged as biased */
.codehl span[id^="L-"].bias-hit {
  background: rgba(239, 83, 80, 0.13);
  box-shadow: -6px 0 0 #ef5350, 6px 0 0 rgba(239, 83, 80, 0.13);
}
/* a flagged line that's also the jump target: amber target wins, keep red rail */
.codehl span[id^="L-"].bias-hit:target {
  background: var(--tintamber2);
  box-shadow: -6px 0 0 #ef5350, 6px 0 0 var(--tintamber2);
}
/* a shared line-RANGE permalink (code.js) -- same "you jumped here" amber as
   :target, since that's exactly what it means; :target itself can't do a
   range (it only ever matches one id), hence the separate JS-applied class */
.codehl span[id^="L-"].range-hit {
  background: var(--tintamber2);
  box-shadow: -6px 0 0 #ff9800, 6px 0 0 var(--tintamber2);
}
.codehl span[id^="L-"].bias-hit.range-hit {
  background: var(--tintamber2);
  box-shadow: -6px 0 0 #ef5350, 6px 0 0 var(--tintamber2);
}
.biashint { margin-top: .6rem; }
.biaschips .tag-warn.linejump { cursor: pointer; text-decoration: none; }
.biaschips .tag-warn.linejump:hover { filter: brightness(1.08); }

/* transparent pills for Prev / page-count / Next -- shared by search results
   and the forum listings, so they all get the same treatment */
.pager { margin: 28px 0; display: flex; gap: 12px; align-items: center; font-size: 15px; }
.pager a, .pager span {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.pager span { color: var(--dim); cursor: default; }
.pager a:hover { border-color: var(--blue); color: var(--blue); }

/* detail */
.detail { padding: 20px 28px; max-width: 1520px; }
/* strategy pages stay at the normal width; expanding the source lifts the cap */
.detail-full.widepage { max-width: none; }
.detail-layout { display: flex; gap: 28px; align-items: flex-start; margin-top: 18px; }
.detail-main { flex: 1 1 0; min-width: 0; }
.detail-main .codebar { margin-top: 0; border-top: none; padding-top: 0; }
.detail-side { width: 420px; flex-shrink: 0; }
.expandbtn {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 17px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 6px;
}
.expandbtn:hover { color: var(--blue); background: var(--tint); }
.expandbtn.active { color: var(--blue); }
/* the expand toggle only lifts the page width cap (.widepage on .detail-full):
   the source column widens/shrinks, the community sidebar always stays right */

/* people also search for */
.alsosearch { margin: 34px 0 8px; }
.alsosearch h3 { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.alsogrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 640px; }
.alsogrid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--ink);
  font-size: 14px;
}
.alsogrid a:hover { background: var(--tint); text-decoration: none; }
@media (max-width: 720px) { .alsogrid { grid-template-columns: 1fr; } }

/* share popover */
.titlerow { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; flex-wrap: wrap; }
.titlerow h1 { margin: 0; }
/* admin toggle sits at the far right of the title row; margin-left:auto
   rather than float so it still wraps sanely on a narrow screen */
.titlerow .titlerow-right { margin-left: auto; }
.rankbadge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
}
.rankbadge:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.rankbadge-top { background: var(--tintamber); border-color: var(--tintamber2); }
.rankbadge-total { color: var(--dim); font-weight: 400; }
/* gated out of the League (confirmed lookahead) -- distinct from "not tested yet" */
.rankbadge-out { background: var(--tintred); border-color: var(--tintred); color: #e53935; }
.rankbadge-out:hover { border-color: #e53935; color: #e53935; }
.sharewrap { position: relative; margin-top: 0; }
.sharebtn {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 50%;
  line-height: 0;
}
.sharebtn:hover { color: var(--blue); background: var(--tint); }
.sharepop {
  position: absolute;
  left: 0;
  top: 115%;
  z-index: 50;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(19, 23, 34, .16);
  padding: 16px;
  width: 430px;
  max-width: 90vw;
}
.sharehead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 16px; }
.shareclose { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--dim); line-height: 1; }
.shareclose:hover { color: var(--ink); }
.sharerow { display: flex; gap: 8px; }
.shareurl { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--mid); }
.sharecopy { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sharecopy:hover { background: var(--tint); }
.sharechannels { display: flex; gap: 20px; margin-top: 14px; }
.sharechannels a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--mid); }
.sharechannels a:hover { text-decoration: none; color: var(--blue); }
.shareball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 600;
}
.sharechannels a:hover .shareball { background: var(--tint); }
.detail-side .community:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.detail-side .community h2 { margin-top: 0; }
.detail-side .stats-table { font-size: 13px; }
.detail-side .stats-table td, .detail-side .stats-table th { padding-right: 8px; }
.detail-side .inline button { margin: 2px 4px 2px 0; }
@media (max-width: 1100px) {
  .detail-layout { flex-direction: column; }
  .detail-side { width: 100%; }
  .expandbtn { display: none; }
}
.detail h1 { font-size: 24px; margin-bottom: 4px; }
.detail .meta { color: var(--dim); font-size: 13px; }
.dupes { margin: 12px 0; font-size: 14px; }
.rel-ico { display: inline-block; width: 1.2em; text-align: center; color: var(--dim); font-weight: 700; }
.relatedlist li { line-height: 1.75; }
.code { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; font-size: 13px; }
.codehl { padding: 0 8px; }
.codehl .linenos { color: var(--faint); padding-right: 8px; user-select: none; }
pre { margin: 8px 0; }

/* pygments (default light) */
.codehl .k, .codehl .kn { color: var(--code-kw); }
.codehl .s, .codehl .s1, .codehl .s2 { color: var(--code-str); }
.codehl .c, .codehl .c1 { color: var(--code-cmt); }
.codehl .n { color: var(--ink); }
.codehl .o { color: var(--code-op); }
.codehl .mf, .codehl .mi { color: var(--code-num); }

/* stats */
.statspage { max-width: 760px; margin: 0 auto; padding: 24px 24px 80px; }
.statspage .lede { font-size: 14.5px; color: var(--mid); line-height: 1.6; max-width: 62ch; margin: 6px 0 36px; }
.statgrid { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.stat { background: var(--panel); border-radius: 8px; padding: 16px 24px; text-align: center; }
a.stat { color: inherit; display: block; }
a.stat:hover { background: var(--tint); text-decoration: none; }
.stat b { display: block; font-size: 26px; color: var(--blue); }
.stat span { font-size: 12px; color: var(--dim); }
.statbars { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 8px; font-size: 13px; }
.statbar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.statbar a { color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statbar a:hover { color: var(--blue); }
.statbar-track { background: var(--panel); border-radius: 4px; height: 14px; overflow: hidden; }
.statbar-fill { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.statbar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); }
.stats-table { border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
.stats-table td, .stats-table th { padding: 4px 14px 4px 0; text-align: left; color: var(--mid); }
.stats-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.footer { text-align: center; color: var(--dim); font-size: 14px; padding: 20px; border-top: 1px solid var(--border); margin-top: auto; }
.footer a { color: var(--dim); }

@media (max-width: 720px) {
  .results-layout { flex-direction: column; }
  .filters { width: 100%; }
  .home-logo { font-size: 56px; margin-top: 10vh; }
  .betabanner + .home-logo { margin-top: 4vh; }
}

/* community / auth */
.tagline { color: var(--dim); font-size: 15px; margin: -14px 0 20px; }
/* identity line hugging the logo */
.tagline-sub { color: var(--dim); font-size: 14px; margin: -10px 0 6px; }
/* benefit line below it */
.tagline-lead {
  color: var(--mid); font-size: 16px; font-weight: 500; letter-spacing: 0;
  margin: 0 0 20px; text-wrap: balance;
}
.usernav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; padding: 8px 16px 4px; font-size: 13px; align-items: center; }
.usernav-hi { color: var(--dim); }
.usernav .cta { background: var(--blue); color: #fff; padding: 7px 14px; border-radius: 6px; }
.usernav .cta:hover { text-decoration: none; background: var(--blue-hover); }
/* ghost pills: plain link at rest, soft rounded fill on hover (the greeting
   .usernav-hi is a span, and the filled .cta keeps its own style) */
.usernav a:not(.cta) { padding: 4px 8px; border-radius: 999px; transition: background .12s ease; }
.usernav a:not(.cta):hover { background: var(--tint2); text-decoration: none; }
.inline { display: inline; }
.linkbtn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 13px; padding: 0; }
.linkbtn:hover { text-decoration: underline; }
.small-logo { font-size: 56px !important; margin: 8vh 0 12px !important; }
.authcard { width: 100%; max-width: 480px; border: 1px solid var(--border); border-radius: 10px; padding: 28px; }
.authcard h2 { margin-top: 0; font-weight: 500; }
.authsub { color: var(--dim); font-size: 13px; }
.autherror {
  color: #e53935;
  font-size: 14px;
  font-weight: 600;
  background: var(--tintred);
  border: 1px solid var(--tintred-b);
  border-radius: 8px;
  padding: 10px 14px;
}
.authcard input { width: 100%; padding: 11px 14px; margin: 6px 0; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.authcard button { width: 100%; margin-top: 14px; background: var(--blue); color: #fff; border: none; border-radius: 6px; padding: 11px; font-size: 14px; cursor: pointer; }
.traderselect { width: 100%; padding: 10px 12px; margin: 4px 0; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: var(--card); }
.authcard button:hover { background: var(--blue-hover); }
.authalt { font-size: 13px; color: var(--dim); }
.authinfo {
  color: #1b7d72;
  font-size: 14px;
  background: var(--tintbull);
  border: 1px solid #26a69a;
  border-radius: 8px;
  padding: 10px 14px;
}
/* secondary (resend) action -- distinct from the primary auth button */
.authresend { margin: 6px 0 10px; }
.authresend button { background: var(--panel); color: var(--mid); border: 1px solid var(--border); margin-top: 0; }
.authresend button:hover { background: var(--tint); }
.authperks { margin: 6px 0 10px; padding-left: 20px; font-size: 13px; color: var(--mid); }
.authperks li { padding: 1px 0; }

.community { margin: 22px 0; border-top: 1px solid var(--border); padding-top: 12px; }
.community h2 { font-size: 17px; font-weight: 500; }
.ratingavg { color: #ff9800; font-size: 15px; margin-left: 8px; }
.dim { color: var(--dim); font-size: 13px; }
.ratingform .starbtn { margin-right: 4px; cursor: pointer; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.ratingform .starbtn:hover { background: var(--tint); }
.check-ok { color: #26a69a; }
.check-bad { color: #ef5350; }
.check-warn { color: #ffa726; }

/* check panel tabs (left/main column) */
.paneltab-grow { margin-left: auto; }
.genbtn {
  background: var(--blue); color: #fff; border: none; border-radius: 6px;
  padding: 9px 18px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.genbtn:hover { background: var(--blue-hover); }
/* Strategy Forge prompt: a proper wide, centered input instead of a cramped box */
.forge-form { max-width: 720px; margin: 10px auto 0; }
.forge-form textarea {
  width: 100%; box-sizing: border-box; padding: 12px 14px; min-height: 110px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  color: var(--ink); font-family: inherit; font-size: 14px; line-height: 1.55; resize: vertical;
}
.forge-form textarea:focus { outline: none; border-color: var(--blue); }
.forge-consent { display: block; margin-top: 10px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.forge-consent input { margin-right: 6px; vertical-align: -2px; }
.forge-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.errlog {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin: 6px 0 14px; max-height: 320px; overflow: auto;
  font-size: 12px; line-height: 1.5; color: var(--mid); white-space: pre-wrap; word-break: break-word;
}
.paneltop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.paneltop h2 { margin: 0; }
.tab-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
/* check tiles are the tab navigation (top row of the main column) */
.checkbtns .checkbtn { text-align: left; }
.tabpanel[hidden] { display: none; }

/* admin section tabs -- two levels: group (Scanner/League/Users/System) as
   .checkbtn tiles (same design as the strategy page's check row), then that
   group's own sub-tabs underneath */
.admingroups { margin: 16px 0 10px; }

.admintabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 0 20px; }
.admintabs[hidden] { display: none; }
.admintab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 12px; margin-bottom: -1px; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--dim); white-space: nowrap;
}
.admintab:hover { color: var(--ink); }
.admintab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
/* the Events log "tab" is a link to its own page, not a panel switch */
.admintabs a.admintab { text-decoration: none; }
.scanrows { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.scanrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- one consistent look for every admin action button. Bare form
   buttons were falling back to the browser default, so each panel looked
   different; this pulls them all onto the same pill as the rest of the
   server (matching .dlbtn/.copybtn), with .btn-primary / .dangerbtn as the
   only variants. .checkbtn tiles opt out and keep the strategy-page tile
   look. --- */
.admin-panel form button:not(.checkbtn) {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .12s, background .12s, color .12s;
}
.admin-panel form button:not(.checkbtn):hover {
  border-color: var(--blue); background: var(--tint2); color: var(--blue);
}
.admin-panel form button.btn-primary {
  background: var(--blue); border-color: var(--blue); color: #fff;
}
.admin-panel form button.btn-primary:hover {
  background: var(--blue-hover); border-color: var(--blue-hover); color: #fff;
}
.admin-panel form button.dangerbtn { color: #ef5350; }
.admin-panel form button.dangerbtn:hover {
  border-color: #ef5350; background: var(--tintred); color: #e53935;
}
.admin-panel form button:disabled { opacity: .5; cursor: not-allowed; }
.admin-panel form button:disabled:hover {
  border-color: var(--border); background: var(--panel); color: var(--ink);
}

/* consistent inputs across every admin panel (were a mix of bare + inline-styled) */
.admin-panel input[type="text"],
.admin-panel input[type="number"],
.admin-panel input[type="search"],
.admin-panel textarea {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  color: var(--ink); font-family: inherit; font-size: 13px; padding: 6px 10px;
}
.admin-panel input:focus, .admin-panel textarea:focus {
  outline: none; border-color: var(--blue);
}

/* let each Scans-panel action sit in the .checkbtns tile grid while still
   being its own POST form -- display:contents lifts the button to be the
   direct flex child so the tiles align like the strategy page's check row */
.admin-panel .checkbtns form { display: contents; }

/* backtest run parameters header */
.bt-params {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 0 14px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; color: var(--dim);
}
.bt-params b { color: var(--ink); font-weight: 600; margin-right: 4px; }

.tabpanel h3 { font-size: 15px; margin: 22px 0 8px; }

/* embedded report charts + export */
.bt-report-head { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.bt-report-head h3 { margin: 0; }
.bt-report-head h3 { margin: 0; font-size: 15px; }
.bt-charts { width: 100%; margin-top: 8px; min-height: 260px; }
.bt-charts .chart-title { font-size: 13px; font-weight: 600; color: var(--mid); margin: 18px 0 4px; }
.bt-charts .chart-title .chart-help { font-size: 11px; font-weight: 400; margin-left: 8px; color: var(--dim); text-decoration: none; border-bottom: 1px dotted currentColor; }
.bt-charts .chart-title .chart-help:hover { color: var(--accent); }
.bt-charts .chartloading { padding: 40px 0; text-align: center; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--dim); margin: 4px 0 8px; }
.chart-legend b { font-style: normal; }

/* Forge improvements: keep a long summary from blowing out the table -- clamp
   to a bounded width with an ellipsis; full text shows on hover + the Review page. */
.forge-summary { max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the request that produced the row -- shown even while queued, when the
   model's summary does not exist yet. Same clamp so the column keeps its
   width; the full text is on the title attribute. */
.forge-prompt { max-width: 60ch; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12px; }
.forge-summary + .forge-prompt { margin-top: 2px; }

/* --- Printable report view (check_report.html) + print rules --- */
.report-view .reportbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.report-view .report-sub { margin: 2px 0 16px; }
.report-view .report-foot { margin-top: 28px; font-size: 12px; }
/* Brand line INSIDE the report body, not in the site chrome: @media print hides
   .topbar, so a printed/PDF'd report would otherwise carry no mark of where it
   came from -- and these get shared. */
.report-view .report-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.report-view .report-brand a { text-decoration: none; }
.report-view .report-foot + .report-foot { margin-top: 6px; }

@media print {
  /* the export IS the page: strip site chrome, print the report only */
  .usernav, .topbar, .footer, .themebtn, .reportbar,
  .rb-help, .chart-help { display: none !important; }
  html, body { background: #fff !important; }
  /* force background fills (pair bars, badges, chart area fills) to print
     without needing the browser's "Background graphics" option enabled */
  .report-view, .report-view * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-view { max-width: none; margin: 0; padding: 0; }
  a { color: inherit; text-decoration: none; }
  /* keep individual blocks intact -- but NOT .bt-charts: it's taller than a
     page, so forcing it whole just leaves a big empty gap and pushes content */
  .robustness, .tablewrap, .bt-summary, .bt-params,
  .pairbar, .tradeblock, .mae-scatter, .mc-fan { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
}
.pairbars { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; font-size: 13px; }
.pairbar { display: grid; grid-template-columns: 130px 1fr 72px 132px; align-items: center; gap: 10px; }
.pairbar .pb-name { color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pairbar .pb-track { background: var(--panel); border-radius: 4px; height: 16px; overflow: hidden; }
.pairbar .pb-fill { display: block; height: 100%; border-radius: 4px; }
/* diverging variant: zero line in the middle, bars grow out from it */
.pairbar .pb-diverge { position: relative; background: transparent; overflow: visible; }
.pairbar .pb-diverge::before { content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: var(--border); }
.pairbar .pb-diverge .pb-fill { position: absolute; top: 0; bottom: 0; height: auto; }
.pairbar .pb-val { text-align: right; font-variant-numeric: tabular-nums; }
.pairbar .pb-meta { text-align: right; font-size: 11px; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .pairbar { grid-template-columns: 110px 1fr 64px; } .pairbar .pb-meta { display: none; } }

/* Monte Carlo distribution fan (SVG) */
.mc-fan { width: 100%; }
.mc-fan-svg { width: 100%; height: 70px; display: block; }
.mc-fan-axis { position: relative; display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: 2px; }
.mc-fan-axis .mc-fan-zero { position: absolute; transform: translateX(-50%); }
.mc-fan-cap { font-size: 12.5px; color: var(--mid); margin-top: 8px; line-height: 1.5; }
.mc-fan-cap b { color: var(--ink); font-weight: 600; }

/* MAE/MFE scatter (canvas) */
.mae-scatter { width: 100%; }
.mae-scatter canvas { display: block; max-width: 100%; }
.mae-note { font-size: 11px; color: var(--dim); margin-top: 2px; }
.pairbar-clickable { cursor: pointer; border-radius: 4px; }
.pairbar-clickable:hover { background: var(--panel); }
.tradeblock { transition: background-color .3s; border-radius: 4px; }
.tradeblock.flash { background-color: rgba(41, 98, 255, .12); }

/* backtest monthly breakdown */
.bt-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.bt-stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; min-width: 90px;
}
/* label only (direct child). NOT the value <span>s nested inside <b> --
   they must keep the 17px bold value size, hence the child combinator. */
.bt-stat > span {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--dim); margin-bottom: 2px;
}
.bt-stat b { font-size: 17px; font-weight: 700; white-space: nowrap; }

/* robustness verdict panel (Monte Carlo + significance + rolling consistency) */
.robustness {
  border: 1px solid var(--border); border-left: 4px solid var(--dim);
  border-radius: 10px; padding: 12px 16px; margin: 4px 0 20px; background: var(--panel);
}
.robustness.rb-robust { border-left-color: #26a69a; }
.robustness.rb-moderate { border-left-color: var(--blue); }
.robustness.rb-fragile { border-left-color: #ff9800; }
.robustness.rb-unreliable { border-left-color: #ef5350; }
.rb-head { display: flex; align-items: center; gap: 10px; }
.rb-badge {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px; color: #fff;
}
.rb-badge.rb-robust { background: #26a69a; }
.rb-badge.rb-moderate { background: var(--blue); }
.rb-badge.rb-fragile { background: #ff9800; }
.rb-badge.rb-unreliable { background: #ef5350; }
.rb-title { font-weight: 600; color: var(--ink); }
.rb-help { margin-left: auto; font-size: 12px; color: var(--dim); }
.rb-mc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 4px; }
.rb-mc-stat span {
  display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--dim); margin-bottom: 1px;
}
.rb-mc-stat b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rb-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.rb-concerns li { color: #c0392b; }
.rb-strengths li { color: var(--green-deep); }
.rb-foot { font-size: 12px; color: var(--dim); margin: 10px 0 0; }
.rb-badge.rb-mini { font-size: 10px; padding: 1px 7px; vertical-align: middle; }
/* compact League verdict: a colored dot (full word lives on the strategy page) */
.rb-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-left: 5px; }
.rb-dot.rb-robust { background: #26a69a; }
.rb-dot.rb-moderate { background: var(--blue); }
.rb-dot.rb-fragile { background: #ff9800; }
.rb-dot.rb-unreliable { background: #ef5350; }
@media (prefers-color-scheme: dark) { .rb-concerns li { color: #ef8f88; } }

.tablewrap { overflow-x: auto; }
/* jumped-to row (e.g. League badge -> the strategy's ranking row) */
tr[id]:target { scroll-margin-top: 20px; }
tr[id]:target > td { background: var(--tint2); }
.bt-months {
  border-collapse: collapse; width: 100%; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.bt-months th, .bt-months td {
  padding: 6px 14px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.bt-months th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--dim); text-align: left; border-bottom: 2px solid var(--border);
}
.bt-months th.num, .bt-months td.num { text-align: right; }
.bt-months td.mon { font-weight: 600; color: var(--ink); }
.bt-months td { color: var(--mid); }
/* bias-check findings: the whole row is a link that jumps to the flagged line */
.biasrow { cursor: pointer; }
.biasrow:hover td { background: var(--tint2); }
.biasrow:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.biasrow td.mon { color: var(--blue); white-space: nowrap; }
/* finding severity, same vocabulary the Forge editor's lint gutter uses:
   error = future-data leak, warning = realism problem, info = worth a look */
.sev { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
       padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.sev-error { background: var(--tintred); color: #e53935; }
.sev-warning { background: var(--tintamber, var(--panel)); color: #d9840a; }
.sev-info { background: var(--panel); color: var(--dim); }
/* text-only variants, for naming the severities inline in prose */
.sev-error-t { color: #e53935; } .sev-warning-t { color: #d9840a; } .sev-info-t { color: var(--dim); }
.bt-months tbody tr:nth-child(even) { background: var(--panel); }
.bt-months tbody tr:hover { background: var(--tint); }

.chat { max-width: 640px; }
/* GitHub-comment-style card: a bordered box per post with its own shaded
   header band, rather than a flat row separated only by a bottom divider.
   overflow: hidden clips the header's background to the card's own rounded
   top corners; padding-bottom gives the last child (body/attachments/edit
   form, whichever a given post ends with) breathing room at the bottom. */
.chatmsg {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 0 12px;
  padding-bottom: 10px;
  font-size: 14px;
  overflow: hidden;
}
.chatmsg p { margin: 4px 0 0; white-space: pre-wrap; }
.chatreply { margin-left: 22px; border-left: 2px solid var(--border); padding-left: 0; }
.cactions { display: flex; gap: 14px; margin-top: 3px; font-size: 12px; padding: 0 12px; }
.cactions .linkbtn { font-size: 12px; color: var(--blue); }
.cactions .linkbtn:hover { text-decoration: underline; }
.replying { margin: 0 0 4px; }
/* a deep-linked/#target post gets an outline instead of a full-bleed fill --
   a colour wash would otherwise fight the header's own background */
.chatmsg:target { border-color: #ff9800; box-shadow: 0 0 0 1px #ff9800; }
.chead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
/* small role/relationship pill next to a poster's name (GitHub's own
   Member/Owner + "Author" pattern) -- site-wide role first, thread-specific
   context second; see forum_thread.html */
.crole {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.4;
}
.crole-mod { background: var(--tintred); color: #e53935; }
.crole-op { background: var(--tint); color: var(--blue); }
/* moderator per-post delete: pushed to the far right of the post header */
.fpostdel { margin-left: auto; }
.linkbtn.dangerlink { color: var(--dim); font-size: 13px; }
.linkbtn.dangerlink:hover { color: #e53935; text-decoration: none; }
.cavatar {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid #d1d4dc;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.cwho { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.cwho:hover { text-decoration: none; color: var(--blue); }
.bigavatar { width: 52px; height: 52px; font-size: 26px; border-radius: 12px; }
.profilehead { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.profilehead h1 { margin: 0; }
.profilelist { list-style: none; padding: 0; margin: 0; font-size: 14px; max-width: 680px; }
/* bound long lists (e.g. many Forge variants under Uploaded strategies) so they
   scroll inside a fixed area instead of running off the page. Short lists show
   no scrollbar. */
.profilelist { max-height: 360px; overflow-y: auto; }
.profilelist li { padding: 6px 0; }
/* subtle count next to a profile category header, so visitors see what's in
   each section without opening it */
.pcount { font-weight: 400; font-size: 13px; }
.inlineselect { display: inline-block; width: auto; margin-right: 8px; }
.aboutbody { margin-left: 0; max-width: 640px; }
.aboutform { max-width: 640px; }
.cvotewrap { margin-left: auto; }
.cvotes {
  background: var(--panel);
  border: none;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
}
.cvotes.has { background: var(--tintgreen); color: var(--green-deep); font-weight: 600; }
.cvotes.voted { box-shadow: 0 0 0 1px var(--blue); }
/* GitHub-style body: full card width below the header band, not indented
   under the avatar (the old flat layout indented it to align with the name;
   the header/body split now does that visual separation instead) */
.cbody { font-size: 14px; margin: 0; padding: 0 12px; overflow-wrap: anywhere; }
.cbody blockquote { border-left: 3px solid var(--border); margin: 4px 0; padding: 2px 10px; color: var(--dim); }
.cbody pre { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; overflow-x: auto; font-size: 12.5px; margin: 6px 0; }
.cbody code { background: var(--panel); border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
.cbody pre code { background: none; padding: 0; }
.cbody ul, .cbody ol { margin: 4px 0 4px 20px; padding: 0; }
.csortrow { display: flex; justify-content: flex-end; font-size: 12px; margin-bottom: 6px; }
.csort { border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-size: 12px; margin-left: 6px; }
.mdbar { display: flex; gap: 2px; justify-content: flex-end; margin-bottom: 4px; }
.mdbtn { background: none; border: none; padding: 4px 9px; border-radius: 4px; color: var(--mid); cursor: pointer; font-size: 13px; }
.mdbtn:hover { background: var(--tint); color: var(--blue); }
.mdhint { font-size: 12px; color: var(--dim); margin: 6px 0 0; }
.chatform textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; }
.chatform button[type="submit"] { margin-top: 6px; background: var(--blue); color: #fff; border: none; border-radius: 6px; padding: 8px 18px; cursor: pointer; }
.chatform .replycancel { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 12px; }
.chatform .replycancel:hover { color: #ef5350; }

.checkbtns { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.checkbtn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  min-width: 112px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.checkbtn { position: relative; }
.checkbtn:hover { border-color: var(--blue); background: var(--tint2); }
.checkbtn .ck-badge { position: absolute; top: 6px; right: 8px; font-size: 12px; line-height: 1; }
.ck-badge { font-weight: 700; }
.ck-badge.ck-done { color: #26a69a; }
.ck-badge.ck-failed { color: #ef5350; }
.ck-badge.ck-run { color: #ff9800; }
.checkbtn .ck-ico { font-size: 17.5px; line-height: 1; }
.checkbtn .ck-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.checkbtn .ck-sub { font-size: 11px; color: var(--dim); }
.checkbtn.active { border-color: var(--blue); background: var(--tint2); }
.checkbtn.active .ck-label { color: var(--blue); }
/* a check that's turned off or not available to this user: greyed, non-clickable */
.checkbtn:disabled, .checkbtn.ck-disabled { opacity: .45; cursor: not-allowed; }
.checkbtn:disabled:hover, .checkbtn.ck-disabled:hover { border-color: var(--border); background: var(--card); }
/* a premium-gated check the viewer can't run yet: dimmed but still clickable
   (the tile opens its panel, which shows the "see plans" upgrade hint) */
.checkbtn.ck-locked { opacity: .62; }
.checkbtn.ck-locked .ck-label { color: var(--mid); }
.checkbtn.ck-locked:hover { opacity: .85; border-color: var(--blue); }
.ck-badge.ck-lock { filter: grayscale(1); opacity: .85; font-weight: 400; }
.checkbar-intro { font-size: 13px; line-height: 1.55; background: var(--panel); border-radius: 8px; padding: 10px 14px; margin: 10px 0 20px; }
.checkbar-intro a { font-weight: 600; }

/* admin Performance tab */
.heatmap { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; margin: 12px 0 20px; max-width: 760px; }
.heatmap .hm-corner { }
.heatmap .hm-hour { font-size: 9px; color: var(--dim); text-align: center; }
.heatmap .hm-day { font-size: 11px; color: var(--dim); display: flex; align-items: center; }
.heatmap .hm-cell { aspect-ratio: 1; border-radius: 2px; background: var(--panel); }
.hoststat-row { display: flex; gap: 24px; flex-wrap: wrap; margin: 12px 0 24px; }
.hoststat { min-width: 220px; }
.hoststat b { font-size: 13px; display: block; margin-bottom: 8px; }
.corebars { display: flex; gap: 3px; align-items: flex-end; height: 60px; }
.corebar { width: 10px; height: 100%; background: var(--panel); border-radius: 2px; display: flex; align-items: flex-end; overflow: hidden; }
.corebar-fill { display: block; width: 100%; }
.corecombo { display: flex; gap: 10px; flex-wrap: wrap; }
.corecombo-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.corecombo-threads { display: flex; gap: 3px; align-items: flex-end; height: 60px; }
.corecombo-label { font-size: 10px; color: var(--dim); white-space: nowrap; }
.tempbar { width: 60px; height: 5px; background: var(--panel); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.tempbar span { display: block; height: 100%; }
.sensorchip .tempbar { width: 100%; }
.membar { width: 220px; height: 10px; background: var(--panel); border-radius: 5px; overflow: hidden; }
.membar span { display: block; height: 100%; }
.sensorgrid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 22px; }
.sensorchip { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.sensorchip b { font-size: 14px; }

/* mobile: performance tab shouldn't force horizontal page scroll */
@media (max-width: 700px) {
  .heatmap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 620px;
    grid-template-columns: 60px repeat(24, minmax(20px, 1fr));
  }
  .hoststat-row { flex-direction: column; gap: 16px; }
  .hoststat { min-width: unset; width: 100%; }
  .sensorchip { min-width: 90px; flex: 1 1 calc(50% - 8px); }
  .corecombo { gap: 6px; }
}

.upgradelog { background: #131722; color: #d1d4dc; border-radius: 6px; padding: 12px; font-size: 12px; max-height: 320px; overflow-y: auto; }
.changelog { margin: 10px 0; font-size: 13px; }
.changelog summary { cursor: pointer; color: var(--dim); }

/* error pages */
.errcode { font-size: 96px; font-weight: 600; letter-spacing: -4px; margin: 12vh 0 0; color: var(--ink); }
.errtitle { font-size: 26px; font-weight: 500; margin: 22px 0 0; }
.errquip { color: var(--dim); font-size: 15px; margin: 10px 0 28px; }
.spark-down .spark-line { stroke: #ef5350; }
.spark-down .spark-tip { fill: #ef5350; }
.homebtn {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--panel);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  margin: 0 4px;
  padding: 9px 16px;
}
.homebtn:hover { border-color: #d1d4dc; text-decoration: none; }

/* code toolbar (detail page) */
.codebar { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; border-top: 1px solid var(--border); padding-top: 12px; }
.codebar h2 { margin: 0; }
.codebar-actions { display: flex; gap: 8px; }
.copybtn, .dlbtn {
  display: inline-block;
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
}
.copybtn:hover, .dlbtn:hover { background: var(--tint); text-decoration: none; }
.dlbtn.pending { color: var(--dim); cursor: help; }
/* floating "copy link to these lines" button (code.js), positioned inline via
   JS (left/top) at the current text selection -- shadow/z-index lift it above
   the code block it's pointing at */
.linecopybtn {
  position: absolute;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.linecopybtn.copied { background: var(--tintbull); border-color: #26a69a; color: #1b7d72; }
/* unfurled code-permalink card (a pasted "code snippet · lines N-M" link,
   enhanced client-side by code.js into this). Reuses .codehl's own token-color
   CSS variables for the body so it stays theme-aware (light/dark), unlike the
   FAQ's .faqcode which bakes in one fixed dark palette on purpose. */
.codecard {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 6px 0;
  max-width: 100%;
}
.codecard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.codecard-head a { font-weight: 600; }
.codecard-lines {
  font-family: ui-monospace, Consolas, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--dim);
  flex-shrink: 0;
}
.codecard-body { overflow-x: auto; font-size: 12.5px; }
.codecard-body .codehl { padding: 0 8px; margin: 0; }
.dangerbtn { color: #ef5350; }
.dlbtn.dangerbtn { border-color: #ef535055; }
.dlbtn.dangerbtn:hover { background: #ef53501a; }
/* forum thread admin controls: uniform button row with breathing room */
.fadmin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.fadmin .inline { display: flex; gap: 8px; }
/* danger variant of the small .dlbtn (Forge Delete/Discard live outside
   .admin-panel, so they need the base .dlbtn shape + a red hover) */
.dlbtn.dangerbtn:hover { border-color: #ef5350; background: var(--tintred); color: #e53935; }
.chipmanage { margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.cm-chip {
  display: inline-flex; align-items: center; gap: 1px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 4px 2px 2px; font-size: 13px;
}
.cm-chip.cm-pinned { background: var(--tint); border-color: var(--blue); }
.cm-q { padding: 0 6px; color: var(--ink); }
.admin-panel form button.cm-btn {
  background: none; border: none; padding: 3px 5px; border-radius: 999px;
  font-size: 12px; line-height: 1; cursor: pointer; color: var(--dim); white-space: nowrap;
}
.admin-panel form button.cm-btn:hover { background: var(--card); color: var(--ink); border-color: transparent; }
.cm-pin { filter: grayscale(1); opacity: .5; }
.cm-chip.cm-pinned .cm-pin { filter: none; opacity: 1; }
.admin-panel form button.cm-del { font-size: 15px; }
.admin-panel form button.cm-del:hover { color: #e53935; background: var(--tintred); }
.dlbtn.pending:hover { background: var(--panel); }
.copybtn.copied { background: var(--tintbull); border-color: #26a69a; color: #1b7d72; }

/* acknowledgment + support */
.tribute li { margin: 8px 0; }
.captchabox {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 16px 0 4px;
}
.captchabot { font-size: 26px; }
.captchatitle { font-size: 12px; color: var(--dim); }
.captchaq { font-size: 14px; font-weight: 600; margin-top: 2px; }
.captchabox input {
  width: 84px !important;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin-left: auto;
}
.feedbackform { max-width: 560px; }
.feedbackform label { display: block; margin: 12px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.feedbackform select, .feedbackform textarea, .feedbackform input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
}
.feedbackform button[type="submit"] {
  margin-top: 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 14px;
  cursor: pointer;
}
.feedbackform button[type="submit"]:hover { background: var(--blue-hover); }

.leaguecta {
  display: inline-block; margin: 26px auto 0; padding: 12px 22px;
  background: var(--tint); border: 1px solid var(--tint3); border-radius: 999px;
  color: var(--blue); font-weight: 600; font-size: 15px;
}
.leaguecta:hover { background: var(--tint3); text-decoration: none; }
/* League + Forum CTAs side by side (wrap on narrow screens) */
.ctarow { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 34px 0 0; }
.ctarow .leaguecta { margin: 0; }
.latest h2 .seeall { font-size: 12px; font-weight: 400; margin-left: 8px; }
.latest h2 .seeall:hover { color: var(--blue); }

/* strategy league / ranking */
.detail.league-page { margin: 0 auto; max-width: 1240px; }
.league-title { font-size: 26px; margin: 8px 0 4px; }
.league-sub { max-width: 900px; line-height: 1.6; margin-bottom: 18px; }
/* the "how it's scored" rationale: available, but folded away by default so the
   board itself is what you land on */
.league-how { max-width: 900px; margin: -8px 0 18px; font-size: 13px; color: var(--dim); }
.league-how > summary { cursor: pointer; color: var(--blue); width: fit-content; }
.league-how > summary:hover { text-decoration: underline; }
.league-how p { line-height: 1.6; margin: 10px 0 0; }
.league { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.league th, .league td { padding: 7px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.league th { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); text-align: left; border-bottom: 2px solid var(--border); }
.league th.num, .league td.num { text-align: right; }
.league tbody tr:hover { background: var(--tint); }
.league .rank { font-size: 15px; font-weight: 700; color: var(--dim); text-align: center; }
/* cap the strategy-name column so a long name can't push the wide League
   table past the viewport and clip the last column; full name on hover */
.league-strat { max-width: 260px; }
.league-name { font-weight: 600; display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.league-repo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league-repo { font-size: 11px; }
.league .score { font-size: 16px; font-weight: 700; color: var(--blue); }
.league .scorebar { display: block; height: 4px; border-radius: 2px; background: var(--panel); margin-top: 3px; overflow: hidden; }
.league .scorebar > span { display: block; height: 100%; background: var(--blue); border-radius: 2px; }
/* league controls: filter box, sortable headers, pagination */
.league-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.league-controls .searchbox { max-width: 320px; }
/* "Refine" threshold-filter panel (collapsed by default) */
.league-refine { flex-basis: 100%; font-size: 13px; }
.league-refine summary { cursor: pointer; color: var(--accent); width: fit-content; padding: 2px 0; }
.refine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin: 10px 0 2px; }
.refine-grid label { display: flex; flex-direction: column; gap: 3px; color: var(--mid); font-size: 12px; }
.refine-grid input { width: 100%; box-sizing: border-box; }
.refine-hint { font-size: 12px; margin: 6px 0 0; }
.league-count { margin-left: auto; font-size: 13px; }
.league th .lg-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.league th .lg-sort:hover { color: var(--blue); }
.league th .lg-sort.on { color: var(--blue); }
.league-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 18px 0; }

/* legal pages */
.legal { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.legal h2 { font-size: 17px; font-weight: 600; margin: 26px 0 6px; }
.legal p { font-size: 14px; color: var(--mid); margin: 6px 0; }

/* FAQ: illustrated, side-nav'd guide */
.faqpage { width: 100%; }
.faqwrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); max-width: 1040px; margin: 0 auto; gap: 36px; padding: 24px 24px 80px; }
@media (max-width: 820px) { .faqwrap { grid-template-columns: minmax(0, 1fr); padding: 20px 16px 60px; } .faqside { display: none; } }

.faqside { position: sticky; top: 16px; align-self: start; font-size: 13px; }
.faqside a { display: block; color: var(--dim); padding: 5px 0 5px 10px; border-left: 2px solid transparent; }
.faqside a:hover { color: var(--ink); }
.faqside a.on { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }

.faqmain { min-width: 0; }

.faqmain h1 { font-size: 25px; margin: 6px 0 8px; letter-spacing: -.01em; }
.faqmain > .lede { font-size: 14.5px; color: var(--mid); line-height: 1.6; max-width: 64ch; margin: 0 0 44px; }

.faqsec { padding: 40px 0; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.faqsec:first-of-type { border-top: none; padding-top: 0; }
.faqsec-h { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; }
.faqsec-ico { font-size: 21px; }
.faqsec-h h2 { font-size: 19px; margin: 0; }
.faqsec-tag { font-size: 11px; color: var(--dim); background: var(--panel); border-radius: 10px; padding: 3px 10px; }
.faqsec-lede { font-size: 13.5px; color: var(--mid); line-height: 1.6; max-width: 100%; margin: 4px 0 20px; }

.faqfig { background: var(--panel); border-radius: 12px; padding: 16px 18px 12px; margin: 0 0 18px; }
.faqfig canvas { display: block; width: 100%; height: auto; }
.faqfig-cap { font-size: 12px; color: var(--dim); margin: 10px 0 0; line-height: 1.5; }
.faqpairs { margin: 10px 0 4px; }
.faqpairs > summary { cursor: pointer; font-size: 13px; color: var(--blue); }
.faqpairs-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.faqpairs-list code { font-size: 12px; }

.faqgrid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 640px) { .faqgrid2 { grid-template-columns: minmax(0, 1fr); } }

.faqcode { background: #0d1117; border-radius: 10px; padding: 13px 15px; overflow-x: auto; margin: 0 0 6px; }
.faqcode pre { margin: 0; font-family: ui-monospace, Consolas, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.65; color: #c9d1d9; }
.faqcode .k { color: #ff7b72; } .faqcode .s { color: #a5d6ff; } .faqcode .f { color: #d2a8ff; } .faqcode .n { color: #79c0ff; }
.faqcode .c { color: #8b949e; font-style: italic; }
.faqcodelabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.faqcodelabel.bad { color: #ef5350; } .faqcodelabel.good { color: #26a69a; }

.faqgroup { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); margin: 22px 0 8px; }
.faqgroup:first-of-type { margin-top: 4px; }
.faqtagdef { margin: 0; display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 6px 14px; }
.faqtagdef dt { font-size: 12.5px; padding: 4px 0; }
.faqtagdef dt code { background: var(--panel); padding: 1px 6px; border-radius: 4px; font-size: 12px; color: var(--blue); }
.faqtagdef dd { margin: 0; padding: 4px 0; font-size: 13px; color: var(--mid); line-height: 1.5; }
.faqtagdef dd code { background: var(--panel); padding: 0 4px; border-radius: 3px; font-size: 12px; }
@media (max-width: 560px) { .faqtagdef { grid-template-columns: minmax(0, 1fr); } .faqtagdef dd { padding-bottom: 10px; } }

.faqcmd { background: #0d1117; border-radius: 10px; padding: 12px 15px; overflow-x: auto; margin: 14px 0; font-family: ui-monospace, Consolas, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.7; color: #9cdcfe; white-space: pre; }
.faqcmd .cmdflag { color: #6a9955; }
.faqcmdlabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); margin: 18px 0 0; }
.faqconfig { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 15px; margin: 8px 0 0; overflow-x: auto; }
.faqconfig pre { margin: 0; font-family: ui-monospace, Consolas, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.6; color: var(--mid); }
.faqperiods { margin: 4px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--mid); line-height: 1.7; }
.faqperiods code { background: var(--panel); padding: 0 5px; border-radius: 4px; font-size: 12px; }

.faqtell { margin: 16px 0 0; font-size: 12.5px; color: var(--dim); border-left: 2px solid var(--border); padding-left: 12px; line-height: 1.6; }
.faqlink { margin: 14px 0 0; font-size: 12.5px; color: var(--dim); }
.faqlink a { font-weight: 600; }

.faqescalate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; padding: 12px 14px; background: var(--tint2); border: 1px dashed var(--blue); border-radius: 10px; }
.faqesc-step { font-size: 12.5px; font-weight: 600; color: var(--mid); display: flex; flex-direction: column; gap: 1px; text-decoration: none; }
.faqesc-step.on { color: var(--blue); }
.faqesc-step em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--dim); }
.faqesc-arrow { font-size: 11.5px; color: var(--dim); white-space: nowrap; }

/* donate page */
.donate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 14px 0 28px; }
.donate-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; color: var(--ink);
}
.donate-card:hover { border-color: var(--blue); text-decoration: none; }
.donate-logo { width: 80px; height: 80px; object-fit: contain; margin-bottom: 4px; }
.donate-card b { font-size: 15px; }
.donate-card span { font-size: 13px; color: var(--mid); }
.donate-card-soon { opacity: .55; }

/* dark mode toggle (footer) */
.themebtn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 0 4px; }
.themebtn:hover { filter: brightness(1.2); }

/* Strategy Forge diff editor */
.diff { margin: 1rem 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
.diff-table { width: 100%; border-collapse: collapse; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.diff-hunk-header { background: var(--panel); }
.diff-hunk-header td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.diff-hunk-desc td { padding: 0.25rem 0.75rem; font-style: italic; color: var(--mid); border-bottom: 1px solid var(--border); }
.diff-marker { width: 1.5rem; text-align: center; color: var(--dim); padding: 0.1rem 0.5rem; user-select: none; }
.diff-line { padding: 0; margin: 0; }
.diff-line pre { margin: 0; padding: 0.1rem 0.5rem; white-space: pre-wrap; }
.diff-add { background: var(--tintgreen); }
.diff-remove { background: var(--tintred); }
.diff-context { background: var(--bg); }
.rationale { line-height: 1.5; }
.footnotes { list-style: none; padding: 0; }
.footnotes li { margin: 0.25rem 0; }

/* AI thinking toast */
.thinking-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.thinking-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.thinking-toast::before {
  content: "✨";
  margin-right: 8px;
}

/* ---- forum ---- */
.fcrumb { margin: 0 0 8px; font-size: 13px; }
.fcats { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 28px; }
.fcat { display: flex; gap: 14px; align-items: flex-start; background: var(--tint2);
  border-radius: 14px; padding: 14px 18px; color: inherit; }
.fcat:hover { background: var(--tint3); text-decoration: none; }
.fcat-emoji { font-size: 26px; line-height: 1.2; }
.fcat-body { display: flex; flex-direction: column; gap: 2px; }
.fcat-body b { font-size: 15px; }
.fcat-meta { font-size: 12px; }
.fcat-last { font-style: italic; }
.fthread-title { font-size: 22px; margin: 4px 0 14px; }
.fthreads td:first-child { max-width: 480px; }
.fstrat { display: block; background: var(--tint2); border-radius: 12px;
  padding: 10px 16px; margin: 0 0 18px; color: inherit; font-size: 14px; }
.fstrat:hover { background: var(--tint3); text-decoration: none; }
.fposts { margin-top: 4px; }
.fquote { font-size: 12px; border-left: 3px solid var(--tint3); padding: 2px 8px;
  margin: 4px 12px 6px; }
.fvotes { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.fvote { background: none; border: none; color: var(--dim); cursor: pointer;
  font-size: 14px; padding: 0 4px; }
.fvote:hover { color: var(--blue); }
.fvote.on { color: var(--blue); font-weight: 700; }
.fscore { font-size: 13px; min-width: 2ch; text-align: center; }
.fscore.pos { color: var(--green-deep); }
.fscore.neg { color: #d2345b; }
/* emoji reactions under a post */
.freacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.freact { display: inline-flex; align-items: center; gap: 4px; background: var(--tint2);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 13px;
  color: var(--mid); line-height: 1.5; cursor: pointer; }
.freact:hover:not(:disabled) { border-color: var(--blue); }
.freact.on { background: var(--tint); border-color: var(--blue); color: var(--blue); }
.freact b { font-weight: 600; font-variant-numeric: tabular-nums; }
.freact:disabled { cursor: default; }
.freact-add { position: relative; }
.freact-add > summary.freact-addbtn { display: inline-flex; align-items: center; gap: 1px;
  list-style: none; cursor: pointer; background: var(--tint2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 9px; font-size: 13px; color: var(--dim); }
.freact-addbtn::-webkit-details-marker { display: none; }
.freact-addbtn:hover, .freact-add[open] > .freact-addbtn { border-color: var(--blue); color: var(--blue); }
.freact-palette { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0;
  display: flex; gap: 2px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 5px; box-shadow: 0 6px 22px rgba(0, 0, 0, .18); }
.freact-pick { background: none; border: none; cursor: pointer; font-size: 18px;
  padding: 3px 6px; border-radius: 8px; line-height: 1; }
.freact-pick:hover { background: var(--tint2); }
.fnew .fnew-row { display: flex; gap: 10px; margin-bottom: 10px; }
.fnew .ftitle { flex: 1; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--tint3); background: var(--tint2); color: inherit; font-size: 15px; }
.fnew .fprefix { max-width: 160px; }
.aunread { font-weight: 600; }
.aunread::before { content: "•"; color: var(--blue); margin-right: 6px; }
/* admin note cell: keep the input + save button on one row */
.notecell { display: flex; gap: 6px; align-items: center; }
.notecell .searchbox { flex: 1; min-width: 110px; width: auto; }
.admininput { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--tint3);
  background: var(--tint2); color: inherit; font-size: 13px; max-width: 180px; }
.agreebox { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0;
  font-size: 13px; line-height: 1.4; }
.agreebox input { margin-top: 3px; }

/* ---- forum two-pane layout ---- */
.forumpage { position: relative; width: min(1500px, 94vw); max-width: none;
  padding-right: 30px; }
.flayout { display: flex; gap: 26px; align-items: flex-start; }
.fside { width: 260px; flex-shrink: 0; position: sticky; top: 14px; }
.fmain { flex: 1; min-width: 0; }
.fnav { display: flex; flex-direction: column; gap: 4px; }
.fnav-cat { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 10px; color: inherit; font-size: 14px; }
.fnav-cat:hover { background: var(--tint2); text-decoration: none; }
.fnav-cat.on { background: var(--tint); color: var(--blue); font-weight: 600; }
.fnav-emoji { width: 22px; text-align: center; }
.fnav-title { flex: 1; }
.fnav-count { font-size: 12px; }
.fgrip { position: absolute; top: 0; right: 4px; width: 10px; height: 100%;
  cursor: col-resize; border-radius: 4px; }
.fgrip:hover, .fgrip.on { background: var(--tint3); }
@media (max-width: 900px) {
  .forumpage { width: 94vw; padding-right: 0; }
  .flayout { flex-direction: column; gap: 14px; }
  .fside { width: 100%; position: static; }
  .fgrip { display: none; }                     /* desktop-only drag-resize */
  .fnav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .fnav-cat { padding: 6px 10px; font-size: 13px; }
  .fnav-blurb { display: none; }                /* compact chips on phones */
}
.fnav-body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fnav-blurb { font-size: 11px; font-weight: 400; line-height: 1.3; }
.fnav-cat.on .fnav-blurb { color: var(--dim); }
.fstrat-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.fstrat-wrap .fstrat { margin: 0; flex: 1; min-width: 260px; }

/* ---- pricing ---- */
.pricing h1 { margin-bottom: 4px; }
.plantag { color: var(--blue); font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.privbox { background: var(--tint2); border-radius: 14px; padding: 16px 22px; margin: 22px 0; }
.privbox h2 { font-size: 17px; margin: 0 0 8px; }
.privbox ul { margin: 0; padding-left: 20px; line-height: 1.55; font-size: 14px; }
.privbox li { margin: 6px 0; }
/* crypto payment box (pricing) */
.cryptobox { border: 1px solid var(--border); border-radius: 14px; padding: 16px 22px; margin: 26px 0; }
.cryptobox h2 { font-size: 17px; margin: 0 0 6px; }
.cryptorows { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0; }
.cryptorow { display: flex; align-items: center; gap: 12px; flex: 1 1 340px;
  padding: 12px 14px; background: var(--tint2); border-radius: 10px; }
.cryptoicon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 24px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.cryptoicon-btc { background: rgba(247, 147, 26, .14); color: #f7931a; }
.cryptoicon-sol { background: rgba(153, 69, 255, .14); color: #9945ff; }
.cryptometa { min-width: 0; font-size: 14px; }
.cryptoaddr { display: block; margin-top: 4px; font-size: 12px; color: var(--mid);
  word-break: break-all; user-select: all; }
.pricegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; margin: 8px 0 26px; }
.pricecard { position: relative; background: var(--tint2); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; }
.pricecard h2 { margin: 0; font-size: 19px; }
.pricecard .ptag { font-size: 13px; margin: 2px 0 10px; }
.pricecard .price { font-size: 30px; font-weight: 700; margin: 0 0 12px; }
.pricecard .price .dim { font-size: 14px; font-weight: 400; }
.pricecard-rec { outline: 2px solid var(--blue); }
.recbadge { position: absolute; top: -11px; right: 14px; background: var(--blue);
  color: #fff; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.perks { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.perks li { font-size: 13.5px; padding: 4px 0 4px 22px; position: relative; line-height: 1.4; }
.perks li::before { content: "✓"; position: absolute; left: 0; color: var(--green-deep);
  font-weight: 700; }
.pbtn { text-align: center; padding: 10px 14px; border-radius: 10px;
  background: var(--blue); color: #fff; font-weight: 600; font-size: 14px; }
.pbtn:hover { background: var(--blue-hover); text-decoration: none; }
.pbtn-rec { background: var(--green-deep, #188038); }
.pbtn-rec:hover { filter: brightness(1.1); }
.dim-btn { background: var(--tint3); color: inherit; }
.dim-btn:hover { background: var(--tint); color: var(--blue); }
.fineprint { font-size: 12.5px; max-width: 760px; }
.pbtn-soon { opacity: .55; cursor: default; display: block; }
.pbtn-soon:hover { filter: none; background: var(--green-deep, #188038); }

/* Strategy Forge code editor (CodeMirror 6). Bounded height so a long
   strategy scrolls inside the editor instead of stretching the page. */
.cm-host { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 8px 0; }
/* Same face and size as .diff-table: the editor IS the diff view now, and two
   monospace stacks side by side made the same code look like two things. */
.cm-host .cm-editor { max-height: 70vh; font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cm-host .cm-scroller, .cm-host .cm-content, .cm-host .cm-gutters {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cm-host .cm-scroller { overflow: auto; }
.cm-host .cm-focused { outline: none; }
.fedit { margin: 4px 12px 0; font-size: 13px; }
.fedit textarea { width: 100%; margin: 6px 0; font-family: ui-monospace, monospace; font-size: 12.5px; }

/* --- forum markdown composer (toolbar + preview + attachments) --- */
.mdbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0 4px; }
.mdbtn {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 9px; font-size: 13px; cursor: pointer; color: inherit; line-height: 1.4;
}
.mdbtn:hover { border-color: var(--blue); color: var(--blue); }
.mdpreview { margin-left: auto; }
.mdstatus { font-size: 12px; }
.mdpane {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  min-height: 60px; background: var(--panel);
}
textarea.dragging { outline: 2px dashed var(--blue); }
/* attachments render inline in a post; cap them so one screenshot can't
   dominate the thread, and keep the aspect ratio */
.cbody .fimg { max-width: 100%; max-height: 420px; height: auto; border-radius: 8px;
  border: 1px solid var(--border); margin: 6px 0; display: block; }

/* static trust-check findings marked on the source line itself (hover shows
   the finding). Severity-coloured to match the findings table. */
.trust-hit { border-left: 3px solid transparent; padding-left: 5px; cursor: help; }
.trust-error   { border-left-color: #ef5350; background: rgba(239, 83, 80, .10); }
.trust-warning { border-left-color: #f0a202; background: rgba(240, 162,  2, .10); }
.trust-info    { border-left-color: #2f6df6; background: rgba(47, 109, 246, .08); }

/* attachments shown UNDER a post (uploaded with it but never embedded inline) */
.fattach { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 12px 0; }
.fattach img {
  max-height: 140px; max-width: 220px; border: 1px solid var(--border);
  border-radius: 6px; display: block;
}
.fattach a:hover img { border-color: var(--blue); }

/* a finding repeated on several lines: the follow-up rows carry only their own
   line number, so tie them to the row above instead of leaving them looking
   like empty rows */
.biasrow-cont td { border-top: 0; padding-top: 0; }
.biasrow-cont td.mon { padding-top: 2px; }

/* a source line carrying a finding: make it obvious it has hover text */
.has-note { cursor: help; }

/* findings tables: the explanation column is prose, so let it wrap instead of
   forcing the whole table into a horizontal scrollbar */
.bt-months.findings td:last-child { white-space: normal; }
.bt-months.findings { table-layout: auto; }
.bt-months.findings td:first-child { width: 1%; }

/* running check: elapsed against the hard timeout. It is a time budget, not
   task progress -- freqtrade reports none -- so it is deliberately understated
   rather than looking like a completion bar. */
.runbar { height: 4px; background: var(--tint3, var(--panel)); border-radius: 3px;
  overflow: hidden; margin: 2px 0 8px; max-width: 420px; }
.runbar-fill { height: 100%; width: 0; background: var(--blue);
  transition: width 1s linear; }
.runbar-fill.over { background: #ef5350; }
/* uploaded strategy's own filename in the meta line */
.upname { background: var(--panel); border-radius: 4px; padding: 1px 6px; font-size: 12.5px; }

/* the rating you actually gave, so six identical buttons stop looking like
   "not rated". aria-pressed carries the same state for screen readers. */
.starbtn-on { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb);
  color: #fff; font-weight: 600; }

/* Favourite toggle. Sits in the title row next to Share; the filled heart is
   the ONLY difference between saved and not, so it carries a colour rather
   than relying on the glyph alone (♡ vs ♥ is a thin signal at small sizes). */
.favbtn { background: none; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 16px; line-height: 1; padding: 5px 9px;
  color: var(--dim); text-decoration: none; display: inline-block; }
.favbtn:hover { color: #e0245e; border-color: #e0245e; }
.favbtn-on { color: #e0245e; border-color: #e0245e; }
/* favourites list on the profile: name on one line, origin dimmed under it,
   same shape the search results use so the two read alike */
.favlist { list-style: none; padding: 0; margin: 8px 0 18px; }
.favlist li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.favlist li:last-child { border-bottom: 0; }
.favlist .dim { display: block; font-size: 12px; }
