/*
 * SmartStructure shared responsive hardening
 * Loaded after each page's embedded styles so every public page, article,
 * calculator, legal page and the admin dashboard behaves consistently.
 */

html {
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

img,
picture,
video,
canvas,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

iframe {
  border: 0;
}

main,
section,
article,
aside,
header,
footer,
nav,
form,
div {
  min-width: 0;
}

p,
li,
dd,
td,
th,
a,
button,
label,
summary,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: anywhere;
}

input,
select,
textarea,
button {
  max-width: 100%;
  font: inherit;
}

textarea {
  resize: vertical;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
[role="button"],
summary,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  touch-action: manipulation;
}

[id] {
  scroll-margin-top: 84px;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  width: 100%;
  min-width: 620px;
}

.article-table-scroll {
  margin-block: 24px;
  border-radius: 12px;
}

.article-table-scroll .price-table {
  display: table;
  margin: 0;
  overflow: visible;
}

.article-table-scroll:focus-visible {
  outline: 3px solid #FBBF24;
  outline-offset: 3px;
}

/* The CMS switches to hamburger navigation at this wider breakpoint. */
@media (max-width: 1180px) {
  .header-nav .nav-links,
  .header-nav .nav-search-wrap {
    display: none !important;
  }

  .header-nav .hamburger {
    display: flex !important;
  }

  .mobile-menu {
    top: 76px !important;
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Tablet and small laptop */
@media (max-width: 960px) {
  html {
    scroll-padding-top: 72px;
  }

  [id] {
    scroll-margin-top: 72px;
  }

  body:has(.dashboard) .sidebar {
    top: 64px !important;
  }

  body:has(.dashboard) .main {
    padding-top: 84px !important;
  }

  .header-nav {
    height: 64px !important;
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)) !important;
    gap: 8px;
  }

  .header-nav .nav-logo {
    min-width: 0;
    max-width: calc(100% - 104px);
    gap: 8px;
  }

  .header-nav .nav-logo img {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px;
  }

  .header-nav .nav-logo-text,
  .header-nav .nav-logo-text span {
    font-size: clamp(18px, 3.5vw, 24px) !important;
    letter-spacing: 1px !important;
  }

  .header-nav .nav-logo-tagline {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-nav .nav-search-toggle,
  .header-nav .hamburger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
  }

  .mobile-menu {
    top: 64px !important;
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px max(14px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
  }

  .mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: 10px !important;
  }

  .nav-search-dropdown {
    position: fixed !important;
    top: 70px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-height: calc(100dvh - 84px) !important;
  }

  .search-overlay {
    padding: 76px 12px 12px !important;
  }

  .search-box {
    max-height: calc(100dvh - 88px);
    display: flex;
    flex-direction: column;
  }

  .search-results {
    max-height: none !important;
    min-height: 0;
    flex: 1;
  }

  .sec-wrap,
  .app-section,
  .blog-section,
  .dealer-benefits-sec,
  .dealer-steps-sec,
  .dark-section {
    padding-inline: clamp(16px, 4vw, 32px) !important;
  }

  .container,
  .journey-inner,
  .dealer-hero-inner,
  .dealer-section-inner {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto !important;
  }

  .app-container {
    width: min(100%, calc(100% - 32px)) !important;
    max-width: 100% !important;
    margin-inline: auto !important;
  }

  .cf-layout,
  .about-grid-new,
  .faq-layout,
  .dealer-support-grid,
  .dealer-hero-inner,
  .app-showcase-wrap,
  .cta-grid,
  .requirements-grid,
  .verify-panel,
  .app-hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ecosystem-cards,
  .benefits-grid,
  .dealer-3-grid,
  .blog-grid,
  .ss-category-grid,
  .media-grid,
  .app-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .founders-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .cat-expert-facts {
    width: 100%;
    max-width: 100%;
    margin-right: 0 !important;
    align-self: stretch !important;
    transform: none !important;
  }

  .mh-stats,
  .dealer-stats-bar,
  .app-proof {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .journey-track,
  .steps-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .journey-connector,
  .steps-row::before {
    display: none !important;
  }

  .dealer-hero-copy,
  .dealer-hero-media {
    width: 100%;
    max-width: 100% !important;
  }

  .dealer-hero-media,
  .dealer-hero-copy {
    text-align: center;
  }

  .dealer-hero-actions,
  .dealer-hero-badges {
    justify-content: center;
  }

  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding-inline: clamp(18px, 4vw, 34px) !important;
  }

  .footer-brand,
  .footer-newsletter {
    grid-column: 1 / -1;
    max-width: 100% !important;
  }

  .footer-bottom {
    gap: 14px;
    padding-inline: clamp(18px, 4vw, 34px) !important;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
  }

  .modal-overlay,
  .dealer-register-modal {
    padding: 12px !important;
  }

  .modal-box,
  .dealer-register-dialog,
  .modal-box.wide,
  .modal-box.preview-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 !important;
  }

  .modal-body,
  .dealer-register-form {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .cookie-banner {
    max-height: min(70dvh, 520px);
    overflow-y: auto;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom)) !important;
  }

  .floating-wa {
    right: max(12px, env(safe-area-inset-right)) !important;
  }
}

