/* Nov 3 2026, Pineville only (loads on pineville.html alone).
   1) Jeremy t1968u "On Pineville swap team chat with census": the inline script in pineville.html moves the census
      into the top row (next to New case) above 860px and under New case + Totals on phones; Team chat takes the
      census's old spot below Recent cases. These rules give the census the column the chat had.
   2) Jeremy t1969u: Interpreters today rows get the Cabarrus Available | Busy switch look (display only). */

/* ---------- 1) swap ---------- */
@media (min-width: 861px) {
  html body #pineLayout > #pinevilleCensusPanel {
    grid-column: 2; grid-row: 1; align-self: stretch; margin: 0; min-width: 0;
    /* the census does not set the row height (New case does); it fills the column and scrolls inside */
    contain: size; min-height: 480px; overflow-y: auto; overscroll-behavior: contain;
  }
  html body #pineLayout > #pinevilleCensusPanel .census-table-wrap { overflow-x: auto; }
  html body #pineCensusChatPair:not(:has(> #pinevilleCensusPanel)) { grid-template-columns: minmax(0,1fr); }
}
/* 769px and up, Team chat in the pair: fixed panel height, the message list takes what is left. When the
   "turn on sound" hint in the chat header goes away on the first click, the list grows instead of the Send button
   jumping up under the pointer (seen in testing: a first click on Send landed on "Posting as"). */
@media (min-width: 769px) {
  html body #pineCensusChatPair > #cabChatPanel { position: static; top: auto; margin-top: 0; height: 660px; max-height: none; min-height: 0;
    display: flex; flex-direction: column; box-sizing: border-box; }
  html body #pineCensusChatPair > #cabChatPanel .cab-chat-list { flex: 1 1 0; height: auto; min-height: 0; max-height: none; }
  html body #pineCensusChatPair > #cabChatPanel .cab-chat-form { flex: 0 0 auto; }
}
@media (max-width: 768px) {
  html body #pineLayout + #pinevilleCensusPanel { margin-top: 0; margin-bottom: 16px; }
  html body #pineCensusChatPair > #cabChatPanel { margin-top: 0; }
}

/* ---------- 2) Cabarrus-style Available | Busy switch (same sizes and colors as lais-cab-3col.css v7) ---------- */
#pineAvailList .lais-st-toggle.pst-sw { display: inline-flex; flex: 0 0 auto; padding: 2px; gap: 2px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(0,0,0,.25); }
#pineAvailList .pst-sw .lais-st-tog { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 32px; min-width: 70px; padding: 0 11px; border-radius: 999px;
  font: 600 12.5px/1 Outfit, system-ui, sans-serif; color: var(--muted); background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none; border: 0; margin: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#pineAvailList .pst-sw .lais-st-tog-available[aria-pressed="true"] { background: #16A34A; color: #fff; box-shadow: 0 1px 6px rgba(22,163,74,.35); }
#pineAvailList .pst-sw .lais-st-tog-busy[aria-pressed="true"] { background: #DC2626; color: #fff; box-shadow: 0 1px 6px rgba(220,38,38,.35); }
html[data-theme="maroon"] #pineAvailList .lais-st-toggle.pst-sw { background: #F6F3F1; border-color: #DDD3CF; }
html[data-theme="enterprise"] #pineAvailList .lais-st-toggle.pst-sw { background: #F2F5F9; border-color: #CBD5E1; }
html[data-theme="maroon"] #pineAvailList .pst-sw .lais-st-tog { color: #5E5459; }
html[data-theme="enterprise"] #pineAvailList .pst-sw .lais-st-tog { color: #405068; }
html:is([data-theme="maroon"],[data-theme="enterprise"]) #pineAvailList .pst-sw .lais-st-tog[aria-pressed="true"] { color: #fff; }
html:is([data-theme="maroon"],[data-theme="enterprise"]) #pineAvailList .pst-sw .lais-st-tog-available[aria-pressed="true"] { background: #15803D; }
html:is([data-theme="maroon"],[data-theme="enterprise"]) #pineAvailList .pst-sw .lais-st-tog-busy[aria-pressed="true"] { background: #B91C1C; }
/* Sky (Cabarrus has no Sky): same switch in Sky's own green / red, dark ink on the lit side */
html[data-theme="sky"] body #pineAvailList .lais-st-toggle.pst-sw { background: var(--sk-card-2, #1E1F22); border-color: var(--sk-line, #2C2E33); }
html[data-theme="sky"] body #pineAvailList .pst-sw .lais-st-tog { color: var(--sk-ink-2, #C4C7C5); font-family: var(--sk-sans, system-ui, sans-serif); font-weight: 500; }
html[data-theme="sky"] body #pineAvailList .pst-sw .lais-st-tog-available[aria-pressed="true"] { background: #81C995; color: #0B1F12; box-shadow: none; }
html[data-theme="sky"] body #pineAvailList .pst-sw .lais-st-tog-busy[aria-pressed="true"] { background: #F28B82; color: #2A0B08; box-shadow: none; }
/* as on Cabarrus: the switch shows Available / Busy, so that pill is hidden visually (kept for screen readers) */
#pineAvailList .pst-look:is(.lais-st-available,.lais-st-busy) .lais-st-pill {
  position: absolute !important; width: 1px !important; min-width: 0 !important; height: 1px !important; padding: 0 !important; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* same row placement as Cabarrus: name on the left, switch on the same line at the right; Pineville keeps its
   "since" time (and the Off shift tag) after the switch, or on a second line, right-aligned, when the row is narrow */
