#marble-tool .marble-heading,#horse-tool .horse-heading { margin-bottom:18px; gap:14px; }
#marble-tool .marble-heading h1,#horse-tool .horse-heading h1 { font-size:26px; margin-bottom:7px; letter-spacing:-.8px; }
#marble-tool .marble-heading p,#horse-tool .horse-heading p { font-size:13px; line-height:1.55; }
#marble-tool .marble-card,#horse-tool .horse-card { border-radius:12px; box-shadow:0 4px 18px #172b3a05; }
#marble-tool .marble-settings,#horse-tool .horse-settings { padding:18px; }
#marble-tool .marble-section-title,#horse-tool .horse-section-title { margin-bottom:12px; }
#marble-tool .marble-section-title h2,#horse-tool .horse-section-title h2 { font-size:16px; }
.race-count-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:17px; }
.race-count-row>span { color:var(--cw-muted); font-size:12px; font-weight:650; white-space:nowrap; }
.race-count-stepper { display:grid; grid-template-columns:40px 52px 40px; align-items:center; border:1px solid var(--cw-line); border-radius:10px; padding:2px; background:var(--cw-page); }
.race-count-stepper button { display:grid; place-items:center; width:40px; height:40px; min-width:0; padding:0; border:0; border-radius:7px; background:var(--cw-surface); color:var(--cw-primary); font-family:inherit; font-size:23px; font-weight:600; line-height:1; box-shadow:0 1px 3px #172b3a07; }
.race-count-stepper button:hover:not(:disabled) { background:var(--cw-selected); }
.race-count-stepper button:focus-visible { outline:2px solid var(--cw-primary); outline-offset:2px; }
.race-count-stepper button:disabled { opacity:.35; box-shadow:none; cursor:default; }
.race-count-stepper output { text-align:center; color:var(--cw-text); font-size:14px; font-weight:750; font-variant-numeric:tabular-nums; }
.cat-name { z-index:1; }
.cat-name>span { display:block; overflow:hidden; text-overflow:ellipsis; }
.cat-label-lines { position:absolute; inset:0; width:100%; height:100%; overflow:hidden; pointer-events:none; }
.cat-name .cat-behavior { display:block; margin-top:2px; color:#587b69; font-size:9px; font-weight:750; line-height:1.2; }
.cat-name .cat-behavior[hidden] { display:none; }
body[data-tool=horse] #horse-stage { background:linear-gradient(145deg,#e1eccc,#d6e6d1); }
#marble-tool .marble-roster-heading,#horse-tool .horse-roster-heading { font-size:12px; margin-bottom:9px; }
#marble-tool .marble-person input,#horse-tool .horse-person input { border-radius:7px; }
#marble-tool .marble-equal,#horse-tool .horse-equal { margin-top:17px; padding:10px; }
#marble-tool .marble-equal p,#horse-tool .horse-equal p { line-height:1.55; }
body[data-tool=marble]:not(.marble-only) .marble-stage,body[data-tool=horse]:not(.horse-only) .horse-stage { height:clamp(390px,60vh,520px); }
body[data-tool=marble]:not(.marble-only) .marble-actions button,body[data-tool=horse]:not(.horse-only) .horse-actions button { min-height:44px; border-radius:8px; }
#marble-tool .marble-race-footer,#horse-tool .horse-race-footer { padding:12px 16px; }
.marble-only #marble-tool .marble-race-card,.horse-only #horse-tool .horse-race-card { border-radius:0; }
.marble-only #marble-tool .marble-race-footer,.horse-only #horse-tool .horse-race-footer { padding:8px 14px; }
@media(max-width:600px) {
  body[data-tool=marble]:not(.marble-only) .marble-stage { height:380px; }
  body[data-tool=horse]:not(.horse-only) .horse-stage { height:320px; }
  body[data-tool=horse]:not(.horse-only) .horse-stage[data-large-roster=true] { height:450px; }
  .race-count-stepper { grid-template-columns:44px 52px 44px; }
  .race-count-stepper button { width:44px; height:44px; }
  #marble-tool .marble-heading h1,#horse-tool .horse-heading h1 { font-size:24px; }
  #marble-tool .marble-settings,#horse-tool .horse-settings { padding:16px; }
}
@media(max-width:430px) {
  html[data-theme] body[data-tool] .topbar .tool-tabs { gap:2px; }
  html[data-theme] body[data-tool] .topbar .tool-tabs button { min-width:0; min-height:44px; padding:10px 3px; font-size:12px; white-space:nowrap; }
  html[data-theme] body[data-tool] .topbar .tool-tabs #tool-cliff { flex:1.1; }
  html[data-theme] body[data-tool] .topbar .tool-tabs #tool-marble,html[data-theme] body[data-tool] .topbar .tool-tabs #tool-horse { flex:1.4; }
}
@media(max-width:340px) { html[data-theme] body[data-tool] .topbar .tool-tabs button { font-size:11px; padding:10px 2px; } }
