/* Paid Search Sandbox — Google Ads flavoured reporting surface.
   Layout and palette only; typography and the card shell come from shared/css/main.css. */

:root {
    --ps-ink: #1c2536;
    --ps-muted: #5a6577;
    --ps-line: #dfe4ec;
    --ps-wash: #f4f6fa;
    --ps-brand: #1a73e8;
    --ps-brand-soft: #e8f0fb;
    --ps-good: #0f7b3f;
    --ps-good-soft: #e6f4ec;
    --ps-warn: #9a6508;
    --ps-warn-soft: #fdf3e0;
    --ps-bad: #a81f1f;
    --ps-bad-soft: #fbeceb;
}

/* ---------------------------------------------------------------- case brief */

.ps-case {
    padding: 0;
    margin-bottom: 1rem;
    border-left: 4px solid var(--ps-brand);
}

.ps-case__summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    color: var(--ps-ink);
    line-height: 1.5;
}

.ps-case__summary::-webkit-details-marker { display: none; }

.ps-case__tag {
    display: inline-block;
    margin-right: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--ps-brand-soft);
    color: #10528f;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ps-case__more {
    color: var(--ps-brand);
    font-weight: 600;
    white-space: nowrap;
}

.ps-case[open] .ps-case__more { display: none; }

.ps-case__body {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--ps-line);
}

.ps-case__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 0.9rem;
    margin: 1rem 0;
}

.ps-case__facts > div {
    background: var(--ps-wash);
    border-radius: 6px;
    padding: 0.75rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.ps-case__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ps-muted);
    margin-bottom: 0.3rem;
}

.ps-case__questions {
    font-size: 0.88rem;
    line-height: 1.6;
    padding: 0.85rem 1rem;
    background: var(--ps-brand-soft);
    border-radius: 6px;
    margin: 0;
}

/* ------------------------------------------------------------------ controls */

.ps-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
}

.ps-control {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ps-control label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.75;
}

.ps-control select,
.ps-control input[type="date"] {
    min-width: 11rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 0.95rem;
}

.ps-control--inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.ps-control--inline select { min-width: 13rem; }

.ps-control--compare { margin-left: auto; }

