/* 可讀性／可點性下限（疊在 index.html 內嵌樣式之後載入）。
   - 文字不小於 13px：index.html 內嵌的字級已逐一調整；這裡只補沒指定字級的 <small>。
   - 可點區域高度不小於 40px：用 min-height／padding，不改視覺配色。
   - 手機（<768px）主分頁列固定在畫面底部。
   選擇器刻意加 :not(#_)（specificity 1,0,x）來壓過內嵌樣式裡各種 button.xxx{min-height:28px}。 */

small{font-size:max(13px,.83em)}

/* ── 可點區域下限 40px ───────────────────────────────────── */
button:not(#_),
select:not(#_),
a.tel:not(#_),
.fold-hd:not(#_),
summary:not(#_),
[role="tab"]:not(#_),
[role="button"]:not(#_){min-height:40px}
button:not(#_):not(.iconbtn):not(#toTopBtn){box-sizing:border-box}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(#_){min-height:40px}
textarea:not(#_){min-height:40px}
a.tel:not(#_){display:inline-flex;align-items:center}

/* ── 手機：主分頁列固定底部 ─────────────────────────────── */
@media (max-width:767px){
  /* backdrop-filter／transform 會讓 header 變成 fixed 子孫的定位基準，手機版先拿掉；
     原本「往下捲收起標題列」改用 sticky 的負 top 達成（不用 transform）。 */
  header:not(#_){backdrop-filter:none;-webkit-backdrop-filter:none;background:var(--surface);
    transform:none;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"brand act";transition:top .2s}
  header.hdr-hide:not(#_){transform:none;top:calc(-1 * var(--hdr-h,60px) - 4px)}
  #modeToggle:not(#_){position:fixed;left:0;right:0;bottom:0;z-index:45;grid-area:auto;
    border-radius:0;border-width:1px 0 0;gap:0;background:var(--surface);
    padding:6px 8px calc(6px + env(safe-area-inset-bottom));box-shadow:0 -2px 10px rgba(20,40,30,.12)}
  #modeToggle button:not(#_){flex:1 1 0;min-width:0;min-height:48px;padding:0 4px;font-size:14px;border-radius:10px;white-space:nowrap}
  #modeToggle button.on:not(#_){background:var(--primary-soft);color:var(--primary-ink);box-shadow:none}
  .wrap:not(#_){padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  #toTopBtn:not(#_){bottom:calc(84px + env(safe-area-inset-bottom))}
  #toast:not(#_){bottom:calc(84px + env(safe-area-inset-bottom))}
}

/* ── 勾選框所在的整個 label 當作可點區域（高 >= 40px）──────── */
label:has(> input[type="checkbox"]):not(#_),
label:has(> input[type="radio"]):not(#_){min-height:40px;align-items:center}

/* ── 習慣連續圈圈：視覺不變，用偽元素把上下可點範圍撐到 40px ── */
.chainring:not(#_){position:relative}
.chainring:not(#_)::after{content:"";position:absolute;left:0;right:0;top:-10px;bottom:-10px}

/* ── 面板右上角關閉鈕 36 -> 40px ───────────────────────────── */
.sheet .sh .x:not(#_){width:40px;height:40px}

/* ── 只有圖示的按鈕：標題列空間不夠放文字，改靠 title／aria-label（a11y-labels.js 補齊）；
      清單內的圖示鈕（例如封存習慣）直接加文字 ── */
.mini .btxt{margin-left:4px}
.mini:has(.btxt){display:inline-flex;align-items:center}

/* ── 平板／窄桌機：標題列右側放不下「建議聯絡」文字，收成圖示並隱藏更新時間，避免換行擠壓 ── */
@media (min-width:768px) and (max-width:1199px){
  .iconbtn.wide .tlabel:not(#_){display:none}
  .iconbtn.wide:not(#_){width:40px;padding:0;justify-content:center}
  #updated:not(#_){display:none}
}
.iconbtn.wide .tlabel:not(#_){white-space:nowrap}
