/* 23.11.2026: strategy catalog and chart workspace. */
* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --surface: #111318;
  --surface2: #16191f;
  --border: #252a34;
  --grid: #1b1f27;
  --title: #f2f4f7;
  --text: #c9d1d9;
  --muted: #939eac;
  --accent: #c8f135;
  --accent-ink: #0a0c10;
  --green: #4ade80;
  --red: #f87171;
  --ema50: #40bf94;
  --ema100: #78aafe;
  --ema200: #ee818a;
  --volume: #8293b2;
  --threshold: #fbbf24;
  --hold: #aeb9c9;
  --mono: 'JetBrains Mono', monospace;
}
body { margin: 0; color: var(--text); background: var(--bg); font: 14px/1.5 'Inter', sans-serif; }
h1, h2, p, dl, dd { margin: 0; }
h1, h2 { color: var(--title); }
h1 { font-size: clamp(27px, 4vw, 38px); line-height: 1.15; font-weight: 700; }
h2 { font-size: 15px; font-weight: 600; }
button, select { font: inherit; }
[hidden] { display: none !important; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.bots-workspace { max-width: 1580px; margin: 0 auto; padding: 26px 26px 40px; }
/* 23.11.2026: second strategy card and Super Guppy settings. */
.bots-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 540px)); gap: 18px; align-items: start; }
.bots-card-status { margin: 0; padding: 0 20px 14px; }
.guppy-settings { margin-block-start: 16px; padding: 12px 14px; }
.guppy-settings summary { cursor: pointer; color: var(--title); font-weight: 600; }
.guppy-settings-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-block: 14px 10px; }
.guppy-settings-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.guppy-settings-fields .guppy-check { display: flex; align-items: center; gap: 7px; }
.guppy-settings-fields input[type='checkbox'] { accent-color: var(--accent); }
.guppy-settings-fields input[type='number'] { width: 140px; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); padding: 5px 8px; font: inherit; }
.guppy-settings p { margin-block-start: 5px; color: var(--muted); font-size: 11px; }
.guppy-key-fast { --key: linear-gradient(90deg, #00bcd4 50%, #ff9800 50%); }
.guppy-key-slow { --key: linear-gradient(90deg, #00e676 50%, #ff5252 50%); }
.bots-panel { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.bots-card { width: min(100%, 540px); margin-block-start: 22px; }
.bots-card-heading { padding: 20px 20px 17px; }
.bots-card-heading h2 { font-size: 22px; line-height: 1.25; }
.bots-card-heading a { color: inherit; text-decoration: none; }
.bots-card-heading a:hover { color: var(--accent); }
.bots-card-heading p { margin-block-start: 5px; color: var(--muted); }
.bots-card-history { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 20px 4px; }
.bots-history-label { color: var(--muted); font-size: 12px; }
[data-catalog-instrument] { font: 500 11px var(--mono); }
.bots-preview { height: 142px; margin-inline: 16px; }
.bots-card-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-block: 1px solid var(--border); margin-top: 12px; }
.bots-card-stats > div { padding: 12px 20px; }
.bots-card-stats > div + div { border-inline-start: 1px solid var(--border); }
.bots-card-stats dt, .bots-statistics dt { color: var(--muted); font-size: 12px; }
.bots-card-stats dd, .bots-statistics dd { font: 600 20px/1.35 'Inter', sans-serif; color: var(--title); font-variant-numeric: tabular-nums; text-align: start; }
.bots-card-stats dd { margin-block-start: 3px; }
.bots-card-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; }
.bots-primary { margin-inline-start: auto; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 8px 12px; border-radius: 7px; text-decoration: none; }
.bots-primary:hover { filter: brightness(.93); }

.bots-detail-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.bots-back { display: inline-flex; align-items: center; gap: 7px; margin-block-end: 6px; color: var(--muted); font-size: 12px; text-decoration: none; }
.bots-back:hover { color: var(--accent); }
[dir='rtl'] .bots-back span { transform: scaleX(-1); }
.bots-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 16px; }
.bots-controls label, .bots-timeframes { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.bots-controls select, .bots-buttons button, .bots-status button {
  min-height: 34px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface2); color: var(--text); padding: 6px 10px; cursor: pointer;
}
.bots-controls select { width: clamp(154px, 27vw, 245px); font-size: 13px; }
/* 23.11.2026: category tiles match the existing timeframe controls. */
#bots-categories { flex-wrap: wrap; }
.bots-controls, .bots-controls > .bots-timeframes { min-width: 0; max-width: 100%; }
#bots-categories button { min-width: 82px; }
.bots-controls select { width: clamp(180px, 27vw, 310px); }
#bots-asset { direction: ltr; text-align: start; unicode-bidi: isolate; }
.bots-controls select:disabled, .bots-buttons button:disabled { cursor: default; opacity: .5; }
.bots-buttons { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.bots-buttons button { font-size: 12px; }
.bots-buttons button:hover:not(:disabled), .bots-status button:hover { border-color: var(--muted); }
.bots-buttons button[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

.bots-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block-start: 14px; color: var(--muted); font-size: 13px; }
.bots-status[data-error] { color: var(--red); }
#bots-data { margin-block-start: 16px; }
#bots-data[aria-hidden='true'] { visibility: hidden; }
.bots-panel-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 11px 14px; border-block-end: 1px solid var(--border); }
.bots-key { display: flex; align-items: center; gap: 3px 14px; flex-wrap: wrap; margin-block-start: 3px; color: var(--muted); font-size: 11px; }
.bots-key > span { display: inline-flex; align-items: center; gap: 5px; }
.bots-key > span::before { content: ''; flex: 0 0 12px; height: 2px; border-radius: 2px; background: var(--key); }
.bots-key-ema50 { --key: var(--ema50); }
.bots-key-ema100 { --key: var(--ema100); }
.bots-key-ema200 { --key: var(--ema200); }
.bots-key-volume { --key: var(--volume); }
.bots-key-threshold { --key: var(--threshold); }
.bots-key-hold { --key: var(--hold); }
.bots-key-strategy { --key: linear-gradient(90deg, var(--green) 50%, var(--red) 50%); }
.bots-volume-key { margin: 0; padding: 6px 14px 0; border-block-start: 1px solid var(--border); }
.bots-preview, .bots-price, .bots-volume, .bots-equity { min-width: 0; direction: ltr; }
.bots-price { height: clamp(270px, 38vh, 455px); }
.bots-volume { height: 112px; }
.bots-equity { height: 252px; }
.bots-results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 305px); gap: 12px; margin-block-start: 12px; align-items: start; }
.bots-dates { color: var(--muted); font-size: 11px; }
.bots-coverage { display: flex; flex-wrap: wrap; gap: 5px 16px; border-block-start: 1px solid var(--border); padding: 8px 14px; font-size: 11px; color: var(--muted); }
.bots-coverage > span { overflow-wrap: anywhere; }
.bots-statistics h2 { padding: 11px 14px; }
.bots-statistics dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 10px; padding: 12px 14px; border-block-start: 1px solid var(--border); }
.bots-statistics dd { font-size: 14px; text-align: end; white-space: nowrap; }
.bots-workspace .bots-positive { color: var(--green); }
.bots-workspace .bots-negative { color: var(--red); }

