/* Rota Done — feel (2026-10-27). Pairs with static/js/feel.js.
   Same colours, same type, same marks: only how things answer a touch,
   how panels arrive and leave, and a little depth at the top of pages. */

/* Taps register at once: no waiting to see if it was a double-tap. */
button, .btn, [role="button"], a, input[type="submit"], input[type="button"], label, select { touch-action: manipulation; }

/* ── Question panel ───────────────────────────────────────────────── */
.rd-ask {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(10, 13, 18, 0); transition: background-color .22s ease;
}
.rd-ask.rd-open { background: rgba(10, 13, 18, .42); }
.rd-ask-panel {
  width: 100%; max-width: 400px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(10, 13, 18, .22), 0 2px 6px rgba(10, 13, 18, .08);
  padding: 22px 22px 18px;
  font-family: var(--font-sans);
}
.rd-ask-panel h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; color: var(--text); }
.rd-ask-panel p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.rd-ask-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.rd-ask-btns button {
  min-height: 40px; padding: 0 18px; border-radius: 9px; cursor: pointer;
  font: 600 14px/1 var(--font-sans);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.rd-ask-btns .rd-ask-yes { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.rd-ask-btns .rd-ask-yes.danger { background: var(--red); border-color: var(--red); color: #fff; }
.rd-ask-btns button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rd-ask .rd-grabber { display: none; }

@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  .rd-ask { align-items: flex-end; padding: 0; }
  .rd-ask-panel {
    max-width: none; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 10px 20px calc(18px + env(safe-area-inset-bottom));
  }
  .rd-ask .rd-grabber { display: block; }
  .rd-ask-panel h2 { margin-top: 12px; font-size: 19px; }
  .rd-ask-btns { flex-direction: column-reverse; }
  .rd-ask-btns button { min-height: 50px; font-size: 16px; border-radius: 12px; }
}

/* ── Undo note ────────────────────────────────────────────────────── */
.rd-toasts {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 1001; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: max-content; max-width: calc(100vw - 24px);
}
.rd-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px;
  padding: 10px 10px 10px 16px; min-height: 46px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  box-shadow: 0 14px 34px rgba(10, 13, 18, .24);
  font: 500 14px/1.35 var(--font-sans);
}
.rd-toast button {
  border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg);
  font: 700 14px/1 var(--font-sans);
}
/* Clear of the rota's labour bar, and on phones of its bottom menu too. */
html.sol2-mode .rd-toasts { bottom: 68px; }
@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  html.sol2-mode .rd-toasts { bottom: calc(136px + env(safe-area-inset-bottom)); }
}

/* ── Phone panels ─────────────────────────────────────────────────── */
.rd-grabber {
  display: none; width: 36px; height: 5px; border-radius: 3px; margin: 8px auto 0;
  background: color-mix(in srgb, var(--text) 22%, transparent);
  flex: none;
}
@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  html.sol2-mode .mbg .modal > .rd-grabber { display: block; position: sticky; top: 0; margin: 0 auto; padding: 0; height: 21px; width: 100%; background: none; z-index: 2; }
  html.sol2-mode .mbg .modal > .rd-grabber::before {
    content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; margin: 8px auto 0;
    background: color-mix(in srgb, var(--text) 22%, transparent);
  }
  html.sol2-mode .mbg .modal { border-radius: 16px 16px 0 0; overscroll-behavior: contain; }
}
/* Marked closed at once, still on screen while it slides away. */
.mbg.rd-closing { opacity: 1 !important; transition: none !important; pointer-events: none; }

/* ── Shifts: lift and land ────────────────────────────────────────── */
.rd-lifted { opacity: .28; outline: 1.5px dashed var(--border-strong); outline-offset: -1.5px; transition: opacity .12s ease; }
.rd-ghost { position: fixed !important; top: -1000px; left: -1000px; box-shadow: 0 14px 30px rgba(10, 13, 18, .22); transform: rotate(-1.2deg); }
.rd-landing { position: relative; z-index: 5; box-shadow: 0 10px 24px rgba(10, 13, 18, .16); }
td.drag-over { transition: background-color .12s ease, box-shadow .12s ease; box-shadow: inset 0 0 0 2px var(--blue); }

/* ── Published ────────────────────────────────────────────────────── */
.btn-pub .rd-tick { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; flex: none; }
.btn-pub .rd-tick path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 0; }
.btn-pub.rd-just-published { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; transition: background-color .25s ease, color .25s ease, border-color .25s ease; }
.btn-pub.rd-just-published .rd-tick path { animation: rd-tick-draw .42s cubic-bezier(.3,.7,.2,1) .08s both; }
@keyframes rd-tick-draw { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }

/* ── Frosted tops: the page scrolls under a see-through bar ─────────── */
nav.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 72%, transparent) !important;
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
}
.sh-top {
  background: color-mix(in srgb, var(--surface) 72%, transparent) !important;
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
}

/* The rota's pinned row of day headings: shifts scroll softly under it. */
html.sol2-mode #grid-wrap thead th.g-dh,
html.sol2-mode #grid-wrap thead th.g-corner {
  background-color: color-mix(in srgb, var(--surface2) 80%, transparent) !important;
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
nav.topnav, .sh-top { border-bottom-color: transparent !important; transition: border-color .2s ease; }
nav.topnav.rd-under, .sh-top.rd-under { border-bottom-color: var(--border) !important; }

/* ── Big type set a touch tighter ─────────────────────────────────── */
.dash h2 { letter-spacing: -.02em; }
.st-card-title { letter-spacing: -.012em; }

/* ── Reduce motion: fades, no slides or springs ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  .rd-ask, .rd-lifted, td.drag-over { transition: none; }
  .btn-pub.rd-just-published .rd-tick path { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  nav.topnav, .sh-top { background: var(--surface) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html.sol2-mode #grid-wrap thead th.g-dh, html.sol2-mode #grid-wrap thead th.g-corner { background-color: var(--surface2) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.rd-ask-panel:focus { outline: none; }

/* ── Light/dark switch: the whole screen cross-fades as one ─────────── */
html.rd-theme-swap::view-transition-old(root),
html.rd-theme-swap::view-transition-new(root) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, 0, 0, 1); mix-blend-mode: normal; }
/* Nothing fades on its own underneath the snapshot. */
html.rd-theme-swap *, html.rd-theme-swap *::before, html.rd-theme-swap *::after { transition: none !important; }
