/* Phone layout: keep browsing and selection within easy reach. */
@media (max-width:760px) {
  :root { --phone-header:calc(64px + env(safe-area-inset-top,0px)); }
  html { scroll-padding-top:calc(var(--phone-header) + 135px); }
  body { padding-bottom:calc(80px + env(safe-area-inset-bottom,0px)); -webkit-text-size-adjust:100%; }
  body.modal-open { overflow:hidden; }
  .topbar { position:sticky;top:0;z-index:30;height:var(--phone-header);padding:env(safe-area-inset-top,0px) 16px 0;background:#f8f7f3f5;backdrop-filter:blur(14px); }
  .brand { font-size:19px;gap:10px;letter-spacing:2px; }
  .brandmark { width:38px;height:38px; }
  .brand small { font-size:9px; }
  .topbar .selection-button { min-height:44px;font-size:12px;padding:7px 12px; }
  .topbar .selection-button span { width:23px;height:23px; }
  .hero { display:block;padding:20px 16px 18px; }
  .hero-copy .eyebrow { font-size:10px;letter-spacing:1px; }
  .hero-copy h1 { font-size:clamp(22px,6.5vw,29px);line-height:1.5;letter-spacing:0;margin:10px 0 0; }
  .hero-copy h1 br { display:none; }
  .hero-copy>p,.hero-link,.hero-art { display:none; }
  .hero-stats { margin-top:13px;gap:0;justify-content:space-between;max-width:330px; }
  .hero-stats>div { flex:1; }
  .hero-stats strong { font-size:22px; }
  .hero-stats small { font-size:11px;margin-top:3px; }
  .catalog { padding:20px 12px 32px;border-top:1px solid var(--line); }
  .section-heading { gap:8px;margin-bottom:14px;padding:0 4px; }
  .section-heading .eyebrow { display:none; }
  .section-heading h2 { font-size:22px;margin:0; }
  .update-date { font-size:11px; }
  .toolbar { position:sticky;top:var(--phone-header);z-index:20;display:flex;flex-direction:column;gap:10px;margin:0 -12px;padding:10px 12px 12px;background:var(--paper);box-shadow:0 5px 12px #243b3509; }
  .toolbar .groups { display:none; }
  .search { width:100%;min-width:0;min-height:46px;border-radius:10px;padding:0 12px;gap:8px; }
  .search input { font-size:16px;min-width:0;min-height:44px;padding:10px 0; }
  .search input::placeholder { font-size:14px; }
  .mobile-filters { display:flex;gap:10px; }
  .mobile-filters .mobile-select { display:flex;flex:1;min-width:0;gap:0; }
  .mobile-select>span { position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
  .mobile-select select { width:100%;min-width:0;min-height:46px;font-size:16px;padding:9px 7px;border:1px solid var(--line);border-radius:9px;background:white;color:var(--ink); }
  .catalog-layout { padding-top:20px; }
  .sidebar { display:none; }
  .results-heading { margin-bottom:14px;gap:8px;padding:0 3px;scroll-margin-top:calc(var(--phone-header) + 140px); }
  .results-heading h3 { font-size:17px;line-height:1.4; }
  .results-heading p { font-size:12px;line-height:1.5;margin-top:6px; }
  .text-button { min-width:44px;min-height:44px;font-size:12px;flex-shrink:0; }
  .product-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
  .product-card { background:white;border:1px solid var(--line);border-radius:12px;overflow:hidden; }
  .product-image { border:0;border-radius:0;padding:5px; }
  .product-info { padding:10px 9px 12px;align-items:center;gap:6px; }
  .product-info>div { min-width:0;flex:1; }
  .product-info small { display:block;font-size:12px;line-height:1.4;overflow-wrap:anywhere; }
  .product-info h4 { font-size:14px;line-height:1.5;margin:5px 0 0; }
  .add-button { width:44px;height:44px;border-radius:12px;border-color:#c8d3ca;background:#f2f5f0;font-size:24px; }
  .add-button.selected { font-size:19px;background:var(--ink);color:white; }
  .pagination { gap:6px;margin-top:24px; }
  .pagination button { min-width:44px;height:44px;font-size:14px;border-radius:8px; }
  .pagination span { font-size:12px; }
  .mobile-nav { display:flex;position:fixed;bottom:0;left:0;right:0;z-index:40;align-items:center;gap:12px;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));background:#fffffff5;backdrop-filter:blur(14px);border-top:1px solid var(--line);box-shadow:0 -4px 18px #243b3509; }
  .mobile-nav>a { display:flex;justify-content:center;align-items:center;min-height:46px;flex:1;font-size:14px; }
  .mobile-nav>button { min-height:46px;flex:2;border:0;border-radius:12px;background:var(--ink);color:white;font-size:15px;font-weight:600; }
  #mobileSelectionCount { display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 5px;margin-left:8px;background:#ffffff25;border-radius:12px;font-size:13px; }
  footer { padding:24px 16px;gap:18px; }
  footer p { font-size:12px;line-height:1.8; }
  footer>a { font-size:13px;min-height:44px;display:flex;align-items:center; }
  .toast { bottom:calc(90px + env(safe-area-inset-bottom,0px));font-size:13px;padding:13px 17px;width:max-content;max-width:calc(100vw - 32px);text-align:center;line-height:1.6; }
  dialog { overscroll-behavior:contain; }
  dialog::backdrop { background:#182d2699; }
  .close { width:44px;height:44px;top:10px;right:10px;font-size:28px; }
  .detail-dialog,.selection-dialog { width:100%;max-width:100%;max-height:94vh;max-height:94dvh;margin:auto 0 0;inset:0;border-radius:20px 20px 0 0; }
  .detail-dialog[open] { display:block;padding-bottom:env(safe-area-inset-bottom,0px); }
  .detail-image { min-height:0;padding:26px 48px 16px; }
  .detail-image>img { max-width:280px;max-height:32vh;max-height:32dvh; }
  .image-arrow { width:44px;height:48px;background:#f2f4ef;font-size:32px; }
  .prev { left:6px; }.next { right:6px; }
  .detail-copy { padding:10px 20px 20px;overflow:visible; }
  .detail-copy h2 { font-size:23px;margin:12px 0 8px; }
  .detail-label { font-size:18px;margin:8px 0 12px; }
  .detail-help { display:none; }
  .source-details { font-size:13px;margin:10px 0 14px; }
  .source-details summary { min-height:44px;display:list-item;padding:12px 0;cursor:pointer;color:var(--muted); }
  .detail-copy dl { font-size:12px;line-height:1.6;grid-template-columns:65px minmax(0,1fr); }
  #detailAdd { position:sticky;bottom:0;width:100%;min-height:50px;border-radius:12px;font-size:16px;box-shadow:0 0 0 6px var(--paper); }
  .selection-dialog[open] { display:flex;flex-direction:column;height:85vh;height:85dvh;overflow:hidden; }
  .selection-head { flex-shrink:0;padding:24px 20px 14px; }
  .selection-head h2 { font-size:24px;padding-right:35px;margin:12px 0; }
  .selection-head p { font-size:13px;line-height:1.65;margin-bottom:0; }
  #selectionList { flex:1;min-height:0;max-height:none;padding:0 16px;overscroll-behavior:contain; }
  .selected-row { gap:12px;padding:14px 0; }
  .selected-row>div { min-width:0; }
  .selected-row img { width:68px;height:68px;flex-shrink:0; }
  .selected-row h3 { font-size:14px;line-height:1.5; }
  .selected-row p { font-size:11px;line-height:1.6; }
  .selected-row button { min-width:44px;min-height:44px;font-size:13px;flex-shrink:0; }
  .selection-actions { flex-shrink:0;gap:14px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);background:var(--paper); }
  .selection-actions .primary-button { flex:1;min-height:50px;font-size:15px;border-radius:12px; }
}
@media (hover:none) { .product-image:hover img { transform:none; } }
@media(max-width:760px){.toolbar .search{flex:none;width:100%;min-width:0;padding:0 5px 0 12px;gap:7px}.toolbar .search input{flex:1;min-width:0;width:0}.toolbar .search button{min-width:60px;min-height:44px;font-size:14px;border-radius:7px;padding:9px 12px}.search input::placeholder{font-size:12px}}
