/* ChartR Gyms design system — extracted from design/ChartR Gyms.dc.html.
   Source of truth for the cream ("Newsreader/Hanken/Plex Mono") theme applied
   to every page by default. */
:root {
  --page: #F6F4EF;
  --sidebar: #F1EEE6;
  --card: #FBFAF6;
  --border: #E4E0D6;
  --border-soft: #ECE8DE;
  --ink: #1C1B17;
  --muted: #5f5d53;
  --muted-2: #6b685d;
  --muted-3: #8a877b;
  --muted-4: #a19d90;
  --faint: #bdb9ac;
  --rust: #B4674A;
  --rust-2: #C9805F;
  --rust-ink: #a06d3d;
  --green: #3d7a52;
  --green-bg: #E6F0E7;
  --green-bd: #cfe3d1;
  --green-ink: #2f6641;
  --code-panel: #1C1B17;
  --code-ink: #d6d2c6;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--sans); }
::selection { background: rgba(180,103,74,0.18); }
#gymroot ::-webkit-scrollbar { width: 10px; height: 10px; }
#gymroot ::-webkit-scrollbar-thumb { background: #dcd6c9; border-radius: 6px; border: 3px solid var(--page); }
a { color: inherit; text-decoration: none; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popUp { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }

/* Best-performer leaderboard bar: grow in, then keep a soft rust glow pulsing +
   a light sweep so the #1 model reads as "alive". */
@keyframes barBestGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,103,74,0.0); filter: saturate(1); }
  50% { box-shadow: 0 0 12px 1px rgba(180,103,74,0.55); filter: saturate(1.25); }
}
@keyframes barBestSweep {
  0% { background-position: -140% 0; }
  100% { background-position: 240% 0; }
}
.lb-bar-best {
  position: relative;
  background: linear-gradient(90deg, #C9805F, #B4674A) !important;
  animation: barGrow .9s cubic-bezier(.2,.8,.2,1) both,
             barBestGlow 2.2s ease-in-out .9s infinite;
}
.lb-bar-best::after {
  content: ""; position: absolute; inset: 0; border-radius: 5px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  background-size: 60% 100%; background-repeat: no-repeat;
  animation: barBestSweep 2.6s ease-in-out .9s infinite;
}
@media (prefers-reduced-motion: reduce) {
  .lb-bar-best { animation: barGrow .9s cubic-bezier(.2,.8,.2,1) both; }
  .lb-bar-best::after { animation: none; display: none; }
}

/* Reveal-on-load helper (mirrors the design's revealIn) */
[data-reveal] { will-change: opacity, transform; }

/* Reusable button/pill primitives so dynamic (server-rendered) content matches. */
.btn-dark { font-size: 15px; font-weight: 600; background: var(--ink); color: var(--page);
  padding: 12px 24px; border-radius: 9px; cursor: pointer; border: none; display: inline-block;
  font-family: var(--sans); text-align: center; }
.btn-dark:disabled { opacity: .5; cursor: not-allowed; }
.chip { border: 1px solid var(--border); padding: 5px 10px; border-radius: 20px;
  font-family: var(--mono); font-size: 12px; color: #7c7a6f; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

/* Form controls styled to the design's field look. */
.f-label { display: block; font-size: 13px; font-weight: 600; color: #57554c; margin-bottom: 7px; }
.f-input, select.f-input, textarea.f-input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; background: #fff;
  padding: 12px 14px; font-size: 15px; color: var(--ink); font-family: var(--sans); outline: none; }
.f-input:focus { border-color: var(--rust); }
select.f-input { appearance: none; background-image:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%2357554c' fill='none' stroke-width='1.4'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }

.flash { border-radius: 9px; padding: 11px 14px; font-size: 14px; margin-bottom: 14px; }
.flash.error { background: #F7E9E6; border: 1px solid #e6c9c4; color: #a04a3d; }
.flash.ok { background: var(--green-bg); border: 1px solid var(--green-bd); color: var(--green-ink); }
.flash.info { background: #F6F3EC; border: 1px solid var(--border-soft); color: var(--muted); }

/* Generic data table matching the design's grid rows. */
.dt { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dt-head, .dt-row { display: grid; align-items: center; }
.dt-head { background: var(--sidebar); font-family: var(--mono); font-size: 11px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted-3); }
.dt-head > div { padding: 12px 16px; }
.dt-row { font-size: 14px; border-top: 1px solid var(--border-soft); }
.dt-row:nth-child(odd) { background: var(--card); }
.dt-row > div { padding: 13px 16px; }

/* Live rollout reasoning + action-log panes (rendered inline, dark theme). */
.rcm-live-panes .muted { color: #8b9aba; font-size: 12px; font-style: italic; }
.rcm-live-panes code { background: #1c2030; color: #c9d1d9; padding: 1px 5px;
  border-radius: 4px; font-size: 12px; }
