/* DGN EV - site styles (based on the approved theme) */
:root {
  --bg: #f5f7fa; --surface: #fff; --ink: #17212b; --muted: #647181;
  --line: #e5eaf0; --green: #19a875; --green-dark: #087d58;
  --navy: #102333; --soft: #eaf7f1;
  --wrap: min(1120px, calc(100% - 40px));
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--navy); color: #d8e4ec; font-size: 13px; }
.topbar-inner, .nav-inner, .container, .footer-inner, .footer-bottom { width: var(--wrap); margin: auto; }
.topbar-inner { display: flex; justify-content: space-between; padding: 8px 0; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.nav-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-size: 26px; font-weight: 850; letter-spacing: -1.2px; color: var(--navy); white-space: nowrap; }
.brand span { color: var(--green); }
.main-nav { display: flex; gap: 20px; color: #405060; font-size: 14px; font-weight: 650; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a { padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--green-dark); }
.main-nav a.active { color: var(--green-dark); border-bottom-color: var(--green); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 40px; cursor: pointer; align-items: center; justify-content: center; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: var(--navy); border-radius: 2px; position: relative; transition: .2s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }
.menu-open .bars { background: transparent; }
.menu-open .bars::before { top: 0; transform: rotate(45deg); }
.menu-open .bars::after { top: 0; transform: rotate(-45deg); }
.preview-bar { background: #fdf5e6; color: #8a5a10; border-bottom: 1px solid #f3e0b8; text-align: center; font-size: 14px; font-weight: 700; padding: 10px 16px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(115deg, #102333 0%, #173b42 65%, #17684f 100%); color: #fff; padding: 66px 0 62px; }
.hero-content { max-width: 720px; }
.eyebrow { color: #8ee0bd; text-transform: uppercase; letter-spacing: 2px; font-size: 12px; font-weight: 800; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.08; letter-spacing: -2px; margin: 14px 0 18px; }
.hero p { color: #d3e1e4; font-size: 17px; max-width: 620px; margin: 0 0 26px; }
.hero-link { display: inline-block; background: var(--green); color: #062a1d; padding: 12px 19px; border-radius: 7px; font-weight: 800; }
.hero-link:hover { background: #63d7a7; }

.page-hero { background: linear-gradient(115deg, #102333 0%, #173b42 70%, #17684f 100%); color: #fff; padding: 34px 0 38px; }
.page-hero h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -1.4px; margin: 8px 0 10px; }
.page-hero p { color: #d3e1e4; max-width: 700px; margin: 0; font-size: 16px; }
.page-hero .crumbs, .page-hero .crumbs a { color: #a9c3cc; }
.h1-icon { font-size: .8em; }

/* ---------- Layout ---------- */
.page { padding: 42px 0 64px; }
.block { margin-bottom: 38px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
h2 { margin: 0; font-size: 25px; letter-spacing: -.6px; line-height: 1.25; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; margin-bottom: 38px; }
.narrow { max-width: 760px; margin: 0 auto; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 7px; flex-wrap: wrap; }
.crumbs a:hover { text-decoration: underline; }
.empty { background: var(--surface); border: 1px dashed #cfd8e1; border-radius: 12px; padding: 34px 24px; text-align: center; color: var(--muted); }

/* ---------- Cards ---------- */
.articles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.articles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.articles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card, .side-card, .feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card { display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.card:hover, .feature-card:hover { border-color: #cfdbe5; box-shadow: 0 6px 22px rgba(16, 35, 51, .06); }
.card-media { display: block; aspect-ratio: 16 / 9; background: #eef2f5; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.visual { height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #d9f1e7, #edf4f6); color: #17684f; font-size: 44px; }
.visual.blue { background: linear-gradient(135deg, #dceaf7, #eef2f8); }
.visual.gold { background: linear-gradient(135deg, #f8edcf, #fbf6e9); }
.visual.dark { background: linear-gradient(135deg, #d9e1e8, #eef1f4); }
.card-body { padding: 18px; }
.tag { display: inline-block; color: var(--green-dark); background: var(--soft); padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.card h3, .feature-card h3 { font-size: 18px; line-height: 1.3; margin: 11px 0 8px; }
.card h3 a:hover, .feature-card h3 a:hover { color: var(--green-dark); }
.card p { color: var(--muted); font-size: 13.5px; margin: 0 0 13px; }
.meta { color: #84909c; font-size: 12px; }

.featured { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 18px; }
.feature-card.lead { grid-row: span 2; }
.feature-card.lead h3 { font-size: 24px; letter-spacing: -.5px; }
.feature-card p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.featured .feature-card:not(.lead) { display: grid; grid-template-columns: 42% 1fr; }
.featured .feature-card:not(.lead) .card-media { aspect-ratio: auto; height: 100%; min-height: 130px; }
.featured .feature-card:not(.lead) .card-body { padding: 14px 16px; }
.featured .feature-card:not(.lead) h3 { font-size: 16px; }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 18px; }
.side-card { padding: 20px; margin-bottom: 18px; }
.side-card h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.2px; }
.topic-list { list-style: none; padding: 0; margin: 0; }
.topic-list li { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; display: flex; justify-content: space-between; gap: 12px; }
.topic-list li:first-child { border-top: 0; }
.topic-list a:hover { color: var(--green-dark); }
.topic-list span { color: #8995a0; }
.popular-list { margin: 0; padding: 0; list-style: none; counter-reset: pop; }
.popular-list li { counter-increment: pop; display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; line-height: 1.4; }
.popular-list li:first-child { border-top: 0; }
.popular-list li::before { content: counter(pop); color: var(--green); font-weight: 850; min-width: 14px; }
.popular-list a:hover { color: var(--green-dark); }
.brand-box { background: var(--navy); color: #fff; border-color: var(--navy); }
.brand-box p { color: #c5d2da; font-size: 13px; margin: 0; }
.brand-box .tag { background: #214a40; color: #9ce4c2; margin-bottom: 10px; }

.feature { background: var(--soft); border: 1px solid #d5eee2; border-radius: 12px; padding: 22px; margin-top: 24px; }
.feature h3 { margin: 0 0 6px; }
.feature p { margin: 0; color: #52675e; font-size: 14px; }
.feature-link { display: inline-block; margin-top: 12px; color: var(--green-dark); font-weight: 800; font-size: 14px; }

/* ---------- Topics grid ---------- */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.topic { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; transition: border-color .15s, transform .15s; }
.topic:hover { border-color: var(--green); transform: translateY(-1px); }
.topic-icon { flex: 0 0 46px; height: 46px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.topic-text { flex: 1; min-width: 0; }
.topic-text b { display: block; font-size: 15px; }
.topic-text small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.topic-count { color: #8995a0; font-size: 13px; font-weight: 700; }

/* ---------- Article ---------- */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 30px 38px 38px; min-width: 0; }
.post .crumbs { margin-bottom: 16px; }
.post h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; letter-spacing: -1.3px; margin: 12px 0 12px; }
.lede { font-size: 18px; color: #3f4d5a; margin: 0 0 14px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 13.5px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.post-meta a { color: var(--green-dark); font-weight: 600; }
.post-image { margin: 0 0 26px; border-radius: 10px; overflow: hidden; background: #eef2f5; aspect-ratio: 16 / 9; }
.post-image img { width: 100%; height: 100%; object-fit: cover; }
.toc { background: #f7f9fb; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; padding: 16px 20px; margin: 0 0 26px; font-size: 15px; }
.toc b { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--green-dark); }
.toc a:hover { text-decoration: underline; }

.prose { font-size: 17px; line-height: 1.75; color: #1f2b36; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 27px; letter-spacing: -.6px; margin: 40px 0 14px; scroll-margin-top: 20px; }
.prose h3 { font-size: 21px; letter-spacing: -.3px; margin: 30px 0 10px; }
.prose h4 { font-size: 18px; margin: 24px 0 8px; }
.prose p { margin: 0 0 18px; }
.prose a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--green); }
.prose blockquote { margin: 24px 0; padding: 14px 20px; border-left: 4px solid var(--green); background: var(--soft); border-radius: 0 8px 8px 0; color: #2b4a3e; }
.prose blockquote p:last-child { margin: 0; }
.prose img { border-radius: 8px; margin: 10px auto; }
.prose figure { margin: 26px 0; }
.prose figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose code { background: #f0f3f6; padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.prose pre { background: #0f1e2a; color: #e3edf2; padding: 16px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; margin: 10px 0 22px; }
.table-scroll { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: #f3f6f9; font-weight: 750; }
.prose tr:last-child td { border-bottom: 0; }
.post-note { margin-top: 30px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; font-size: 13.5px; color: var(--muted); }
.post-note a { color: var(--green-dark); text-decoration: underline; }
.related { margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--line); }
.related h2 { margin-bottom: 18px; font-size: 22px; }
.related .card h3 { font-size: 16px; }
.related .card p { display: none; }

/* ---------- Ads ---------- */
.ad { margin: 26px 0; text-align: center; min-height: 100px; }
.ad-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #9aa5b0; margin-bottom: 4px; }
.sidebar .ad { margin: 0 0 18px; }

/* ---------- Pager / 404 ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; font-size: 14px; color: var(--muted); }
.pager a { background: var(--surface); border: 1px solid var(--line); padding: 9px 15px; border-radius: 7px; font-weight: 700; color: var(--ink); }
.pager a:hover { border-color: var(--green); }
.notfound { text-align: center; padding: 30px 0 50px; }
.notfound .big { font-size: 90px; font-weight: 850; letter-spacing: -4px; color: var(--green); line-height: 1; }
.notfound h1 { margin: 10px 0; }
.notfound p { color: var(--muted); margin-bottom: 24px; }
.page .narrow.prose { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px 38px; }
.page .notfound { background: none; border: 0; }

/* ---------- Footer ---------- */
.site-footer { background: #0c1b27; color: #b8c6cf; font-size: 14px; padding-top: 42px; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-brand .brand { color: #fff; }
.footer-brand p { max-width: 360px; margin: 10px 0 0; font-size: 13.5px; }
.site-footer h2 { color: #fff; font-size: 14px; letter-spacing: .3px; text-transform: uppercase; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 7px 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1d2f3d; padding: 18px 0 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #8094a1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(16, 35, 51, .08); flex-direction: column; gap: 0; padding: 8px 20px 14px; }
  .menu-open .main-nav { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a.active { border-bottom-color: var(--line); }
  .nav-inner { min-height: 64px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .articles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { grid-template-columns: 1fr; }
  .feature-card.lead { grid-row: auto; }
}
@media (max-width: 700px) {
  .articles.three { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .post { padding: 22px 18px 26px; border-radius: 10px; }
  .page .narrow.prose { padding: 22px 18px; }
  .prose { font-size: 16.5px; }
  .prose h2 { font-size: 23px; }
}
@media (max-width: 560px) {
  :root { --wrap: calc(100% - 32px); }
  .topbar-inner { font-size: 11px; }
  .hide-sm { display: none; }
  .hero { padding: 44px 0; }
  .articles, .articles.four { grid-template-columns: 1fr; }
  .page { padding: 28px 0 44px; }
  .featured .feature-card:not(.lead) { grid-template-columns: 38% 1fr; }
  .section-heading { margin-bottom: 14px; }
  h2 { font-size: 22px; }
}

/* Logo icon next to the brand name */
.brand { display: inline-flex; align-items: center; }
.brand-icon { width: .95em; height: .95em; margin-left: .22em; flex: 0 0 auto; position: relative; top: -.02em; }
.bi-bg { fill: var(--navy); }
.bi-bolt { fill: var(--green); }
.site-footer .bi-bg { fill: #1b3446; }

/* Contact form */
.contact-box { margin: 10px 0 26px; }
.contact-form { background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 5px; color: var(--ink); }
.form-field .opt { font-weight: 400; color: var(--muted); }
.form-field input, .form-field textarea { width: 100%; padding: 11px 13px; border: 1px solid #cfd8e1; border-radius: 8px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.form-field textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
.form-field input:focus, .form-field textarea:focus { outline: 2px solid #9ce4c2; border-color: var(--green); }
.form-field.has-error input, .form-field.has-error textarea { border-color: #d64545; }
.form-field small { display: block; color: #b33a3a; font-size: 13px; margin-top: 4px; }
.form-note { font-size: 13px !important; color: var(--muted); margin: 0 0 14px !important; line-height: 1.5; }
.form-submit { border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 15px; }
.form-error { background: #fdeeee; color: #a33232; border: 1px solid #f5d0d0; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: 15px; }
.form-success { background: var(--soft); border: 1px solid #cdebdc; border-radius: 12px; padding: 20px 22px; color: #2b4a3e; }
.form-success b { display: block; color: var(--green-dark); font-size: 18px; margin-bottom: 4px; }
.form-success span { font-size: 15px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; gap: 0; } .contact-form { padding: 16px; } }

/* Comments */
.comments { margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--line); }
.comments h2 { font-size: 22px; margin-bottom: 18px; }
.comment-list { margin-bottom: 26px; }
.comment { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; padding-top: 0; }
.comment.reply { margin-left: 54px; border-top: 0; padding-top: 4px; }
.avatar { flex: 0 0 40px; height: 40px; border-radius: 50%; background: #e3ebf2; color: #3c5163; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.by-admin .avatar { background: var(--navy); color: var(--green); font-size: 18px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 14.5px; }
.comment-head time { color: #8995a0; font-size: 13px; }
.team-badge { background: var(--soft); color: var(--green-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 4px; }
.comment-body { font-size: 15.5px; line-height: 1.65; color: #26323d; overflow-wrap: anywhere; }
.by-admin .comment-main { background: #f4fbf8; border: 1px solid #d5eee2; border-radius: 10px; padding: 10px 14px; }
.comment-form-wrap h3 { font-size: 19px; margin: 0 0 6px; }
.comment-rules { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
@media (max-width: 560px) { .comment.reply { margin-left: 26px; } }

/* Featured block adapts to how many featured articles there are */
.featured.featured-one { grid-template-columns: 1fr; }
.featured.featured-one .feature-card.lead { display: grid; grid-template-columns: 1.15fr 1fr; grid-row: auto; }
.featured.featured-one .feature-card.lead .card-media { aspect-ratio: auto; height: 100%; min-height: 300px; }
.featured.featured-one .feature-card.lead .card-body { padding: 30px 32px; display: flex; flex-direction: column; justify-content: center; }
.featured.featured-one .feature-card.lead h3 { font-size: 28px; }
.featured.featured-one .feature-card.lead p { font-size: 15px; }
.featured.featured-two { grid-template-columns: 1fr 1fr; }
.featured.featured-two .feature-card.lead { grid-row: auto; }
.featured.featured-two .feature-card:not(.lead) { display: block; }
.featured.featured-two .feature-card:not(.lead) .card-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
.featured.featured-two .feature-card .card-body { padding: 18px 20px; }
.featured.featured-two .feature-card h3 { font-size: 21px; }

/* A single card in a list is shown wide (image left, text right) */
.articles.single { grid-template-columns: 1fr; }
.articles.single .card { display: grid; grid-template-columns: 1fr 1fr; }
.articles.single .card .card-media { aspect-ratio: auto; height: 100%; min-height: 220px; }
.articles.single .card .card-body { display: flex; flex-direction: column; justify-content: center; padding: 22px 24px; }
.articles.single .card h3 { font-size: 21px; }

@media (max-width: 760px) {
  .featured.featured-one .feature-card.lead, .articles.single .card { grid-template-columns: 1fr; }
  .featured.featured-one .feature-card.lead .card-media, .articles.single .card .card-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .featured.featured-one .feature-card.lead .card-body { padding: 18px; }
  .featured.featured-one .feature-card.lead h3 { font-size: 22px; }
  .featured.featured-two { grid-template-columns: 1fr; }
}

/* ---------- Calculators ---------- */
.main-nav a.nav-calc { color: var(--green-dark); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.calc-tile { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.calc-tile:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,35,51,.07); }
.calc-tile-icon { width: 50px; height: 50px; border-radius: 12px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 6px; }
.calc-tile b { font-size: 18px; line-height: 1.3; }
.calc-tile span { color: var(--muted); font-size: 14px; }
.calc-tile .calc-tile-go { color: var(--green-dark); font-weight: 800; margin-top: auto; padding-top: 8px; }
.calc-note { margin-top: 18px; }
.calc-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.calc-strip a { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 14px; display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14.5px; line-height: 1.3; transition: border-color .15s, transform .15s; }
.calc-strip a:hover { border-color: var(--green); transform: translateY(-1px); }
.calc-strip a span { font-size: 22px; }
.calc-strip a small { color: var(--muted); font-weight: 400; font-size: 12.5px; }

.calc-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 30px; box-shadow: 0 6px 24px rgba(16,35,51,.05); }
.calc-settings { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: #eef2f5; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 7px; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.cur-pick { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.cur-pick select { padding: 8px 10px; border: 1px solid #cfd8e1; border-radius: 8px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
.calc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.calc-form .f { margin-bottom: 14px; }
.calc-form .f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc-form label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.calc-form .opt { font-weight: 400; color: var(--muted); }
.calc-form .in { display: flex; align-items: center; border: 1px solid #cfd8e1; border-radius: 9px; background: #fff; overflow: hidden; }
.calc-form .in:focus-within { outline: 2px solid #9ce4c2; border-color: var(--green); }
.calc-form .in input { flex: 1; min-width: 0; border: 0; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--ink); background: transparent; outline: none; }
.calc-form .in .unit, .calc-form .in .pre { color: var(--muted); font-size: 13.5px; padding: 0 12px; white-space: nowrap; }
.calc-form .in .pre { padding-right: 0; font-weight: 700; color: var(--ink); }
.calc-form select { width: 100%; padding: 11px 12px; border: 1px solid #cfd8e1; border-radius: 9px; font: inherit; font-size: 15px; background: #fff; color: var(--ink); }
.calc-form small, .hint-line { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.45; }
.calc-form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 2px; margin: 0 0 14px; }
.calc-form legend { font-weight: 800; font-size: 14px; padding: 0 6px; }
.calc-form .adv { margin: 4px 0 8px; }
.calc-form .adv summary { cursor: pointer; font-weight: 700; color: var(--green-dark); font-size: 14px; margin-bottom: 10px; }
.check-line { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; }
.check-line input { width: 18px; height: 18px; }
.calc-results { background: linear-gradient(160deg, #102333, #173b42); color: #fff; border-radius: 14px; padding: 22px; position: sticky; top: 18px; }
.calc-results .r { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.calc-results .r span { display: block; color: #a9c3cc; font-size: 13px; font-weight: 600; }
.calc-results .r b { display: block; font-size: 22px; letter-spacing: -.4px; margin-top: 2px; }
.calc-results .r small { display: block; color: #c5d6dc; font-size: 13px; margin-top: 2px; }
.calc-results .r.big { background: rgba(25,168,117,.18); border-color: rgba(142,224,189,.35); padding: 16px 18px; }
.calc-results .r.big b { font-size: 36px; color: #8ee0bd; letter-spacing: -1px; }
.calc-results .r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc-results .r-grid .r { margin-bottom: 0; }
.calc-results .r-grid + * { margin-top: 10px; }
.calc-results .r-note { color: #c5d6dc; font-size: 13.5px; margin: 12px 0 0; line-height: 1.5; }
.calc-results .r-warn { color: #ffd2a8; font-weight: 700; margin: 0; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.bar-row span { color: #a9c3cc; }
.bar-row b { font-size: 13.5px; white-space: nowrap; }
.bar-track { height: 10px; background: rgba(255,255,255,.1); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: #19a875; border-radius: 6px; transition: width .25s; }
.bar-fill.gas { background: #c9861a; }
.bar-fill.warn { background: #e0a83a; }
.calc-info .post h2 { font-size: 24px; margin: 0 0 12px; }
.calc-info .faq-title { margin-top: 30px !important; }
@media (max-width: 960px) { .calc-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .calc-body { grid-template-columns: 1fr; }
  .calc-results { position: static; }
}
@media (max-width: 560px) {
  .calc-wrap { padding: 16px; border-radius: 12px; }
  .calc-form .f2, .calc-results .r-grid { grid-template-columns: 1fr; }
  .calc-strip { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 96px 1fr auto; }
}
.calc-body > *, .calc-form .f2 > *, .calc-form fieldset { min-width: 0; }
@media (max-width: 820px) { .calc-body { grid-template-columns: minmax(0, 1fr); } }
/* Switch to the mobile menu before the 8 menu items run out of room */
@media (max-width: 1180px) {
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(16, 35, 51, .08); flex-direction: column; gap: 0; padding: 8px 20px 14px; }
  .menu-open .main-nav { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a.active { border-bottom-color: var(--line); }
  .nav-inner { min-height: 64px; }
}

/* ---------- Car brands (/brands) ---------- */
.mk-logo { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 850; font-size: 20px; letter-spacing: -.5px; color: #17684f; background: linear-gradient(135deg, #d9f1e7, #edf4f6); }
.mk-logo.blue { color: #24527a; background: linear-gradient(135deg, #dceaf7, #eef2f8); }
.mk-logo.gold { color: #8a5a10; background: linear-gradient(135deg, #f8edcf, #fbf6e9); }
.mk-logo.dark { color: #2c3e4f; background: linear-gradient(135deg, #d9e1e8, #eef1f4); }
.mk-hero { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.mk-hero .mk-logo { width: 72px; height: 72px; font-size: 26px; border-radius: 18px; }
.mk-hero h1 { margin: 0 0 8px; }
.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mk-tile { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; transition: border-color .15s, transform .15s; min-width: 0; }
.mk-tile:hover { border-color: var(--green); transform: translateY(-1px); }
.mk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mk-text b { font-size: 17px; }
.mk-text small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.mk-count { flex: 0 0 auto; align-self: flex-start; background: var(--soft); color: var(--green-dark); font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 20px; white-space: nowrap; }
.mk-note { margin-top: 18px; }
.mk-intro { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; margin-bottom: 28px; }
.mk-intro > :first-child { margin-top: 0; }
.mk-intro > :last-child { margin-bottom: 0; }
.mk-list-title { font-size: 21px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.mk-list-title span { background: var(--soft); color: var(--green-dark); font-size: 13px; padding: 3px 9px; border-radius: 20px; letter-spacing: 0; }
.mk-more { margin-top: 34px; }
.mk-more h2 { font-size: 19px; margin-bottom: 12px; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mk-chips a { background: var(--surface); border: 1px solid #d5dee6; border-radius: 20px; padding: 6px 13px; font-size: 14px; font-weight: 700; color: var(--ink); transition: border-color .15s, color .15s; }
.mk-chips a:hover { border-color: var(--green); color: var(--green-dark); }
.mk-chips a span { color: #8995a0; font-weight: 600; margin-left: 3px; }
.mk-chips a.mk-all { border-color: transparent; background: none; color: var(--green-dark); padding-left: 4px; }
.mk-chips.small-chips a { font-size: 13px; padding: 5px 11px; }
.mk-chips.big-chips a { font-size: 15px; padding: 9px 16px; }
.post-brands { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.post-brands > span { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.side-more { display: inline-block; margin-top: 12px; font-size: 13.5px; font-weight: 800; color: var(--green-dark); }
@media (max-width: 700px) {
  .mk-grid { grid-template-columns: minmax(0, 1fr); }
  .mk-intro { padding: 18px; }
  .mk-hero .mk-logo { width: 56px; height: 56px; font-size: 21px; border-radius: 14px; }
}
/* 11 menu items (9 topics + Brands + Calculators) fit on one line (v17) */
@media (min-width: 1181px) {
  .main-nav { gap: 12px; font-size: 13px; flex-wrap: nowrap; }
  .main-nav a { white-space: nowrap; }
  .nav-inner { gap: 18px; }
}

/* v16: sources, calculator links, all-guides page */
.post-meta .meta-soft { font-weight: 500; text-decoration: underline; text-decoration-color: #b9c6d1; text-underline-offset: 2px; }
.post-meta .upd { font-weight: 700; color: var(--ink); }
.post-sources { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.post-sources h2 { font-size: 18px; margin: 0 0 10px; }
.post-sources ol { margin: 0; padding-left: 22px; font-size: 14.5px; }
.post-sources li { margin: 5px 0; overflow-wrap: anywhere; }
.post-sources a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 2px; }
.post-sources span { color: var(--muted); font-size: 13px; }
.post-tools { margin-top: 30px; }
.post-tools h2 { font-size: 18px; margin: 0 0 12px; }
.post-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.post-tools-grid a { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.post-tools-grid a:hover { border-color: var(--green); transform: translateY(-1px); }
.post-tools-grid span { grid-row: span 2; font-size: 24px; line-height: 1.2; }
.post-tools-grid b { font-size: 15px; line-height: 1.3; }
.post-tools-grid small { color: var(--muted); font-size: 13px; line-height: 1.45; }
@media (max-width: 560px) { .post-tools-grid { grid-template-columns: 1fr; } }
.guides-index { columns: 2; column-gap: 34px; }
.guides-index section { break-inside: avoid; margin-bottom: 26px; }
.guides-index h2 { font-size: 19px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.guides-index h2 a:hover { color: var(--green-dark); }
.guides-index h2 small { color: var(--muted); font-weight: 600; font-size: 13px; }
.guides-index ul { margin: 0; padding-left: 18px; }
.guides-index li { margin: 6px 0; line-height: 1.45; }
.guides-index li a { color: var(--ink); }
.guides-index li a:hover { color: var(--green-dark); text-decoration: underline; }
.guides-index li time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 760px) { .guides-index { columns: 1; } }

/* v17: EV News box on the home page */
.news-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.news-list li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.news-list li:last-child { border-bottom: 0; }
.news-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #eef2f5; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-thumb span { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 28px; }
.news-list time { color: var(--green-dark); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.news-list h3 { font-size: 17px; line-height: 1.3; margin: 3px 0 4px; }
.news-list h3 a:hover { color: var(--green-dark); }
.news-list p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 560px) { .news-list li { grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; } .news-list h3 { font-size: 15.5px; } .news-list p { display: none; } }

/* v22: calculator hub groups */
.calc-group { font-size: 20px; margin: 30px 0 12px; }
.calc-group:first-of-type { margin-top: 0; }
