/* Shared sizing only: each page retains its own colors and imagery. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { overflow-wrap:break-word; }
body :is(.container,.shopping-page main) { width:100%; }
body :is(.grid,.home-sort-container,.near-list,.dpa-list,.ai-route-list,.restaurant-search-list,.future-grid,.detail-grid,.prediction-main,.summary,.top-summary,.menus) > *,
body :is(.header,.head,.card-head,.near-head,.restaurant-subhead,.top,.page-header) > * { min-width:0; }
body :is(h1,h2,h3,.name,.shop-name,.meta,.sub,.small,.btn,.back,.menu a) { overflow-wrap:anywhere; }
body :is(input,select,textarea,button) { max-width:100%; }
body :is(.controls,.tools) > :is(input,select) { min-width:0; }
body :is(.actions,.btns,.btn-group,.item-actions,.near-actions,.tabs,.switches) { flex-wrap:wrap; }
body :is(.btn,.back,.near-btn,.loc-btn,.clear-btn,.map,.official-app) { min-height:44px; white-space:normal; text-align:center; }
body :is(.status-wrap,.date-picker,.week) { max-width:100%; min-width:0; overscroll-behavior-x:contain; scrollbar-width:thin; }
body .week { width:100%; }
body .status-table { overflow-wrap:normal; }
body #forecastAiReview { width:calc(100% - 24px); max-width:1180px; margin:18px auto; padding:18px 0; line-height:1.7; }
body #forecastAiReview h3 { font-size:16px; }
body #forecastAiReview .forecast-ai-stamp { font-size:12px; overflow-wrap:anywhere; }
@media (min-width:1200px) {
  body .container:has(.hero,.week,.future-grid,.actual-list,.shop,.restaurant-head) { max-width:1440px; }
  body .container:has(.hero) .menu { grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }
  body .container:has(.hero) .home-sort-container { grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); }
}
@media (min-width:601px) and (max-width:1000px) {
  body .container:has(.hero) .menu { grid-template-columns:repeat(3,minmax(0,1fr)); }
  body .container:has(.hero) .home-sort-container { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .container:has(.hero) .glass { padding:18px; }
  body .grid:has(>.shop,>.item,>.place) { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  body .overlay { padding:16px 12px 28px; }
  body .container:has(.hero) .glass { padding:16px; margin-bottom:14px; }
  body .container:has(.hero) .hero { padding:24px 14px; }
  body .container:has(.hero) .hero h1 { font-size:24px; line-height:1.4; }
  body .container:has(.hero) .menu { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  body .container:has(.hero) .menu a { padding:14px 8px; min-height:72px; font-size:14px; }
  body .container:has(.hero) :is(.grid,.home-sort-container,.near-list,.restaurant-search-list,.ai-route-list,.dpa-list) { grid-template-columns:minmax(0,1fr); gap:12px; }
  body .grid:has(>.shop,>.item,>.place) { grid-template-columns:minmax(0,1fr); }
  body.shopping-page .grid:has(>.item) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body :is(.header,.head,.card-head,.near-head,.restaurant-subhead,.top) { flex-wrap:wrap; gap:10px; }
  body :is(.header,.head,.top) > div:first-child { flex:1 1 200px; }
  body .near-head h2 { flex:1 1 100%; }
  body .near-head .near-btn { flex:1 1 auto; }
  body :is(.header,.head) h1 { font-size:21px; line-height:1.4; }
  body :is(.panel,.glass) { padding:14px; }
  body .data-row { gap:10px; flex-wrap:wrap; }
  body .data-row > * { min-width:0; }
  body .prediction-main { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .prediction-main :is(b,strong) { overflow-wrap:anywhere; }
  body .detail-grid { grid-template-columns:minmax(0,1fr); }
  body .future-grid { grid-template-columns:minmax(0,1fr); }
  body .actual-row { grid-template-columns:minmax(0,1fr); }
  body .actual-nav select { width:100%; min-width:0; }
  body .restaurant-head { min-width:0; }
  body .restaurant-title { overflow-wrap:anywhere; }
  body .btn-group > * { flex:1 1 120px; }
}
@media (max-width:360px) {
  body :is(.controls,.restaurant-search-row) { grid-template-columns:minmax(0,1fr); }
  body .controls input { grid-column:auto; }
  body :is(.summary,.top-summary,.weather-strip) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .item-actions { gap:6px; }
  body .near-btn { max-width:100%; }
}
/* Wider catalogues show more complete items, not enlarged cards. */
@media (min-width:1001px) {
  body .container:has(.grid,.menus,.rank,.actual-list,.link-grid) { max-width:1920px; }
  body.shopping-page:has(#items,.place) :is(main,header) { max-width:1920px; }
  body .grid:has(>.shop,>.item,>.place) { grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); }
  body .menus { grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); }
  body .grid:has(>.day) { grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); }
  body :is(.near-list,.dpa-list,.restaurant-search-list,.ai-route-list) { grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); }
  body .future-grid { grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
  body .container:has(>.archive-card) { max-width:1920px; display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
  body .container:has(>.archive-card) > :not(.archive-card) { grid-column:1/-1; }
}
@media (min-width:1500px) {
  body .grid:has(>.card .week) { grid-template-columns:repeat(auto-fit,minmax(760px,1fr)); align-items:start; }
  body .rank { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  body .rank > * { min-width:0; }
  body .rank .item > * { min-width:0; }
  body .rank .prediction-main { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .container:has(.hero) .home-sort-container { grid-template-columns:repeat(auto-fit,minmax(360px,1fr)); }
}
