/* Targeted analyzer controls; palette and layout follow the existing theme. */
:root {
    --analyzer-danger: #b42332;
    --analyzer-caution: #ad4a0a;
}

#resultBadge[data-tone="danger"], #resultTitle[data-tone="danger"], #differenceBpm[data-tone="danger"] { color: var(--analyzer-danger); }
#resultBadge[data-tone="caution"], #resultTitle[data-tone="caution"], #differenceBpm[data-tone="caution"] { color: var(--analyzer-caution); }
#resultBadge[data-tone="neutral"], #resultTitle[data-tone="neutral"], #differenceBpm[data-tone="neutral"] { color: var(--ink); }

.left-column { grid-template-rows: auto minmax(0, 1fr); }
.sport-selection { display: grid; align-content: start; gap: 18px; min-width: 0; }
.sport-selection .discipline-field { margin-top: 0; }
#resultPanel.result-empty { align-items: flex-start; justify-content: flex-start; }
#resultPanel.result-empty > .discipline-guidance:not([hidden]) { display: block; width: 100%; }
#resultPanel > .discipline-guidance[hidden], #resultPanel:not(.result-empty) > .discipline-guidance { display: none; }
.discipline-guidance h2 { margin: 0 0 12px; color: var(--ink); font-size: 21px; line-height: 1.3; font-weight: 500; }
.discipline-guidance p { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.6; }

.hero .brand-menu { position: relative; display: table; margin-bottom: 32px; }
.hero .brand-toggle { display: block; padding: 0; border: 0; border-radius: 4px; background: transparent; box-shadow: none; cursor: pointer; }
.hero .brand-toggle .logo { display: block; margin: 0; }
.brand-source-menu { position: absolute; inset: calc(100% + 10px) auto auto 0; z-index: 50; width: max-content; max-width: calc(100vw - 48px); padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.brand-source-menu[hidden] { display: none; }
.brand-source-menu a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--ink); font-size: 14px; line-height: 1.5; text-decoration: none; }
.brand-source-menu a:hover { background: var(--accent-soft); }
.brand-toggle:focus-visible, .brand-source-menu a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.discipline-field .ts-wrapper { width: 100%; min-width: 0; font-family: inherit; font-size: 15px; color: var(--ink); }
.discipline-field .ts-wrapper.single .ts-control { min-height: 54px; padding: 12px 40px 12px 16px; align-items: center; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: none; font: inherit; line-height: 1.5; color: var(--ink); cursor: pointer; }
.discipline-field .ts-wrapper.single .ts-control::after { right: 16px; border-top-color: var(--muted); }
.discipline-field .ts-control > .item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discipline-field .ts-wrapper.focus .ts-control { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 3px; }
.discipline-field .ts-wrapper.disabled .ts-control { background: #f7f7f7; color: var(--muted); cursor: default; opacity: .7; }
.discipline-field .ts-dropdown { z-index: 40; margin-top: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: none; font: inherit; }
.discipline-field .ts-dropdown-content { max-height: 300px; overflow-y: auto; scrollbar-color: #9aa8a2 #f7f7f7; scrollbar-width: thin; }
.discipline-field .ts-dropdown .option { padding: 10px 12px; border-radius: 6px; line-height: 1.5; }
.discipline-field .ts-dropdown .active, .discipline-field .ts-dropdown .selected { background: var(--accent-soft); color: var(--ink); }
.discipline-field .ts-dropdown .active { box-shadow: inset 0 0 0 1px var(--accent); }
.discipline-field .ts-wrapper.single.dropdown-active .ts-control { border-radius: 12px; }

/* The label opens the picker; its invisible native input must not widen the page. */
.upload input[type="file"] { width: 1px; min-width: 0; max-width: 100%; height: 1px; }

.control-icon { display: block; flex: 0 0 auto; object-fit: contain; filter: brightness(0) invert(1); pointer-events: none; }
#audioPlayButton .control-icon, #audioDownload .control-icon { width: 22px; height: 22px; }
#engineerButton { position: relative; padding-inline: 62px; }
#engineerButton .engineer-question { position: absolute; left: 22px; top: 50%; width: 26px; height: 26px; transform: translateY(-50%); }
#engineerButton .engineer-question-secondary { left: auto; right: 24px; width: 18px; height: 18px; opacity: .65; }
@media (max-width: 760px) {
    .hero .brand-menu { margin-bottom: 26px; }
    .discipline-field .ts-control > .item { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 520px) {
    #engineerButton { padding-inline: 48px 14px; font-size: 17px; line-height: 1.35; }
    #engineerButton .engineer-question { left: 15px; width: 23px; height: 23px; }
    #engineerButton .engineer-question-secondary { display: none; }
}
