/* RuleMind showroom shell for the existing tool pages (landlords, tax, money, driving, charges, legal...).
   Only the new header, menus, search and footer, every rule scoped so nothing leaks into the tools themselves.
   bridge.css (loaded after this) remaps the old theme's tokens to the new paper, ink and type. */
@font-face { font-family: "RM Display"; src: url("/assets/fonts/source-serif-4-opsz.woff2") format("woff2-variations"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "RM Display"; src: url("/assets/fonts/source-serif-4-opsz-italic.woff2") format("woff2-variations"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "RM Text"; src: url("/assets/fonts/inter-opsz.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "RM Display Fallback"; src: local("Georgia"); size-adjust: 101.7%; ascent-override: 101.9%; descent-override: 32.9%; line-gap-override: 0%; }
@font-face { font-family: "RM Text Fallback"; src: local("Arial"); size-adjust: 108.2%; ascent-override: 89.5%; descent-override: 22.3%; line-gap-override: 0%; }

:root {
  --s-ink: #17191c; --s-ink-2: #3b3e45; --s-slate: #5d616c; --s-line: #e3e4e7; --s-line-2: #cfd1d6;
  --s-paper: #ffffff; --s-fog: #fafafb; --s-mist: #f2f2f3;
  --s-display: "RM Display", "RM Display Fallback", Georgia, serif;
  --s-text: "RM Text", "RM Text Fallback", Arial, system-ui, sans-serif;
  --s-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --hdr: 68px;
}
:root:has(.pvbar) { --pv: 40px; }

/* the old body has side padding; the shell bleeds to the edges */
.pvbar, .hdr, .ftr { margin-inline: calc(-1 * var(--gut, 0px)); }
:is(.pvbar, .hdr, .ftr, .mnav, .sdlg) { font-family: var(--s-text); letter-spacing: 0; -webkit-font-smoothing: antialiased; }
:is(.pvbar, .hdr, .ftr, .mnav, .sdlg) *, :is(.pvbar, .hdr, .ftr, .mnav, .sdlg) *::before, :is(.pvbar, .hdr, .ftr, .mnav, .sdlg) *::after { box-sizing: border-box; }
:is(.hdr, .ftr, .mnav, .sdlg, .pvbar) .wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
:is(.hdr, .ftr, .mnav, .sdlg) :is(svg, img) { display: block; max-width: 100%; }
:is(.hdr, .ftr, .mnav, .sdlg) a { color: var(--s-ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: currentColor; }
:is(.hdr, .ftr, .mnav, .sdlg) a:hover { color: var(--s-ink); }
:is(.hdr, .ftr, .mnav, .sdlg, .pvbar) :focus-visible { outline: 2px solid var(--s-ink); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--s-ink); color: #fff; padding: 10px 16px; border-radius: 999px; text-decoration: none; font-family: var(--s-text); }
.skip:focus { top: 12px; color: #fff; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pvbar { background: var(--s-ink); color: #fff; font-size: 14px; line-height: 1.4; }
.pvbar .wrap { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 40px; padding-block: 6px; }
.pvbar a { color: #fff !important; font-weight: 500; text-decoration-color: #fff; }

/* header */
.hdr { position: sticky; top: 0; z-index: 80; background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--s-line); }
@supports (backdrop-filter: blur(1px)) { .hdr { backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); } }
.hdr .hdr__in { display: flex; align-items: center; gap: 24px; height: var(--hdr); }
:is(.hdr, .mnav, .ftr) .brand { display: inline-flex; align-items: center; color: var(--s-ink); text-decoration: none; flex: none; font-size: 16px; }
:is(.hdr, .mnav, .ftr) .brand svg { height: 26px; width: auto; margin: 0; }
.hdr .nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.hdr .nav a, .hdr .nav button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 999px; background: none; border: 0; text-decoration: none; font: 450 15.5px/1 var(--s-text); color: var(--s-ink); cursor: pointer; }
.hdr .nav a:hover, .hdr .nav button:hover, .hdr .nav button[aria-expanded="true"], .hdr .nav a[aria-current="page"] { background: var(--s-mist); color: var(--s-ink); }
.hdr .nav a::after { display: none !important; }
:is(.hdr, .mnav) .chev { width: 10px; height: 10px; transition: transform 180ms var(--s-ease); }
:is(.hdr, .mnav) [aria-expanded="true"] > .chev, .mnav details[open] summary .chev { transform: rotate(180deg); }
.hdr .hdr__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
:is(.hdr, .mnav) .searchbtn { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px 0 14px; border-radius: 999px; border: 1px solid var(--s-line-2); background: #fff; color: var(--s-slate); cursor: pointer; font: 400 15px/1 var(--s-text); }
:is(.hdr, .mnav) .searchbtn:hover { border-color: var(--s-ink); color: var(--s-ink); }
:is(.hdr, .mnav) .searchbtn svg { width: 16px; height: 16px; }
.hdr .kbd { font: 500 12px/1 var(--s-text); padding: 4px 6px; border-radius: 6px; background: var(--s-mist); color: var(--s-ink-2); }
.hdr .hdr__link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; text-decoration: none; font: 400 15.5px/1 var(--s-text); color: var(--s-ink); border-radius: 999px; }
.hdr .hdr__link:hover { background: var(--s-mist); }
:is(.hdr, .mnav) .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--s-ink); color: #fff; border: 1px solid var(--s-ink); font: 500 15px/1.1 var(--s-text); text-decoration: none; white-space: nowrap; box-shadow: none; letter-spacing: 0; }
:is(.hdr, .mnav) .btn:hover { background: #2b2e33; border-color: #2b2e33; color: #fff; }
.hdr .menubtn { display: none; }
@media (max-width: 1080px) {
  .hdr .nav, .hdr .hdr__link, .hdr .hdr__cta, .hdr .searchbtn .sb-text, .hdr .searchbtn .kbd { display: none; }
  .hdr .searchbtn { padding: 0; width: 44px; height: 44px; justify-content: center; }
  .hdr .menubtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--s-ink); background: var(--s-ink); color: #fff; font: 500 15.5px/1 var(--s-text); cursor: pointer; position: static; width: auto; height: auto; }
}

/* mega menu */
.hdr .mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--s-line); box-shadow: 0 30px 60px -30px rgba(17, 20, 28, 0.25); }
.hdr .mega[hidden] { display: none; }
.hdr .mega__in { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.25fr); gap: 28px; padding-block: 28px 32px; }
.hdr .mega__col h2 { margin: 0 0 4px; font: 500 16px/1.3 var(--s-text); letter-spacing: 0; color: var(--s-ink); }
.hdr .mega__col h2 a { text-decoration: none; }
.hdr .mega__col > p { margin: 0 0 12px; font-size: 14px; line-height: 1.4; color: var(--s-slate); min-height: 2.8em; }
.hdr .mega__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hdr .mega__col li a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; text-decoration: none; font-size: 15px; line-height: 1.3; border-top: 1px solid var(--s-line); }
.hdr .mega__col li a:hover .mi-name { text-decoration: underline; }
:is(.hdr, .mnav) .mi-price { color: var(--s-slate); white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.hdr .mega__all { display: inline-block; margin-top: 10px; font-size: 15px; font-weight: 500; text-decoration: none; }
.hdr .mega__feat { background: var(--s-mist); border-radius: 24px; padding: 18px; display: grid; gap: 10px; align-content: start; text-decoration: none; }
.hdr .mega__feat img { border-radius: 12px; background: #fff; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; width: 100%; height: auto; box-shadow: 0 0 0 1px rgba(4, 23, 43, 0.06), 0 20px 25px -5px rgba(17, 20, 28, 0.1); }
.hdr .mega__feat b { font-weight: 500; font-size: 16px; }
.hdr .mega__feat span { font-size: 14px; color: var(--s-slate); line-height: 1.45; }
.hdr .mega__foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 18px; border-top: 1px solid var(--s-line); font-size: 15px; }
.hdr .mega__foot a { text-decoration: none; font-weight: 500; }
.hdr .arrow::after { content: "\2192"; display: inline-block; margin-left: 4px; }

/* phone menu + search dialog */
.mnav { border: 0; padding: 0; margin: 0 0 0 auto; width: min(100vw, 440px); max-width: 100vw; height: 100dvh; max-height: 100dvh; background: #fff; color: var(--s-ink); }
.mnav::backdrop, .sdlg::backdrop { background: rgba(17, 20, 28, 0.4); }
.mnav .mnav__top { display: flex; align-items: center; justify-content: space-between; height: var(--hdr); padding-inline: clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--s-line); position: sticky; top: 0; background: #fff; z-index: 1; }
.mnav .mnav__body { padding: 8px clamp(16px, 4vw, 40px) 32px; }
.mnav details { border-bottom: 1px solid var(--s-line); }
.mnav summary { list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 56px; font: 500 17px/1.3 var(--s-text); cursor: pointer; }
.mnav summary::-webkit-details-marker { display: none; }
.mnav ul { list-style: none; margin: 0 0 14px; padding: 0; }
.mnav li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; text-decoration: none; font-size: 16px; }
.mnav .mnav__links { display: grid; margin-top: 12px; }
.mnav .mnav__links a { min-height: 48px; display: flex; align-items: center; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--s-line); }
.mnav > .mnav__body > .btn { width: 100%; margin-top: 20px; min-height: 48px; }
:is(.mnav, .sdlg) .iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--s-line-2); background: #fff; cursor: pointer; color: var(--s-ink); padding: 0; }
:is(.mnav, .sdlg) .iconbtn svg { width: 18px; height: 18px; }
.sdlg { border: 0; padding: 0; width: min(680px, calc(100vw - 24px)); max-height: min(78dvh, 720px); margin: 10vh auto auto; border-radius: 20px; box-shadow: 0 0 0 1px rgba(4, 23, 43, 0.06), 0 8px 40px rgba(17, 20, 28, 0.12); background: #fff; color: var(--s-ink); overflow: hidden; }
.sdlg .sdlg__bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--s-line); margin: 0; }
.sdlg .sdlg__bar > svg { width: 18px; height: 18px; color: var(--s-slate); flex: none; }
.sdlg .sdlg__bar input { flex: 1; min-width: 0; border: 0 !important; outline: 0; font: 400 18px/1.2 var(--s-text); min-height: 48px; background: transparent; box-shadow: none !important; padding: 0; }
.sdlg .sdlg__res { overflow: auto; max-height: calc(min(78dvh, 720px) - 70px); padding: 8px; }
.sdlg .sdlg__empty { padding: 18px 12px; color: var(--s-slate); margin: 0; font-size: 15px; }
.sdlg .res { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sdlg .res a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--s-ink); }
.sdlg .res a:hover, .sdlg .res a:focus-visible { background: var(--s-mist); }
.sdlg .res b { font-weight: 500; font-size: 16px; }
.sdlg .res .r-meta { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 14px; color: var(--s-ink-2); white-space: nowrap; }
.sdlg .res .r-task { font-size: 14px; color: var(--s-slate); line-height: 1.4; }
.sdlg .res .r-cat { font-size: 13px; color: var(--s-slate); }

