/* "Waiting on you": the signed-in person's open tasks. Since wave 1 (Oct 12
   2026) the list is the Tasks tile on Home (.lfr-tile, the look of the
   other Home cards: a surface panel, a hairline, a mono kicker), plus the
   drawer the task board's Answer button opens (.lfr: docked beside the page
   on wide screens while it is open, a drawer from the right on narrower
   ones). The header pill shows the count everywhere and opens the Tasks
   screen. Every class is lfr- prefixed so the console's short class names
   never leak in; colours and faces are the console's tokens (system.css),
   so both follow the theme and light/dark. */

:root { --lfr-w: 320px; }

.lfr-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink2);
  font: 600 12px/1 var(--ui);
  padding: 6px 10px; cursor: pointer; white-space: nowrap;
}
.lfr-pill:hover { color: var(--ink); border-color: var(--gold); }
.lfr-pill b {
  font: 600 11.5px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  background: var(--gold); color: var(--accent-ink); border-radius: 999px; padding: 3px 7px;
}
.lfr-pill.lfr-urgent b { background: var(--clay); color: var(--paper); }

.lfr {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--lfr-w), 88vw);
  z-index: 60;
  background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 32px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .2s ease;
  font: 14px/1.4 var(--ui);
}
.lfr.lfr-open { transform: none; }
.lfr *, .lfr-tile * { box-sizing: border-box; min-width: 0; }

.lfr-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px; border-bottom: 2px solid var(--gold);
}
.lfr-kicker {
  margin: 0;
  font: 500 11px/1.2 var(--mono);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink3);
}
.lfr-count {
  font: 600 12px/1 var(--mono);
  font-variant-numeric: tabular-nums; color: var(--ink3);
}
.lfr-spacer { flex: 1; }
.lfr-close {
  border: 0; background: none; color: var(--ink3); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px 4px; border-radius: var(--r);
  min-width: 34px; min-height: 34px;
}
.lfr-close:hover { color: var(--ink); }

.lfr-list { list-style: none; margin: 0; padding: 4px 16px 12px; overflow-y: auto; flex: 1; }
.lfr-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.lfr-row:last-child { border-bottom: 0; }
/* The check: a 34px target (44px on a phone) around an 18px box. */
.lfr-check {
  appearance: none; -webkit-appearance: none;
  width: 34px; height: 34px; margin: -7px 0 0;
  border: 0; border-radius: var(--r); background: transparent;
  display: grid; place-items: center; cursor: pointer;
}
.lfr-check::before {
  content: ""; grid-area: 1 / 1; width: 18px; height: 18px; box-sizing: border-box;
  border: 1.5px solid var(--ink3); border-radius: 4px; background: var(--surface);
}
.lfr-check::after {
  content: ""; grid-area: 1 / 1; width: 5px; height: 9px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg) scale(0); transition: transform .12s ease;
}
.lfr-check:hover::before { border-color: var(--gold); }
.lfr-check:checked::before { background: var(--gold); border-color: var(--gold); }
.lfr-check:checked::after { transform: translateY(-1px) rotate(45deg) scale(1); }
.lfr-check:disabled { opacity: .5; cursor: default; }

.lfr-body { display: flex; flex-direction: column; gap: 3px; }
.lfr-title {
  color: var(--ink); overflow-wrap: anywhere;
  background: none; border: 0; padding: 0; text-align: left; font: inherit; font-weight: 600; cursor: pointer;
}
.lfr-title:hover { color: var(--gold); }
.lfr-detail {
  font-size: 12.5px; color: var(--ink2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lfr-detail a { color: var(--ink2); text-underline-offset: 2px; }
.lfr-detail a:hover { color: var(--gold); }
.lfr-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.lfr-tag {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .06em; padding: 3px 6px; border-radius: 4px;
}
.lfr-tag.lfr-urg { background: var(--claybg); color: var(--clay); }
.lfr-due {
  font: 500 11.5px/1 var(--mono);
  font-variant-numeric: tabular-nums; color: var(--ink3);
}
.lfr-due.lfr-late { color: var(--clay); font-weight: 700; }

.lfr-row.lfr-done .lfr-title { color: var(--ink3); text-decoration: line-through; }
.lfr-row.lfr-done .lfr-detail { display: none; }
.lfr-undo {
  font: 600 11.5px/1 var(--mono);
  background: none; border: 0; padding: 6px 2px; color: var(--gold); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

.lfr-empty {
  margin: 14px 0; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r);
  color: var(--ink2); font-size: 13px;
}
.lfr-err { margin: 10px 0; color: var(--clay); font-size: 12.5px; }

.lfr-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}
.lfr-board {
  font: 600 12.5px/1 var(--ui); color: var(--ink2);
  background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 7px 10px; cursor: pointer;
  min-height: 34px;
}
.lfr-board:hover { color: var(--ink); border-color: var(--gold); }
.lfr-live {
  font: 500 11px/1 var(--mono); color: var(--ink3);
  display: inline-flex; align-items: center; gap: 6px;
}
.lfr-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); display: inline-block; }
.lfr-live.lfr-on i { background: var(--jade); }