#pineAvailList .pst-look { box-sizing: border-box; max-width: 100%; min-width: 0; padding-top: 5px; padding-bottom: 5px; flex-wrap: wrap; row-gap: 6px; }
#pineAvailList .pst-look .lais-st-name { flex: 1 1 110px; min-width: 0; }
#pineAvailList .pst-look > .lais-st-toggle.pst-sw { margin-left: auto; }
#pineAvailList .pst-look .lais-st-right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; align-items: center; row-gap: 6px; max-width: 100%; min-width: min(100%, 172px); } /* 172px lines the switches up on wide rows, Off shift row included */
@media (max-width: 520px) {
  #pineAvailList .pst-look { box-sizing: border-box; max-width: 100%; min-width: 0; }
  #pineAvailList .pst-look .lais-st-right { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 8px; max-width: 100%; min-width: 0; }
  #pineAvailList .pst-sw .lais-st-tog { min-height: 40px; min-width: 76px; font-size: 13px; }
}

/* Nov 3 2026 (Jeremy t1972u-t1974u): Off clock after End of day. Same quiet look as the Cabarrus Off shift row:
   neither side of the switch lit, switch + name dimmed, slate "Off clock" tag (colours from lais-auto-status.css). */
#pineAvailList .pst-look.pst-offclock { background: transparent; }
#pineAvailList .pst-look.pst-offclock .lais-st-name { opacity: .55; }
#pineAvailList .pst-look.pst-offclock > .lais-st-toggle.pst-sw { opacity: .55; }
#pineAvailList .pst-look.pst-offclock > .lais-st-toggle.pst-sw .lais-st-tog { background: transparent; box-shadow: none; }
#pineAvailList .pst-look.pst-offclock .lais-st-pill { font-size: 11px; padding: 2px 8px; font-weight: 600; opacity: .9; }
#pineAvailList .pst-look.pst-offclock .lais-st-since { opacity: .6; }

/* Nov 3 2026 (Jeremy t1977u): the switch is tappable now (real buttons from lais-auto-status.js data-toggle="1"). */
#pineAvailList .pst-sw .lais-st-tog:not([aria-pressed="true"]):hover { color: var(--fg, #fff); background: rgba(255,255,255,.08); }
html:is([data-theme="maroon"],[data-theme="enterprise"]) #pineAvailList .pst-sw .lais-st-tog:not([aria-pressed="true"]):hover { color: #1F1A1D; background: rgba(0,0,0,.05); }
html[data-theme="sky"] body #pineAvailList .pst-sw .lais-st-tog:not([aria-pressed="true"]):hover { color: var(--sk-ink, #E3E3E3); background: rgba(255,255,255,.06); }
#pineAvailList .pst-sw .lais-st-tog:focus-visible { outline: 2px solid #C9A45C; outline-offset: 2px; }
#pineAvailList .pst-sw .lais-st-tog:active { transform: scale(.97); }
#pineAvailList .pst-look.pst-offclock > .lais-st-toggle.pst-sw:hover, #pineAvailList .pst-look.pst-offclock > .lais-st-toggle.pst-sw:focus-within { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #pineAvailList .pst-sw .lais-st-tog:active { transform: none; } }
