/* =============================================================================
   KOTOVA BOOKS · stress.css — the interactive stress test card (books/stress.js) on /books/index*.html
   Loaded after product.css (§7 .bkp-stress / .bkp-st-row stay the base). Prefix bkp-st-.
   Without JS the card shows its static −20 % state; stress.js adds .is-live and turns the buttons on.
   ============================================================================= */

/* ---- the segment: the kit's .seg looked like spans, now it is four real buttons ---- */
.bk-app .bkp-stress .seg button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    line-height: inherit;
    cursor: default;
}
.bk-app .bkp-stress.is-live .seg button {
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}
.bk-app .bkp-stress.is-live .seg button:hover:not(.on) {
    color: var(--ink);
    background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}
.bk-app .bkp-stress .seg button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* ---- the assumption under the title ---- */
.bk-app .bkp-st-assume {
    margin: 0;
    padding: 0 18px 10px;
    min-height: 2.9em;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ink-3);
}

/* ---- Custom: one price change per asset ---- */
.bk-app .bkp-st-custom {
    padding: 2px 18px 12px;
    border-bottom: 1px solid var(--hairline);
}
.bk-app .bkp-st-custom[hidden] { display: none; }
.bk-app .bkp-st-cu-t {
    margin: 0 0 7px;
    font: 600 11px var(--f-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.bk-app .bkp-st-cu-g {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 8px;
}
.bk-app .bkp-st-in {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 6px 9px 5px;
    border: 1px solid var(--hairline);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink-2);
    font: 600 11.5px var(--f-mono);
    letter-spacing: 0.04em;
    cursor: text;
}
.bk-app .bkp-st-in:focus-within { border-color: var(--primary); }
.bk-app .bkp-st-in .h { display: flex; align-items: center; gap: 6px; }
.bk-app .bkp-st-in .f { display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.bk-app .bkp-st-in .u { flex: none; color: var(--ink-3); font-weight: 500; }
.bk-app .bkp-st-in input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 1px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: 600 14px var(--f-mono);
    letter-spacing: 0;
    text-align: left;
}
.bk-app .bkp-st-in input.is-invalid { color: var(--neg); }
.bk-app .bkp-st-in:has(input.is-invalid) { border-color: var(--neg); }

/* ---- the result rows ---- */
.bk-app .bkp-st-row .bkp-st-sym {
    margin-left: 4px;
    font: 500 11.5px var(--f-mono);
    color: var(--ink-3);
    white-space: normal;
}
.bk-app .bkp-st-row .num.zero { color: var(--ink-3); }
.bk-app .bkp-st-row.is-none > span:first-child { color: var(--ink-3); }

/* ---- touch: bigger targets, and 16 px inputs so iOS does not zoom in on focus ---- */
@media (pointer: coarse) {
    .bk-app .bkp-stress .seg button { min-height: 36px; justify-content: center; }
    .bk-app .bkp-st-in { padding: 8px 10px 7px; }
    .bk-app .bkp-st-in input { font-size: 16px; }
}

@media print {
    .bk-app .bkp-st-custom { display: none; }
}