/* 23.11.2026: Properties is separate from the charts and recalculates live. */
.bots-properties { position: fixed; z-index: 1000; margin: 0; inset: auto; width: min(420px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 8px 32px #0008; }
.bots-properties[open] { display: flex; flex-direction: column; }
.bots-properties header, .bots-properties footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; flex-shrink: 0; }
.bots-properties header { border-block-end: 1px solid var(--border); cursor: move; touch-action: none; user-select: none; }
.bots-properties footer { border-block-start: 1px solid var(--border); }
.bots-properties button { min-height: 34px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface2); color: var(--text); font: inherit; cursor: pointer; }
.bots-properties .bots-property-done { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.bots-properties-status { margin: 0; padding: 8px 12px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.bots-properties-status[data-error] { color: var(--red); }
.bots-properties-body { overflow: auto; min-height: 0; padding: 0 12px 10px; }
.bots-properties fieldset { margin: 0 0 10px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.bots-properties legend { padding-inline: 5px; color: var(--title); font-weight: 600; font-size: 12px; }
.bots-properties-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bots-properties label { display: grid; gap: 5px; align-content: start; color: var(--muted); font-size: 11px; min-width: 0; }
.bots-properties label:not(.bots-property-check) { display: flex; flex-direction: column; justify-content: space-between; }
.bots-properties .bots-property-check { display: flex; align-items: center; gap: 7px; }
.bots-properties input[type='checkbox'] { accent-color: var(--accent); }
.bots-properties input[type='number'] { box-sizing: border-box; width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); font: inherit; font-size: 13px; direction: ltr; text-align: start; }
.bots-properties input[aria-invalid='true'] { border-color: var(--red); }
@media (max-width: 600px) { .bots-properties-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 760px) {
  .bots-catalog { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bots-workspace { padding: 18px 10px 28px; }
  .bots-results { grid-template-columns: minmax(0, 1fr); }
  .bots-equity { height: 218px; }
  .bots-market .bots-panel-heading { align-items: end; }
}

/* 23.11.2026: compact price header, highlighted Properties and trade details. */
.bots-title-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; min-width: 0; }
.bots-title-row .bots-key { margin: 0; }
.bots-key > span { white-space: nowrap; }
.bots-market > .bots-panel-heading { align-items: center; }
.bots-buttons .bots-properties-trigger { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.bots-buttons .bots-properties-trigger:hover { filter: brightness(1.08); border-color: var(--accent); }
.bots-equity { position: relative; }
.bots-trade-tooltip { position: absolute; z-index: 5; width: max-content; max-width: min(270px, calc(100% - 16px)); padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface2); color: var(--text); box-shadow: 0 4px 18px #0006; pointer-events: none; font-size: 12px; line-height: 1.5; direction: inherit; text-align: start; }
.bots-trade-tooltip time { display: block; color: var(--title); font-weight: 600; }
.bots-trade-tooltip section { margin-block-start: 6px; }
.bots-trade-tooltip p { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.bots-trade-tooltip bdi { font-weight: 700; }

/* 23.11.2026: equal catalog cards with aligned content, without clipping copy. */
.bots-catalog { margin-block-start: 22px; gap: 18px; align-items: stretch; grid-auto-rows: 1fr; }
.bots-catalog > .bots-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(min-content, 1fr) auto minmax(142px, max-content) auto auto; width: 100%; margin-block-start: 0; row-gap: 0; }
.bots-catalog > .bots-card > * { grid-column: 1; min-width: 0; }
.bots-catalog .bots-card-heading { grid-row: 1; }
.bots-catalog .bots-card-history { grid-row: 2; }
.bots-catalog .bots-preview { grid-row: 3; }
.bots-catalog .bots-card-stats { grid-row: 4; }
.bots-catalog .bots-card-footer { display: grid; grid-row: 5; grid-template-columns: minmax(0, 1fr) auto; }
.bots-catalog .bots-card-footer .bots-primary { margin-inline-start: 0; justify-self: end; }
.bots-catalog .bots-card-status { grid-row: 3; z-index: 1; margin: 0; padding: 14px 20px; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--surface); }
@supports (grid-template-rows: subgrid) {
  @media (min-width: 761px) {
    .bots-catalog { grid-auto-rows: auto; row-gap: 0; }
    .bots-catalog > .bots-card { grid-row: span 6; grid-template-rows: subgrid; }
    .bots-catalog .bots-card-heading { display: grid; grid-row: 1 / span 2; grid-template-rows: subgrid; row-gap: 0; }
    .bots-catalog .bots-card-heading h2 { grid-row: 1; }
    .bots-catalog .bots-card-heading p { grid-row: 2; }
    .bots-catalog .bots-card-history { grid-row: 3; }
    .bots-catalog .bots-preview, .bots-catalog .bots-card-status { grid-row: 4; }
    .bots-catalog .bots-card-stats { grid-row: 5; }
    .bots-catalog .bots-card-footer { grid-row: 6; }
    .bots-catalog > .bots-card::before { content: ''; grid-column: 1; grid-row: 4; min-block-size: 142px; pointer-events: none; }
  }
}
