/* CivilEngineer.ai: blueprint navy + safety orange on concrete. */
:root {
    --navy: #0d2238;
    --navy-2: #163453;
    --blue: #1f5c99;
    --accent: #f26b1d;
    --accent-d: #d4560c;
    --ink: #15212c;
    --muted: #5a6875;
    --line: #dde2e6;
    --bg: #ffffff;
    --bg-alt: #f3f5f2;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(13, 34, 56, .10);
}
html { scroll-behavior: smooth; }
body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink); background: var(--bg); font-size: 16.5px; line-height: 1.6;
    display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1 0 auto; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
.skip-link { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { width: auto; height: auto; clip: auto; overflow: visible; left: 12px; top: 12px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }

/* nav */
.site-nav { background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: .55rem 0; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.02em; color: var(--navy) !important; font-size: 1.15rem; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: url(../favicon.svg) center / cover no-repeat; }
.site-nav .nav-link { color: var(--ink); font-weight: 550; padding: .5rem .8rem !important; border-radius: 8px; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--navy); background: var(--bg-alt); }
.navbar-toggler { border: 0; }
.btn-accent { background: var(--accent); border: 0; color: #fff; font-weight: 700; border-radius: 10px; padding: .55rem 1.05rem; }
.btn-accent:hover, .btn-accent:focus { background: var(--accent-d); color: #fff; }
.btn-lg.btn-accent { padding: .8rem 1.4rem; }

/* hero */
.hero { position: relative; color: #fff; padding: 64px 0 72px;
    background:
      linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 28px 28px,
      linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 28px 28px,
      radial-gradient(1200px 500px at 15% 0%, #1d4877 0%, transparent 60%),
      var(--navy); }
.hero-copy { text-align: center; }
@media (min-width: 992px) { .hero-copy { text-align: left; } }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .6rem; }
.hero .kicker { color: #ffb37f; }
.hero-h { font-size: clamp(34px, 5.6vw, 62px); font-weight: 840; letter-spacing: -.038em; line-height: 1.04; margin: 0 auto 1rem; max-width: 900px; text-wrap: balance; }
.hero-sub { font-size: 1.15rem; color: #d3deea; max-width: 640px; margin: 0 auto 1.4rem; }
@media (min-width: 992px) { .hero-sub { margin-left: 0; } }
.hero-points { list-style: none; padding: 0; margin: 0; display: inline-flex; flex-direction: column; gap: .45rem; text-align: left; }
.hero-points li { padding-left: 1.6rem; position: relative; color: #e8eef5; }
.hero-points li::before { content: ""; position: absolute; left: 0; top: .45em; width: .95rem; height: .55rem; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }

/* quote card + form */
.card-quote { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-quote-h { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .8rem; }
.quote-form .form-label { font-size: .82rem; font-weight: 650; color: var(--muted); margin-bottom: .2rem; }
.form-control, .form-select { border-radius: 9px; border-color: #cfd6dc; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .2rem rgba(31,92,153,.15); }
.consent { font-size: .86rem; color: var(--muted); display: flex; gap: .45rem; align-items: flex-start; }
.consent input { margin-top: .3rem; }
.form-fine { font-size: .8rem; color: var(--muted); margin: .6rem 0 0; text-align: center; }
.form-error { background: #fff1ea; border: 1px solid #f7c3a6; color: #8a3109; padding: .6rem .8rem; border-radius: 9px; margin-bottom: .8rem; font-size: .92rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sticky-aside { position: sticky; top: 84px; }
.notice { background: #eaf6ee; border: 1px solid #b9e1c6; padding: 1rem; border-radius: 10px; text-align: center; }

/* sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.h-section { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.025em; margin-bottom: .9rem; }
.h-sub { font-size: 1.02rem; font-weight: 700; margin: 1.1rem 0 .5rem; color: var(--navy-2); }
.link-more { font-weight: 650; text-decoration: none; color: var(--accent-d); }
.link-more:hover { color: var(--navy); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.cat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.2rem; background: #fff; }
.cat-h { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin-bottom: .55rem; }
.cat-card ul { list-style: none; padding: 0; margin: 0 0 .4rem; }
.cat-card li { padding: .22rem 0; border-bottom: 1px dashed #e6eaed; }
.cat-card li:last-child { border-bottom: 0; }
.cat-card a { text-decoration: none; color: var(--ink); }
.cat-card a:hover { color: var(--accent-d); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1.4rem; }
.step { background: #fff; border-radius: var(--radius); padding: 1.4rem; border: 1px solid var(--line); text-align: center; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; margin-bottom: .7rem; }
.step h3 { font-size: 1.08rem; font-weight: 750; }
.step p { color: var(--muted); margin: 0; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.tile-grid-2 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: #fff; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.tile-h { font-weight: 750; color: var(--navy); }
.tile-p { font-size: .9rem; color: var(--muted); }

.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .45rem; }
.state-grid a { padding: .45rem .7rem; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .93rem; }
.state-grid a:hover { border-color: var(--accent); color: var(--navy); }
.state-grid-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.state-grid-lg a { display: flex; justify-content: space-between; padding: .8rem 1rem; }
.state-grid-lg span { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: .85rem; }

/* inner pages */
.page { padding: 28px 16px 64px; }
.page-narrow { max-width: 760px; }
.page-head { margin-bottom: 1.6rem; }
.page-h { font-size: clamp(30px, 4.4vw, 46px); font-weight: 840; letter-spacing: -.035em; line-height: 1.1; text-wrap: balance; }
.lede { font-size: 1.15rem; color: #384856; }
.byline { color: var(--muted); font-size: .88rem; }
.crumbs ol { list-style: none; padding: 0; margin: 0 0 1.1rem; display: flex; flex-wrap: wrap; gap: .35rem; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .35rem; color: #b5bec6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy); }
.block { margin: 2.2rem 0; }
.prose p { margin-bottom: 1rem; }
.prose h2 { font-size: 1.35rem; font-weight: 800; margin-top: 1.8rem; }
.muted { color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .7rem; margin: 1.2rem 0 .4rem; }
.fact { background: var(--bg-alt); border-radius: 12px; padding: .85rem 1rem; border-left: 4px solid var(--accent); }
.fact-k { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.fact-v { display: block; font-size: 1.2rem; font-weight: 800; color: var(--navy); }
.fact-v-sm { font-size: .98rem; font-weight: 650; }
.fact-s { font-size: .82rem; color: var(--muted); }

.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding: .35rem 0 .35rem 1.8rem; border-bottom: 1px solid #eef1f3; }
.checks li::before { content: ""; position: absolute; left: .2rem; top: .78rem; width: .8rem; height: .45rem; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.checks-warn li::before { border-color: #c79100; }

.faq details { border: 1px solid var(--line); border-radius: 10px; padding: .2rem 1rem; margin-bottom: .55rem; background: #fff; }
.faq summary { cursor: pointer; font-weight: 700; padding: .65rem 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent-d); font-weight: 800; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: #33424f; }

.svc-list { display: grid; gap: .5rem; }
.svc-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) 2fr auto; gap: 1rem; align-items: center; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; color: var(--ink); background: #fff; }
.svc-row:hover { border-color: var(--accent); color: var(--ink); }
.svc-name { font-weight: 750; color: var(--navy); }
.svc-short { color: var(--muted); font-size: .92rem; }
.svc-cost { font-family: "JetBrains Mono", monospace; font-size: .85rem; color: var(--accent-d); white-space: nowrap; }
@media (max-width: 767px) { .svc-row { grid-template-columns: 1fr; gap: .2rem; } }

.aside-list { margin-top: 1.4rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); }
.aside-h { font-size: 1rem; font-weight: 800; }
.aside-list ul { padding-left: 1.1rem; margin: 0; }
.aside-list li { padding: .2rem 0; }

.sources { margin-top: 2rem; font-size: .85rem; color: var(--muted); }
.sources h2 { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sources ul { padding-left: 1.1rem; columns: 2; }
@media (max-width: 575px) { .sources ul { columns: 1; } }

.cta-band { margin: 3rem 0 0; padding: 1.8rem; border-radius: var(--radius); background: var(--navy); color: #fff; display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; }
.cta-band h2 { font-size: 1.45rem; font-weight: 800; margin: 0 0 .3rem; }
.cta-band p { margin: 0; color: #c9d6e3; }

/* calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; background: var(--bg-alt); border-radius: var(--radius); padding: 1.3rem; border: 1px solid var(--line); }
@media (max-width: 767px) { .calc { grid-template-columns: 1fr; } }
.calc-in { display: grid; gap: .7rem; }
.calc-field { display: grid; gap: .2rem; }
.calc-label { font-size: .86rem; font-weight: 650; color: #3a4955; }
.calc-label em { font-style: normal; color: var(--muted); font-weight: 500; }
.calc-out { display: grid; gap: .6rem; align-content: start; }
.calc-result { background: #fff; border-radius: 11px; padding: .8rem 1rem; border-left: 4px solid var(--accent); }
.calc-rk { display: block; font-size: .8rem; color: var(--muted); font-weight: 650; }
.calc-rv { font-size: 1.05rem; color: var(--muted); }
.calc-rv b { font-size: 1.55rem; color: var(--navy); font-family: "JetBrains Mono", monospace; }

/* footer */
.site-footer { background: #0a1a2b; color: #b9c6d3; padding: 52px 0 28px; margin-top: 0; }
.site-footer a { display: block; color: #d6e0ea; text-decoration: none; padding: .18rem 0; font-size: .94rem; }
.site-footer a:hover { color: #fff; }
.site-footer .btn-accent { display: inline-block; color: #fff; }
.brand-footer { color: #fff !important; margin-bottom: .6rem; }
.footer-tag { font-size: .94rem; max-width: 340px; }
.footer-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #8ea2b6; font-weight: 700; margin-bottom: .6rem; }
.footer-note { font-size: .8rem; color: #8ea2b6; margin-top: .8rem; }
.footer-bottom { border-top: 1px solid #1b3048; margin-top: 2rem; padding-top: 1rem; font-size: .84rem; color: #8ea2b6; }
@media (max-width: 991px) { .site-nav .navbar-nav { padding: .5rem 0; } .hero { padding: 40px 0 48px; } }
.note-box { background: var(--bg-alt); border-radius: 10px; padding: .8rem 1rem; font-size: .95rem; color: #33424f; }
.az { display: flex; flex-wrap: wrap; gap: .35rem; position: sticky; top: 62px; background: #fff; padding: .6rem 0; z-index: 5; border-bottom: 1px solid var(--line); }
.az a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--bg-alt); text-decoration: none; font-weight: 700; color: var(--navy); }
.az a:hover { background: var(--accent); color: #fff; }
.az-h { font-size: 2rem; font-weight: 840; color: var(--accent); border-bottom: 2px solid var(--line); }
.gloss dt { font-size: 1.12rem; font-weight: 800; color: var(--navy); margin-top: 1.1rem; scroll-margin-top: 130px; }
.gloss dd { margin: .25rem 0 0; color: #33424f; }
.gloss-rel { display: block; font-size: .86rem; color: var(--muted); margin-top: .3rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ref-table th { background: var(--navy); color: #fff; text-align: left; padding: .65rem .8rem; font-weight: 650; vertical-align: bottom; }
.ref-table th .unit { display: block; font-weight: 400; font-size: .78rem; color: #b9c9da; }
.ref-table td { padding: .55rem .8rem; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ref-table tbody tr:nth-child(even) { background: var(--bg-alt); }

/* Mobile header: brand left, quote CTA + menu pinned top right, ONE line down to 320px.
   The wordmark is shown only when it fits whole (container query on the brand box);
   otherwise the logo mark stands alone. It never truncates and the CTA never wraps.
   Measured with Playwright at 320/360/375/390/430/768/991 in en, es and fr. */
@media (max-width: 991.98px) {
    .site-nav .navbar-collapse { flex-basis: 100%; }
    .site-nav .navbar-brand { flex: 1 1 0; min-width: 0; margin-right: .5rem; container-type: inline-size; font-size: 1.05rem; }
    .site-nav .brand-text { white-space: nowrap; }
    .nav-mobile-actions { flex: 0 0 auto; margin-left: auto; gap: .4rem; }
    .nav-cta-mobile { white-space: nowrap; font-size: .82rem; padding: .42rem .7rem; border-radius: 9px; }
    .site-nav .navbar-toggler { padding: .25rem .35rem; }
    .row.g-5 { --bs-gutter-x: 1.5rem; }
}
@container (max-width: 172px) {
    .site-nav .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Hero video: famous US structures behind the headline + quote form. The poster
   paints first; the shade keeps text above 4.5:1 on the brightest frames. */
.hero { overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; background: var(--navy) url(../media/hero-structures-poster.webp) center / cover no-repeat; }
.hero-video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.03); }
.hero-shade { position: absolute; inset: 0;
    background:
      linear-gradient(100deg, rgba(10,26,43,.72) 0%, rgba(10,26,43,.48) 45%, rgba(10,26,43,.18) 100%); }
@media (max-width: 991.98px) {
    .hero-shade { background:
      linear-gradient(180deg, rgba(10,26,43,.40) 0%, rgba(10,26,43,.52) 55%, rgba(10,26,43,.78) 100%); }
}
.hero-inner { position: relative; }
.hero-h, .hero-sub, .hero-points li, .hero .kicker { text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 2px 22px rgba(0,0,0,.55); }

/* Icons + photos (scan, don't read). */
.ico { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -.22em; color: currentColor; }
.ico-h { width: 1.05em; height: 1.05em; margin-right: .45rem; color: var(--accent); vertical-align: -.12em; }

.quicknav { background: #fff; border-bottom: 1px solid var(--line); }
.quicknav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; padding: 1rem 0; }
.quicknav-grid a { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .85rem .4rem; border-radius: 12px; text-decoration: none; color: var(--navy); font-weight: 650; font-size: .9rem; text-align: center; border: 1px solid transparent; }
.quicknav-grid a:hover { background: var(--bg-alt); border-color: var(--line); color: var(--navy); }
.quicknav-grid .ico { width: 30px; height: 30px; color: var(--accent); }
@media (max-width: 767.98px) {
    .quicknav-grid { grid-template-columns: repeat(3, 1fr); gap: .3rem; padding: .7rem 0; }
    .quicknav-grid a { padding: .6rem .2rem; font-size: .8rem; }
    .quicknav-grid .ico { width: 26px; height: 26px; }
}

.cat-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.cat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-photo { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); }
.cat-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.cat-card:hover .cat-photo img { transform: scale(1.04); }
.cat-badge { position: absolute; left: 14px; top: -24px; width: 44px; height: 44px; border-radius: 12px; background: var(--navy); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(13,34,56,.3); border: 2px solid #fff; }
.cat-badge .ico { width: 24px; height: 24px; color: #fff; }
.cat-body { position: relative; padding: 1.7rem 1.2rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.cat-body .link-more { margin-top: auto; }
.cat-h a { color: var(--navy); text-decoration: none; }

.step { position: relative; }
.step-ico { position: relative; display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--navy); color: #fff; margin-bottom: .8rem; }
.step-ico .ico { width: 30px; height: 30px; }
.step-ico b { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; display: grid; place-items: center; border: 2px solid #fff; }

.tile-ico { position: relative; padding-left: 3.4rem; }
.tile-ico > .ico { position: absolute; left: 1rem; top: 1rem; width: 28px; height: 28px; padding: 5px; box-sizing: content-box; margin: -5px; border-radius: 9px; background: #fff3ea; color: var(--accent-d); }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.6rem; }
.chips a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--navy); font-weight: 600; font-size: .88rem; }
.chips a:hover { border-color: var(--accent); }
.chips .ico { color: var(--accent); width: 18px; height: 18px; }
.chips em { font-style: normal; color: var(--muted); font-weight: 500; font-size: .8rem; }

.svc-cat { scroll-margin-top: 80px; }
.cat-banner { position: relative; height: 150px; border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; background: var(--navy); }
.cat-banner img { width: 100%; height: 100%; object-fit: cover; opacity: .55; display: block; }
.cat-banner h2 { position: absolute; left: 1.2rem; bottom: 1rem; margin: 0; color: #fff; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; display: flex; align-items: center; gap: .6rem; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.cat-banner h2 .ico { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: var(--accent); }
.svc-name { display: flex; align-items: center; gap: .55rem; }
.svc-name .ico { color: var(--accent); width: 20px; height: 20px; }

.kicker-ico { display: inline-flex; align-items: center; gap: .4rem; }
.kicker-ico .ico { width: 18px; height: 18px; }
.svc-photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 6; margin: .4rem 0 1rem; background: var(--bg-alt); }
.svc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767.98px) {
    .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scroll-snap-type: x proximity; }
    .chips::-webkit-scrollbar { display: none; }
    .chips a { flex: 0 0 auto; scroll-snap-align: start; }
    .cat-banner { height: 110px; }
}

/* State flags (Wikimedia Commons, public domain). Height-locked: flags differ in ratio. */
.flag { height: 16px; width: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(13,34,56,.14); vertical-align: -2px; margin-right: .45rem; flex: 0 0 auto; }
.flag-lg { height: 32px; border-radius: 3px; margin-right: .7rem; vertical-align: middle; }
.state-grid a { display: flex; align-items: center; }
.state-grid-lg strong { display: flex; align-items: center; }
.page-h-flag { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem 0; }
@media (max-width: 575.98px) { .flag-lg { height: 24px; } }

/* Right-to-left (Arabic). Bootstrap's RTL build flips the grid/utilities; these
   flip the few physical left/right rules in this stylesheet. */
[dir="rtl"] .hero-copy { text-align: center; }
@media (min-width: 992px) { [dir="rtl"] .hero-copy { text-align: right; } [dir="rtl"] .hero-sub { margin-left: auto; margin-right: 0; } }
[dir="rtl"] .hero-points { text-align: right; }
[dir="rtl"] .hero-points li { padding-left: 0; padding-right: 1.6rem; }
[dir="rtl"] .hero-points li::before { left: auto; right: 0; }
[dir="rtl"] .checks li { padding: .35rem 1.8rem .35rem 0; }
[dir="rtl"] .checks li::before { left: auto; right: .2rem; }
[dir="rtl"] .faq summary::after { float: left; }
[dir="rtl"] .tile-ico { padding-left: 1.1rem; padding-right: 3.4rem; }
[dir="rtl"] .tile-ico > .ico { left: auto; right: 1rem; }
[dir="rtl"] .cat-badge { left: auto; right: 14px; }
[dir="rtl"] .cat-banner h2 { left: auto; right: 1.2rem; }
[dir="rtl"] .fact { border-left: 0; border-right: 4px solid var(--accent); }
[dir="rtl"] .calc-result { border-left: 0; border-right: 4px solid var(--accent); }
[dir="rtl"] .flag { margin-right: 0; margin-left: .45rem; }
[dir="rtl"] .flag-lg { margin-right: 0; margin-left: .7rem; }
[dir="rtl"] .ico-h { margin-right: 0; margin-left: .45rem; }
[dir="rtl"] .navbar-brand { margin-right: 0; margin-left: .5rem; }
[dir="rtl"] .crumbs li + li::before { margin-right: 0; margin-left: .35rem; }
[dir="rtl"] .sources ul, [dir="rtl"] .aside-list ul { padding-left: 0; padding-right: 1.1rem; }
[dir="rtl"] .ref-table th { text-align: right; }
[dir="rtl"] .hero-shade { transform: scaleX(-1); }
[dir="rtl"] .link-more, [dir="rtl"] .gloss-rel { unicode-bidi: plaintext; }
.state-grid { grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); }
.state-grid-flags a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.state-grid-sm a { white-space: normal; line-height: 1.3; }
@media (max-width: 575.98px) { .state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kicker-ico .flag { height: 14px; margin-right: .1rem; vertical-align: 0; }
[dir="rtl"] .kicker-ico .flag { margin-right: 0; margin-left: .1rem; }
.site-footer a.brand-footer { display: inline-flex; padding: 0; font-size: 1.15rem; }
.site-footer a.footer-home { display: inline; color: #8ea2b6; font-size: .84rem; padding: 0; }
.site-footer a.footer-home:hover { color: #fff; }

/* Error pages (Django 400/403/404/500; nginx 502-504 has its own static file). */
.err { padding: 72px 0 96px; background:
    linear-gradient(rgba(13,34,56,.04) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(13,34,56,.04) 1px, transparent 1px) 0 0 / 28px 28px; }
.err-inner { max-width: 720px; text-align: center; }
.err-ico { width: 64px; height: 64px; color: var(--accent); }
.err-code { font-family: "JetBrains Mono", monospace; font-size: 1rem; color: var(--muted); letter-spacing: .2em; margin: .6rem 0 .2rem; }
.err-links { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.6rem; }

/* Per-service icons in grids and lists. */
.svc-grid a { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; }
.svc-grid .ico { width: 30px; height: 30px; flex: 0 0 30px; padding: 5px; border-radius: 8px; background: #fff3ea; color: var(--accent-d); box-sizing: border-box; }
.svc-grid a:hover .ico { background: var(--accent); color: #fff; }
.svc-mini { list-style: none; padding: 0; margin: 0; }
.svc-mini a { display: flex; align-items: center; gap: .5rem; }
.svc-mini .ico { width: 20px; height: 20px; flex: 0 0 20px; color: var(--accent); }
.aside-list .svc-mini { padding-left: 0; }
.aside-list .svc-mini li { padding: .25rem 0; }
.svc-name .ico { width: 26px; height: 26px; padding: 4px; border-radius: 7px; background: #fff3ea; color: var(--accent-d); box-sizing: border-box; flex: 0 0 26px; }
.page-h-ico { display: flex; align-items: center; gap: .9rem; }
.page-h-ico .ico { width: 54px; height: 54px; flex: 0 0 54px; padding: 10px; border-radius: 14px; background: var(--navy); color: #fff; box-sizing: border-box; }
@media (max-width: 575.98px) { .page-h-ico .ico { width: 42px; height: 42px; flex-basis: 42px; padding: 8px; } }
.svc-grid .ico { width: 36px; height: 36px; flex-basis: 36px; padding: 6px; }
.site-footer a.btn-accent { display: inline-block; padding: .55rem 1.1rem; margin-top: .3rem; font-size: .95rem; color: #fff; }
.site-footer a.btn-accent:hover { color: #fff; }