/* footer */
.ftr { background: var(--s-mist); padding-block: 64px 28px; font-size: 15px; color: var(--s-ink); margin-top: 72px; }
.ftr .ftr__grid { display: grid; gap: 32px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 40px; }
@media (min-width: 760px) { .ftr .ftr__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .ftr .ftr__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.ftr .ftr__brand { display: grid; gap: 14px; max-width: 64ch; }
.ftr .ftr__brand p { margin: 0; color: var(--s-ink-2); font-size: 14px; line-height: 1.55; }
.ftr h2 { font: 500 15px/1.3 var(--s-text); margin: 0 0 10px; letter-spacing: 0; color: var(--s-ink); }
.ftr h2 a { text-decoration: none; display: inline-block; padding: 4px 0; margin: -4px 0; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ftr li a { display: inline-block; padding: 5px 0; text-decoration: none; color: var(--s-ink-2); }
.ftr li a:hover { color: var(--s-ink); text-decoration: underline; }
.ftr .ftr__legal { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--s-line-2); display: grid; gap: 10px; font-size: 13px; color: var(--s-slate); }
.ftr .ftr__legal a { color: var(--s-ink-2); }
@media (prefers-reduced-motion: reduce) { :is(.hdr, .mnav, .sdlg) * { transition-duration: 1ms !important; } }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.mnav li.mnav__sub { margin: 12px 0 2px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2, #3b3e45); text-transform: uppercase; }
