/* fin·calc v5 page skin for calculator pages (every page with an inline .fc-embed calculator).
   Loaded after landing.css and after the page's own <style>, by scripts/apply_shell.py.
   Selectors start with "main" so they outrank the inline fc-embed-css block. Content and
   calculator logic are untouched: this file only changes layout and look. */
main { max-width: 1120px !important; padding: 20px 16px 48px !important; }
main .crumbs { font-size: 14px; color: var(--muted, #5c6b7a); margin: 4px 0 12px; }
main .crumbs a { color: var(--accent, #0e7a4a); text-decoration: none; }
main .crumbs a:hover { text-decoration: underline; }
main > h1 { font-size: clamp(30px, 4.2vw, 44px); letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 8px; max-width: 900px; }
main > .sub, main > p.sub { font-size: 17px; color: var(--muted, #5c6b7a); max-width: 760px; margin-bottom: 20px; }

/* Calculator: inputs panel left, result right (stacked under 900 px) */
main .fc-embed {
  display: grid !important; grid-template-columns: 1fr; gap: 0 !important; padding: 0 !important; margin: 20px 0 28px !important;
  background: var(--card, #fff) !important; border: 1px solid var(--line, rgba(16,38,58,0.10)) !important; border-radius: 16px !important;
  box-shadow: 0 6px 18px -8px rgba(16,38,58,0.18); overflow: hidden; color: var(--ink, #1a2733) !important;
}
main .fc-embed > .fc-grid { grid-template-columns: 1fr !important; gap: 16px !important; padding: 24px; background: color-mix(in srgb, var(--bg, #f4f6f7) 70%, var(--card, #fff)); border-bottom: 1px solid var(--line, rgba(16,38,58,0.10)); }
main .fc-embed > :not(.fc-grid):not(style):not(script) { padding-left: 24px; padding-right: 24px; }
main .fc-embed > .fc-res { padding-top: 24px; padding-bottom: 24px; margin: 0 !important; }
main .fc-embed > .fc-head { padding-top: 24px; }
main .fc-embed > :last-child { padding-bottom: 24px; }
main .fc-embed label { font-size: 14px !important; font-weight: 600; color: var(--ink, #1a2733) !important; text-transform: none !important; letter-spacing: 0 !important; margin-bottom: 6px !important; }
main .fc-embed .fc-in { min-height: 48px; background: var(--bg-2, #fff) !important; border: 1px solid color-mix(in srgb, var(--ink, #1a2733) 18%, transparent) !important; border-radius: 10px !important; padding: 0 14px !important; }
main .fc-embed .fc-in span { font-family: 'JetBrains Mono', monospace; font-size: 13px !important; color: var(--muted, #5c6b7a) !important; }
main .fc-embed .fc-in input { font-family: 'JetBrains Mono', monospace; font-size: 17px !important; font-weight: 500 !important; color: var(--ink, #1a2733) !important; min-height: 46px; }
main .fc-embed select { min-height: 48px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ink, #1a2733) 18%, transparent); background: var(--bg-2, #fff); padding: 0 12px; font-size: 15px; color: var(--ink, #1a2733); width: 100%; }
main .fc-embed .fc-head { font-family: 'JetBrains Mono', monospace; font-size: 12px !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted, #5c6b7a) !important; }
main .fc-embed .fc-head strong {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif !important; font-weight: 400 !important;
  font-size: clamp(44px, 6vw, 64px) !important; line-height: 1 !important; letter-spacing: -0.01em; text-transform: none;
  color: var(--ink, #1a2733) !important; margin-top: 8px !important; padding-bottom: 16px; border-bottom: 1px solid var(--line, rgba(16,38,58,0.10));
  overflow-wrap: anywhere;
}
main .fc-embed .fc-mini { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px !important; margin-top: 16px !important; font-size: 13px !important; color: var(--muted, #5c6b7a) !important; }
main .fc-embed .fc-mini b { font-family: 'JetBrains Mono', monospace; font-weight: 500 !important; font-size: 16px !important; color: var(--ink, #1a2733) !important; margin-top: 4px; overflow-wrap: anywhere; }
main .fc-embed .fc-mini > div:nth-child(2) b { color: var(--accent-3, #6d28d9) !important; }
main .fc-embed .fc-bar { height: 12px !important; border: 0 !important; border-radius: 6px !important; margin-top: 18px !important; background: color-mix(in srgb, var(--muted, #5c6b7a) 12%, transparent); }
main .fc-embed .fc-bar i[data-bar="a"] { background: var(--accent, #0e7a4a) !important; }
main .fc-embed .fc-bar i[data-bar="b"] { background: var(--accent-3, #6d28d9) !important; }
main .fc-embed .fc-note { font-size: 13px !important; margin-top: 14px !important; color: var(--muted, #5c6b7a) !important; }
main .fc-embed .fc-note a { font-weight: 600; }
main .fc-embed .fc-err { margin: 12px 0 0 !important; }
main .fc-next {
  display: flex !important; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 16px;
  padding: 0 18px !important; border-radius: 10px; background: var(--accent, #0e7a4a); color: var(--bg-2, #fff) !important;
  font-weight: 700; font-size: 15px; text-decoration: none !important;
}
main .fc-next:hover { filter: brightness(1.08); }
@media (min-width: 900px) {
  main .fc-embed:has(> .fc-grid):not(:has(> .fc-grid ~ .fc-grid)) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  main .fc-embed:has(> .fc-grid):not(:has(> .fc-grid ~ .fc-grid)) > .fc-grid { grid-column: 1; grid-row: 1 / span 12; border-bottom: 0; border-right: 1px solid var(--line, rgba(16,38,58,0.10)); align-content: start; padding: 28px; }
  main .fc-embed:has(> .fc-grid):not(:has(> .fc-grid ~ .fc-grid)) > :not(.fc-grid):not(style):not(script) { grid-column: 2; padding-left: 32px; padding-right: 32px; }
  main .fc-embed > .fc-res { padding-top: 28px; padding-bottom: 28px; }
  main .fc-embed > .fc-head { padding-top: 28px; }
}

/* Content blocks become cards */
main > section, main > aside.keyfacts, main > article {
  background: var(--card, #fff); border: 1px solid var(--line, rgba(16,38,58,0.10)); border-radius: 12px;
  padding: 24px !important; margin: 0 0 16px !important;
}
main > section:empty { display: none; }
main > section h2, main > aside.keyfacts h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 10px; }
main > section h3 { font-size: 17px; font-weight: 600; margin: 18px 0 6px; }
main > section p, main > section li, main > section dd { max-width: 78ch; }
main > section a { color: var(--accent, #0e7a4a); }
main > section table { width: 100%; }
main > aside.keyfacts { border-left: 3px solid var(--accent, #0e7a4a) !important; }
main > aside.keyfacts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
@media (max-width: 640px) { main > aside.keyfacts dl { grid-template-columns: 1fr; } main > section, main > aside.keyfacts { padding: 18px !important; } }
main > a.cta, main a.cta {
  display: inline-flex !important; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px !important;
  border-radius: 10px; background: var(--accent, #0e7a4a) !important; color: var(--bg-2, #fff) !important; font-weight: 700; text-decoration: none !important; margin: 4px 0 20px;
}
main .byline { font-size: 14px !important; color: var(--muted, #5c6b7a) !important; line-height: 1.6; }
main > section.xl-related ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; margin: 0; padding: 0; }
main > section.xl-related li a { display: flex !important; align-items: center; min-height: 48px; padding: 0 14px !important; border: 1px solid var(--line, rgba(16,38,58,0.10)); border-radius: 10px; color: var(--ink, #1a2733) !important; text-decoration: none !important; font-weight: 500; }
main > section.xl-related li a:hover { border-color: var(--accent, #0e7a4a); color: var(--accent, #0e7a4a) !important; }

/* fixes after first render */
main .fc-embed > .fc-bar { padding: 0 !important; margin-left: 24px !important; margin-right: 24px !important; }
main .fc-embed > .fc-next { margin: 8px 24px 24px !important; }
main .fc-res .fc-next { margin: 16px 0 0 !important; }
@media (min-width: 900px) {
  main .fc-embed > .fc-bar { margin-left: 32px !important; margin-right: 32px !important; }
  main .fc-embed > .fc-next { margin: 8px 32px 28px !important; }
}
main > aside.keyfacts h2 { font: 600 12px/1.4 'JetBrains Mono', monospace !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent, #0e7a4a); margin-bottom: 12px; }
main > section table th { text-align: left; }
main > section table th, main > section table td { padding: 8px 10px; border-bottom: 1px solid var(--line, rgba(16,38,58,0.10)); }

/* Data reports (assets/fc-report.js) */
main table.rates { width: 100%; border-collapse: collapse; font-size: 14px; }
main table.rates th { text-align: left; padding: 0 !important; border-bottom: 1px solid var(--line, rgba(16,38,58,0.10)); }
main table.rates td { padding: 10px; border-bottom: 1px solid var(--line, rgba(16,38,58,0.10)); }
main table.rates td:not(:first-child):not(:nth-child(2)) { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
main table.rates tr:hover td { background: color-mix(in srgb, var(--accent, #0e7a4a) 5%, transparent); }
.fcr-sort { width: 100%; min-height: 44px; padding: 0 10px; border: 0; background: transparent; font: 600 13px 'Inter', system-ui, sans-serif; color: var(--ink, #1a2733); text-align: left; cursor: pointer; white-space: nowrap; }
th[aria-sort="ascending"] .fcr-sort::after { content: " \2191"; color: var(--accent, #0e7a4a); }
th[aria-sort="descending"] .fcr-sort::after { content: " \2193"; color: var(--accent, #0e7a4a); }
.fcr-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fcr-btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ink, #1a2733) 20%, transparent); background: var(--bg-2, #fff); font: 600 14px 'Inter', system-ui, sans-serif; color: var(--ink, #1a2733); cursor: pointer; }
.fcr-btn:hover { border-color: var(--accent, #0e7a4a); color: var(--accent, #0e7a4a); }
.fcr-cite { background: color-mix(in srgb, var(--bg, #f4f6f7) 80%, transparent); border: 1px solid var(--line, rgba(16,38,58,0.10)); border-radius: 10px; padding: 12px 14px; font-size: 14px; overflow-wrap: anywhere; }
.fcr-small { font-size: 13px !important; color: var(--muted, #5c6b7a); margin-top: 8px; }
.fcr-bars { display: flex; flex-direction: column; gap: 6px; }
.fcr-bar { display: grid; grid-template-columns: 150px 1fr 110px; gap: 12px; align-items: center; font-size: 14px; }
.fcr-t { height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--muted, #5c6b7a) 12%, transparent); overflow: hidden; }
.fcr-t i { display: block; height: 100%; border-radius: 6px; background: var(--accent-3, #6d28d9); }
.fcr-v { font: 500 13px 'JetBrains Mono', monospace; text-align: right; }
@media (max-width: 560px) { .fcr-bar { grid-template-columns: 96px 1fr 84px; gap: 8px; font-size: 13px; } }

/* calculators without an inputs grid (e.g. debt payoff): one column, comfortable padding */
main .fc-embed:not(:has(> .fc-grid)) { padding: 24px !important; }
main .fc-embed:not(:has(> .fc-grid)) > * { padding-left: 0 !important; padding-right: 0 !important; }
main .fc-embed:not(:has(> .fc-grid)) > .fc-bar { margin-left: 0 !important; margin-right: 0 !important; }

/* calculators with several input groups (balance transfer, consolidation, refinance): one column, groups side by side inside */
main .fc-embed:has(> .fc-grid ~ .fc-grid) > .fc-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important; background: transparent; border-bottom: 0; padding: 4px 24px 16px; }
main .fc-embed:has(> .fc-grid ~ .fc-grid) > .fc-sub { padding-top: 16px; font: 600 12px/1.4 'JetBrains Mono', monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted, #5c6b7a); }
main .fc-embed:has(> .fc-grid ~ .fc-grid) > div:first-child:not([class]) { padding-top: 16px; }

/* Share this result (assets/fc-share.js) */
main .fc-embed > .fc-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; padding-bottom: 8px; }
.fc-share-btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ink, #1a2733) 20%, transparent); background: var(--bg-2, #fff); font: 600 14px 'Inter', system-ui, sans-serif; color: var(--ink, #1a2733); cursor: pointer; }
.fc-share-btn:hover { border-color: var(--accent, #0e7a4a); color: var(--accent, #0e7a4a); }
.fc-share-msg { font-size: 13px; color: var(--muted, #5c6b7a); overflow-wrap: anywhere; }