/* Questions an agent parked for this person: which agent, the question,
   quick options and a one-line answer. They sit above the person's tasks. */
.lfr-sec {
  margin: 12px 0 0; padding-bottom: 2px;
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink3);
}
.lfr-qmark {
  width: 18px; height: 18px; margin: 1px 0 0 8px; border-radius: 50%;
  background: var(--gold); color: var(--accent-ink); display: grid; place-items: center;
  font: 700 11px/1 var(--mono);
}
.lfr-agent {
  font: 600 10.5px/1.2 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
.lfr-question { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.lfr-qtask {
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
  font: 12px/1.35 var(--ui); color: var(--ink3); overflow-wrap: anywhere;
}
.lfr-qtask:hover { color: var(--gold); }
.lfr-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lfr-opt {
  font: 600 12px/1 var(--ui); color: var(--ink);
  background: transparent; border: 1px solid var(--gold); border-radius: var(--r);
  padding: 7px 11px; min-height: 34px; cursor: pointer;
}
.lfr-opt:hover { background: var(--gold); color: var(--accent-ink); }
.lfr-answer { display: flex; gap: 6px; margin-top: 6px; }
.lfr-input {
  flex: 1; min-width: 0; font: 13px/1.3 var(--ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 9px;
  min-height: 36px;
}
.lfr-input:focus { outline: none; border-color: var(--gold); }
.lfr-send {
  font: 600 12px/1 var(--ui); color: var(--accent-ink);
  background: var(--gold); border: 0; border-radius: var(--r); padding: 0 12px; min-height: 36px; cursor: pointer;
}
.lfr-opt:disabled, .lfr-send:disabled, .lfr-input:disabled { opacity: .5; cursor: default; }
.lfr-row.lfr-sent .lfr-opts, .lfr-row.lfr-sent .lfr-answer { display: none; }
.lfr-row.lfr-sent .lfr-question { color: var(--ink3); }
.lfr-sentnote { color: var(--jade); font-size: 12px; overflow-wrap: anywhere; }

.lfr-pill:focus-visible, .lfr-close:focus-visible, .lfr-check:focus-visible,
.lfr-title:focus-visible, .lfr-board:focus-visible, .lfr-undo:focus-visible, .lfr-detail a:focus-visible,
.lfr-qtask:focus-visible, .lfr-opt:focus-visible, .lfr-send:focus-visible, .lfr-kicker:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.lfr-kicker:focus { outline: none; }

/* The Tasks tile on Home: the same list in a Home card. Long lists scroll
   inside the card so the tiles under it stay in reach. */
.lfr-tile {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  color: var(--ink); font: 14px/1.4 var(--ui); display: flex; flex-direction: column;
}
.lfr-tile .lfr-head { padding: 10px 14px 6px; border-bottom: 0; min-height: 26px; }
.lfr-tile .lfr-count {
  font: 600 11px var(--mono); letter-spacing: .04em; color: var(--ink);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-radius: 4px; padding: 2px 6px;
}
.lfr-tile .lfr-count:empty { display: none; }
.lfr-tile .lfr-list { flex: none; padding: 0 14px 6px; max-height: min(70vh, 640px); overflow-y: auto; }
.lfr-tile .lfr-row:first-child, .lfr-tile .lfr-sec + .lfr-row { border-top: 1px solid var(--line); }
.lfr-tile .lfr-empty { margin: 6px 0 8px; }
.lfr-tile .lfr-foot { padding: 8px 14px; }

/* Wide screens: the open drawer docks as its own column and the page steps
   aside, so nothing sits under it. */
@media (min-width: 1280px) {
  .lfr { box-shadow: none; width: var(--lfr-w); }
  /* The console's header and main sit inside section#s-app, so the whole
     app screen steps aside (the older body > main selector no longer matched). */
  body.lfr-docked #s-app { margin-right: var(--lfr-w); }
}

/* Phone: thumb-sized checks, options and the board button. */
@media (max-width: 560px) {
  .lfr-row { grid-template-columns: 44px minmax(0, 1fr); }
  .lfr-check { width: 44px; height: 44px; margin-top: -12px; }
  .lfr-qmark { margin-left: 13px; }
  .lfr-opt, .lfr-board, .lfr-close, .lfr-send, .lfr-input { min-height: 44px; }
  .lfr-undo { padding: 14px 4px; margin: -10px 0; }
  .lfr-tile .lfr-head { padding: 10px 12px 6px; }
  .lfr-tile .lfr-list { padding: 0 12px 6px; }
}
@media (pointer: coarse) {
  .lfr-check { width: 44px; height: 44px; margin-top: -12px; }
  .lfr-row { grid-template-columns: 44px minmax(0, 1fr); }
  .lfr-qmark { margin-left: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .lfr, .lfr-check::after { transition: none; }
}
