/* Channel performance page. Builds on styles.css and performance.css; adds only what this page needs. */

/* Channel selector and section navigation */
.ch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; margin-bottom: -12px; }
.ch-bar .sectionnav { margin-bottom: 0; }
.ch-select { display: inline-flex; border: 1px solid var(--ink); }
.ch-select [role='tab'] { border: 0; background: var(--paper); padding: 10px 18px; font-size: 15px; font-weight: 600; color: var(--muted); min-height: 44px; }
.ch-select [role='tab'] + [role='tab'] { border-left: 1px solid var(--ink); }
.ch-select [role='tab']:hover { color: var(--ink); background: var(--grey); }
.ch-select [role='tab'][aria-selected='true'] { background: var(--ink); color: var(--paper); }
.ch-select [role='tab'][aria-selected='true']::before { content: '\2713'; margin-right: 8px; font-size: 13px; }
.ch-select [role='tab']:focus-visible { outline-offset: 3px; }
.sections { display: grid; gap: 40px; }

/* Section 1 */
.ch-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-bottom: 14px; }
.ch-identity__name { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.ch-basis { margin-top: 12px; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.ch-basis .mono { color: var(--muted); }
.ch-basis .mono::before { content: '['; color: var(--red); margin-right: 3px; }
.ch-basis .mono::after { content: ']'; color: var(--red); margin-left: 3px; }

/* Section 2: components */
.comp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); margin-top: 6px; }
.comp { padding: 12px 18px 14px 0; min-width: 0; display: grid; align-content: start; gap: 4px; }
.comp + .comp { padding-left: 18px; border-left: 1px solid var(--line); }
@media (max-width: 860px) { .comp-grid { grid-template-columns: minmax(0, 1fr); } .comp + .comp { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }
.comp__title { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.comp__metric { font-size: 13px; color: var(--muted); display: flex; align-items: center; }
.comp__rows { display: grid; gap: 6px; margin-top: 8px; }
.comp__row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 84px; gap: 10px; align-items: center; }
.comp__track { position: relative; height: 14px; background: var(--grey); }
.comp__bar { position: absolute; left: 0; top: 0; bottom: 0; }
.comp__bar--sep { background: var(--sage-track); top: 3px; bottom: 3px; }
.comp__bar--oct { background: var(--ink); }
.comp__v { text-align: right; font-size: 15px; white-space: nowrap; }
.comp__v--now { font-weight: 700; font-size: 17px; }
.comp__change { font-size: 14px; margin-top: 6px; }
.comp__effect { font-size: 11px; color: var(--ink); }

.identity { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 2fr); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.identity__block { padding: 12px 16px 12px 0; min-width: 0; }
.identity__block + .identity__block { padding-left: 16px; border-left: 1px solid var(--grey); }
.identity__formula { font-size: 14px; font-weight: 650; display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.identity__table { border-collapse: collapse; margin-top: 6px; font-size: 14px; }
.identity__table th { font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; color: var(--muted); text-align: left; padding: 3px 12px 3px 0; }
.identity__table td { padding: 3px 0; white-space: nowrap; text-align: right; }
.identity__table td.op { color: var(--muted); padding: 3px 8px; text-align: center; }
.identity__table td.res { font-weight: 700; }
.identity__big { font-size: 24px; font-weight: 650; letter-spacing: -0.03em; margin-top: 4px; }
.identity__note { grid-column: 1 / -1; margin: 0 0 10px; }
@media (max-width: 1000px) {
  .identity { grid-template-columns: minmax(0, 1fr); }
  .identity__block + .identity__block { padding-left: 0; border-left: 0; border-top: 1px solid var(--grey); }
}
@media (max-width: 380px) { .identity__table { font-size: 13px; } .identity__table td.op { padding: 3px 4px; } }

/* Section 3: segments */
.seg-change { display: grid; margin-bottom: 18px; }
.seg-change__head, .seg-change__row { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; align-items: center; }
.seg-change__head { font-size: 10.5px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.seg-change__row { padding: 8px 0; border-bottom: 1px solid var(--grey); }
.seg-change__row--total { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 650; }
.seg-change__name { font-size: 14px; font-weight: 600; }
.seg-change__cell { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 10px; align-items: center; }
.seg-change__row--total .seg-change__cell { grid-template-columns: minmax(0, 1fr); text-align: right; }
.seg-change__v { text-align: right; font-size: 14px; font-weight: 650; white-space: nowrap; }
.dv { position: relative; height: 16px; }
.dv__axis { position: absolute; left: 50%; top: -3px; bottom: -3px; border-left: 1px solid var(--muted); }
.dv__bar { position: absolute; top: 0; bottom: 0; background: var(--ink); }
.dv__bar.is-neg { background: var(--paper) var(--hatch); border: 1px solid var(--ink); }
@media (max-width: 620px) {
  .seg-change__head { display: none; }
  .seg-change__row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .seg-change__cell::before { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--muted); grid-column: 1 / -1; }
  .seg-change__row .seg-change__cell:nth-child(2)::before { content: 'Spend change'; }
  .seg-change__row .seg-change__cell:nth-child(3)::before { content: 'Attributed value change'; }
  .seg-change__row--total .seg-change__cell { text-align: left; }
}
.seg-table tr.detail td { padding: 10px 14px; }
.seg-detail { background: transparent; }
.seg-total { font-weight: 700; padding-left: 28px; display: inline-block; }
@media (max-width: 620px) { .seg-total { padding-left: 0; } .seg-table tr.detail, .seg-table tr.detail > td { display: block; } }

/* Section 4: role */
.row--flush { gap: 28px; }
.role-job__text { font-size: 18px; font-weight: 650; margin-top: 2px; }
.is-chart { margin-bottom: 14px; }
.is-chart__title { margin-bottom: 8px; }
.is-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 8px; }
.is-bar { display: flex; height: 28px; gap: var(--gap); }
.is-seg { display: flex; align-items: center; padding: 0 8px; min-width: 0; overflow: hidden; }
.is-seg span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
.is-seg--shown { background: var(--ink); color: var(--paper); }
.is-seg--budget { background: var(--paper) var(--hatch); border: 1px solid var(--ink); }
.is-seg--budget span { background: var(--paper); padding: 0 3px; }
.is-seg--rank { background: var(--sage-track); }
@media (max-width: 480px) { .is-seg span { font-size: 9.5px; } .is-seg { padding: 0 4px; } }

/* Section 6 and 7 */
.row--tight { gap: 40px; align-items: start; }
.biz-figs { margin-top: 10px; }
.biz-figs .figure:nth-child(3) { padding-left: 0; border-left: 0; }
.biz-figs .figure:nth-child(n+3) { border-top: 1px solid var(--grey); }
.biz-figs .figure__value { font-size: 22px; }
.biz-links { display: grid; gap: 4px; margin-top: 12px; }
.biz-links a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.biz-links a::after { content: ' \2192'; }

.qlist { display: grid; border-top: 1px solid var(--ink); }
details.q { border-bottom: 1px solid var(--line); }
details.q summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 30px minmax(0, 1fr) 22px; gap: 10px; align-items: baseline; padding: 12px 0; }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: '+'; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--ink); font-size: 13px; align-self: center; }
details.q[open] summary::after { content: '\2212'; }
details.q summary:hover .q__text { text-decoration: underline; text-underline-offset: 3px; }
.q__n { color: var(--muted); }
.q__text { font-size: 16px; font-weight: 650; }
.q__body { display: grid; gap: 10px; padding: 0 0 14px 40px; font-size: 14px; }
.q__body div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; }
.q__body dt { color: var(--muted); font-size: 10.5px; padding-top: 2px; }
.q__body dd { margin: 0; }
.q__body ul { display: grid; gap: 2px; }
.q__body li { padding-left: 14px; position: relative; }
.q__body li::before { content: ''; position: absolute; left: 0; top: .7em; width: 7px; height: 1px; background: var(--ink); }
@media (max-width: 620px) { .q__body { padding-left: 0; } .q__body div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.prog-figs { margin-top: 16px; }
.channels .ch-question { margin-top: 14px; }
.channels .ch-question .mono { display: block; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 620px) { .ch-select { width: 100%; } .ch-select [role='tab'] { flex: 1; } }
@media (max-width: 620px) { .seg-table tbody tr.main { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.is-seg .sm { display: none; }
@media (max-width: 620px) { .is-seg .lg { display: none; } .is-seg .sm { display: inline; } }
