/* Credit card minimum payment calculator: page styles on top of the shared style.css.
   Everything here is prefixed "cc-" so it never changes another page.
   Colours: a fixed payment = gold (the shared "good outcome" colour), minimum only = slate,
   interest = rust (a cost), the balance itself = a quiet ink tint. */

.cc-head { padding-block: 24px 4px; }
.cc-head h1 { font-size: var(--step-3); margin-top: 6px; }

.cc-work { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 40px; align-items: start; padding-top: 16px; }
.cc-stage { display: grid; min-width: 0; }

.cc-answer { display: grid; gap: 2px; justify-items: start; }
.cc-answer .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.cc-answer .big { font-size: clamp(2.6rem, 2rem + 2.4vw, 4rem); }
.cc-answer .big.is-gold { color: var(--gold); }
.cc-answer .big.is-ink { color: var(--ink); }
.cc-answer-line { color: var(--muted); font-size: 0.93rem; max-width: 60ch; margin-top: 6px; }
.cc-answer-line strong { color: var(--ink); font-weight: 600; }

.cc-figure { margin: 0; padding-top: 12px; }
.cc-legend-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 24px; padding-top: 8px; }
.cc-legend-row .hint { font-size: 0.8rem; }
.cc-key { display: inline-flex; align-items: center; gap: 7px; }
.chip.cc-chip-fix { border-color: var(--gold); }
.chip.cc-chip-min { border-color: var(--slate); }
.cc-swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; background: color-mix(in srgb, var(--gold-area) 26%, transparent); }
.cc-swatch.cc-sw-principal { background: color-mix(in srgb, var(--ink) 20%, transparent); }
.cc-swatch.cc-sw-interest { background: color-mix(in srgb, var(--rust) 62%, transparent); }
.cc-swatch.cc-sw-saved { background: transparent; border: 1.5px dashed var(--gold); }

