/* Subscription Cost Checker (#016). Only this tool's own pieces; everything else is the shared tool frame.
   Colours come from the site's variables only (tests/catalogue.test.mjs checks there are no hex values here). */

.sc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 420px) { .sc-pair { grid-template-columns: 1fr; } }
.sc-money { font-size: 18px; font-variant-numeric: tabular-nums; }
.sc-custom { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; }
.sc-custom__l { font-size: 15px; font-weight: 600; }
.sc-every { width: 84px; font-size: 18px; text-align: center; }
.sc-unit { flex: 1; min-width: 0; }
.sc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sc-btns .btn--wide { flex: 1 1 100%; }

/* The totals: the yearly figure leads, the monthly average under it; with changes, both states and the difference. */
.sc-empty { margin: 0; padding: 30px 0 18px; font-size: 15px; color: var(--steel); }
.sc-head { margin-top: 18px; }
.sc-big { margin: 0; font-size: clamp(32px, 7vw, 42px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sc-avg { margin: 4px 0 0; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sc-based { margin: 12px 0 0; font-size: 13.5px; color: var(--slate); }

/* With changes being tried (refinement approved by David, 31 Oct 2026): Current costs, then With your changes, side
   by side when the sheet has room for both and stacked when it doesn't (a phone). What you pay now stays quiet; the
   changed total and the difference lead. On a narrow sheet Current costs folds into one compact band. */
.sc-cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 236px), 1fr)); gap: 12px; align-items: start; }
.sc-card { min-width: 0; margin: 0; padding: 16px 18px 18px; border-radius: var(--r-card); }
.sc-card--now { background: var(--mist); }
.sc-card--with { background: var(--white); box-shadow: inset 0 0 0 2px var(--graphite); }
.sc-card__h { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--slate); }
.sc-card__year { margin: 6px 0 0; font-size: clamp(26px, 5.4vw, 32px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sc-card__avg { margin: 3px 0 0; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sc-card--now .sc-card__year { font-size: clamp(22px, 4.4vw, 26px); }
.sc-card--now .sc-card__avg { font-size: 15px; }
.sc-card__info { margin: 10px 0 0; font-size: 13.5px; color: var(--slate); }
.sc-card__diff { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--silver); }
.sc-card__d { margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sc-card__d--month { margin-top: 2px; font-size: 14px; font-weight: 500; }
.sc-card__tried { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--silver); }
.sc-card__th { margin: 0; font-size: 13px; font-weight: 600; color: var(--slate); }
.sc-card__list { list-style: none; margin: 4px 0 0; padding: 0; }
.sc-card__list li { margin: 0; padding: 2px 0; font-size: 14px; overflow-wrap: anywhere; }
.sc-card__list .sc-card__more { color: var(--slate); }
.sc-card__all { margin: 4px 0 0; font-size: 14px; font-weight: 600; }
.sc-cmp__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; }
.sc-cmp__note { flex: 1 1 260px; margin: 0; font-size: 13.5px; color: var(--slate); }
.sc-resetall { flex: none; }
/* A narrow sheet (a phone): Current costs as one compact band, the yearly figure and monthly average sharing a line
   (each goes onto its own line when the amounts are too long to sit together). */
.sc-head { container-type: inline-size; }
@container (max-width: 499px) {
  .sc-card--now { padding: 12px 16px 13px; }
  .sc-card--now .sc-card__figs { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 12px; margin-top: 4px; }
  .sc-card--now .sc-card__year { margin: 0; font-size: 21px; }
  .sc-card--now .sc-card__avg { margin: 0; font-size: 14px; }
  .sc-card--now .sc-card__info { margin: 4px 0 0; font-size: 13px; }
  .sc-card--with { padding: 14px 16px 15px; }
  .sc-card__diff, .sc-card__tried { margin-top: 10px; padding-top: 8px; }
  .sc-cmp__foot { margin-top: 8px; }
}

/* Each subscription: name and yearly cost, how it's paid, then Include and Try a price. */
.sc-rows { list-style: none; margin: 18px 0 0; padding: 0; display: grid; border-top: 1px solid var(--silver); }
.sc-row { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--mist); }
.sc-row__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sc-row__name { min-width: 0; padding: 0; border: 0; background: none; font: inherit; font-size: 17px; font-weight: 600; color: var(--graphite); text-align: left; text-decoration: underline; text-decoration-color: var(--silver); text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; min-height: 32px; }
.sc-row__name:hover { text-decoration-color: var(--graphite); }
.sc-row__name:focus-visible { outline: 3px solid var(--graphite); outline-offset: 2px; border-radius: 4px; }
.sc-row__year { flex: none; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-row__basis { margin: 0; font-size: 14px; color: var(--slate); font-variant-numeric: tabular-nums; }
.sc-row__state { margin: 0; font-size: 14px; font-weight: 600; }
.sc-row.is-out .sc-row__top, .sc-row.is-out .sc-row__basis { opacity: .45; }
.sc-row__btns, .sc-row__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.sc-inc span { padding: 8px 14px; }
.sc-tryb { font-size: 14.5px; min-height: 40px; }
.sc-try { display: grid; gap: 6px; margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--mist); }
.sc-try label { font-size: 14px; font-weight: 600; }
.sc-try__line { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-try__line .input { flex: 1 1 120px; min-width: 0; }
.sc-try .field__warn { margin: 0; }

/* On paper only (Print and the PDF; refinement approved by David, 30 Oct 2026). #sc-sum: the yearly headline, or with
   changes being tried, Current costs beside With your changes. #sc-table: the breakdown with its total. */
.sc-print { display: none; }
.sc-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.sc-table th, .sc-table td { text-align: left; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--mist); vertical-align: top; overflow-wrap: anywhere; }
.sc-table thead th { font-size: 13px; font-weight: 600; color: var(--slate); border-bottom: 1px solid var(--silver); }
.sc-table tbody th { font-weight: 600; }
.sc-table .sc-num { text-align: right; white-space: nowrap; }
.sc-table__name { display: block; }
.sc-table__note { display: block; font-size: 12.5px; font-weight: 500; color: var(--slate); }

