/* Phone layout: same authored content, separate reading and touch treatment.
   Desktop sidebars are never duplicated into the mobile document flow. */
@media (max-width:767px) {
  html body { --mobile-gutter:24px; }
  .masthead .masthead__inner {
    width:100%;padding:12px 16px;min-height:72px;gap:8px;flex-wrap:nowrap;
  }
  .masthead__inner > .brand {
    flex:1 1 0;min-width:0;max-width:none;gap:8px;margin:0;
  }
  .masthead__inner > .brand > span {
    min-width:0;max-width:none;white-space:normal;overflow-wrap:anywhere;
    font-size:13px;line-height:1.35;
  }
  .masthead .brand__icon {width:28px;height:28px;flex:0 0 28px;}
  .masthead .header-controls {flex:0 0 auto;gap:2px;margin-left:auto;}
  .masthead :is(.theme-toggle,.language-menu > summary,.nav-toggle) {
    width:44px;height:44px;min-height:44px;padding:10px;flex-shrink:0;
  }
  .masthead .language-chevron {display:none;}
  .language-menu > .language-switcher {
    width:200px;min-width:0;max-width:calc(100vw - 32px);
    max-height:calc(100dvh - var(--masthead-height,72px) - 24px);overflow-y:auto;
  }
  .language-menu .language-switcher a {min-height:44px;display:flex;align-items:center;}
  .mobile-nav-header .brand {min-width:0;gap:8px;}
  .mobile-nav-header .brand > span {font-size:13px;white-space:normal;line-height:1.35;overflow-wrap:anywhere;}
  .mobile-nav-controls {gap:2px;flex:none;}
  .mobile-nav-controls .language-menu > summary {width:44px;height:44px;padding:10px;}
  .mobile-nav-controls .language-chevron {display:none;}
  .mobile-nav-panel .language-switcher {right:0;}

  body[data-template-layout] .site-shell {
    width:100%;max-width:100%;margin-inline:auto;padding-inline:var(--mobile-gutter);padding-top:32px;
  }
  .page-grid,.main-content,.main-content > article {min-width:0;max-width:100%;}
  .page-grid {gap:0;}
  .page-title-hero {padding:40px var(--mobile-gutter) 32px;}
  .page-title-hero h1 {font-size:32px;line-height:1.18;}
  .page-title-hero .lede {line-height:1.8;}
  .main-content :is(img,video) {max-width:100%;}
  .main-content :is(p,li,a) {overflow-wrap:anywhere;}

  body[data-desktop-home] .home-composition > .home-hero--backdrop {
    padding:16px 0 24px;max-width:100%;overflow:hidden;
  }
  .home-hero--backdrop h1 {font-size:clamp(30px,8.2vw,36px);line-height:1.12;margin:20px 0 28px;}
  .home-hero--backdrop .home-hero-visual {width:90%;max-width:300px;height:auto;aspect-ratio:16/9;margin:0 auto;}
  .home-hero--backdrop .home-hero-visual > img.home-desktop-poster {display:block;width:100%;height:100%;object-fit:cover;}
  .home-hero--backdrop > .lede {margin:24px 0 0;text-align:center;line-height:1.85;}
  .home-hero .home-stats {margin:24px 0;gap:12px;}
  .home-hero .home-stats > li {min-width:0;padding:14px 12px;line-height:1.65;}
  body[data-home-defaults] .home-actions {display:flex;flex-direction:column;gap:12px;margin-top:24px;}
  :root body[data-home-defaults][data-presentation] .home-actions a.home-cta {width:100%;min-height:48px;padding:12px 16px;text-align:center;}
  .home-actions svg {width:16px;height:16px;flex:none;}

  .home-inline-video {display:block;width:100%;max-width:100%;margin:48px auto 64px;text-align:center;}
  .home-inline-video .factory-video {position:relative;display:block;width:100%;aspect-ratio:16/9;margin:0;overflow:hidden;border-radius:12px;}
  .home-inline-video .factory-video__trigger {width:100%;height:100%;border:0;border-radius:12px;}
  .home-inline-video img {width:100%;height:100%;object-fit:cover;}
  .home-inline-video iframe {display:block;width:100%;height:100%;aspect-ratio:16/9;border:0;}
  .home-inline-video [hidden] {display:none!important;}
  .home-video-youtube {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;margin-top:16px;padding:6px 12px;border:1px solid var(--ref-border);border-radius:8px;color:var(--color-muted-ink);font-size:12px;text-decoration:none;}
  .home-video-youtube svg {width:14px;height:14px;}

  .home-topic-index {display:block;margin:64px 0;text-align:center;}
  .home-topic-index h2 {font-size:30px;line-height:1.2;margin:0 0 20px;text-wrap:balance;}
  .home-topic-index > p {color:var(--color-muted-ink);line-height:1.8;}
  .home-index-title {color:var(--color-accent);}
  html body[data-desktop-home][data-page-type='home'] .home-topic-index nav {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;text-align:left;}
  .home-topic-index a {display:flex;flex-direction:column;align-items:flex-start;min-width:0;padding:16px;border:1px solid var(--ref-border);border-radius:12px;background:var(--color-surface);color:var(--color-ink);text-decoration:none;}
  .home-index-icon {display:grid;place-items:center;width:40px;height:40px;border-radius:10px;background:color-mix(in srgb,var(--color-accent) 12%,var(--color-surface));color:var(--color-accent);}
  .home-index-icon svg {width:22px;height:22px;}
  html body[data-desktop-home][data-page-type='home'] .home-index-icon {flex:none;margin:0 0 16px;}
  .home-topic-index a :is(h3,p) {max-width:100%;overflow-wrap:anywhere;}
  .home-topic-index a h3 {font-size:14px;line-height:1.5;margin:0 0 8px;}
  .home-topic-index a p {font-size:14px;line-height:1.5;color:var(--color-muted-ink);margin:0;}
  body[data-explore-presentation='categories-v1'] .home-explore-cards {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
  body[data-explore-presentation='categories-v1'] .home-explore-card {padding:16px;}
  body[data-explore-presentation='categories-v1'] .home-explore-card h3 {font-size:14px;overflow-wrap:anywhere;max-width:100%;}
  body[data-explore-presentation='categories-v1'] .home-explore-card p {display:block;-webkit-line-clamp:unset;overflow:visible;overflow-wrap:anywhere;max-width:100%;}
  .home-topic-index a:focus-visible,.home-video-youtube:focus-visible {outline:2px solid var(--color-accent);outline-offset:3px;}

  body .home-composition .home-block {margin-block:64px;}
  body .home-composition .home-discovery-row .home-block {margin:0;}
  .home-about-grid,.home-grid {gap:24px;}
  .home-composition .home-module {padding:24px 20px;}
  .home-faq-list {padding-inline:18px;}
  body[data-article-presentation] .article-reader .article-body-section {margin:40px 0;}
  body[data-article-presentation] .article-reader .article-body-section p {line-height:1.85;margin-block:22px;}
  body[data-article-presentation] .article-body-section :is(ul,ol) {line-height:1.85;}
  .category-cards {gap:24px;}
  .footer-content {padding-inline:var(--mobile-gutter);}
  /* Keep original creative dimensions; slots that do not fit are omitted by the loader. */
  [data-factory-sticky-host] {max-width:100%;}
}
@media(max-width:359px) {
  html body {--mobile-gutter:16px;}
  .masthead .masthead__inner {padding-inline:12px;gap:6px;}
  .masthead .brand__icon {width:24px;height:24px;flex-basis:24px;}
  .masthead__inner > .brand {gap:6px;}
  .masthead__inner > .brand > span {font-size:12px;}
}

/* Phone homepage rhythm: full-width reading copy, not desktop cards squeezed inside cards. */
@media(max-width:767px) {
  html body[data-page-type='home'] .home-composition .home-block {margin-block:48px;}
  html body[data-page-type='home'] .home-hero--backdrop > .lede {font-size:15px;line-height:1.65;}
  html body[data-desktop-home][data-page-type='home'] .home-topic-index {margin-block:48px;}
  html body[data-desktop-home][data-page-type='home'] .home-topic-index > p {font-size:15px;line-height:1.6;margin-bottom:24px;}
  html body[data-desktop-home][data-page-type='home'] .home-topic-index h2 {margin-bottom:16px;}
  html body[data-desktop-home][data-page-type='home'] .home-topics {gap:48px;margin-block:48px;}
  html body[data-desktop-home][data-page-type='home'] .home-topic {padding:0;border:0;border-radius:0;background:none;}
  html body[data-desktop-home][data-page-type='home'] .home-topic h2 {font-size:26px;line-height:1.25;margin:0 0 16px;}
  html body[data-desktop-home][data-page-type='home'] .home-topic > .lede {font-size:15px;line-height:1.65;margin:0 0 24px;}
  html body[data-page-type='home'] .home-topic :is(.topic-layout-items,.topic-panels,.topic-table-wrap) {margin:24px 0;gap:12px;}
  html body[data-page-type='home'] .home-topic .topic-item {display:block;position:relative;padding:16px;border-radius:12px;}
  html body[data-page-type='home'] .topic-item > .topic-marker {position:absolute;inset:16px auto auto 16px;width:32px;height:32px;}
  html body[data-page-type='home'] .topic-item > .topic-marker svg {width:18px;height:18px;}
  html body[data-page-type='home'] .topic-item:has(> .topic-marker) .home-topic-label {min-height:32px;padding-left:44px;align-items:center;}
  html body[data-page-type='home'] .home-topic .topic-item-copy {display:block;min-width:0;}
  html body[data-page-type='home'] .home-topic .topic-item h3 {font-size:16px;line-height:1.4;}
  html body[data-page-type='home'] .home-topic :is(.topic-item p,.topic-panel-body p) {font-size:14px;line-height:1.6;margin:10px 0 0;}
  html body[data-page-type='home'] .home-topic .topic-points {margin:12px 0 0;}
  html body[data-page-type='home'] .home-topic .topic-points li {font-size:14px;line-height:1.6;padding-left:16px;margin:6px 0;}
  html body[data-page-type='home'] .home-topic .topic-tags {margin-top:10px;}
  html body[data-page-type='home'] .home-topic .topic-note {font-size:13px;line-height:1.6;padding:10px 12px;}
  html body[data-page-type='home'] .home-topic[data-topic-layout='feature-list'] .topic-item {border-radius:0;padding-block:16px;}
  html body[data-page-type='home'] .home-topic .topic-panel summary {padding:16px;gap:10px;font-size:16px;}
  html body[data-page-type='home'] .home-topic .topic-summary-text {font-size:14px;line-height:1.6;margin-top:6px;}
  html body[data-page-type='home'] .home-topic .topic-panel-body {padding:0 16px 16px;}
  html body[data-page-type='home'] .home-topic .topic-table tbody tr {padding:16px;}
  html body[data-page-type='home'] .home-topic .topic-table {line-height:1.6;}
  html body[data-page-type='home'] .home-topic .home-module-link {display:inline-flex;align-items:center;min-height:44px;margin-top:4px;font-size:14px;}
  html body[data-page-type='home'][data-home-defaults] .home-composition .home-block--finalCta {padding:28px 20px;border-radius:16px;}
  html body[data-page-type='home'][data-home-defaults] .home-block--finalCta h2 {font-size:30px;line-height:1.15;}
  html body[data-page-type='home'][data-home-defaults] .home-block--finalCta .lede {font-size:15px;line-height:1.6;margin-top:16px;}
  html body[data-page-type='home'][data-home-defaults] .home-block--finalCta .home-actions {margin-top:20px;gap:12px;}

  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-content {width:calc(100% - 40px);padding:24px 0 20px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-grid,
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-grid:not(:has(> :nth-child(3))) {grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-intro {grid-column:1/-1;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-brand {font-size:16px;gap:10px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-brand img {width:32px;height:32px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-intro p {font-size:13px;line-height:1.65;margin-top:12px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-column h4 {font-size:11px;line-height:1.5;letter-spacing:.08em;margin:0 0 8px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-column ul,
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-column:last-child ul {grid-template-columns:minmax(0,1fr);gap:0;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-link {font-size:13px;line-height:1.5;min-height:44px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-bottom {margin-top:20px;padding-top:12px;gap:8px;}
  html body[data-footer-presentation][data-page-type='home'] .site-footer .footer-bottom nav {gap:0 16px;}
}
