/* Match the existing phone and desktop cutoffs. Larger touch tablets also
   use this layout in landscape. Short phone landscape viewports keep their layout. */
@media screen and (min-width: 681px) and (max-width: 1140px) and (min-height: 501px),
       screen and (min-width: 681px) and (max-width: 1440px) and (min-height: 501px) and (pointer: coarse) {
  :root {
    --fk-tablet-gutter: clamp(24px, 4vw, 52px);
    --fk-tablet-font: system-ui, sans-serif;
    --fk-tablet-line: #d9d7d2;
  }

  @supports selector(:popover-open) {
    .fk-tablet-bar[hidden] {
      display: block !important;
      position: relative;
      background: #171716;
      color: white;
      border-bottom: 1px solid #383530;
      font: 500 1rem/1.45 var(--fk-tablet-font);
    }
    .fk-tablet-bar ~ header,
    .fk-tablet-bar ~ .fk-wide-only[role="banner"],
    .fk-tablet-bar ~ #hs-site-wrap .fk-classic-masthead { display: none !important; }
    body.fk-site-shell #hs-site-wrap #hs-page-container { padding-top: 0 !important; }
    body.fk-site-shell button.fk-floating-menu { display: none !important; }
    #fk-tablet-menu:popover-open { display: block; }
  }
  @supports not selector(:popover-open) {
    body > header img { width: min(52vw, 514px); }
    body > header .wrap { height: auto; min-height: 90px; }
  }
  .fk-tablet-inner {
    box-sizing: border-box;
    max-width: 1240px;
    margin-inline: auto;
    padding: 10px var(--fk-tablet-gutter);
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
  }
  .fk-tablet-brand { display: block; width: min(52vw, 514px); min-width: 0; margin-right: auto; }
  .fk-tablet-brand img { display: block; width: 100%; height: auto; }
  .fk-tablet-bar :is(.fk-tablet-phone, .fk-tablet-menu-button, .fk-menu-top button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    box-sizing: border-box;
    font: 650 1rem/1.2 var(--fk-tablet-font);
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    border-radius: 5px;
    cursor: pointer;
  }
  .fk-tablet-phone { flex: none; color: white; }
  .fk-tablet-phone svg { color: #ffa440; }
  .fk-tablet-menu-button { padding: 0 14px; color: white; background: transparent; border: 1px solid #7a7771; }
  .fk-tablet-bar :focus-visible { outline: 3px solid #e79736; outline-offset: 2px; }
  #fk-tablet-menu {
    box-sizing: border-box;
    position: fixed;
    inset: 16px var(--fk-tablet-gutter) auto auto;
    margin: 0;
    width: min(620px, calc(100% - 2 * var(--fk-tablet-gutter)));
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    font: 500 1rem/1.35 var(--fk-tablet-font);
    color: #211f1c;
    background: #fff;
    border: 1px solid #c8c5bf;
    border-radius: 8px;
    box-shadow: 0 15px 48px #14120f3b;
  }
  #fk-tablet-menu::backdrop { background: #10101055; }
  .fk-menu-top { display: flex; align-items: center; justify-content: space-between; padding: 9px 22px; border-bottom: 1px solid var(--fk-tablet-line); }
  .fk-menu-top strong { font: 650 1.125rem/1.3 var(--fk-tablet-font); }
  .fk-menu-top button { border: 0; background: transparent; color: #694013; padding-inline: 12px; }
  .fk-tablet-directory { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 20px 24px 24px; }
  #fk-tablet-menu h2 { color: #59544d; margin: 0 0 7px; font: 650 .92rem/1.4 var(--fk-tablet-font); letter-spacing: normal; text-transform: none; }
  #fk-tablet-menu :is(a, summary) { display: flex; align-items: center; min-height: 46px; padding: 6px 0; box-sizing: border-box; border-bottom: 1px solid #e5e2dd; color: #211f1c; font: 550 1rem/1.3 var(--fk-tablet-font); text-decoration: none; cursor: pointer; }
  #fk-tablet-menu summary { list-style: none; justify-content: space-between; }
  #fk-tablet-menu summary::-webkit-details-marker { display: none; }
  #fk-tablet-menu summary::after { content: '+'; font-size: 1.2em; color: #77420e; }
  #fk-tablet-menu details[open] > summary::after { content: '−'; }
  #fk-tablet-menu details a { padding-inline: 12px; font-size: .94rem; background: #f8f7f4; }
  #fk-tablet-menu [aria-current="page"] { color: #844107; font-weight: 720; }

  .fk-tablet-registers { display: flex; gap: 24px; padding: 0 24px 10px; }
  #fk-tablet-menu .fk-tablet-registers a { font-size: .875rem; border: 0; text-decoration: underline; }

  /* Homepage */
  body > main#hs-page-content > .wrap,
  body > main#hs-page-content .herocopy,
  body > footer > .wrap { width: min(calc(100% - 2 * var(--fk-tablet-gutter)), 1136px); }
  .hero:has(.herocopy) {
    background: linear-gradient(90deg, #0d0e10f5 4%, #101012c7 48%, #11101322 88%),
                url('/fk-home-hero-desktop-v1.webp') center 52% / cover;
  }
  .hero .herocopy { padding-block: clamp(32px, 4.6vw, 56px); }
  .herocopy h1 { max-width: 21ch; font: 680 clamp(2.05rem, 4.2vw, 3.4rem)/1.08 var(--fk-tablet-font); letter-spacing: -.04em; }
  .hero .herocopy p { margin: 12px 0 19px; max-width: 44ch; font: 450 1rem/1.5 var(--fk-tablet-font); }
  .herocopy .actions { gap: 20px; }
  .herocopy .actions a { display: inline-flex; align-items: center; min-height: 46px; }
  .herocopy .button, .booking .button { border-radius: 5px; }
  #services.services { padding-block: 26px 24px; }
  #services .servicehead { display: block; }
  #services .servicehead > h2 { margin: 0 0 12px; font: 650 1.55rem/1.2 var(--fk-tablet-font); letter-spacing: -.03em; }
  #services #fk-service-finder { width: 100%; max-width: none; margin: 0; }
  #services .fk-finder-box { border-radius: 5px; border-color: #88847d; }
  #services #fk-finder-input { min-height: 52px; padding-inline: 16px; }
  #services .fk-finder-box button { padding-inline: 22px; }
  #services #fk-finder-results { z-index: 3; border-radius: 5px; }
  #services .list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; margin-top: 10px; }
  #services .list :is(a, summary) { min-height: 50px; }
  .wrap.booking { border-radius: 6px; gap: 18px; padding: 14px; }
  .booking h2 { font: 650 1.35rem/1.2 var(--fk-tablet-font); letter-spacing: -.025em; }
  .booking img { width: 78px; height: 78px; border-radius: 4px; }
  .booking > a { display: inline-flex; align-items: center; min-height: 46px; margin-right: 6px; }
  .wrap.utility { gap: 4px 24px; margin-bottom: 18px; }
  .footlinks a { display: inline-flex; align-items: center; min-height: 44px; }

  /* Service detail pages retain their full articles, imagery and booking links. */
  body.fk-site-shell .hs-section.hs-page-header {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  .fk-site-shell .hs-section.hs-page-header .hs-container {
    box-sizing: border-box;
    width: min(calc(100% - 2 * var(--fk-tablet-gutter)), 1136px) !important;
    margin-inline: auto;
    padding: 32px 0 !important;
  }
  .fk-site-shell .hs-page-header .hs-container > .hs-grid-container { margin: 0 !important; }
  .fk-site-shell .hs-page-header .hs-grid-container > .hs-grid-item { padding: 0 !important; }
  .fk-site-shell .hs-page-header .hs-module:has(h1) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .fk-site-shell .hs-page-header .hs-module:has(h1) .hs-module-content {
    max-width: 720px;
    padding: 0 !important;
    text-align: left !important;
  }
  .fk-site-shell .hs-page-header .hs-section-bgimage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0d1014ee, #101216cb 50%, #10111544);
  }
  .fk-site-shell .hs-page-header :is(.fk-electrical-shortcuts, .fk-boiler-routes) { justify-content: flex-start !important; }
  .fk-site-shell .hs-page-header .hs-content > p:has(+ h1) {
    margin-bottom: 8px !important;
    color: #f8ce98 !important;
    font: 550 .9rem/1.4 var(--fk-tablet-font) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
  }
  .fk-site-shell :is(#hs-page-content, main) :is(h1, h2, h3, p, legend, label, button),
  .fk-site-shell .fk-contact-compact-title {
    font-family: var(--fk-tablet-font) !important;
    text-transform: none !important;
  }
  .fk-site-shell .hs-page-header .hs-content h1.hs-element,
  .fk-site-shell .fk-contact-compact-title {
    max-width: 30ch;
    font-size: clamp(1.95rem, 3.8vw, 2.85rem) !important;
    line-height: 1.13 !important;
    letter-spacing: -.035em !important;
  }
  .fk-site-shell #hs-page-content .fk-service-desktop h3.hs-element {
    font-size: clamp(1.38rem, 2.7vw, 1.85rem) !important;
    line-height: 1.22 !important;
    letter-spacing: -.02em;
  }
  .fk-site-shell .fk-contact-compact-title { margin-inline: auto; }
  #hs17335018986651 #fk-enquiry { max-width: 600px; padding: 24px; border-radius: 7px; }
  .fk-site-shell #hs-page-content .fk-service-desktop :is(.hs-button, .fk-service-quote-link),
  #hs-page-content .fk-offer-inner .fk-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; box-sizing: border-box; border-radius: 5px; }
  #hs-page-content .fk-service-desktop .hs-content p { line-height: 1.55; }
  #fk-quote-page .wizard, #fk-quote-page .sidebar, .fk-boiler-wrap form, .fk-offer-inner { border-radius: 7px; }
  #fk-quote-page main { padding-inline: var(--fk-tablet-gutter); }
  #fk-quote-page .wizard :is(button, select), .fk-cert .cert-actions button { min-height: 46px; }
  #hs-footer-container .fk-foot-links a { min-height: 44px; }
}
@media screen and (min-width: 681px) and (max-width: 900px) and (min-height: 501px) {
  #services .list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #fk-quote-page .layout, #fk-boiler-service-page .fk-boiler-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