/* Phone */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 68px;
  }

  body {
    font-size: 15px;
  }

  [id] {
    scroll-margin-top: 68px;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  button,
  [role="button"],
  summary,
  input[type="button"],
  input[type="submit"],
  input[type="reset"] {
    min-height: 44px;
  }

  .header-nav .nav-logo {
    max-width: calc(100% - 96px);
  }

  .header-nav .nav-logo img {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px;
  }

  .header-nav .nav-logo-reg,
  .header-nav .nav-logo-tagline {
    display: none !important;
  }

  .header-nav .nav-logo-text,
  .header-nav .nav-logo-text span {
    font-size: clamp(16px, 5.2vw, 21px) !important;
    letter-spacing: .5px !important;
    white-space: nowrap;
  }

  .sec-wrap,
  .app-section,
  .blog-section,
  .dealer-benefits-sec,
  .dealer-steps-sec,
  .dark-section {
    padding: 42px 16px !important;
  }

  .sec-title,
  .journey-heading,
  .dealer-section-heading,
  .blog-section h2,
  .app-section h2 {
    font-size: clamp(25px, 8vw, 34px) !important;
    line-height: 1.15 !important;
  }

  .market-hero,
  .dealer-hero,
  .blog-hero,
  .app-hero {
    padding-inline: 16px !important;
  }

  .market-hero {
    margin-top: 64px !important;
  }

  .ecosystem-section {
    padding-top: 64px !important;
  }

  .market-hero h1,
  .dealer-hero h1,
  .blog-hero h1,
  .app-hero h1,
  .slide-h1 {
    font-size: clamp(29px, 10vw, 42px) !important;
    line-height: 1.08 !important;
  }

  .founders-grid,
  .ecosystem-cards,
  .benefits-grid,
  .dealer-3-grid,
  .dealer-support-grid,
  .requirements-grid,
  .blog-grid,
  .ss-category-grid,
  .media-grid,
  .app-feature-grid,
  .journey-track,
  .steps-row,
  .form-row,
  .form-grid,
  .dealer-form-grid,
  .f-row,
  .f-row3,
  .emi-grid,
  .expense-form,
  .ply-result-grid,
  .paint-result-grid,
  .app-proof {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .mh-stats,
  .dealer-stats-bar,
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .mh-stat,
  .dealer-stat,
  .stat-card {
    min-width: 0;
    padding: 16px 12px !important;
  }

  .mh-stat-num,
  .dealer-stat-num,
  .stat-num {
    font-size: clamp(24px, 9vw, 34px) !important;
  }

  .eco-card,
  .founder-card,
  .benefit-card,
  .dealer-card,
  .dealer-support-card,
  .blog-card,
  .tool-card,
  .section-card,
  .faq-card {
    max-width: 100% !important;
  }

  .section-head,
  .panel-header,
  .cms-toolbar,
  .modal-head,
  .modal-actions {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .section-action,
  .panel-header button,
  .cms-toolbar .f-input,
  .cms-toolbar button,
  .modal-actions .modal-btn,
  .dealer-hero-actions a,
  .dealer-hero-actions button {
    width: 100% !important;
    max-width: none !important;
    justify-content: center;
    text-align: center;
  }

  .dealer-hero-actions,
  .app-store-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }

  .dealer-hero-actions > *,
  .app-store-actions > * {
    width: 100% !important;
  }

  .dealer-category-options {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .dealer-category-option {
    width: 100%;
    min-height: 44px;
  }

  .dealer-register-close,
  .modal-close,
  .search-close,
  .app-install-dismiss {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .dealer-register-head,
  .modal-head {
    padding: 18px !important;
  }

  .dealer-register-form,
  .modal-body {
    padding: 18px !important;
  }

  .article-page {
    margin-inline: 8px !important;
    border-radius: 14px !important;
  }

  .article-hero,
  .article-content {
    padding-inline: 18px !important;
  }

  .article-page > .app-cta,
  .article-page > .editorial-note {
    margin-inline: 18px !important;
  }

  .article-content h2 {
    font-size: clamp(23px, 7.4vw, 29px) !important;
  }

  .related {
    margin-bottom: 36px !important;
    padding: 24px 18px !important;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-inline: 18px !important;
  }

  .footer-brand,
  .footer-newsletter {
    grid-column: auto;
  }

  .footer-subscribe {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .footer-subscribe input,
  .footer-subscribe button {
    width: 100% !important;
    min-height: 46px;
  }

  .footer-bottom {
    flex-direction: column !important;
    padding: 18px !important;
  }

  .footer-bottom-links {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .footer-bottom-links a::after {
    display: none !important;
  }

  .footer-col a,
  .footer-bottom-links a,
  .app-faq summary {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .cookie-banner {
    /* Base rule's 20px gap was sized for the desktop text+buttons *row*; here
       text and buttons stack, so it reads as vertical spacing and is worth
       trimming. Slightly tighter than the shared ≤960px padding rule too. */
    gap: 10px !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important;
  }

  .cookie-text {
    min-width: 0 !important;
    width: 100%;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
  }

  .cookie-btns {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .cookie-btns button {
    width: 100%;
    min-height: 44px;
    padding: 0 8px !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .app-install-bar {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    max-width: calc(100% - 16px);
  }

  .app-install-bar strong {
    font-size: 12px;
  }

  .app-install-bar .app-store-button {
    min-width: 92px;
    white-space: nowrap;
  }

  .floating-wa {
    /* --wa-lift is set by index.html's cookie-consent script to the banner's
       live height + a gap while it's visible, and back to 0px once it's
       hidden - see updateWaLift(). The base rule's "transition: all .2s"
       already covers animating this. */
    bottom: calc(12px + env(safe-area-inset-bottom) + var(--wa-lift, 0px)) !important;
  }

  .floating-wa-label {
    display: none !important;
  }

  .floating-wa {
    width: 52px !important;
    height: 52px !important;
    padding: 0 !important;
    justify-content: center;
  }

  .search-input-row {
    padding: 12px !important;
  }

  .search-result-item {
    align-items: flex-start !important;
  }

  .search-result-tag {
    display: none !important;
  }

  .table-scroll {
    border-radius: 10px;
  }

  .faq-search-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .faq-count {
    white-space: normal !important;
  }

  .tools-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-inline: -16px !important;
    padding: 4px 16px 10px !important;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: none;
  }

  .tools-tabs::-webkit-scrollbar {
    display: none;
  }

  .tools-tabs .tab-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 44px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  #tools {
    background-attachment: scroll !important;
  }

  #tools > .container {
    width: 100% !important;
    padding-inline: 0 !important;
  }

  .tool-panel:has(> .tool-card) {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .slider-dot {
    position: relative;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    background: transparent !important;
    border-radius: 999px !important;
  }

  .slider-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    transform: translate(-50%, -50%);
  }

  .slider-dot.active::before {
    width: 28px;
    background: #FDC31A;
  }

  .checklist-item {
    min-height: 44px;
  }

  #costResult {
    min-height: auto !important;
    padding: 24px 16px !important;
  }

  #tab-planner > div:first-child {
    padding: 18px !important;
  }

  #totalCost,
  #paintLitres,
  #plySheetCount,
  .emi-card-val,
  .mat-info span,
  .ply-result-value,
  .paint-result-value {
    font-size: clamp(28px, 10vw, 42px) !important;
  }

  .expense-total {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 6px;
  }

  .exp-del {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
  }

  .blog-popular-topic,
  .blog-category-chip,
  .blog-reset,
  .blog-search-clear,
  .blog-sort select {
    min-height: 44px !important;
  }

  .blog-sort,
  .blog-sort select {
    min-width: 0;
    max-width: 100% !important;
  }

  .blog-sort select {
    width: 100%;
  }

  .blog-filter-bar {
    top: 64px !important;
  }

  .mistri-grid,
  .mistri-why-grid,
  .bam-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .mistri-cta-box {
    padding: 28px 18px !important;
  }

  .mistri-cta-box .cta-btn {
    width: 100%;
    max-width: 100%;
    white-space: normal;
  }

  .hub-section {
    padding: 24px 18px !important;
  }

  /* Previously hid .floating-wa outright (opacity:0) while the cookie banner
     was visible to avoid overlap. Replaced by the --wa-lift-driven "bottom"
     offset above, which moves the button above the banner instead - it stays
     visible and usable rather than disappearing. */
}

/* Very small phones */
@media (max-width: 380px) {
  .header-nav .nav-logo-text,
  .header-nav .nav-logo-text span {
    font-size: 15px !important;
    letter-spacing: 0 !important;
  }

  .header-nav .nav-logo img {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px;
  }

  .header-nav .nav-search-toggle,
  .header-nav .hamburger {
    width: 40px;
    min-width: 40px;
  }

  .mh-stats,
  .dealer-stats-bar,
  .stats-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  /* .cookie-btns intentionally stays 2-column even at this width - see the
     ≤640px rule for the padding/font-size that keeps "Accept All Cookies"
     legible at a ~140px column on a 320px screen instead of stacking. */

  .app-install-bar small,
  .app-install-bar div {
    display: none !important;
  }

  .app-install-bar .app-store-button {
    flex: 1;
    margin-left: 0 !important;
  }

  .cat-stats-bar {
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 16px 12px !important;
  }

  .cat-stat,
  .cat-stat:nth-child(-n + 2) {
    min-height: 64px;
    padding: 10px 8px !important;
    border-bottom: 1px solid #d7e1ef;
  }

  .cat-stat:last-child {
    border-bottom: 0;
  }

  .cat-stat img {
    width: 34px !important;
    height: 34px !important;
  }

  .cat-stat-num {
    font-size: 24px !important;
  }

  .ss-category-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ss-category-card {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }

  .mistri-card__top {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .mistri-card__pill {
    white-space: normal !important;
  }

  .about-principle-card {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 16px !important;
  }
}

@media (max-width: 480px) {
  .site-header {
    gap: 8px;
    padding-inline: 12px;
  }

  .site-header .brand {
    min-width: 0;
    gap: 7px;
    font-size: 15px;
  }

  .site-header .brand img {
    width: 40px;
    height: 40px;
  }

  .site-header .nav-cta {
    flex-shrink: 0;
    padding: 10px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  .article-hero h1 {
    font-size: clamp(28px, 9vw, 36px) !important;
  }
}

/* Admin dashboard: use a thumb-friendly bottom rail on phones. */
@media (max-width: 600px) {
  body:has(.dashboard) .sidebar {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: calc(68px + env(safe-area-inset-bottom)) !important;
    padding: 6px 8px env(safe-area-inset-bottom) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    z-index: 2400;
  }

  body:has(.dashboard) .sidebar::-webkit-scrollbar {
    display: none;
  }

  body:has(.dashboard) .sidebar-logo,
  body:has(.dashboard) .sidebar-section,
  body:has(.dashboard) .sidebar-footer,
  body:has(.dashboard) .sidebar-badge {
    display: none !important;
  }

  body:has(.dashboard) .sidebar-item {
    flex: 0 0 64px;
    min-width: 64px;
    height: 56px;
    padding: 6px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    justify-content: center !important;
    font-size: 0 !important;
  }

  body:has(.dashboard) .sidebar-item .icon {
    display: block !important;
    margin: 0 !important;
    font-size: 22px !important;
    line-height: 1;
  }

  body:has(.dashboard) .main {
    margin-left: 0 !important;
    padding: 84px 12px calc(84px + env(safe-area-inset-bottom)) !important;
  }

  body:has(.dashboard) .page-title {
    font-size: 22px !important;
  }

  body:has(.dashboard) .stats-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:has(.dashboard) .dash-tabs,
  body:has(.dashboard) .preview-tabs,
  body:has(.dashboard) .seo-subtabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body:has(.dashboard) .dash-tabs::-webkit-scrollbar,
  body:has(.dashboard) .preview-tabs::-webkit-scrollbar,
  body:has(.dashboard) .seo-subtabs::-webkit-scrollbar {
    display: none;
  }

  body:has(.dashboard) .dash-tab,
  body:has(.dashboard) .preview-tab-btn,
  body:has(.dashboard) .seo-subtab {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
  }

  body:has(.dashboard) .btn-sm,
  body:has(.dashboard) .btn-danger,
  body:has(.dashboard) .section-action {
    min-height: 44px;
  }

  body:has(.dashboard) .seo-code-editor {
    max-width: 100%;
    overflow: auto;
  }

  body:has(.dashboard) .f-file-row {
    flex-wrap: wrap;
  }

  body:has(.dashboard) .f-file-row .f-input {
    min-width: 0;
    flex: 1 1 180px;
  }

  body:has(.dashboard) .section-head,
  body:has(.dashboard) .panel-header {
    padding-inline: 16px !important;
  }

  body:has(.dashboard) .data-table {
    min-width: 680px;
  }

  body:has(.dashboard) .toast-wrap {
    left: 10px !important;
    right: 10px !important;
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }

  body:has(.dashboard) .toast {
    min-width: 0 !important;
    width: 100%;
    max-width: none !important;
  }

  body:has(.dashboard) .login-screen {
    padding: 78px 14px 20px !important;
  }

  body:has(.dashboard) .login-box {
    width: 100%;
    max-width: 420px;
    padding: 28px 20px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Cookie-consent actions must remain legible over the navy banner. These
   selectors intentionally override the site's generic button hover effect. */
.cookie-banner button.cookie-decline {
  min-height: 44px;
  border: 1.5px solid #FFC107 !important;
  background: rgba(255, 255, 255, .1) !important;
  color: #FFFFFF !important;
  opacity: 1 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.cookie-banner button.cookie-decline:hover {
  border-color: #FFC107 !important;
  background: #FFFFFF !important;
  color: #061A42 !important;
  transform: translateY(-2px) scale(1) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .24) !important;
}

.cookie-banner button.cookie-decline:active {
  transform: translateY(0) scale(1) !important;
}

.cookie-banner button.cookie-decline:focus-visible {
  outline: 3px solid #FFC107 !important;
  outline-offset: 3px !important;
}

.cookie-banner button.cookie-accept:hover {
  color: #061A42 !important;
  transform: translateY(-2px) scale(1) !important;
}

@media (prefers-contrast: more) {
  button,
  input,
  select,
  textarea,
  .section-card,
  .tool-card,
  .blog-card {
    border-width: 2px !important;
  }
}

/* ── ACCESSIBILITY: sitewide focus-visible fallback ──
   Loads after every page's embedded styles, so this only fills the gaps -
   anything with its own :focus-visible rule (hero CTAs, footer accordion,
   cookie banner, hamburger, FAQ controls, search box, etc.) keeps that,
   because a same-or-higher-specificity selector always wins regardless of
   source order. The white outline + dark inset ring combo stays visible
   whether the element sits on a light or a dark/navy background. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #0A3BA8;
  border-radius: 4px;
}

/* ── ACCESSIBILITY: touch targets (mobile) ──
   Bumps a handful of known-undersized, sitewide-shared controls to a usable
   ~44x44px tap area on phones without changing their desktop size/look. */
@media (max-width: 767px) {
  .mobile-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .faq-cat-btn {
    min-height: 44px;
  }

  .search-close {
    width: 44px !important;
    height: 44px !important;
  }

  .footer-app-badge.footer-app-badge--img img {
    height: 44px !important;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 18px;
    height: 18px;
  }
}

/* ── ACCESSIBILITY: contrast ──
   Small, targeted color adjustments for text/backgrounds that measured
   below WCAG AA (4.5:1) against their real rendered background. */

/* WhatsApp floating button: white text on the stock brand green (#25D366)
   only reaches ~2:1. Darkened green keeps the same hue/recognisability
   while white text clears 4.5:1 (4.88:1). Shared markup across every page. */
.floating-wa {
  background: #0F8245 !important;
}

.floating-wa:hover {
  background: #0C6E3A !important;
}

/* Footer "Smartly Create Your Own Home" motto: the bright link-blue used
   elsewhere only reaches ~4:1 on the gold footer background. */
.footer-motto {
  color: #123B96 !important;
}