.ps-data-through {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* -------------------------------------------------------------------- layout */

.ps-layout {
    display: grid;
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 880px) {
    .ps-layout { grid-template-columns: 1fr; }
    .ps-control--compare { margin-left: 0; }
}

.ps-nav { position: sticky; top: 1rem; }

.ps-nav__title {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.6;
}

.ps-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ps-nav__btn {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.ps-nav__btn:hover { background: rgba(0, 0, 0, 0.05); }

.ps-nav__btn[aria-current="page"] {
    background: rgba(26, 115, 232, 0.12);
    color: #10528f;
    font-weight: 600;
}

.ps-report {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.ps-report__head h2 { margin: 0 0 0.25rem; }

.ps-report__lede {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* ---------------------------------------------------------------- scorecards */

.ps-scorecards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 0.85rem;
}

.ps-card {
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #fff;
}

.ps-card__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.65;
}

.ps-card__value {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.ps-card__delta {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

/* Direction only. Whether a rise is good news is the student's call, not the tool's. */
.ps-card__delta--up { color: var(--ps-good); }
.ps-card__delta--down { color: var(--ps-bad); }
.ps-card__delta--flat { opacity: 0.6; }

.ps-card__help {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0.62;
}

.ps-profit-note {
    margin: 1rem 0 0;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.ps-profit-note.is-bad {
    background: var(--ps-bad-soft);
    color: #7c1616;
    border-left: 3px solid var(--ps-bad);
}

.ps-profit-note.is-good {
    background: var(--ps-good-soft);
    color: #0b5a2e;
    border-left: 3px solid var(--ps-good);
}

.ps-profit-note:empty { display: none; }

/* -------------------------------------------------------------------- charts */

.ps-chart__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ps-chart__head h3 { margin: 0; }

.ps-chart-mount {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ps-chart__caption {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.75;
}

.ps-chart { margin: 0; }

.ps-chart__title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ps-chart__note {
    margin: 0.6rem 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    opacity: 0.7;
    max-width: 78ch;
}

.ps-chart--columns svg { width: 100%; height: 120px; }
.ps-chart--scatter svg { width: 100%; height: 300px; }
.ps-chart__linesvg { width: 100%; height: auto; }

.ps-chart__col { transition: opacity 0.15s; }
.ps-chart__col.is-current { opacity: 0.7; }

.ps-chart__axis {
    display: flex;
    margin-top: 0.35rem;
}

.ps-chart__tick {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 0;
}

.ps-chart__ticklabel {
    font-size: 0.72rem;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ps-chart__tickvalue {
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ps-chart__grid { stroke: rgba(0, 0, 0, 0.08); stroke-width: 1; }
.ps-chart__axisline { stroke: rgba(0, 0, 0, 0.25); stroke-width: 1; }

.ps-chart__gridlabel {
    font-size: 11px;
    fill: var(--ps-muted);
}

.ps-chart__series {
    fill: none;
    stroke: var(--ps-brand);
    stroke-width: 2;
    stroke-linejoin: round;
}

.ps-chart__series--compare {
    stroke: var(--ps-muted);
    stroke-dasharray: 5 4;
    stroke-width: 1.5;
}

.ps-chart__area { fill: rgba(26, 115, 232, 0.12); stroke: none; }

.ps-chart__dot { opacity: 0.72; }

.ps-chart__axes {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ---------------------------------------------------------------- fill tones */

.ps-fill--brand { fill: var(--ps-brand); background: var(--ps-brand); }
.ps-fill--good { fill: var(--ps-good); background: var(--ps-good); }
.ps-fill--warn { fill: #c98a12; background: #c98a12; }
.ps-fill--bad { fill: var(--ps-bad); background: var(--ps-bad); }
.ps-fill--muted { fill: #b6bdc9; background: #b6bdc9; }

/* ---------------------------------------------------------------- legend */

.ps-legend {
    list-style: none;
    margin: 0.7rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
}

.ps-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
}

.ps-legend__swatch {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    flex: none;
}

.ps-legend__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------- stacked / ranked */

.ps-stacked, .ps-ranked, .ps-slots {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ps-stacked__row, .ps-ranked__row, .ps-slots__row {
    display: grid;
    grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.86rem;
}

.ps-stacked__label, .ps-ranked__label, .ps-slots__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-stacked__track, .ps-ranked__track, .ps-slots__track {
    display: flex;
    height: 1.1rem;
    border-radius: 3px;
    overflow: hidden;
    background: var(--ps-wash);
}

.ps-stacked__seg { display: block; height: 100%; }

.ps-ranked__bar, .ps-slots__bar {
    display: block;
    height: 100%;
    border-radius: 3px;
}

.ps-stacked__value, .ps-ranked__value, .ps-slots__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ps-stacked__verdict {
    grid-column: 2 / -1;
    font-size: 0.76rem;
    font-style: italic;
    opacity: 0.7;
}

.ps-slots__row.is-top .ps-slots__label { font-weight: 600; }
.ps-slots__row.is-missed { opacity: 0.85; }

/* --------------------------------------------------------------------- table */

.ps-table__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ps-table__head h3 { margin: 0; }

.ps-table__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.ps-dimension-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ps-tab {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--ps-line);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.84rem;
    cursor: pointer;
}

.ps-tab[aria-selected="true"] {
    background: var(--ps-brand-soft);
    border-color: var(--ps-brand);
    color: #10528f;
    font-weight: 600;
}

.ps-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--ps-brand);
    border-radius: 6px;
    background: var(--ps-brand);
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}

.ps-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ps-btn--ghost {
    background: #fff;
    color: #10528f;
    border-color: rgba(0, 0, 0, 0.2);
}

.ps-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
}

.ps-table__scroll { overflow-x: auto; }

.ps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.ps-table th, .ps-table td {
    padding: 0.45rem 0.6rem;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--ps-line);
}

.ps-table th:first-child, .ps-table td:first-child,
.ps-table th:nth-child(2), .ps-table td:nth-child(2) {
    text-align: left;
}

.ps-table td { font-variant-numeric: tabular-nums; }

.ps-table thead th {
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.8;
    border-bottom: 2px solid var(--ps-line);
}

.ps-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--ps-line);
    border-bottom: none;
}

.ps-table tbody tr:hover { background: var(--ps-wash); }

.ps-table__sort {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-transform: inherit;
    letter-spacing: inherit;
}

.ps-table__sort.is-active { color: var(--ps-brand); font-weight: 700; }
.ps-table__arrow { margin-left: 0.2rem; }

.ps-cell--wrap {
    white-space: normal;
    min-width: 14rem;
    max-width: 26rem;
}

.ps-num--good { color: var(--ps-good); font-weight: 600; }
.ps-num--bad { color: var(--ps-bad); font-weight: 600; }

.ps-table__note {
    margin: 0.8rem 0 0;
    font-size: 0.82rem;
    line-height: 1.55;
    opacity: 0.75;
    max-width: 82ch;
}

/* --------------------------------------------------------------------- chips */

.ps-chip {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.ps-chip--unresolved { background: var(--ps-warn-soft); color: var(--ps-warn); }
.ps-chip--worse { background: var(--ps-bad-soft); color: var(--ps-bad); }
.ps-chip--better { background: var(--ps-good-soft); color: var(--ps-good); }
.ps-chip--no-data { background: var(--ps-wash); color: var(--ps-muted); }

/* ------------------------------------------------------------------- explore */

.ps-explore {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ps-metric-picker {
    border: 1px solid var(--ps-line);
    border-radius: 8px;
    padding: 0.75rem 1rem 1rem;
}

.ps-metric-picker legend {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
    padding: 0 0.35rem;
}

.ps-metric-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.35rem 0.9rem;
}

.ps-metric-option {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

/* ------------------------------------------------------- auction explorer */

.ps-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ps-auction__controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    align-items: end;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--ps-wash);
    border-radius: 10px;
}

.ps-control--wide { grid-column: span 1; }

.ps-auction__controls input[type="range"] {
    width: 100%;
    accent-color: var(--ps-brand);
}

.ps-auction__controls output {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--ps-brand);
}

/* The formula is the lesson, so it gets to look like an equation rather than a caption. */
.ps-auction__formula {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 0.75rem 1rem;
    background: var(--ps-ink-soft, var(--ps-wash));
    border-left: 3px solid var(--ps-brand);
    border-radius: 0 8px 8px 0;
    margin: 0 0 1.25rem;
}

.ps-auction__grid,
.ps-terms__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ps-auction__stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--ps-line);
    border-radius: 8px;
}

.ps-auction__statlabel {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.65;
}

.ps-auction__statvalue {
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Shown only when a control has been moved, so the panel never claims a change that is not there. */
.ps-auction__statwas {
    font-size: 0.74rem;
    color: var(--ps-muted);
    font-variant-numeric: tabular-nums;
}

.ps-auction__panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.ps-auction__rivals h4,
.ps-terms__negative h4,
.ps-terms__suggestions h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.ps-auction__verdict {
    margin-top: 1.25rem;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    border-left: 4px solid var(--ps-line);
    background: var(--ps-wash);
}

.ps-auction__verdict p { margin: 0 0 0.5rem; font-size: 0.9rem; line-height: 1.6; }
.ps-auction__verdict p:last-child { margin-bottom: 0; }
.ps-auction__verdict.is-good { border-left-color: var(--ps-good); background: var(--ps-good-soft); }
.ps-auction__verdict.is-bad { border-left-color: var(--ps-bad); background: var(--ps-bad-soft); }

/* ------------------------------------------------------------ search terms */

.ps-terms__negative {
    margin-top: 1.5rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--ps-line);
    border-radius: 10px;
}

.ps-terms__form {
    display: flex;
    gap: 0.6rem;
    margin: 0.75rem 0;
}

.ps-terms__form input {
    flex: 1 1 auto;
    max-width: 320px;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--ps-line);
    border-radius: 6px;
    font-size: 0.9rem;
}