.sc-send { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.sc-send h2 { margin: 0; color: var(--slate); }
.sc-send__btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .sc-send__btns { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .sc-send__btns .btn { width: 100%; justify-content: center; min-height: 44px; white-space: nowrap; }
  .sc-send__btns #sc-copy { grid-column: 1 / -1; }
}

@media print {
  .sc-print { display: block; }
  /* The screen's totals and note give way to the paper summary below (same figures, laid out for A4). */
  .sc-head, .sc-based { display: none !important; }
  /* A one-page sheet fills its page, so the footer mark sits at the foot of the page rather than under the table
     (as the letter tools do). Longer lists simply carry on; nothing is stretched. */
  .sc-paper { display: flex; flex-direction: column; min-height: 271mm; box-sizing: border-box; }
  .sc-paper .paper__foot { margin-top: auto; padding-top: 6mm; }
  .sc-result { margin-top: 7mm; }

  .sc-sum__label, .sc-panel__h, .sc-tried__h { margin: 0; font-size: 8.5pt; font-weight: 600; letter-spacing: .04em; color: var(--slate); }

  /* No changes: the yearly total leads, the monthly average beside it, then one factual line. */
  .sc-hero { break-inside: avoid; padding: 6mm 0 5.5mm; border-top: .5mm solid var(--graphite); border-bottom: 1px solid var(--silver); }
  .sc-hero__figs { display: grid; grid-template-columns: 1.55fr 1fr; gap: 8mm; align-items: end; }
  .sc-hero__month { padding-left: 6mm; border-left: 1px solid var(--silver); }
  .sc-sum__value { margin: 1.5mm 0 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .sc-hero__year .sc-sum__value { font-size: 30pt; letter-spacing: -0.03em; }
  .sc-hero__month .sc-sum__value { font-size: 15pt; font-weight: 500; }
  .sc-hero__text { margin: 4.5mm 0 0; font-size: 10pt; color: var(--slate); }

  /* Changes being tried: the two states side by side. */
  .sc-compare { break-inside: avoid; display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; align-items: stretch; }
  .sc-panel { padding: 5mm 5.5mm 5.5mm; border-radius: 2.5mm; min-width: 0; }
  .sc-panel--now { background: var(--mist); border: .4mm solid var(--mist); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sc-panel--with { background: var(--white); border: .4mm solid var(--graphite); }
  .sc-panel__year { margin: 2.5mm 0 0; font-size: 21pt; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .sc-panel__avg { margin: 1.2mm 0 0; font-size: 11.5pt; font-weight: 500; font-variant-numeric: tabular-nums; }
  .sc-panel__info { margin: 4mm 0 0; padding-top: 3mm; border-top: 1px solid var(--silver); font-size: 9.5pt; color: var(--slate); }
  .sc-panel__diffs { margin-top: 4mm; padding-top: 3mm; border-top: 1px solid var(--silver); }
  .sc-panel__diff { margin: 0; font-size: 10.5pt; font-weight: 600; font-variant-numeric: tabular-nums; }
  .sc-panel__diff--month { margin-top: .8mm; font-size: 9.5pt; font-weight: 500; }
  .sc-tried { margin-top: 4mm; padding-top: 3mm; border-top: 1px solid var(--silver); }
  .sc-tried__list { list-style: none; margin: 1.5mm 0 0; padding: 0; }
  .sc-tried__list li { margin: 0; padding: .6mm 0; font-size: 9.5pt; overflow-wrap: anywhere; }
  .sc-tried__list .sc-tried__more { color: var(--slate); }
  .sc-tried__all { margin: 1.5mm 0 0; font-size: 9.5pt; font-weight: 600; }
  .sc-compare__note { margin: 3mm 0 0; font-size: 9pt; color: var(--slate); }

  /* The breakdown: every subscription at its own price, the left-out and tried ones marked, then the total. */
  .sc-break__h { margin: 10mm 0 0; font-size: 11pt; font-weight: 600; color: var(--graphite); }
  .sc-table { margin-top: 2.5mm; font-size: 10pt; }
  .sc-table th, .sc-table td { padding: 2.3mm 3mm 2.3mm 0; border-bottom-color: var(--mist); }
  .sc-table th:last-child, .sc-table td:last-child { padding-right: 0; }
  .sc-table thead th { padding-top: 1.5mm; font-size: 8.5pt; border-bottom: 1px solid var(--silver); }
  .sc-table tr { break-inside: avoid; }
  .sc-table th:first-child { width: 44%; }
  .sc-table__note { margin-top: .8mm; font-size: 8.5pt; }
  .sc-table tr.is-out .sc-table__name, .sc-table tr.is-out td { color: var(--steel); }
  .sc-table tr.is-out .sc-table__note { color: var(--slate); }
  .sc-total th, .sc-total td { font-weight: 600; border-bottom: 0; }
  .sc-table .sc-total th, .sc-table .sc-total td { padding-top: 3mm; padding-bottom: 1mm; }
  .sc-table .sc-total:not(.sc-total--with) th, .sc-table .sc-total:not(.sc-total--with) td { border-top: .4mm solid var(--graphite); }
  .sc-table .sc-total--with th, .sc-table .sc-total--with td { padding-top: 1mm; }
  .sc-break__based { margin: 3mm 0 0; font-size: 9pt; color: var(--slate); }
}
