/* Undeniable Truths — site-level tweaks loaded on top of the three interactive handbooks.
   The handbook files themselves are never edited; everything here is additive. */
.bar select,.bar input{max-width:100%}
.ut-top{margin-bottom:-18px}

/* Covenant Calendar: appointed-times rows stack on phones */
@media(max-width:640px){
  .frow{flex-wrap:wrap;row-gap:2px}
  .frow .fdate{flex-basis:100%}
  .frow>span:nth-child(3){flex-basis:100%;order:5}
  .frow>span:nth-child(4){margin-left:auto}
}

/* Covenant Calendar: month grid fits the screen on phones.
   Columns may shrink below their longest word; labels hyphenate instead of widening the grid. */
.grid{grid-template-columns:repeat(7,minmax(0,1fr))}
.cell{min-width:0}
@media(max-width:520px){
  .grid{gap:2px}
  .dow{font-size:9px;letter-spacing:0}
  .cell{min-height:50px;padding:3px 2px 4px;border-radius:3px}
  .cell .dn{font-size:11.5px;display:block;line-height:1.15}
  .cell .gd{font-size:8.5px;display:block;line-height:1.2;white-space:nowrap;letter-spacing:-.2px}
  .sabtag{display:none}
  /* labels move to the key under the month; the cell keeps a colored bar */
  .cell .fl{display:none}
  .cell:has(.fl){padding-bottom:9px}
  .cell:has(.fl)::after{content:"";position:absolute;left:3px;right:3px;bottom:3px;height:3px;border-radius:2px;background:var(--gold)}
  .cell:has(.fl.high)::after{background:var(--high)}
  .cell:has(.fl.memorial)::after{background:var(--mem)}
  .cell:has(.fl.count)::after{background:var(--tekhelet)}
}
/* month key: phones only */
.mkey{display:none}
@media(max-width:520px){
  .mkey{display:grid;gap:7px;list-style:none;margin:12px 0 0;padding:12px 14px;background:var(--card);border:1px solid var(--line);border-radius:6px;font-size:14px;line-height:1.35;color:var(--ink)}
  .mkey li{display:grid;grid-template-columns:10px 42px 1fr;align-items:baseline;gap:10px}
  .mkey i{width:10px;height:10px;border-radius:2px;background:var(--gold);transform:translateY(1px)}
  .mkey i.k-high{background:var(--high)}.mkey i.k-memorial{background:var(--mem)}.mkey i.k-count{background:var(--tekhelet)}
  .mkey b{font-family:'IBM Plex Mono',monospace;font-size:12.5px;font-weight:500;color:var(--ink-soft)}
}

/* Torah Laws: larger tap area for the Details toggles */
@media(max-width:760px){
  button.more{padding:10px 0;margin-top:2px}
}

/* Tanakh Timeline: tell phone users the chart scrolls sideways */
@media(max-width:760px){
  .ctrl:has(+ .chartwrap)::after{content:"Swipe the chart to move through time \2192";flex-basis:100%;display:block;font-family:'IBM Plex Mono',monospace;font-size:11.5px;letter-spacing:.04em;color:var(--ink-soft);margin:4px 0 0}
}