.ps-terms__result:empty { display: none; }

.ps-terms__result {
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    border-left: 4px solid var(--ps-line);
    background: var(--ps-wash);
    margin-bottom: 1rem;
}

.ps-terms__result p { margin: 0 0 0.5rem; font-size: 0.9rem; line-height: 1.6; }
.ps-terms__result p:last-child { margin-bottom: 0; }
.ps-terms__result.is-good { border-left-color: var(--ps-good); background: var(--ps-good-soft); }
.ps-terms__result.is-bad { border-left-color: var(--ps-bad); background: var(--ps-bad-soft); }

.ps-terms__collateral { font-weight: 600; color: var(--ps-warn); }

.ps-terms__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ps-terms__suggestions h4 { flex: 1 0 100%; }

.ps-terms__suggestion {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ps-line);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.ps-terms__suggestion:hover,
.ps-terms__suggestion:focus-visible {
    border-color: var(--ps-brand);
    background: var(--ps-wash);
}

.ps-terms__suggestionterm { font-weight: 600; font-size: 0.88rem; }

.ps-terms__suggestioncost {
    font-size: 0.75rem;
    color: var(--ps-muted);
    font-variant-numeric: tabular-nums;
}

/* The incomplete-data warning. Loud enough to be read before the numbers above it are. */
.ps-lag-note {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.85rem;
    border-left: 3px solid var(--ps-warn);
    background: var(--ps-warn-soft);
    border-radius: 0 6px 6px 0;
    font-size: 0.82rem;
    line-height: 1.6;
    max-width: 74ch;
}

