/* Phone presentation. Desktop rules and feature permissions remain in their own files. */
.ll-mobile-menu { display: none; }

@media (max-width: 760px) {
  html { scroll-padding-top: calc(var(--ll-header-height, 72px) + 16px); }

  /* The public menu progressively enhances the existing navigation links. */
  .public-header[data-mobile-ready] .public-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand toggle" "pages pages" "portals book";
    min-height: 64px;
    column-gap: 12px;
    padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  }
  .public-header[data-mobile-ready] .header-identity { min-width: 0; gap: 6px; }
  .public-header[data-mobile-ready] .header-brand { min-width: 0; flex: 0 1 auto; }
  .public-header[data-mobile-ready] .header-brand img { width: clamp(114px, 35vw, 150px); max-width: 100%; }
  .public-header .header-market { width: 44px; min-width: 44px; min-height: 44px; }
  .public-header[data-mobile-ready] .ll-mobile-menu {
    grid-area: toggle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 76px;
    min-height: 44px;
    padding: 10px;
    border: 1px solid #ffffff40;
    border-radius: 6px;
    background: transparent;
    color: var(--header-light, #fcfbf8);
    font: 600 14px/1.2 "DM Sans", Arial, sans-serif;
    cursor: pointer;
  }
  .ll-mobile-menu svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; }
  .ll-mobile-menu:focus-visible { outline: 2px solid #ddc59c; outline-offset: 2px; }
  .public-header[data-mobile-ready]:not([data-mobile-open]) :is(.header-primary, .header-portals, .header-book-mobile) { display: none; }
  .public-header[data-mobile-ready] .header-primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 12px 0;
    overflow: visible;
  }
  .public-header[data-mobile-ready] .header-primary a {
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 5px;
    background: #ffffff08;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 15px;
  }
  .public-header[data-mobile-ready] .header-primary a:is(:hover, :focus-visible, [aria-current]) { background: #ffffff12; }
  .public-header[data-mobile-ready] .header-portals { align-self: start; min-width: 0; padding-bottom: 4px; }
  .public-header[data-mobile-ready] .header-portals summary { min-height: 46px; padding-inline: 12px; font-size: 15px; }
  .public-header[data-mobile-ready] .header-panel { position: static; min-width: 0; max-width: 100%; margin: 4px 0 0; box-shadow: none; }
  .public-header[data-mobile-ready] .header-panel a { min-height: 46px; white-space: normal; }
  .public-header[data-mobile-ready] .header-book-mobile { align-self: start; min-height: 46px; padding-inline: 14px; font-size: 14px; }
  .public-header[data-mobile-open] { max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }

  /* A portal drawer frees the full content width on a phone. */
  body[data-portal-design].ll-phone-navigation {
    --rail: 0px;
    --gutter: clamp(16px, 4vw, 24px);
    padding-inline-start: 0;
  }
  html[data-desk-folded] body[data-portal-design].ll-phone-navigation { --rail: 0px; }
  body[data-portal-design].ll-phone-navigation #desk-sidebar {
    width: min(320px, calc(100vw - 32px));
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-100%);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  html[data-desk-open] body[data-portal-design].ll-phone-navigation #desk-sidebar {
    visibility: visible;
    pointer-events: auto;
    transform: none;
    width: min(320px, calc(100vw - 32px));
  }
  body[data-portal-design].ll-phone-navigation .portal-header,
  body[data-portal-design].ll-phone-navigation .portal-header:has(.client-wallet) {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-auto-flow: row;
    gap: 8px;
    height: auto;
    min-height: 64px;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  }
  .ll-phone-navigation .portal-header > #desk-toggle { grid-area: 1 / 1; }
  .ll-phone-navigation .portal-header > .desk-trail { grid-area: 1 / 2; margin: 0; min-width: 0; }
  .ll-phone-navigation .portal-header > :is(a, .employee-account, .employee-header-actions) { grid-area: 1 / 3; min-width: 0; }
  .ll-phone-navigation .portal-header > a { display: inline-flex; align-items: center; max-width: 108px; min-height: 44px; white-space: normal; }
  .ll-phone-navigation .portal-header > .client-wallet { grid-area: 2 / 1 / auto / -1; width: 100%; margin: 0; }
  .ll-phone-navigation .desk-portal-name { font-size: clamp(16px, 4.6vw, 19px); min-width: 0; }
  .ll-phone-navigation .portal-header .employee-account > summary { min-height: 44px; max-width: min(34vw, 138px); }
  .ll-phone-navigation .portal-header :is(.desk-divider, .desk-page-mark, #desk-page-name) { display: none; }
  body[data-portal-design].ll-phone-navigation #desk-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
    color: var(--ink);
    transform: none;
  }
  .ll-phone-navigation #desk-toggle::before { content: none; }
  .ll-phone-navigation #desk-toggle::after {
    width: 18px;
    height: 12px;
    border: solid currentColor;
    border-width: 2px 0;
    background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
    transform: none;
  }
  html[data-desk-folded] .ll-phone-navigation #desk-toggle::after { transform: none; }
  body[data-portal-design].ll-phone-navigation #desk-sidebar > #desk-toggle {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    transform: none;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
  }
  html[data-desk-open] .ll-phone-navigation #desk-toggle::after {
    width: 18px;
    height: 18px;
    border: 0;
    background: linear-gradient(45deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%);
  }
  html[data-desk-open] .ll-phone-navigation .desk-brand { height: 64px; padding-right: 62px; }
  html[data-desk-open] .ll-phone-navigation .desk-brand img { max-width: 168px; }
  html[data-desk-open] .ll-phone-navigation .desk-nav-title { overflow-wrap: anywhere; }
  .ll-phone-navigation #desk-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
  body[data-portal-design].ll-phone-navigation #desk-sidebar > #desk-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

  /* Public media and reading layouts retain the site's editorial styling. */
  .public-header ~ main :is(.wrap, .section, .hero-copy, .hero-visual, .story-copy, .native-form-intro, .native-inquiry) { min-width: 0; }
  .public-header ~ main :is(.native-contact-links strong, .contact-email, .concierge-links strong) { overflow-wrap: anywhere; }
  .public-header ~ main :is(.button, .text-link, .faqs summary) { min-height: 44px; }
  .public-header ~ footer :is(a, .text-link) { min-height: 44px; display: inline-flex; align-items: center; }
  .public-header ~ main :is(video, audio) { max-width: 100%; }
  .caller-player {
    bottom: max(12px, env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    overflow-y: auto;
    padding: 16px;
    gap: 12px;
  }
  .caller-player .caller-player-copy { flex-basis: calc(100% - 52px); min-width: 0; padding-right: 44px; }
  .caller-player .caller-player-copy span { font-size: 12px; }
  .caller-player .recording-choice { width: 100%; margin: 0; font-size: 13px; }
  .caller-player .recording-choice select { width: 100%; min-height: 44px; font-size: 16px; padding: 10px 32px 10px 12px; }
  .caller-player audio { min-width: 0; width: 100%; }
  .caller-player .close-player { top: 8px; right: 8px; width: 44px; height: 44px; }
  .has-caller-player { padding-bottom: calc(250px + env(safe-area-inset-bottom)); }
  .sign :is(input, select, textarea) { min-width: 0; max-width: 100%; font-size: 16px; }
  .sign :is(input, button) { min-height: 44px; }
  .ll-resource-page header .shell { padding-block: 12px; gap: 8px; }
  .ll-resource-page :is(nav, .footlinks) { gap: 4px 12px; }
  .ll-resource-page :is(nav, .footlinks) a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
  .ll-resource-page :is(.action, summary) { min-height: 44px; }
  .ll-resource-page :is(.shell, .prose, .cards, .card) { min-width: 0; }
  .ll-resource-page :is(.prose, .card) { overflow-wrap: anywhere; }
  .ll-resource-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
  .ll-resource-table-scroll[data-wide] table { min-width: 600px; }
  .ll-resource-table-scroll:focus-visible { outline: 2px solid var(--blue, #826239); outline-offset: 3px; }
}

@media (max-width: 520px) {
  .public-header ~ main .wrap, .public-header ~ footer.wrap { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .public-header ~ main .hero { padding-top: 30px; padding-bottom: 40px; gap: 30px; }
  .public-header ~ main .hero h1 { font-size: clamp(36px, 10.7vw, 48px); line-height: 1.12; margin-block: 18px; }
  .public-header ~ main .hero-description { font-size: 16px; line-height: 1.65; }
  .public-header ~ main .hero-actions { margin-top: 24px; gap: 12px; }
  .public-header ~ main .hero-note { flex-wrap: wrap; gap: 8px; font-size: 12px; }
  .public-header ~ main .hero-visual { display: grid; grid-template-columns: minmax(0, 1fr); height: auto; padding-bottom: 0; }
  .public-header ~ main .hero-visual .house { position: static; display: block; width: 100%; height: clamp(230px, 65vw, 330px); border-radius: 52px 6px 6px 6px; }
  .public-header ~ main .hero-visual .lead-card { position: relative; left: auto; bottom: auto; width: calc(100% - 16px); max-width: 340px; margin: -42px 8px 0; justify-self: center; padding: 20px; }
  .public-header ~ main .hero-visual .photo-label { top: 14px; right: 12px; max-width: calc(100% - 24px); font-size: 11px; }
  .public-header ~ main .hero-visual .visual-stamp { position: static; writing-mode: horizontal-tb; justify-self: center; margin-top: 12px; font-size: 10px; }
  .public-header ~ main .lead-card .lead-row { gap: 12px; }
  .public-header ~ main .lead-card .lead-row strong { text-align: right; }
  .public-header ~ main .section { padding-block: 48px; }
  .public-header ~ main .native-inquiry { padding: 24px 16px; }
  .public-header ~ main :is(.jobs-intro h1, .page-intro h1, .native-form-intro h1) { font-size: clamp(34px, 10vw, 44px); overflow-wrap: anywhere; }
  .public-header ~ main .staffing-grid { grid-template-columns: 1fr; gap: 16px; }
  .public-header ~ main .staffing-grid article { padding-top: 18px; }
  .public-header ~ main .staffing-grid .text-link { font-size: 14px; }
  .public-header ~ main :is(.plan-heading, .lead-count) { min-width: 0; }
  .public-header ~ main .price { font-size: clamp(44px, 13vw, 54px); }
  .public-header ~ main .price span { display: inline-block; }
  .public-header ~ main :is(.careers-banner, .closing) { margin-inline: 16px; padding: 28px 20px; }
  .ll-resource-page .shell { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .ll-resource-page h1 { font-size: clamp(34px, 9.8vw, 44px); }
  .ll-resource-page .card { padding: 18px; }
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  body[data-portal-design].ll-phone-navigation #desk-sidebar { transition: transform 200ms ease, visibility 200ms; }
}


/* Employee navigation and account controls stay readable and tappable on phones. */
@media (max-width:760px) {
  html body[data-portal-design="employee"].ll-phone-navigation > .portal-header {
    grid-template-columns: max-content minmax(0,1fr) auto auto;
    column-gap: 6px;
  }
  body[data-portal-design="employee"].ll-phone-navigation > .portal-header > .desk-trail {
    white-space: normal;
  }
  body[data-portal-design="employee"] .portal-header .desk-portal-name {
    overflow: visible;
    overflow-wrap: normal;
    text-overflow: clip;
    font-size: clamp(14px, 4vw, 18px);
  }
  body[data-portal-design="employee"].ll-phone-navigation #desk-toggle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: auto;
    padding-inline: 9px;
    font: 650 .82rem/1 var(--font);
  }
  body[data-portal-design="employee"].ll-phone-navigation #desk-toggle::after {
    order: -1;
    flex: none;
    width: 15px;
  }
  html[data-desk-open] body[data-portal-design="employee"].ll-phone-navigation #desk-sidebar {
    width: min(390px, calc(100vw - 20px));
  }
  body[data-portal-design="employee"].ll-phone-navigation #desk-sidebar .desk-nav-title,
  body[data-portal-design="employee"].ll-phone-navigation #desk-sidebar .desk-nav-words small {
    white-space: normal;
  }
  body[data-portal-design="employee"] #desk-sidebar #desk-toggle {
    color: var(--ink);
  }
  body[data-portal-design="employee"] .portal-header > [data-portal-help] {
    grid-area: 1 / 4;
  }
  body[data-portal-design="employee"] .portal-header .employee-account {
    position: static;
  }
  body[data-portal-design="employee"] .portal-header .employee-account > .account-menu {
    left: 12px;
    right: 12px;
    top: calc(100% + 4px);
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(65vh, 480px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body[data-portal-design="employee"] .portal-header .account-menu :is(summary,a,button) {
    min-height: 44px;
  }
}
