/* Public guide pages: Switch to Milesby, the per-app guides and About.
   Same type and colours as the landing page; works in both layouts. */
.mk-page {
    --mk-ink: #302d43;
    --mk-muted: #5f5a6d;
    --mk-purple: #70538c;
    --mk-border: #e7e3ed;
    --mk-soft: #f6f2fa;
    --mk-green: #4f715b;
    --mk-green-soft: #edf5ef;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 40px 24px;
    color: var(--mk-ink);
    font-size: 16px;
    line-height: 1.65;
}
.app-body .mk-page {padding-inline: 0;}
.mk-page * {box-sizing: border-box;}
.mk-page h1, .mk-page h2, .mk-page h3 {font-family: var(--display); color: var(--mk-ink); overflow-wrap: break-word;}
.mk-page p, .mk-page dd, .mk-page li {color: var(--mk-muted);}
.mk-page a:focus-visible {outline: 3px solid var(--mk-purple); outline-offset: 4px;}

.mk-hero {max-width: 760px; padding: 64px 0 40px;}
.mk-hero-guide {padding-top: 40px;}
.mk-eyebrow {margin: 0 0 14px; color: var(--mk-purple) !important; font-size: 14px; font-weight: 700; letter-spacing: .2px;}
.mk-hero h1 {margin: 0 0 18px; font-size: clamp(36px, 4.6vw, 56px); font-weight: 800; line-height: 1.08; letter-spacing: -2px;}
.mk-lead {max-width: 640px; margin: 0; font-size: 18px; line-height: 1.7;}
.mk-actions {display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 28px;}
.mk-page .mk-primary {min-height: 48px; padding: 13px 21px; border: 1px solid #70538c; border-radius: 12px; background: #70538c; box-shadow: none; color: #fff; font-size: 15px;}
.mk-page .mk-primary:hover {background: #5c4277; border-color: #5c4277; transform: none;}
.mk-text-link {display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #65457f; font-weight: 700;}
.mk-text-link:hover {text-decoration: underline; text-underline-offset: 4px;}
.mk-back {display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 10px; color: #65457f; font-size: 15px; font-weight: 600;}
.mk-back:hover {text-decoration: underline; text-underline-offset: 4px;}
.mk-badge {display: inline-flex; align-items: center; min-height: 28px; margin-top: 18px; padding: 3px 12px; border-radius: 999px; background: var(--mk-soft); color: #5b4673; font-size: 13px; font-weight: 700;}
.mk-badge.is-matched {background: var(--mk-green-soft); color: #3f6049;}

.mk-section {padding: 44px 0; border-top: 1px solid var(--mk-border);}
.mk-section h2 {margin: 0 0 14px; font-size: clamp(25px, 2.6vw, 32px); font-weight: 750; line-height: 1.25; letter-spacing: -1px;}
.mk-section > p {max-width: 680px; margin: 0;}
.mk-split {display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: start;}
.mk-split > div:not(.mk-prose) > p {margin: 0;}
.mk-prose p {margin: 0 0 14px;}
.mk-prose p:last-child {margin-bottom: 0;}

.mk-app-grid {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px;}
.mk-app-card {display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 24px; border: 1px solid var(--mk-border); border-radius: 16px; background: #fff; color: var(--mk-ink); transition: border-color .15s;}
.mk-app-card:hover {border-color: #9b86ac;}
.mk-app-card .mk-badge {margin-top: 10px;}
.mk-app-name {font-family: var(--display); font-size: 23px; font-weight: 750; letter-spacing: -.5px;}
.mk-app-summary {margin-top: 14px; color: var(--mk-muted); line-height: 1.7;}
.mk-app-link {margin-top: auto; padding-top: 16px; color: #65457f; font-weight: 700;}

.mk-list {margin: 0;}
.mk-list > div {padding: 16px 0; border-bottom: 1px solid var(--mk-border);}
.mk-list > div:first-child {padding-top: 0;}
.mk-list dt {font-weight: 700;}
.mk-list dd {margin: 4px 0 0;}

.mk-steps {display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: mk-step;}
.mk-steps li {position: relative; padding-top: 52px; counter-increment: mk-step;}
.mk-steps li::before {position: absolute; top: 0; left: 0; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--mk-soft); color: var(--mk-purple); content: counter(mk-step); font-family: var(--display); font-weight: 800;}
.mk-steps strong {display: block; margin-bottom: 4px; color: var(--mk-ink);}
.mk-note {margin-top: 26px !important; padding: 14px 18px; border-left: 3px solid #b7a4c8; background: var(--mk-soft); font-size: 15px;}

.mk-cta {display: flex; align-items: center; justify-content: space-between; gap: 28px;}
.mk-cta h2 {margin-bottom: 8px;}
.mk-cta p {margin: 0;}
.mk-cta > a {flex-shrink: 0;}

.mk-guide {display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 48px; align-items: start; padding: 36px 0 48px; border-top: 1px solid var(--mk-border);}
.mk-guide-main {display: grid; gap: 36px;}
.mk-guide-main h2 {display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 24px; font-weight: 750; letter-spacing: -.6px;}
.mk-step-number {display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: var(--mk-soft); color: var(--mk-purple); font-size: 16px; font-weight: 800;}
.mk-numbered {display: grid; gap: 10px; margin: 0 0 22px; padding-left: 22px;}
.mk-numbered li {padding-left: 6px;}
.mk-numbered li::marker {color: var(--mk-purple); font-weight: 700;}
.mk-numbered strong {color: var(--mk-ink);}
.mk-guide-side {display: grid; gap: 22px; padding: 24px; border: 1px solid var(--mk-border); border-radius: 16px; background: #fcfbfd;}
.mk-guide-side h2 {margin: 0 0 10px; font-size: 17px; font-weight: 750; letter-spacing: -.2px;}
.mk-guide-side p {margin: 0 0 10px; font-size: 15px;}
.mk-guide-side p:last-child {margin-bottom: 0;}
.mk-check, .mk-cross {display: grid; gap: 8px; margin: 0; padding: 0; list-style: none;}
.mk-check li, .mk-cross li {position: relative; padding-left: 26px; font-size: 15px; line-height: 1.6;}
.mk-check li::before, .mk-cross li::before {position: absolute; top: .2em; left: 0; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; line-height: 1;}
.mk-check li::before {background: var(--mk-green-soft); color: var(--mk-green); content: "✓";}
.mk-cross li::before {background: #f2eff4; color: #7b7385; content: "–";}
.mk-check-large {gap: 14px;}
.mk-check-large li {font-size: 16px;}
.mk-check-large strong {color: var(--mk-ink);}
.mk-others p {display: flex; flex-wrap: wrap; gap: 10px 12px;}
.mk-others a {display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid var(--mk-border); border-radius: 999px; color: #5b4673; font-weight: 600;}
.mk-others a:hover {border-color: #9b86ac;}

.mk-why-grid {display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 22px 0 0; padding: 0; list-style: none;}
.mk-why-grid li {padding-top: 18px; border-top: 2px solid #d9cce6;}
.mk-why-grid strong {display: block; margin-bottom: 8px; color: var(--mk-ink); font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.3px;}
.mk-why-grid span {display: block; color: var(--mk-muted); font-size: 15px; line-height: 1.7;}
.mk-page .mk-stay {max-width: 760px; margin: 26px 0 0; padding: 14px 18px; border-left: 3px solid #b7a4c8; background: var(--mk-soft); font-size: 15px;}
.mk-stay strong {color: var(--mk-ink);}
.mk-page .mk-disclaimer {display: block; margin: 0 0 8px; color: var(--mk-muted); font-size: 13px;}
.mk-others .mk-disclaimer {margin-top: 18px;}
@media (max-width: 860px) {
    .mk-page {padding-inline: 28px;}
    .mk-split, .mk-guide {grid-template-columns: minmax(0, 1fr); gap: 24px;}
    .mk-steps, .mk-why-grid {grid-template-columns: minmax(0, 1fr); gap: 18px;}
    .mk-steps li {padding: 4px 0 0 54px; min-height: 38px;}
    .mk-cta {align-items: flex-start; flex-direction: column; gap: 20px;}
}
@media (max-width: 560px) {
    .mk-page {padding-inline: 20px;}
    .mk-hero {padding: 36px 0 30px;}
    .mk-hero h1 {font-size: 36px; letter-spacing: -1.4px;}
    .mk-lead {font-size: 17px;}
    .mk-section {padding: 34px 0;}
    .mk-app-grid {grid-template-columns: minmax(0, 1fr);}
    .mk-app-card {padding: 20px;}
    .mk-guide-side {padding: 20px;}
}
@media (prefers-reduced-motion: reduce) {
    .mk-app-card {transition: none;}
}
@media screen {
    html[data-theme="dark"] .mk-page {--mk-ink: var(--ink); --mk-muted: var(--muted); --mk-border: var(--line); --mk-soft: #302b43; --mk-green: #b3d9bc; --mk-green-soft: #263a31;}
    html[data-theme="dark"] .mk-page :is(p, dd, li) {color: var(--muted);}
    html[data-theme="dark"] .mk-page :is(.mk-app-card, .mk-guide-side) {background: var(--card); border-color: var(--line);}
    html[data-theme="dark"] .mk-page :is(.mk-text-link, .mk-back, .mk-app-link, .mk-others a, .mk-eyebrow) {color: #d4bdf7 !important;}
    html[data-theme="dark"] .mk-page .mk-badge {background: #302b43; color: #dcc8f5;}
    html[data-theme="dark"] .mk-page .mk-badge.is-matched {background: #263a31; color: #b3d9bc;}
    html[data-theme="dark"] .mk-page .mk-step-number, html[data-theme="dark"] .mk-page .mk-steps li::before {background: #302b43; color: #d4bdf7;}
    html[data-theme="dark"] .mk-page .mk-cross li::before {background: #2b3040; color: var(--muted);}
    html[data-theme="dark"] .mk-page .mk-primary {background: #c0a8e8; border-color: #c0a8e8; color: #1d1a28;}
    html[data-theme="dark"] .mk-page :is(.mk-note, .mk-stay) {border-left-color: #8c74a8;}
    html[data-theme="dark"] .mk-page .mk-why-grid li {border-top-color: #5a4a70;}
}

/* Cost-per-mile calculator */
.calc-layout {display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 44px;}
.calc-form {display: grid; gap: 20px;}
.calc-form fieldset {display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 0; padding: 22px; border: 1px solid var(--mk-border); border-radius: 16px;}
.calc-form legend {padding: 0 6px; font-family: var(--display); font-size: 17px; font-weight: 750; color: var(--mk-ink);}
.calc-form legend small {font-family: var(--body, inherit); font-size: 13px; font-weight: 500; color: var(--mk-muted);}
.calc-form .field {display: grid; margin: 0;}
.calc-form .field span {color: var(--mk-ink); font-weight: 600;}
.calc-form .field input {width: 100%;}
.calc-mpg-help {grid-column: 1 / -1; margin: -4px 0 0; font-size: 14px;}
.calc-mpg-help summary {min-height: 32px; color: #65457f; font-weight: 700; cursor: pointer;}
.calc-mpg-help p {margin: 4px 0 10px; font-size: 14px;}
.calc-mpg-row {display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end;}
.calc-mpg-row .button {min-height: 46px; white-space: nowrap;}
.calc-results {position: sticky; top: 20px; display: grid; gap: 16px; padding: 24px; border-radius: 18px; background: var(--mk-soft);}
.calc-headline strong {font-family: var(--display); font-size: clamp(44px, 6vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -2px; color: var(--mk-ink);}
.calc-headline .calc-unit {margin-left: 8px; font-size: 17px; font-weight: 600; color: var(--mk-muted);}
.calc-headline p {margin: 8px 0 0; font-size: 15px;}
.calc-label {display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--mk-purple);}
.calc-all-in {padding-top: 16px; border-top: 1px solid var(--mk-border);}
.calc-all-in strong {font-size: clamp(34px, 4.4vw, 44px);}
.calc-breakdown {display: grid; gap: 2px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--mk-border); list-style: none;}
.calc-breakdown li {display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 15px;}
.calc-breakdown li[hidden] {display: none;}
.calc-breakdown b {color: var(--mk-ink); font-variant-numeric: tabular-nums;}
.calc-compare {margin: 0; font-size: 13px; line-height: 1.55;}
.calc-compare a {color: #65457f; font-weight: 600;}
.calc-visually-hidden {position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;}
.calc-cta {padding-bottom: 32px;}
@media (max-width: 860px) {
    .calc-layout {grid-template-columns: 1fr;}
    .calc-results {position: static;}
}
@media (max-width: 560px) {
    .calc-form fieldset {grid-template-columns: 1fr; padding: 16px;}
    .calc-mpg-row {grid-template-columns: 1fr 1fr;}
    .calc-mpg-row .button {grid-column: 1 / -1;}
}
@media screen {
    html[data-theme="dark"] .calc-results {background: var(--card);}
    html[data-theme="dark"] .calc-page :is(.calc-label, .calc-mpg-help summary, .calc-compare a) {color: #d4bdf7;}
}

/* Keep or replace */
.calc-form .field select {width: 100%;}
.calc-hint {grid-column: 1 / -1; margin: 0; font-size: 13px; line-height: 1.55;}
.kr-headline {margin: 0 !important; font-family: var(--display); font-size: clamp(22px, 2.4vw, 27px) !important; font-weight: 800; line-height: 1.25; letter-spacing: -.5px; color: var(--mk-ink) !important;}
.kr-verdict p + p {margin-top: 8px;}
.kr-table {width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums;}
.kr-table th, .kr-table td {padding: 7px 0; border-bottom: 1px solid var(--mk-border); text-align: right;}
.kr-table th[scope="row"], .kr-table thead th:first-child {text-align: left; font-weight: 500; color: var(--mk-muted);}
.kr-table thead th {font-size: 13px; font-weight: 700; color: var(--mk-purple);}
.kr-table td {color: var(--mk-ink); padding-left: 12px;}
.kr-table tfoot th, .kr-table tfoot td {border-bottom: 0; font-weight: 800; color: var(--mk-ink);}

/* Guide articles */
.guide-article .mk-hero {max-width: 720px;}
.guide-meta {margin: 14px 0 0; font-size: 14px;}
.guide-body {max-width: 720px; padding-bottom: 36px;}
.guide-body section {padding-top: 28px;}
.guide-body h2 {margin: 0 0 10px; font-size: clamp(22px, 2.2vw, 26px); font-weight: 750; line-height: 1.3; letter-spacing: -.5px;}
.guide-body p {margin: 0 0 12px;}
.guide-body .mk-check {margin: 0; padding: 0;}
.guide-table-wrap {overflow-x: auto;}
.guide-table {width: 100%; border-collapse: collapse; font-size: 15px;}
.guide-table th, .guide-table td {padding: 11px 12px 11px 0; border-bottom: 1px solid var(--mk-border); text-align: left; vertical-align: top;}
.guide-table thead th {font-size: 13px; color: var(--mk-purple);}
.guide-table tbody th {width: 34%; color: var(--mk-ink); font-weight: 700; white-space: nowrap;}
.guide-table td {color: var(--mk-muted);}
.guide-sources ul {margin: 0; padding-left: 18px; font-size: 14px;}
.guide-sources a, .guide-more a {color: #65457f; font-weight: 600;}
.guide-more ul {margin: 0; padding-left: 18px;}
@media (max-width: 560px) {
    .guide-table tbody th {white-space: normal;}
}
@media screen {
    html[data-theme="dark"] .mk-page :is(.guide-sources a, .guide-more a, .kr-table thead th, .guide-table thead th) {color: #d4bdf7;}
}
.guide-list {margin: 0; padding-left: 20px;}
.guide-list li {margin-bottom: 8px; padding-left: 2px;}

/* Phones: the answer stays in view while the form is filled in. */
.calc-jump {display: none;}
@media (max-width: 860px) {
    .calc-jump {position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; border-radius: 14px; background: #3d3352; box-shadow: 0 6px 20px rgba(30, 24, 44, .25); color: #fff; font-size: 15px; font-weight: 700; line-height: 1.3; text-decoration: none;}
    .calc-jump-link {flex-shrink: 0; font-size: 13px; color: #e6dcf5;}
    .calc-results h2.calc-visually-hidden {scroll-margin-top: 16px;}
}
main.marketing-main:has(.calc-page), main:has(> .calc-page) {overflow: clip;}

/* Used car checklist */
.ucc-tiers {display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -12px 0 24px;}
.ucc-tiers a {display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--mk-border); border-radius: 999px; color: var(--mk-ink); font-weight: 700; text-decoration: none;}
.ucc-tiers a[aria-current="page"] {border-color: #70538c; background: #70538c; color: #fff;}
.ucc-tiers .ucc-print {margin-left: auto; min-height: 44px;}
.ucc-sheet {max-width: 880px; padding-bottom: 36px;}
.ucc-sheet-head h2 {margin: 0 0 6px; font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.5px;}
.ucc-sheet-head p {margin: 0 0 16px;}
.ucc-columns {display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-bottom: 8px;}
.ucc-columns > div {padding: 18px 20px; border-radius: 16px;}
.ucc-walk {border: 2px solid #b4523f; background: #fdf3f0;}
.ucc-ok {border: 1px solid var(--mk-border); background: var(--mk-soft);}
.ucc-columns h3 {margin: 0 0 8px; font-family: var(--display); font-size: 17px; font-weight: 800; color: var(--mk-ink);}
.ucc-walk h3 {color: #8f3a2a;}
.ucc-columns ul {margin: 0; padding-left: 18px;}
.ucc-columns li {margin-bottom: 6px; font-size: 15px; line-height: 1.5;}
.ucc-ok p {margin: 0 0 14px; font-size: 15px; line-height: 1.5;}
.ucc-ok p:last-child {margin-bottom: 0;}
.ucc-step {padding-top: 22px;}
.ucc-step h3 {margin: 0 0 8px; font-family: var(--display); font-size: 19px; font-weight: 800; color: var(--mk-ink);}
.ucc-boxes {margin: 0; padding: 0; list-style: none;}
.ucc-boxes li {display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--mk-border);}
.ucc-boxes input {flex-shrink: 0; width: 20px; height: 20px; margin: 2px 0 0; accent-color: #70538c;}
.ucc-boxes label {color: var(--mk-muted); font-size: 15px; line-height: 1.5; cursor: pointer;}
.ucc-boxes input:checked + label {color: var(--mk-ink);}
.ucc-sources {padding-top: 24px;}
.ucc-sources h3 {margin: 0 0 6px; font-size: 15px;}
.ucc-print-only {display: none;}
@media (max-width: 700px) {
    .ucc-columns {grid-template-columns: 1fr;}
    .ucc-tiers .ucc-print {margin-left: 0;}
}
@media screen {
    html[data-theme="dark"] .ucc-walk {background: #3a2522; border-color: #c9705e;}
    html[data-theme="dark"] .ucc-walk h3 {color: #f0a596;}
    html[data-theme="dark"] .ucc-ok {background: var(--card); border-color: var(--line);}
    html[data-theme="dark"] .ucc-tiers a {color: var(--ink); border-color: var(--line);}
    html[data-theme="dark"] .ucc-tiers a[aria-current="page"] {background: #c0a8e8; border-color: #c0a8e8; color: #1d1a28;}
}
@media print {
    @page {margin: 12mm;}
    html, body, .marketing-body, .app-body, main {background: #fff !important;}
    .marketing-nav, .marketing-footer, .marketing-skip, .ucc-noprint, .sidebar, .topbar, .app-footer, .mobile-backdrop, .marketing-mobile-nav {display: none !important;}
    .ucc-page {max-width: none; padding: 0; color: #111; font-size: 10.5pt; line-height: 1.4;}
    .ucc-page .mk-hero {padding: 0 0 4pt;}
    .ucc-page .mk-hero h1 {font-size: 18pt; letter-spacing: 0; margin: 0;}
    .ucc-sheet {max-width: none; padding: 0;}
    .ucc-sheet-head h2 {font-size: 13pt; margin: 2pt 0;}
    .ucc-sheet-head p, .ucc-columns li, .ucc-ok p, .ucc-boxes label {font-size: 9.5pt; line-height: 1.35; color: #111;}
    .ucc-print-only {display: block; margin: 0 0 6pt;}
    .ucc-columns {gap: 8pt; break-inside: avoid;}
    .ucc-columns > div {padding: 6pt 8pt; border-radius: 4pt; background: #fff !important;}
    .ucc-columns li {margin-bottom: 2pt;}
    .ucc-step {padding-top: 6pt; break-inside: avoid;}
    .ucc-step h3, .ucc-columns h3 {font-size: 11pt; margin: 0 0 2pt;}
    .ucc-boxes li {padding: 2.5pt 0; gap: 6pt;}
    .ucc-boxes input {width: 11pt; height: 11pt; margin-top: 0;}
    .ucc-notes {min-height: 50pt; margin-top: 8pt; border-bottom: 1px solid #999;}
    .ucc-sources {padding-top: 6pt; font-size: 8pt;}
    .ucc-sources h3 {font-size: 9pt;}
    .ucc-sources a {color: #111; font-weight: 400;}
    .ucc-sources a::after {content: " (" attr(href) ")"; word-break: break-all;}
}
.guide-template {margin: 4px 0 16px; padding: 16px 18px; border: 1px dashed #b7a6cf; border-radius: 12px; background: #fff; font-size: 15px;}
.guide-template p {margin: 0 0 6px !important; color: var(--mk-ink) !important;}
.guide-template p:first-child {font-weight: 700;}
.guide-template p:last-child {margin-bottom: 0 !important;}
@media screen {html[data-theme="dark"] .guide-template {background: var(--card); border-color: #6c5a85;}}

[data-cost-calculator] [hidden] { display: none !important; }
[data-cost-calculator] input[aria-invalid="true"] { border-color: var(--danger, #ac3333); }