/* ------------------------------------------------------ optimization plan */
.ps-plan__section {
    margin: 1.75rem 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ps-line);
}

.ps-plan__section:first-of-type { border-top: none; padding-top: 0; }
.ps-plan__section h4 { margin: 0 0 0.35rem; font-size: 1rem; }

.ps-plan__keyword {
    padding: 1rem 1.1rem;
    border: 1px solid var(--ps-line);
    border-radius: 10px;
    margin-bottom: 0.85rem;
}

.ps-plan__keywordhead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.ps-plan__keywordtext { font-weight: 700; font-size: 1rem; }

.ps-plan__keywordmeta {
    font-size: 0.75rem;
    color: var(--ps-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ps-plan__keywordstats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    margin-bottom: 0.6rem;
}

.ps-plan__stat { display: flex; flex-direction: column; gap: 0.1rem; }

.ps-plan__statlabel {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.6;
}

.ps-plan__statvalue { font-weight: 700; font-variant-numeric: tabular-nums; }

/* The Wilson range in prose. This is the sentence that decides most of the exercise. */
.ps-plan__evidence {
    margin: 0 0 0.8rem;
    padding: 0.6rem 0.8rem;
    background: var(--ps-wash);
    border-radius: 6px;
    font-size: 0.86rem;
    line-height: 1.6;
}

.ps-plan__choices { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.ps-plan__choice,
.ps-plan__negative,
.ps-plan__structopt {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--ps-line);
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
}

.ps-plan__choice:hover,
.ps-plan__negative:hover,
.ps-plan__structopt:hover { border-color: var(--ps-brand); background: var(--ps-wash); }

.ps-plan__choice:has(input:checked),
.ps-plan__negative:has(input:checked),
.ps-plan__structopt:has(input:checked) {
    border-color: var(--ps-brand);
    background: var(--ps-brand-soft, var(--ps-wash));
    font-weight: 600;
}

.ps-plan__negatives,
.ps-plan__structural {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.5rem;
}

.ps-plan__negativebody,
.ps-plan__structbody { display: flex; flex-direction: column; gap: 0.15rem; }

.ps-plan__negativeterm, .ps-plan__structlabel { font-weight: 600; }

.ps-plan__negativecost,
.ps-plan__structdetail {
    font-size: 0.76rem;
    color: var(--ps-muted);
    font-weight: 400;
    line-height: 1.5;
}

.ps-plan__budget {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 640px;
}

.ps-plan__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ps-line);
}

.ps-plan__progress { font-size: 0.82rem; color: var(--ps-muted); }

.ps-plan__debrief:empty { display: none; }
.ps-plan__debrief { margin-top: 1.5rem; }
.ps-plan__debrief h4 { margin: 0 0 0.3rem; font-size: 1.05rem; }

.ps-plan__debriefnote {
    margin: 0 0 1rem;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--ps-muted);
}

.ps-plan__finding {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--ps-line);
    background: var(--ps-wash);
    margin-bottom: 0.6rem;
}

.ps-plan__finding p { margin: 0; font-size: 0.88rem; line-height: 1.65; }

.ps-plan__findinghead {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.ps-plan__findingtitle { font-weight: 700; }

.ps-plan__finding.is-supported { border-left-color: var(--ps-good); background: var(--ps-good-soft); }
.ps-plan__finding.is-defensible { border-left-color: var(--ps-warn); background: var(--ps-warn-soft); }
.ps-plan__finding.is-partial { border-left-color: var(--ps-warn); background: var(--ps-warn-soft); }
.ps-plan__finding.is-elsewhere { border-left-color: var(--ps-bad); background: var(--ps-bad-soft); }

@media (max-width: 900px) {
    .ps-auction__controls,
    .ps-auction__panels,
    .ps-plan__budget { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ps-chart__col { transition: none; }
}