/* chart marks */
.chart-box .cc-extra { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .cc-normal { fill: none; stroke: var(--slate); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .cc-saved-area { fill: var(--gold-area); fill-opacity: 0.2; }
.chart-box .cc-saved-label { font-family: var(--font-body); font-style: normal; font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.chart-box .cc-span { stroke: var(--gold); stroke-width: 1.5; }
.chart-box .cc-span-label { font-size: 11.5px; font-weight: 700; fill: var(--gold); }
.chart-box .cc-bar-principal { fill: var(--ink); fill-opacity: 0.2; }
.chart-box .cc-bar-interest { fill: var(--rust); fill-opacity: 0.62; }
.chart-box .cc-bar-saved { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-box .cc-bar-name { font-family: var(--font-body); font-size: 14px; font-weight: 600; fill: var(--ink); }
.chart-box .cc-bar-v { font-size: 12px; font-weight: 700; }
.chart-box .cc-bar-s { font-size: 11px; fill: var(--muted); }
.chart-box .cc-normal-dash { fill: none; stroke: var(--slate); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart-box .cc-dot-extra { fill: var(--gold); stroke: var(--paper); stroke-width: 2; }
.chart-box .cc-dot-normal { fill: var(--slate); stroke: var(--paper); stroke-width: 2; }
.chart-box .cc-mark { font-size: 11.5px; font-weight: 700; }
.chart-box .cc-mark-sub { font-size: 11px; fill: var(--muted); }
.chart-box .cc-zone { fill: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.chart-box .cc-you { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; }
.chart-box .cc-empty { fill: var(--muted); font-family: var(--font-body); font-style: normal; font-size: 13px; }
.tip .t-h { font-weight: 700; font-size: 0.78rem; margin-top: 4px; }
.tip .t-h.extra { color: var(--gold); }
.tip .t-h.normal { color: var(--slate); }
.tip .t-ahead { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 5px; font-weight: 600; }

/* stats */
.cc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.cc-stat { padding: 12px 16px 14px 0; display: grid; gap: 2px; align-content: start; min-width: 0; }
.cc-stat + .cc-stat { padding-left: 16px; border-left: 1px solid var(--line); }
.cc-stat .label { font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.cc-stat .v { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; font-variant-numeric: lining-nums tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.cc-stat .sub { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* inputs */
.cc-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px; display: grid; gap: 4px; min-width: 0; position: sticky; top: 12px; }
.cc-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; }
.cc-panel-head h2 { font-size: 1.4rem; }
.cc-panel-head .btn-row { flex-wrap: nowrap; gap: 4px; }
.cc-panel-head .inline-field select { max-width: 11.5rem; }
.cc-form { display: grid; border-top: 1px solid var(--ink); }
.cc-group { border: 0; margin: 0; padding: 14px 0; display: grid; gap: 10px; min-width: 0; }
.cc-group + .cc-group { border-top: 1px solid var(--line); }
.cc-group:last-child { padding-bottom: 6px; }
.cc-group legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-size: 1.05rem; }
.cc-group legend + * { clear: both; }
.cc-row2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.cc-row-rule { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cc-row-fix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: end; }
.cc-fix-hint { margin: 0 0 4px; line-height: 1.35; }
.cc-group .hint { font-size: 0.8rem; }
.cc-panel .privacy { margin-top: 6px; }
.cc-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 42px; }
.cc-seg button { border: 0; background: var(--paper); color: var(--muted); font-weight: 600; font-size: 0.86rem; cursor: pointer; padding: 0 6px; }
.cc-seg button + button { border-left: 1px solid var(--line); }
.cc-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cc-panel input[type="text"] { min-height: 42px; }

/* sections */
.cc-section { padding-top: 64px; }
.cc-section-head { display: grid; gap: 8px; margin-bottom: 8px; }
.cc-msg { font-size: 1.05rem; max-width: 70ch; }
.cc-msg b { font-weight: 700; }
.cc-msg .c-gold { color: var(--gold); }

/* year by year */
.cc-yt-scroll { overflow-x: auto; margin-top: 8px; }
.cc-yt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.93rem; border-top: 1px solid var(--ink); }
.cc-yt th, .cc-yt td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.cc-yt th:first-child, .cc-yt td:first-child { text-align: left; }
.cc-yt thead th { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.cc-yt .cc-yt-group th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; padding-top: 10px; text-align: center; border-bottom: 0; }
.cc-yt .cc-yt-group .g-fix { color: var(--gold); }
.cc-yt .cc-yt-group .g-min { color: var(--slate); }
.cc-yt tbody th { font-weight: 600; }
.cc-yt tbody th small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.cc-yt td.z { color: var(--muted); }
.cc-yt td.saved { color: var(--gold); font-weight: 600; }
.cc-yt td.free { color: var(--gold); font-weight: 600; }
.cc-yt td:nth-child(4), .cc-yt th:nth-child(4) { padding-right: 22px; }
.cc-yt-note { margin-top: 10px; }

@media (max-width: 1200px) and (min-width: 961px) { .cc-work { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; } }
@media (max-width: 960px) {
  .cc-work { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cc-stage { display: contents; }
  .cc-answer { order: 1; }
  .cc-stage .cc-figure { order: 2; }
  .cc-panel { order: 3; margin-top: 18px; position: static; }
  .cc-stats { order: 4; margin-top: 28px; }
}
@media (max-width: 960px) and (min-width: 640px) {
  .cc-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; }
  .cc-form .cc-group + .cc-group { border-top: 0; border-left: 1px solid var(--line); padding-left: 20px; }
}
@media (max-width: 640px) {
  .cc-stats { grid-template-columns: minmax(0, 1fr); }
  .cc-stat + .cc-stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .cc-stat { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding-right: 0; }
  .cc-stat .label { grid-column: 1; }
  .cc-stat .v { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 1.3rem; }
  .cc-stat .sub { grid-column: 1; grid-row: 2; }
}
@media (max-width: 600px) {
  .cc-head { padding-block: 16px 0; }
  .cc-head .eyebrow { display: none; }
  .cc-head h1 { font-size: 1.55rem; }
  .cc-answer .big { font-size: 2.6rem; }
  .cc-answer-line { font-size: 0.86rem; }
  .cc-figure { padding-top: 6px; }
  .cc-hover-hint { display: none; }
  .cc-panel { padding: 14px 14px 14px; margin-inline: -4px; }
  .cc-row2, .cc-row-rule, .cc-row-fix { gap: 8px; }
  .cc-seg button { font-size: 0.8rem; padding: 0 2px; }
  .cc-group .hint { font-size: 0.76rem; }
  .cc-section { padding-top: 52px; }
  .cc-yt { font-size: 0.84rem; }
  .cc-yt th, .cc-yt td { padding-right: 9px; }
  .cc-yt td:nth-child(4), .cc-yt th:nth-child(4) { padding-right: 14px; }
  .cc-yt tbody th small { display: none; }
}

.chart-box .cc-halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.cc-panel-head h2 { white-space: nowrap; }
@media (max-width: 600px) {
  .cc-answer-line .cc-more { display: none; }
  .cc-answer .label { font-size: 0.76rem; }
  .cc-answer .big { font-size: 2.3rem; }
  .cc-head h1 { font-size: 1.4rem; }
  .cc-panel-head h2 { font-size: 1.2rem; }
  .cc-panel-head { padding-bottom: 10px; }
  .cc-group { padding: 12px 0; gap: 8px; }
}
.cc-panel-head h2 { flex: none; font-size: 1.3rem; }
.cc-panel-head .btn-row { flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.cc-panel-head .inline-field { min-width: 0; flex: 0 1 auto; }
.cc-panel-head .inline-field select { max-width: 10rem; width: 100%; min-width: 0; }
.cc-panel-head .btn-ghost { padding-inline: 6px; }
.cc-group { align-content: start; }

/* extra-payment page additions */
.chart-box .cc-tick { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 2; }
.chart-box .cc-saved-none { fill-opacity: 0; }
.cc-answer-line .cc-more { color: var(--muted); }
.cc-short { display: none; }
@media (max-width: 600px) {
  .cc-long { display: none; }
  .cc-short { display: inline; }
  .cc-stage .cc-legend-row .legend { gap: 4px 14px; }
  .cc-panel-head { padding-bottom: 8px; }
  .cc-group legend { font-size: 1rem; }
}

/* credit card page additions */
.chart-box .cc-fix { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .cc-min { fill: none; stroke: var(--slate); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .cc-tail { fill: var(--slate); fill-opacity: 0.12; }
.chart-box .cc-int-area { fill: var(--rust); fill-opacity: 0.22; }
.chart-box .cc-dot-fix { fill: var(--gold); stroke: var(--paper); stroke-width: 2; }
.chart-box .cc-dot-min { fill: var(--slate); stroke: var(--paper); stroke-width: 2; }
.chart-box .cc-span-min { stroke: var(--slate); stroke-width: 1.5; }
.chart-box .cc-span-label-min { font-size: 11.5px; font-weight: 700; fill: var(--slate); }
.chart-box .cc-tail-label { font-family: var(--font-body); font-style: normal; font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.tip .t-h.fix { color: var(--gold); }
.tip .t-h.min { color: var(--slate); }
.cc-answer .big.is-slate { color: var(--ink); }
.cc-yt td.more { color: var(--muted); text-align: left; font-style: normal; }
.cc-fix-hint b { color: var(--ink); font-weight: 600; }
@media (max-width: 600px) { .cc-fix-hint { font-size: 0.76rem; } #rule-hint { font-size: 0.74rem; } }
.cc-msg .c-rust { color: var(--rust); }

/* Keep the currency picker readable: it used to shrink to an empty box once Share joined Reset.
   When "Your numbers" and the buttons don't fit on one line, the buttons move under the title. */
.cc-panel-head { flex-wrap: wrap; row-gap: 8px; }
.cc-panel-head .btn-row { flex: 0 0 auto; max-width: 100%; flex-wrap: wrap; row-gap: 6px; }
.cc-panel-head .inline-field { flex: 0 0 auto; }
.cc-panel-head .inline-field select { width: 8rem; min-width: 8rem; max-width: 8rem; }
