.itg-stamina {
  --itg-bg: #0d141a;
  --itg-panel: #111a22;
  --itg-line: #2a3740;
  --itg-muted: #8b9aa4;
  --itg-text: #edf5f7;
  --itg-lime: #b9f27c;
  --itg-cyan: #6fe5d4;
  color: var(--itg-text);
  border-radius: 18px;
  background: var(--itg-bg);
  box-shadow: 0 18px 50px rgba(22, 35, 43, .12);
  overflow: hidden;
}
.itg-stamina button, .itg-stamina select { font: inherit; }
.itg-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 28px; background: radial-gradient(circle at 8% 0, rgba(111,229,212,.12), transparent 25rem); }
.itg-hero h2, .itg-hero p { margin: 0; }
.itg-hero h2 { color: #fff; font-size: 30px; }
.itg-hero > div > p:last-child { margin-top: 5px; color: var(--itg-muted); }
.itg-refresh-area { display: flex; align-items: flex-end; flex-direction: column; gap: 8px; }
.itg-refresh-area small { color: var(--itg-muted); font-size: 11px; }
.itg-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--itg-line); border-top: 1px solid var(--itg-line); border-bottom: 1px solid var(--itg-line); }
.itg-target { min-height: 126px; padding: 19px; color: var(--itg-text); text-align: left; border: 0; background: linear-gradient(145deg, #17232c, #111920); cursor: pointer; }
.itg-target:hover { filter: brightness(1.12); }
.itg-target span { color: var(--itg-cyan); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.itg-target strong, .itg-target small { display: block; }
.itg-target strong { margin-top: 17px; color: #fff; font-size: 34px; letter-spacing: -.04em; }
.itg-target small { margin-top: 6px; color: var(--itg-muted); }
.itg-target-gold span { color: #ffcf67; }
.itg-panel { background: var(--itg-panel); }
.itg-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 26px 28px 20px; }
.itg-panel-heading h3, .itg-panel-heading p { margin: 0; }
.itg-panel-heading h3 { color: #fff; font-size: 22px; }
.itg-panel-heading #itg-summary { margin-top: 5px; color: var(--itg-muted); font-size: 12px; }
.itg-view-toggle { display: flex; padding: 3px; background: #090e12; border: 1px solid var(--itg-line); }
.itg-view-toggle button { padding: 9px 14px; color: var(--itg-muted); border: 0; background: transparent; cursor: pointer; }
.itg-view-toggle button.active { color: #09100d; background: var(--itg-lime); font-weight: 800; }
.itg-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 13px 28px; border-top: 1px solid var(--itg-line); border-bottom: 1px solid var(--itg-line); background: #0e161d; }
.itg-controls label { display: flex; align-items: center; gap: 8px; color: var(--itg-muted); font-size: 11px; }
.itg-controls select { padding: 7px; color: var(--itg-text); border: 1px solid var(--itg-line); background: #18232c; }
.itg-controls input { accent-color: var(--itg-lime); }
.itg-key { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 11px 28px; color: var(--itg-muted); font-size: 10px; }
.itg-key span { display: flex; align-items: center; gap: 6px; }
.itg-key span:last-child { margin-left: auto; }
.itg-key i { width: 13px; height: 13px; border: 1px solid #42515b; background: #17222a; }
.itg-key i.itg-key-direct { border-color: #72b397; background: #377a68; }
.itg-key i.itg-key-inferred { border-color: #72b397; background: repeating-linear-gradient(135deg,#28594f 0 3px,#1c3f39 3px 6px); }
.itg-grid-wrap { max-height: 620px; overflow: auto; border-top: 1px solid var(--itg-line); }
.itg-loading { padding: 60px; color: var(--itg-muted); text-align: center; }
.itg-surface-grid { --itg-cell: 49px; display: grid; width: max-content; min-width: 100%; grid-template-columns: 72px repeat(var(--itg-cols), var(--itg-cell)); grid-auto-rows: 39px; background: #0d141a; }
.itg-axis-corner, .itg-measure-head, .itg-bpm-head { position: sticky; z-index: 3; display: grid; place-items: center; color: #bdc9cf; border-right: 1px solid #28343d; border-bottom: 1px solid #28343d; background: #121a21; font-size: 9px; }
.itg-axis-corner { top: 0; left: 0; z-index: 5; color: var(--itg-muted); }
.itg-measure-head { top: 0; }
.itg-bpm-head { left: 0; justify-items: end; padding-right: 10px; }
.itg-cell { border: 0; border-right: 1px solid #202b33; border-bottom: 1px solid #202b33; color: #788891; background: #141e25; cursor: pointer; font-size: 10px; }
.itg-cell:hover, .itg-cell.selected { position: relative; z-index: 2; outline: 1px solid #fff; outline-offset: -2px; filter: brightness(1.25); }
.itg-cell.passed { color: #f4fff8; background: #377a68; font-weight: 800; }
.itg-cell.passed.inferred { background: repeating-linear-gradient(135deg,#28594f 0 4px,#1c3f39 4px 8px); }
.itg-detail { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(360px,1.2fr); gap: 1px; background: var(--itg-line); border-top: 1px solid var(--itg-line); }
.itg-detail > div { padding: 25px 28px; background: #101820; }
.itg-detail h3, .itg-detail p { margin-top: 0; }
#itg-detail-subtitle, #itg-selected-status { color: var(--itg-muted); font-size: 12px; }
#itg-selected-status { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--itg-line); }
.itg-recent { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.itg-recent li { padding: 9px; border: 1px solid var(--itg-line); background: #0c1319; font-size: 10px; }
.itg-recent strong, .itg-recent span { display: block; }
.itg-recent span { margin-top: 3px; color: var(--itg-muted); }
@media (max-width: 850px) {
  .itg-hero, .itg-panel-heading { align-items: stretch; flex-direction: column; }
  .itg-refresh-area { align-items: stretch; }
  .itg-targets, .itg-detail { grid-template-columns: 1fr; }
  .itg-key span:last-child { width: 100%; margin-left: 0; }
  .itg-recent { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .itg-hero, .itg-panel-heading, .itg-controls, .itg-key, .itg-detail > div { padding-left: 17px; padding-right: 17px; }
  .itg-surface-grid { --itg-cell: 44px; grid-template-columns: 62px repeat(var(--itg-cols), var(--itg-cell)); }
}
